//Edited during Migration



//Pop-it menu- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

var linkset=new Array()
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT

linkset[0]='<div class="menuitems"><b>Trade Shows and Exhibitions</b></div>'
linkset[0]+='<div class="menuitems"><a href="shownews.html?newsid=26">The Polytype Group will participate in the following Shows:</a></div>'
linkset[2]='<div class="menuitems"><a href="polytype_dry_offset_printing_equipment.html"> Polytype Dry Offset Printing Equipment:</a></div>'
linkset[2]+='<div class="menuitems"><a href="accumulators_and_oven.html">Accumulators and Ovens</a></div>'
linkset[2]+='<div class="menuitems"><a href="converting_equipment.html">Converting Equipment</a></div>'
linkset[2]+='<div class="menuitems"><a href="madaghot_stamping_equipment.html">MADAG Hot Stamping Equipment</a></div>'
linkset[2]+='<div class="menuitems"><a href="wifag_newspaper_printingpress.html">WIFAG Newspaper Printing Presses</a></div>'
linkset[1]='<div class="menuitems"><a href="spareparts.html">Spare Parts</a></div>'
linkset[1]+='<div class="menuitems"><a href="trainingprogram.html">Training Program</a></div>'
linkset[1]+='<div class="menuitems"><a href="machineshop.html">Machine Shop</a></div>'
linkset[1]+='<div class="menuitems"><a href="service.html">Service</a></div>'
linkset[3]='<div class="menuitems"><a href="ourpeople.html#18">Pieter S. van der Griendt</a></div>'
linkset[3]+='<div class="menuitems"><a href="ourpeople.html#19">Felix Gomez</a></div>'
linkset[3]+='<div class="menuitems"><a href="ourpeople.html#20">Jim Dominico</a></div>'
linkset[3]+='<div class="menuitems"><a href="ourpeople.html#21">Rod Brynildsen</a></div>'
linkset[3]+='<div class="menuitems"><a href="ourpeople.html#22">Elvin Rivera</a></div>'
linkset[3]+='<div class="menuitems"><a href="ourpeople.html#26">Thomas Stuart</a></div>'
linkset[3]+='<div class="menuitems"><a href="ourpeople.html#24">Bill Smith</a></div>'
linkset[3]+='<div class="menuitems"><a href="ourpeople.html#25">Ken Glade</a></div>'
linkset[4]='<div class="menuitems"><b> POLYTYPE GROUP OF COMPANIES ///////////////////////////////////////////////////////////////////////</b></div>'
linkset[4]+='<div class="menuitems"><a href="http://www.polytype.com" target="_blank"> Polytype SA</a></div>'
linkset[4]+='<div class="menuitems"><b> POLYTYPE GROUP OF COMPANIES ///////////////////////////////////////////////////////////////////////</b></div>'
linkset[4]+='<div class="menuitems"><a href="http://www.mall-herlan.de" target="_blank">Mall+Herlan GmbH</a></div>'
linkset[4]+='<div class="menuitems"><b> POLYTYPE GROUP OF COMPANIES ///////////////////////////////////////////////////////////////////////</b></div>'
linkset[4]+='<div class="menuitems"><a href="http://www.metzgerundbecker.de" target="_blank">Metzger & Becker GmbH</a></div>'
linkset[4]+='<div class="menuitems"><b> REPRESENTATIONS ///////////////////////////////////////////////////////////////////////////////////</b></div>'
linkset[4]+='<div class="menuitems"><a href="http://www.madag-printingsystems.ch/en/index.htm" target="_blank">MADAG</a></div>'
linkset[4]+='<div class="menuitems"><b>TRADE SHOWS ////////////////////////////////////////////////////////////////////////////////////////</b></div>'
linkset[4]+='<div class="menuitems"><a href="http://www8.drupa.de/cipp/md_drupa/custom/pub/content,lang,2/oid,11167/ticket,g_u_e_s_t" target="_blank">Drupa 2008</a></div>'


linkset[5]='<div class="menuitems"><a href="emailus.html">Email-Us</a></div>'
linkset[5]+='<div class="menuitems"><a href="directions.html">Directions</a></div>'
linkset[5]+='<div class="menuitems"><a href="contactus.html">Subscribe</a></div>'

////No need to edit beyond here

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all
var ns4=document.layers

