function searchclear(str)
 {MyForm = eval("document."+str);
 for (i=0 ; i <= MyForm.elements.length ; i++)
      {if (MyForm.elements[i].value == "Search Here")
	      {MyForm.elements[i].value = "";break;}
	  }//end of loop
}//end of function

function loadinquiry()
{MyForm = eval("document.inquiry");
 for (i = 0 ; i < MainCat.length ; i++)
	 {CatPro = MainCat[i]+"";
	  CatPro = CatPro.replace(/\W/g,"_");
	  CatPro = eval(CatPro);
	  for (ii = 0 ; ii < CatPro.length ; ii++)
	      { var newOption=new Option();
		    newOption.value=CatPro[ii];
		    newOption.text=CatPro[ii];
		 	MyForm.productslist.options[MyForm.productslist.length] = newOption;
		  }//end of inneer loop
	 }//END OF MAIN LOOP
}//end of function

function focusinquiry(str)
{MyForm = eval("document.inquiry."+str);
 if (MyForm.value == "Required" )
    {MyForm.value = "";}
}//end of function

function submitinquiry()
{MyForm = eval("inquiry");
if (trim(MyForm.realname.value) == "" || trim(MyForm.company.value) == "" || trim(MyForm.email.value) == "")
    {MyForm.realname.focus();alert("Invalid Inputs\n\n Notice: Fields Cannot Be Empty\n1- Contact Person\n2- Company Name\n3- Counyty");return false;}//end of if 

}//end of funstion

function submitfeedback()
{MyForm = eval("document.feedback");
 if (trim(MyForm.realname.value) == "" || trim(MyForm.email.value) == "" || trim(MyForm.telephone.value) == "" ||  trim(MyForm.message.value) == "" )
    {MyForm.realname.focus();alert("Invalid Inputs");return false;}//end of if

if (MyForm.email.value.indexOf("@") != -1)
       {var len = MyForm.email.value
	    var em = MyForm.email.value.substr(MyForm.email.value.indexOf("@")+1 , len.length);
	    if(em.indexOf(".") != -1 && em.indexOf("@") == -1 && em.indexOf(" ") == -1)
	      {//no error
		  }//end of if
	    else
	      {alert("Inavlid Email");MyForm.email.focus();return false;}
	   }
    else
        {alert("Inavlid Email");MyForm.email.focus();return false;}//end of if

}//end of function

function submitmail()
{MyForm = eval("document.mailform");
 
 if (trim(MyForm.realname.value) == "" || trim(MyForm.company.value) == ""  || trim(MyForm.email.value) == "" || trim(MyForm.telephone.value) == "" || MyForm.mnuCountry.value == "-Select One-")
    {alert("Invalid Inputs");MyForm.realname.focus();return false;}//end of if

if (MyForm.email.value.indexOf("@") != -1)
       {var len = MyForm.email.value
	    var em = MyForm.email.value.substr(MyForm.email.value.indexOf("@")+1 , len.length);
	    if(em.indexOf(".") != -1 && em.indexOf("@") == -1 && em.indexOf(" ") == -1)
	      {//no error
		  }//end of if
	    else
	      {alert("Inavlid Email");MyForm.email.focus();return false;}
	   }
    else
        {alert("Inavlid Email");MyForm.email.focus();return false;}//end of if

}//emd of function

	function validationformone()
	{
	 LgForm = eval("document.login");
   	 if (trim(LgForm.loginname.value) == "" || trim(LgForm.password.value) == "")
	    {alert("Invalid Inputs\n Notice: Login & Password Cannot Be Empty");return false;}
	}//end of function

function trim(inputString) {
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function

function gomenu(str)
{MyForm = eval(str)
 if (MyForm.navigation.value.match(".htm") != null)//founf then go to URL
    {setCookie("jumpselection", MyForm.navigation.value);
	 window.location = nlink + "/" + MyForm.navigation.value;	
	}//end of if
 else
 	{setCookie("jumpselection", " ");
	}//end of if
}//end of funciton

function selectjumpmenu(frmname,List1,List2)
{
//For AutoSelection
/*List1 = eval(List1);List2 = eval(List2);

if (getCookie("CatClicked") != null && getCookie("ProClicked") != null)
{
if (getCookie("CatClicked") != " " && getCookie("ProClicked") != " ")
   {
    for (var i=0 ; i <= List1.options.length-1 ; i++)
         {
		  if (List1.options[i].value == getCookie("CatClicked")){List1.options[i].selected = true;break;}//end of if
		 }//emd of loop
		 CatChanged(List1.value);
    for (var i=0 ; i <= List2.options.length-1 ; i++)
         {
		  if (List2.options[i].value == getCookie("ProClicked")){List2.options[i].selected = true;break;}//end of if
		 }//emd of loop
   setCookie("CatClicked", " ");setCookie("ProClicked", " ");
   }//end of if
}
else
{setCookie("CatClicked", " ");setCookie("ProClicked", " ");
}//end of main if
*/
//For Quick Menu
if (getCookie("jumpselection") != null || getCookie("jumpselection") != " ")
     {MyForm = eval(frmname);
	  for (var i=0 ; i <= MyForm.navigation.options.length-1 ; i++)
	      {
		   if (MyForm.navigation.options[i].value == getCookie("jumpselection"))
		      {
			   MyForm.navigation.options[i].selected = true;
			   break;
			  }//end of if
		  }//end of if
	  setCookie("jumpselection", " ");
	 }//end of if









}//end of function

function setCookie(name, value) {document.cookie=name + "=" + escape(value) + "; expires=";}//end of function

function getCookie(name)
  {
    var bikky = document.cookie;
    var index = bikky.indexOf(name + "=");
    if (index == -1) return null;
    index = bikky.indexOf("=", index) + 1;
    var endstr = bikky.indexOf(";", index);
    if (endstr == -1) endstr = bikky.length;
    return unescape(bikky.substring(index, endstr));
  }//END OF FUCTION

