<!--
//		-- common.js --
//		Functions for menus and rollover images

function I_swapImgRestore() { //v3.0
  var i,x,a=document.I_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function I_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.I_p) d.I_p=new Array();
    var i,j=d.I_p.length,a=I_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.I_p[j]=new Image; d.I_p[j++].src=a[i];}}
}

function I_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=I_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function I_swapImage() { //v3.0
  var i,j=0,x,a=I_swapImage.arguments; document.I_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=I_findObj(a[i]))!=null){document.I_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function init() {
	onLoad="I_preloadImages('/images/brand_allies-over.gif','/images/brand_aggro-over.gif','/images/nav_products-over.gif','/images/nav_lab-over.gif','/images/nav_distributors-over.gif','/images/nav_company-over.gif','/images/nav_contact-over.gif','/images/pglink-top-over.gif','/images/pglink-print-over.gif','/images/pglink-email-over.gif','/images/pglink-moreinfo-over.gif')";
}

function confExit() {
	return confirm('Are you sure that you want to leave Grotek.net?');
}




// ** More Information Window **
	function openMoreInfo() {
		winMoreInfo=window.open("/misc/moreinfo_frame.htm", "x_moreinfo", "height=450,width=300")
		winMoreInfo.focus
	}

// ** E-Mail this Page Window **
	function openEMail() {
		winEmail=window.open('/misc/email.asp?t=' + escape(document.title) + '&u=' + escape(location.href),'x_emaillink','height=360,width=400,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
		winEmail.focus
	}

// ** Printer-Friendly Version Window **
	function openPrint() {
		if (location.href.indexOf("?") != -1) {
			winPrintPage=window.open(location.href + '&ver=print','x_printpage','top=0,left=0,height=440,width=620,status=yes,toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes');
		} else {
			winPrintPage=window.open(location.href + '?ver=print','x_printpage','top=0,left=0,height=440,width=620,status=yes,toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes');
		}
		winPrintPage.focus
	}

// ** Product Label **
	function openLabel(pcode) {
		winLabel=window.open('/products/guide/labels/view.asp?code=' + pcode,'x_label','top=0,left=0,height=550,width=765,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
		winLabel.focus
	}

// ** Open a PDF File **
	function openPDF(filename) {
		winPDF=window.open(filename,'x_pdf','top=0,left=0,height=550,width=765,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
		winPDF.focus
	}

// ** Open App Calculator **
	function openCalc(pcode) {
		winCALC=window.open('/products/calc/default.asp?step=1&code=' + pcode,'x_calc','top=0,left=0,height=450,width=700,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
		winCALC.focus
	}

// ** Open App Calculator **
	function openCalc2() {
		winCALC=window.open('/products/calc/default.asp','x_calc','top=0,left=0,height=450,width=700,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
		winCALC.focus
	}
	
	// ** Open a Image Feedback File **
	function openImage(filename) {
		winImage=window.open(filename,'x_image','top=0,left=0,height=525,width=700,status=yes,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=yes');
		winImage.focus
	}


window.onload = init;
//-->
