// JavaScript Document
<!--
var browserName=navigator.appName; 
if (browserName=="Netscape")
{ 
	//netscape & mozilla
	document.writeln("<style type=\"text/css\">");
	document.writeln("<!--");
	document.writeln("#bottomHide { left:5px; top:310px; }");
	document.writeln("#topHide { left:5px; top:100px; }");
	document.writeln("#leftHide { left:5px; top:120px; }");
	document.writeln("#rightHide { left:155px; top:120px; }");
	document.writeln("#products { left:148px; top:141px; }");
	document.writeln("#company { left:148px; top:249px; }");
	document.writeln("#searchlayer { left:733px; top:54px; }");
	document.writeln("-->");
	document.writeln("</style>");
}
else 
{
	//assumes internet explorer
	document.write("<style type=\"text/css\">");
	document.write("<!--");
	document.writeln("#bottomHide { left:7px; top:320px; }");
	document.writeln("#topHide { left:7px; top:107px; }");
	document.writeln("#leftHide { left:7px; top:120px; }");
	document.writeln("#rightHide { left:157px; top:120px; }");
	document.writeln("#products { left:150px; top:160px; }");
	document.writeln("#company { left:150px; top:268px; }");
	document.writeln("#searchlayer { left:733px; top:54px; }");
	document.write("-->");
	document.write("</style>");
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(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 Validator(theForm){
	  var error = "";
		if (theForm.name.value == "")
		{
			error += "Please enter your name.\n";
		}
		if (theForm.ccompany.value == "")
		{
			error += "Please enter your company.\n";
		}
		if (theForm.address1.value == "")
		{
			error += "Please enter your address.\n";
		}
		if (theForm.city.value == "")
		{
			error += "Please enter your city.\n";
		}
		if (theForm.state.options[0].selected == true)
		{
			error += "Please select a state from the drop-down list.\n";
		} 
		if (theForm.zip.value == "")
		{
			error += "Please enter your zip code.\n";
		}
		if (theForm.telenum.value == "")
		{
			error += "Please enter your telephone number.\n";
		}
		if (theForm.email.value == "")
		{
			error += "You must include an accurate email address for a response.\n";
		}
		if ((theForm.email.value.indexOf ('@',0) == -1 ||
		   theForm.email.value.indexOf ('.',0) == -1) &&
		   theForm.email.value != "")
		{
			error += "Please verify that your email address is valid.";
		} 
		if (error != "")
		{
			alert(error);
			return (false);
		}
		else 
		{
			return (theForm.submit());
		}
	}
	
function minimizeSearch()
{
	var browserName=navigator.appName; 
	if (browserName=="Netscape")
	{
		thelayer = document.getElementById('searchlayer');
		thelayer.style.visibility = 'hidden';
	}
	else
	{
		document.all.searchlayer.style.visibility="hidden";
	}
	window.document.searchform.term.value = window.document.asearchform.term.value;
}
function showSearch()
{
	var browserName=navigator.appName; 
	if (browserName=="Netscape")
	{
		thelayer = document.getElementById('searchlayer');
		thelayer.style.visibility = 'visible';
	}
	else
	{
		document.all.searchlayer.style.visibility="visible";
	}
	window.document.asearchform.term.value = window.document.searchform.term.value;
}

function searchLinker(theForm)
	{
	  var error = "";
		if (theForm.term.value == "")
		{
			error += "		Please enter a search term to look for.\n";
		}		
		
		if (error != "")
		{
			alert(error);
			return (false);
		}
		else 
		{
			if(theForm.goog.checked == true)
			{
				window.location="http://www.google.com/search?hl=en&q=" + theForm.term.value + "+site%3Ahttp%3A%2F%2Fwww.lifetecinc.com";
			}
			else
			{
				
				var dispAmt;
				if(theForm.disp.value=="")
				{
					dispAmt = 10;
				}
				else
				{
					dispAmt = theForm.disp.value;
				}
			
				var phpQuery = "?searchterm=" + theForm.term.value + "&searchterms=";
			//product titles and descriptions
				if(theForm.tad.checked == true)
				{
					phpQuery += "1,";
				}
				else
				{
					phpQuery += "0,";
				}
				//categorys
				if(theForm.ct.checked == true)
				{
					phpQuery += "1,";
				}
				else
				{
					phpQuery += "0,";
				}
				//Catalog Number
				if(theForm.cn.checked == true)
				{
					phpQuery += "1,";
				}
				else
				{
					phpQuery += "0,";
				}
				//company name
				if(theForm.comp.checked == true)
				{
					phpQuery += "1";
				}
				else
				{
					phpQuery += "0";
				}
			
				phpQuery += "&page=1&dispamt=" + dispAmt;
			
				window.location = "https://www.lifetecinc.com/search/index.php" + phpQuery;
			}
		}
	}

function submitSearch(theForm)
{
	query_string = "searchterm=" + theForm.term.value + "&searchterms=1,1,1,1&dispamt=10";

	window.location = "http://www.lifetecinc.com/search/index.php?" + query_string;
	exit;
}
//-->
