/*
son of suckerfish menu script from:
http://www.htmldog.com/articles/suckerfish/dropdowns/
 */
 
 sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
			this.style.zIndex=200; //this line added to force flyout to be above relatively positioned stuff in IE
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);



function CheckLogin()
{
	//document.getElementById('loginbox22').style.display= 'block';
	
	var http;
	
	if(window.XMLHttpRequest)
	{
		http = new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		http = new AciveXObject("Microsoft.XMLHTTP");
	}
	
	var uid = document.form1.username.value;
	var pass = document.form1.loginpassword.value;
	var hide = document.form1.hide.value;
	var box = document.getElementById('loginbox2');
	
	http.onreadystatechange = function ()
	{
		if(http.readyState == 4 )
		{
			str = http.responseText ;
			if(str == 'success')
			{
				if(hide == 'executive')
					
				{
					//window.close();
					//box.style.display='none';
					location.href = 'http://www.executivecrashcourse.com/curriculum/returning_member.php';
				}
				//else if(hide == 'telecom')
				if(hide == 'telecom')
				{
					//window.close();
					//box.style.display='none';
					location.href = 'http://www.telecomcrashcourse.com/curriculum/returning_member.php';
				}
			}
			
			
			else if(str == 'nopromo')
			{
			     //window.close();
				 box.style.display='none';
			    alert('Sorry!!! Your trial period is Complete');
				window.location.href='index.php';
				   
      		}
			//document.getElementById('loginbox2').close;
		}
			
	}
	
	if(hide == 'executive')
	{
	http.open('get', 'http://www.executivecrashcourse.com/curriculum/login_process2.php?username='+uid+'&loginpassword='+pass, true);
	}
	if(hide == 'telecom')
	{
		http.open('get', 'http://www.telecomcrashcourse.com/curriculum/login_process2.php?username='+uid+'&loginpassword='+pass, true);
	}
	
	http.send(null);
}

/*
function createObject()
{
	var http2;
	if(window.XMLHttpRequest)
	{
		http2 = new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		http2 = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else
	{
		alert("Your browser Does not support Ajax");
	}
	
	return http2;
}


	 
	 var req = createObject();
function statecheck(cc)
{
	//var country = document.
	//alert(cc);
	
	req.open('get', 'statechecked.php?country='+cc);
	
	req.onreadystatechange = handleresponse;
	req.send(null);
	//return false;
}

function handleresponse()
{
	if(req.status == 200 && req.readyState == 4)
	{
		var response = req.responseText;
		  
		if(response == 'show_state')
		{
		
			document.getElementById('flip').style.display = 'block';
		}
		else
		{
		  document.getElementById('flip').style.display = 'none';
    	}
	}
}
*/
function statecheck2(cc)
{
		
	if(cc == 'USA')
		{
			
			document.getElementById('flip').style.display = 'block';
		}
		else
		{
		  document.getElementById('flip').style.display = 'none';
    	}
}
