<!--

//URL to the root folder of the website:
var path="http://www.eatec.com/"







//################################### DO NOT CHANGE BELOW ################################################


// browser detection:
var ua = navigator.userAgent;
var ns = (navigator.appName.toLowerCase().indexOf("netscape")!=-1)?1:0;
var ns4 = (document.layers)?1:0;
var ns6 = (document.getElementById && ns)?1:0;
var mac = (navigator.userAgent.toLowerCase().indexOf("mac")!=-1)?1:0;
var macie4 = (mac && !ns && parseInt(ua.substr(ua.indexOf("MSIE")+4,2)) <= 4)?1:0;
var macie = (mac && !ns)?1:0;

document.write('<link rel="stylesheet" type="text/css" href="'+path+'eatec.css">')

if (typeof(pageID)=="undefined") pageID=""


// array for top menu:
var arrTopMnu=new Array(
path+"images/mnug_hom_off.gif",path+"images/mnug_hom_on.gif",path+"client_login.asp","Home",29,11,"hom",
path+"images/mnug_con_off.gif",path+"images/mnug_con_on.gif",path+"about_contact.htm","Contact Eatec",71,11,"con",
path+"images/mnug_log_off.gif",path+"images/mnug_log_on.gif","http://www.eatec.info/","Client Login",62,11,"log",
path+"images/mnug_map_off.gif",path+"images/mnug_map_on.gif",path+"site_map.htm","Site Map",45,11,"map"
)
var step1=7

var j=0

// building the top menu:
var arrTop_on = new Array;
var arrTop_off = new Array;
var strTop=""
for (var i=0; i<arrTopMnu.length; i+=step1) {
	j=parseInt(i/step1)
	
	arrTop_on[j]=arrTopMnu[i+1]
	arrTop_off[j]=arrTopMnu[i]
	
	if (pageID==arrTopMnu[i+6]) strTop+='<A href="'+arrTopMnu[i+2]+'"><IMG src="'+arrTopMnu[i+1]+'" width="'+arrTopMnu[i+4]+'" height="'+arrTopMnu[i+5]+'" border=0 alt="'+arrTopMnu[i+3]+'" title="'+arrTopMnu[i+3]+'" name="imgTop'+j+'"></A>'
	else strTop+='<A href="'+arrTopMnu[i+2]+'" onmouseover="Swap('+j+',\'on\',\'imgTop\')" onmouseout="Swap('+j+',\'off\',\'imgTop\')"><IMG src="'+arrTopMnu[i]+'" width="'+arrTopMnu[i+4]+'" height="'+arrTopMnu[i+5]+'" border=0 alt="'+arrTopMnu[i+3]+'" title="'+arrTopMnu[i+3]+'" name="imgTop'+j+'"></A>'
	if (parseInt(arrTopMnu.length/step1)-1!=j) strTop+='<IMG src="'+path+'images/mnu_line.gif" width=1 height=12 hspace=10>'
}
//preloading top menu images:
var imgTop_on = new Array;
var imgTop_off = new Array;
Preload("arrTop","imgTop",0);


// START: Rollover functions >>>
function Preload(arrFrom,arrToGen,act) {
	var l = eval(arrFrom + '_on.length');
	for (var i=0; i<l; i++) {
		eval(arrToGen + '_on[i] = new Image()');
		eval(arrToGen + '_on[i].src = ' + arrFrom + '_on[i]');
		
		eval(arrToGen + '_off[i] = new Image()');
		eval(arrToGen + '_off[i].src = ' + arrFrom + '_off[i]');
		
		if (act==1) {
			eval(arrToGen + '_act[i] = new Image()');
			eval(arrToGen + '_act[i].src = ' + arrFrom + '_act[i]');
		}
	}
}

function Swap() {
	var imgName = Swap.arguments[2] + Swap.arguments[0];
	var index = (Swap.arguments.length >= 4) ? parseInt(Swap.arguments[3]) : parseInt(Swap.arguments[0]);
	document.images[imgName].src = eval(Swap.arguments[2] + '_' + Swap.arguments[1] + '[' + index + '].src');
}
// <<< END: Rollover functions




