
var clear="images/spacer.gif" //path to clear.gif
var homeHeroArr = new Array();

pngfix=function(){var els=document.getElementsByTagName('*');var ip=/\.png/i;var i=els.length;while(i-- >0){var el=els[i];var es=el.style;if(el.src&&el.src.match(ip)&&!es.filter){es.height=el.height;es.width=el.width;es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+el.src+"',sizingMethod='crop')";el.src=clear;}else{var elb=el.currentStyle.backgroundImage;if(elb.match(ip)){var path=elb.split('"');var rep=(el.currentStyle.backgroundRepeat=='no-repeat')?'crop':'scale';es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+path[1]+"',sizingMethod='"+rep+"')";es.height=el.clientHeight+'px';es.backgroundImage='none';var elkids=el.getElementsByTagName('*');if (elkids){var j=elkids.length;if(el.currentStyle.position!="absolute")es.position='static';/*while (j-- >0)if(!elkids[j].style.position)elkids[j].style.position="relative";*/}}}}}



$(document).ready(function(){

	$("button").each(function(){
		if($(this).attr("href")){
			$(this).click(function(){
				window.location = $(this).attr("href");				   
			});
		}
	});

	if($("#homeTop .vsBoard").get(0)){
		$("#homeTop .vsBoard").css("visibility", "visible");
		rotateFeature();
	}
  	if($.browser.msie && parseInt($.browser.version)<7){
		pngfix();
		
	}
	
	$("#featureSection .content").css("visibility", "visible");
	rotateFeature();
	
	
	/*
	$("form#PredictionPredictForm").submit(function(){
		$("#predictFormError").css("display", "none");
		var hasErrors = false;
		$("form#PredictionPredictForm label").removeClass("error");
		$("form#PredictionPredictForm select").each(function(){
			if($(this).get(0).value == ""){
				$(this).prev("label").addClass("error");
				//alert($(this).attr("id"));
				hasErrors = true;
			}
		});
		if(!hasErrors){
			
		}else{
			alert("All questions need to be filled out.");
			$("#predictFormError").css("display", "block");
			return false;
		}
	});
	*/
	
	$("#flashMessage").click(function(){
	  $(this).remove();
	  })

})


var rotateFeatureInt;
var featureCurrent = -1;
function rotateFeature(){
	clearTimeout ( rotateFeatureInt );
	featureCurrent++;
	if(featureCurrent > $("#homeTop .vsBoard").length-1){
		featureCurrent = 0;
	}
	var target = $("#homeTop .vsBoard").eq(featureCurrent);
	
	//alert(featureCurrent);
	$("#homeTop .vsBoard").not(target).hide();
	$(target).stop().fadeIn(200);
	rotateFeatureInt = setTimeout (  "rotateFeature()", 5000 );
}

