// 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, function() {
			if(jQuery.browser.msie)
			this.style.removeAttribute('filter');
		}); //Show the subnav
	} , function() { //on hover out...
		$(this).find("ul.subNav").fadeOut(500, function() {
			if(jQuery.browser.msie)
			this.style.removeAttribute('filter');
		}); //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 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';
		}
	}
	
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}	