// JavaScript Document
var hideAfter = 100 //milisecconds after the dropdown should be hidden.
var timeOut = null;
var path="images/";
var layerArray =  new Array('industriesDD','BPODD','alliancesDD','clientsDD','reachusDD','careersDD');
var curLayer = layerArray[0];
var ercode;

function changeClass(obj)
{
	var cls = String(obj.className);
	cls = cls.replace('Def','MO');
	obj.className = cls;
}

function restoreClass(obj)
{
	var cls = String(obj.className);
	cls = cls.replace('MO','Def');
	obj.className = cls;
}

// drop down show hide.
function setTimer()
{
	timeOut = setTimeout("hideLayer()",hideAfter);
}

function clearTimer(layerName)
{
	clearTimeout(timeOut);
	showLayer(layerName);	
}

function showLayer(layerName)
{
	MM_showHideLayers(curLayer,'','hide');
	curLayer = layerName;
	MM_showHideLayers(curLayer,'','show');
}

function hideLayer()
{
	MM_showHideLayers(curLayer,'','hide');
}

function hideAll()
{
	clearTimeout(timeOut);
	for(var i=0;i<layerArray.length;i++)
	{
		MM_showHideLayers(layerArray[i],'','hide');
	}
}

function loadPage(pgURL)
{
	window.location = pgURL;
}

function loadPop(pg)
{
	pg=pg+'.html';
	window.open(pg,"sample","left=100,top=80,width=500,resizable=no, height=400,scrollbars=2,title=no");
}
function popwind(pg)
{
	pg=pg+'.html';
	window.open(pg,"sample","left=100,top=80,width=430,resizable=no, height=450,scrollbars=2,title=no");
}

function submit_onclick()
{
		if(document.frmcontact.myname.value == "")
		{
			alert("Please enter your name ");
			document.frmcontact.myname.focus();
			return false;
		}
		/*if (document.frmcontact.myemail.value =="")
		{
			alert("Please enter your email id ");
			document.frmcontact.myemail.focus();
			return false;
		}*/
		email();
		if(ercode==1)
		{
		   alert("Your e-mail is invalid.");
           document.frmcontact.myemail.focus();
           return false;
		}
		/*if (document.frmcontact.myemail.value!== "")
  		{
    	if (!valid_email(document.frmcontact.myemail.value))
    	{
        alert("Your e-mail is invalid.");
        document.frmcontact.myemail.focus();
        return (false);
    	}
  		}*/
		if (document.frmcontact.mycomments.value == "")
		{
			alert("Please enter your comments !");
			document.frmcontact.mycomments.focus();
			return false;
		}

		/*function valid_email(theItem)
		{
  		if (theItem.indexOf("@")==-1 ||theItem.indexOf(".")==-1 || theItem.indexOf(" ")!=-1 || theItem.indexOf("com")==-1 || theItem.length<6)
    	{ return false;
    	} 
  		else
    	{ return true;
    	} 
		}
		function email()
		{
			ercode=0;
  		var fal=0;
	  	var e=document.frmcontact.myemail.value; 
	  	ok = &quot;1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM&quot;;
	  	for(i=0; i&lt; e.length ;i++) if(ok.indexOf(e.charAt(i))&lt;0) fal=1;
	  	var suffix = e.substring(e.lastIndexOf('.')+1);
	  	var atpos = e.indexOf('@',0);
	  	if (suffix.length &lt;2 || e.indexOf('..',0) != -1 || e.indexOf('.@',0) != -1 ||e.indexOf('@.',0) != -1 || e.indexOf('.', atpos) == -1
	  	|| atpos==-1 || atpos==0 || fal==1 ||(e.indexOf('@',0)!=e.lastIndexOf('@'))) 
		{
  			ercode=1;
  		}
  		} */

		//document.frmcontact.action = "thanks1.asp";
		document.frmcontact.action = "thanks1.php";
		document.frmcontact.method="post";
		document.frmcontact.reach_state.value="valid";
		document.frmcontact.submit();		
}
function mail_send()
{
	document.myform.action="../../frommail.asp";
	document.myform.method="post";
	document.myform.submit();
}
function mail_send_gen()
{
	document.myform.action="frommail.asp";
	document.myform.method="post";
	document.myform.submit();
}

