function validate(){
	var b_valid, err_Msg;
	b_valid = true;
	err_Msg = "";

var optioncount = document.productpage.option_count.value;

if (optioncount == "2"){

	var label1val = document.productpage.label1.value;
	var label2val = document.productpage.label2.value;

	if(document.productpage.option1.value == "||" && document.productpage.option2.value == "||"){
		b_valid = false;
		err_Msg = err_Msg + "You need to select a " +label1val+ " & " +label2val+ " before adding this item to your cart.";		

	} else {

	if(document.productpage.option1.value != "||" && document.productpage.option2.value == "||"){
		b_valid = false;
		err_Msg = err_Msg + "You need to select a " +label2val+ " before adding this item to your cart.";		

	} else {

	if(document.productpage.option1.value == "||" && document.productpage.option2.value != "||"){
		b_valid = false;
		err_Msg = err_Msg + "You need to select a " +label1val+ " before adding this item to your cart.";		

	}
	}
	}

}


if (optioncount == "1"){

	var label1val = document.productpage.label1.value;

	if(document.productpage.option1.value == "||"){
		b_valid = false;
		err_Msg = err_Msg + "\nYou need to select a " +label1val+ " before adding this item to your cart.";		

	}
}


	if(b_valid === false){
		alert(err_Msg);
	}
	return b_valid;
}