function showmenu(e,which){
if (!document.all&&!document.getElementById&&!document.layers)
return

clearhidemenu()

menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""

menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj

if (ie4||ns6)
menuobj.innerHTML=which
else{
menuobj.document.write('<layer name=gui bgColor=#E6E6E6 width=165 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')
menuobj.document.close()
}

menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
eventX=ie4? event.clientX : ns6? e.clientX : e.x
eventY=ie4? event.clientY : ns6? e.clientY : e.y

//Find out how close the mouse is to the corner of the window
var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth) {
//move the horizontal position of the menu to the left by it's width
menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth : ns6? window.pageXOffset+eventX-menuobj.contentwidth : eventX-menuobj.contentwidth
//alert("Izq 1: " + menuobj.thestyle.left);
} else {
//position the horizontal position of the menu where the mouse was clicked
menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX : ns6? window.pageXOffset+eventX : eventX
//alert("Izq 2: " + menuobj.thestyle.left);
}

if (showmenu.arguments.length == 4)
menuobj.thestyle.left = showmenu.arguments[2] + "px"
menuobj.thestyle.top = showmenu.arguments[3] + "px"

//same concept with the vertical position
menuobj.thestyle.visibility="visible"
return false
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
}

function dynamichide(e){
if (ie4&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
if (ie4||ns6||ns4)
delayhide=setTimeout("hidemenu()",500)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

function highlightmenu(e,state){
if (document.all)
source_el=event.srcElement
else if (document.getElementById)
source_el=e.target
if (source_el.className=="menuitems"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}
else{
while(source_el.id!="popmenu"){
source_el=document.getElementById? source_el.parentNode : source_el.parentElement
if (source_el.className=="menuitems"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}
}
}
}

if (ie4||ns6)
document.onclick=hidemenu







function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



/* Opens a new window where to show the image.
	 *
	 * sName		- Image title.
	 * sCode		- Product or category code.
	 * sImage		- Image name.
	 * sImageType	- Image type.
	 */
	function showLargerPhoto(sName, sCode, sImage, sImageType) {
		var w, h;
		
		if (showLargerPhoto.arguments.length == 6) {
			w = parseInt(showLargerPhoto.arguments[4]) + 60;
			h = parseInt(showLargerPhoto.arguments[5]) + 90;
		} else {
			w = 550;
			h = 550;
		}
	
		sImagePath = ((sImageType=="p") ? "prodimages/" : "catimages/") + sImage;
		open(
			"picviewer.php?name=" + escape(sName) + "&code=" + escape(sCode) + "&Image=" + escape(sImagePath), 
			"picviewer",
			"directories=no,location=no,menubar=no,resizeable=yes,status=no,toolbar=no,scrollbars=yes,width=" + w + ",height=" + h,
			true);
	}
	
	function isFieldEmpty(psCaption, pField) {
			if (pField.value=="") {
				alert(psCaption + " must have a value, please fill this field first.");
				pField.focus();
				return false;
			} else 
				return true;
		}
		
		function validateform(form){
			b=true;
			b=b && isFieldEmpty("Search", form.searchfor);
			return b;
		}
		
		
			function isFieldEmpty(psCaption, pField) {
		if (pField.value=="") {
			alert(psCaption + " must have a value, please fill this field first.");
			pField.focus();
			return false;
		} else 
			return true;
	}	
	
	function validateForm(pForm) {
		bValid = true;
		
		// Validate required fields
		bValid = bValid && isFieldEmpty("User Name", pForm.User);
		bValid = bValid && isFieldEmpty("Password", pForm.Password);
		
		return bValid;
	}
	
	
/* ---------  Start Code for contactus.html --------- */
function send_reply(form)
{
	okay = 1;
	if (form.lname.value == "" && okay == 1)
	{
		alert ("You must enter your name before you can continue.");
		okay = 0;
	}
	if (form.email.value == "" && okay == 1)
	{
		alert ("You must enter your email before you can continue");
		okay = 0;
	}
	if (okay == 1)
	{
        return true;
//		document.forms.register.submit();
	}

}
/* ---------  End Code for contactus.html --------- */



 /* ---------  Start Code for formLogin form --------- */
/*function isFieldEmpty(psCaption, pField) {
    if (pField.value=="") {
        alert(psCaption + " must have a value, please fill this field first.");
        pField.focus();
        return false;
    } else
        return true;
}*/
 function validateForm(pForm) {
    bValid = true;
     // Validate required fields
    bValid = bValid && isFieldEmpty("User Name", pForm.User);
    bValid = bValid && isFieldEmpty("Password", pForm.Password);
     return bValid;
}
/* ---------  Start Code for formLogin form --------- */