//getting the content height:
var contH="100%"
var headerH=177
var footerH=16
var contHHome="100%"
var headerHHome=225
var footerHHome=16
function GetContentH(){
	if (ns) {
		contH=window.innerHeight-headerH-footerH
		contHHome=window.innerHeight-headerHHome-footerHHome
	} else if (ua.toLowerCase().indexOf("windows")<0) {
		contH=document.body.clientHeight-headerH-footerH
		contHHome=document.body.clientHeight-headerHHome-footerHHome
	}
}

// START: fixing the page content on resize >>>
FixNSWindow();
function FixNSWindow() {
	if (ns6 || ns && (parseInt(navigator.appVersion) == 4)) {
		if (typeof document.NS == 'undefined') document.NS = new Object;
		if (typeof document.NS.NS_scaleFont == 'undefined') {
			document.NS.FixCssInNS = new Object;
			document.NS.FixCssInNS.initWindowWidth = window.innerWidth;
			document.NS.FixCssInNS.initWindowHeight = window.innerHeight;
		}
		window.onresize = FixCssInNS;
	}
}
function FixCssInNS() {
	if (document.NS.FixCssInNS.initWindowWidth != window.innerWidth || document.NS.FixCssInNS.initWindowHeight != window.innerHeight) document.location = document.location;
}
ReloadWindow();
function ReloadWindow(){if (!ns && (ua.toLowerCase()).indexOf("windows")<0) setTimeout("window.onresize=new Function('window.location.reload()')",200);}
// <<< END: fixing the page content on resize

var newWin;
function WinOpen(url,title,w,h){
	w=parseInt(w)
	h=parseInt(h)
	if (!mac) if (new String(newWin)!="undefined" && newWin!=null) if (!newWin.closed) newWin.close();
	newWin=window.open(url,title,"width="+w+",height="+h+",top=0,left=0,location=no,directories=no,hotkeys=no,copyhistory=no,resizable=yes,menubar=no,status=no,toolbar=no,scrollbars=yes,z-lock=yes");
	if (mac) win.resizeTo(w+25,h+50)
	newWin.focus()
}


//for Home page: rotating the header images
function HeaderImage(){
	var i=1
	var ck=GetCookie("EatecCookie")
	if (ck==null || ck=="" || new String(ck)=="undefined" || isNaN(parseInt(ck))) {
		NewCookie("EatecCookie","1")
	} else {
		i=parseInt(ck)
		i++
		if (i>3) i=1
		DeleteCookie("EatecCookie")
		NewCookie("EatecCookie",i)
	}
	var j=(i-1)*3
	var hImg='<img src="'+arrHImg[j]+'" width='+arrHImg[j+1]+' height='+arrHImg[j+2]+'>'
	document.write(hImg)
}



var timeOut

