$(document).ready(function(){
	$("input[name='forestCre']").click( function(){
		if ($("input[name='forestCre']:checked").length > 0)
			$("#div_forestmembership").removeClass("hide");
		else
			$("#div_forestmembership").toggleClass("hide",true);
	});	
	$("#bizpartnerSolution").click( function(){
		if (this.checked == true)
			$("#div_bizpartner").removeClass("hide");
		else
			$("#div_bizpartner").toggleClass("hide",true);
	});	
});

	
function validateForm(){
	CheckFormInput();	
	CheckBgInfo();
	//custom validation
	errors += required($("input[name='ListForestIndustry']"),"radiogroup",$("#div_ListForestIndustry"));
	
	if($("input[name='ListForestIndustry']:checked:last").get(0) == $("input[name='ListForestIndustry']:last").get(0))
		errors += required($("#otherSegment")); 

	errors += required($("input[name='memberStatus']"),"radiogroup",$("#divMemberStatus"));

	if ( $("#esrisoftware option:selected").length == 0 )
	{
		$("#esrisoftware").css("background-color","#E48028");
		$("#esrisoftware").css("color","#FFFFFF");
		errors = errors + 'Error.';
	}
	else
	{
	var selected = $("#esrisoftware option:selected");
		if(selected.val() =='')
			{ 
				$("#esrisoftware").css("background-color","#E48028");
				$("#esrisoftware").css("color","#FFFFFF");
				errors = errors + 'Error.';
			}
		else 
			{
				$("#esrisoftware").css("background-color","");
				$("#esrisoftware").css("color","#000000");
				errors = errors + '';
			}
	}

	if ( errors ){
		alert(msg + "Please fill out all the required fields. \n\n The required fields will be highlighted for you.");
		window.location='#top';
		return false;
	}
	else{
		return true;
	}
}