/*function submit_onclick1()
{
		if (document.frmdemo.myproduct.value =="")
		{
			alert("Please select the Product ");
			document.frmdemo.myproduct.focus();
			return false;
		}
		if(document.frmdemo.myname.value == "")
		{
			alert("Please enter your name ");
			document.frmdemo.myname.focus();
			return false;
		}
		if (document.frmdemo.myemail.value =="")
		{
			alert("Please enter your email id ");
			document.frmdemo.myemail.focus();
			return false;
		}
		
		if (document.frmdemo.mytelephone.value =="")
		{
			alert("Please enter your Telephone No ");
			document.frmdemo.mytelephone.focus();
			return false;
		}
		if (document.frmdemo.mycountry.value =="")
		{
			alert("Please select your country ");
			document.frmdemo.mycountry.focus();
			return false;
		}
		
		if (document.frmdemo.mycomments.value == "")
		{
			alert("Please enter your comments !");
			document.frmdemo.mycomments.focus();
			return false;
		}
		
		document.frmdemo.action = "demothanks1.asp";
		document.frmdemo.method="post";
		document.frmdemo.reach_state.value="valid";
		document.frmdemo.submit();		
}
function mail_send()
{
	document.myform.action="../../frommail.asp";
	document.myform.method="post";
	document.myform.submit();
}
function mail_send_gen()
{
	document.myform.action="frommail.asp";
	document.myform.method="post";
	document.myform.submit();
}



function submit_onclick2()
{
        if (document.frmcall.myproduct.value =="")
		{
			alert("Please select the Product ");
			document.frmcall.myproduct.focus();
			return false;
		}

		if(document.frmcall.myname.value == "")
		{
			alert("Please enter your name ");
			document.frmcall.myname.focus();
			return false;
		}
		if (document.frmcall.myemail.value =="")
		{
			alert("Please enter your email id ");
			document.frmcall.myemail.focus();
			return false;
		}
		
		if (document.frmcall.mytelephone.value =="")
		{
			alert("Please enter your Telephone No ");
			document.frmcall.mytelephone.focus();
			return false;
		}
		if (document.frmcall.mycountry.value =="")
		{
			alert("Please select your country ");
			document.frmcall.mycountry.focus();
			return false;
		}
		
		if (document.frmcall.mycomments.value == "")
		{
			alert("Please enter your comments !");
			document.frmcall.mycomments.focus();
			return false;
		}
		
		document.frmcall.action = "callthanks.asp";
		document.frmcall.method="post";
		document.frmcall.reach_state.value="valid";
		document.frmcall.submit();		
}
function mail_send()
{
	document.myform.action="../../frommail.asp";
	document.myform.method="post";
	document.myform.submit();
}
function mail_send_gen()
{
	document.myform.action="frommail.asp";
	document.myform.method="post";
	document.myform.submit();
}*/
function email()
  {
		ercode=0;
  		var fal=0;
	  	var e=document.frmcontact.myemail.value; 
	  	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	  	for(i=0; i<e.length ;i++) if(ok.indexOf(e.charAt(i))<0) fal=1;
	  	var suffix = e.substring(e.lastIndexOf('.')+1);
	  	var atpos = e.indexOf('@',0);
if(suffix.length<2 || e.indexOf('..',0) != -1 || e.indexOf('.@',0) != -1 ||e.indexOf('@.',0) != -1 || e.indexOf('.', atpos) == -1
	  	|| atpos==-1 || atpos==0 || fal==1 ||(e.indexOf('@',0)!=e.lastIndexOf('@')))
		   {
  			  ercode=1;
  		   }
  	}
function clogin_onclick()
{
		if(document.login.clogin.value == "")
		{
			alert("Please enter username ");
			document.login.clogin.focus();
			return false;
		}
		if (document.login.paswrd.value == "")
		{
			alert("Please enter password");
			document.login.paswrd.focus();
			return false;
		}
		document.login.action = "Sorry.asp";
		document.login.method="post";
		document.login.submit();		
}

function submit_onclick3()
{
        if (document.frmpart.myproduct.value =="")
		{
			alert("Please select the Product ");
			document.frmpart.myproduct.focus();
			return false;
		}

		if(document.frmpart.myname.value == "")
		{
			alert("Please enter your name ");
			document.frmpart.myname.focus();
			return false;
		}

		if(document.frmpart.mycompany.value == "")
		{
			alert("Please enter your company name  ");
			document.frmpart.myname.focus();
			return false;
		}

		if (document.frmpart.myemail.value =="")
		{
			alert("Please enter your email id ");
			document.frmpart.myemail.focus();
			return false;
		}
		
		if (document.frmpart.mytelephone.value =="")
		{
			alert("Please enter your Telephone No ");
			document.frmpart.mytelephone.focus();
			return false;
		}
		if (document.frmpart.mycountry.value =="")
		{
			alert("Please select your country ");
			document.frmpart.mycountry.focus();
			return false;
		}
		
		if (document.frmpart.mycomments.value == "")
		{
			alert("Please enter your comments !");
			document.frmpart.mycomments.focus();
			return false;
		}
		
		document.frmpart.action = "mailtest.php";
		document.frmpart.method="post";
		document.frmpart.reach_state.value="valid";
		document.frmpart.submit();		
}
