// JavaScript Document
$(document).ready(function(){
	//SubNav rollover
	$("ul.subNav").hide();

	$("#topNav ul li").hover(function() { //Hover over event on list item
		//$(this).children("ul").css({ 'visibility' : 'visible'}); //Add background color and image on hovered list item
		$(this).find("ul.subNav").fadeIn(500); //Show the subnav
	} , function() { //on hover out...
		$(this).find("ul.subNav").fadeOut(500); //Hide the subnav
	});
});


function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



function onCountryChange(){ 
		var sCountry = frmReqDemo.dlCountry.value;
		var indxSelCountry = document.getElementById('slCountry').selectedIndex
		var iCountry = document.getElementById('slCountry').options[indxSelCountry].text
		frmReqDemo.txtCountryName.value = iCountry;
  if(sCountry == 'US'){ 
			spanStateText.style.display = 'block';
			spanStateList.style.display = 'block';
			spanProvinceText.style.display = 'none';
			spanProvinceTextField.style.display = 'none'; 
  }
  if(sCountry != 'US'){ 
    		spanStateText.style.display = 'none';
			spanStateList.style.display = 'none';
			spanProvinceText.style.display = 'block';
			spanProvinceTextField.style.display = 'block'; 
  } 
} 


	function chkSlCountry(){
		var sCountry = frmReqDemo.dlCountry.value;
		if(sCountry != "US" ){
			//alert('3 Selected Country: ' + sCountry)
//			spStateList.style.display = 'none';
//			spStateText.style.display = 'block';
			spanStateText.style.display = 'none';
			spanStateList.style.display = 'none';
			spanProvinceText.style.display = 'block';
			spanProvinceTextField.style.display = 'block';
		}
	}