function Partsearch()
{
	var strPartNo;
	var strOption;
	strPartNo=document.getElementById("txtPart").value;	
	if(strPartNo=="") 
    {     
      alert('Enter Part Number for Search!');
      return;      
    }	
    strOption="Contains";     
	window.open("https://partsmart.aerotechcomp.com/Main.aspx?LoadPage=PRODUCTLIST&Search="+strPartNo+"&Option="+strOption+"&Check=NORMAL&From=HOME","_parent");		
	
}

function MutliPartsearch()
{
	var strPartNo;
	var strOption;
	strPartNo=document.getElementById("txtPart").value;	
	if(strPartNo=="") 
    {     
      alert('Enter Part Number for Search!');
      return;      
    }	
    strOption="Contains";     
	window.open("https://partsmart.aerotechcomp.com/Main.aspx?LoadPage=PRODUCTLIST&Search="+strPartNo+"&Option="+strOption+"&Check=MULTI&From=HOME","_parent");		
	
}

function memberlogin()
{
	
	strusrname=document.getElementById("lfrmname2").value;
	strpassword=document.getElementById("lfrmpswd2").value;	
    if(strusrname=="" || strpassword=="") 
    {     
      alert('Enter User Name And Password!');
      return;
    }
	
	document.cookie ="usrname="+document.getElementById("lfrmname2").value
	document.cookie ="password="+document.getElementById("lfrmpswd2").value
	
	SetCookie("usrname",strusrname,1);
	SetCookie("password",strpassword,1);
alert(document.cookie);
	
	window.location="https://partsmart.aerotechcomp.com/Main.aspx?LoadPage=LOGIN"; 
	
	//window.location="https://partsmart.aerotech.com/SetCookie.htm?un="+document.getElementById("lfrmname2").value+"&pw="+document.getElementById("lfrmpswd2").value;
	
	
}

function SetCookie(cookieName,cookieValue,nDays) 
{
	 var today = new Date();

 	var expire = new Date();
 	if (nDays==null || nDays==0) nDays=1;
 	expire.setTime(today.getTime() + 3600000*24*nDays);
 	document.cookie = cookieName+"="+escape(cookieValue)+";expires="+expire.toGMTString();

}

function Partsubmit()
{
       var strPartNo;
	
	strPartNo=document.getElementById("Search").value;	
	if(strPartNo=="") 
    {     
      alert('Enter Part Number for Search!');
      return;      
    }	
	strOption="Contains";     
	window.open("https://partsmart.aerotechcomp.com/Main.aspx?LoadPage=PRODUCTLIST&Search="+strPartNo+"&Option="+strOption+"&Check=MULTI&From=HOME","_parent");	
	
}

function submitlogin()
{
	
	strusrname=document.getElementById("usrname").value;
	strpassword=document.getElementById("password").value;	
    if(strusrname=="" || strpassword=="") 
    {     
      alert('Enter User Name And Password!');
      return;
    }
    	
   document.forms[0].action="https://partsmart.aerotechcomp.com/Main.aspx?LoadPage=LOGIN";
	//window.location="http://test.msinternational.biz/boomtechnologies/PartSearch/Main.aspx?LoadPage=LOGIN&subid=ca0a45b1-9a6c-4816-81b4-3e24f48ba277"; 
	document.forms[0].submit();	

	//window.location="https://partsmart.aerotech.com/SetCookie.htm?un="+document.getElementById("lfrmname2").value+"&pw="+document.getElementById("lfrmpswd2").value;
	
	
}


function getCookie(name) {

        var arg = name + "=";

        var alen = arg.length;

        var clen = document.cookie.length;

        var i = 0;

        while (i < clen) {

                var j = i + alen;

                if (document.cookie.substring(i, j) == arg) return getCookieVal (j);

                i = document.cookie.indexOf(" ", i) + 1;

                if (i == 0) break;

        }

        return null;

}
 function getCookieVal (offset) {  

	var endstr = document.cookie.indexOf (";", offset);  

	if (endstr == -1) { endstr = document.cookie.length; }

	return unescape(document.cookie.substring(offset, endstr));

}

function SetCookie(cookieName,cookieValue,nDays) 
{

	 var today = new Date();

 	var expire = new Date();
 	if (nDays==null || nDays==0) nDays=1;
 	expire.setTime(today.getTime() + 3600000*24*nDays);
 	document.cookie = cookieName+"="+escape(cookieValue)+";expires="+expire.toGMTString();
// 	alert(document.cookie);

}
function clickButton(e, buttonid)
		 { 
			var bt = document.getElementById(buttonid); 			
			if (typeof bt == 'object')
			{ 
					if(navigator.appName.indexOf("Netscape")>(-1))
					{ 
						if (e.keyCode == 13)
						{ 
								bt.click(); 
								return false; 
						} 
					} 
					if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
					{ 
						if (event.keyCode == 13)
						{ 
								bt.click(); 
								return false; 
						} 
					} 
			} 
        }        