// START: rotating clients for Home page
var arrObjCli=new Array()
// preloading clients images
function PreloadClients(){
	for (i=0;i<arrCli.length;i+=stepCli){
		var j=parseInt(i/stepCli)
		arrObjCli[j]=new Image()
		arrObjCli[j].src=arrCli[i]
	}
}
// writes clients
function WriteClients(){
	if (arrCli.length>=stepCli && arrObjCli.length>0){
		var str='<font><center><img src="'+arrObjCli[0].src+'"></center><br>'+arrCli[1]+'</font>'
		var strCl=""
		strCl+='<div id="divRotCl">'
		strCl+='<layer id="lyrRotCl">'
		strCl+=str
		strCl+='</layer>'
		strCl+='</div>'
		document.write(strCl)
	}
}
// starts rotating clients
var indCli=0
function StartRotateClients(){
	if (arrCli.length>=stepCli && arrObjCli.length>0){
		if (ns6) document.getElementById("divRotCl").style.visibility="visible"
		else if (ns4) document.divRotCl.visibility="visible"
		else document.all["divRotCl"].style.visibility="visible"
		timeOut=setTimeout('RotateClients()',arrCli[indCli+2])
	}
}
// rotating clients
function RotateClients(){
	clearTimeout(timeOut)
	if (parseInt(indCli/stepCli)>=parseInt(arrCli.length/stepCli)-1) indCli=0; else indCli+=stepCli;
	var j=parseInt(indCli/stepCli)
	newCont='<font><center><img src="'+arrObjCli[j].src+'"></center><br>'+arrCli[indCli+1]+'</font>'
	if (ns6) {
		document.getElementById("divRotCl").innerHTML=newCont
	} else if (ns4) {
		document.divRotCl.document.lyrRotCl.document.open()
		document.divRotCl.document.lyrRotCl.document.write('<layer id="lyrRotCl">'+newCont+'</layer>')
		document.divRotCl.document.lyrRotCl.document.close()
	} else {
		document.all["divRotCl"].innerHTML=newCont
	}
	timeOut=setTimeout('RotateClients()',arrCli[indCli+2])
}
// END: rotating clients for Home page



// START: rotating quotes >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
var arrQ=new Array()
var arrObjQ=new Array()
// preloading quotes images
function PreloadQuotes(){
	arrQ=eval("arrQ_"+pageID)
	for (i=0;i<arrQ.length;i+=stepQ){
		var j=parseInt(i/stepQ)
		arrObjQ[j]=new Image()
		arrObjQ[j].src=arrQ[i]
	}
}
// writes quotes
function WriteQuotes(){
	if (arrQ.length>=stepQ && arrObjQ.length>0){
		var str='<center><img src="'+arrObjQ[0].src+'"></center>'
		var strCl=""
		strCl+='<div id="divRotQ">'
		strCl+='<layer id="lyrRotQ">'
		strCl+=str
		strCl+='</layer>'
		strCl+='</div>'
		document.write(strCl)
	}
}
// starts rotating quotes
var indQ=0
function StartRotateQuotes(){
	if (arrQ.length>=stepQ && arrObjQ.length>0){
		if (ns6) document.getElementById("divRotQ").style.visibility="visible"
		else if (ns4) document.divRotQ.visibility="visible"
		else document.all["divRotQ"].style.visibility="visible"
		timeOut=setTimeout('RotateQuotes()',arrQ[indQ+1])
	}
}
// rotating quotes
function RotateQuotes(){
	clearTimeout(timeOut)
	if (parseInt(indQ/stepQ)>=parseInt(arrQ.length/stepQ)-1) indQ=0; else indQ+=stepQ;
	var j=parseInt(indQ/stepQ)
	newCont='<center><img src="'+arrObjQ[j].src+'"></center>'
	if (ns6) {
		document.getElementById("divRotQ").innerHTML=newCont
	} else if (ns4) {
		document.divRotQ.document.lyrRotQ.document.open()
		document.divRotQ.document.lyrRotQ.document.write('<layer id="lyrRotQ">'+newCont+'</layer>')
		document.divRotQ.document.lyrRotQ.document.close()
	} else {
		document.all["divRotQ"].innerHTML=newCont
	}
	timeOut=setTimeout('RotateQuotes()',arrQ[indQ+1])
}
// END: rotating quotes <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


// Trims the leading and trailing blanks from a given string:
function Trim(strToTrim) {
	while(strToTrim.charAt(0)==' '){strToTrim = strToTrim.substring(1,strToTrim.length);}
	while(strToTrim.charAt(strToTrim.length-1)==' '){strToTrim = strToTrim.substring(0,strToTrim.length-1);}
	return strToTrim;
}
// Validate an e-mail address:
function ValidateEmail(str){
	if (str.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) return true;
	else return false; 
}
// Allows only letters and numbers:
function ChkIllegalChars(str){
	var expr = /[\W]/
	if (expr.test(str)) return false;
	else return true
}

//-->