var rightCap = new Image()
rightCap.src = '/images/generic/bot_right_cap_right.gif'
var rightCapOver = new Image()
rightCapOver.src = '/images/generic/bot_right_cap_right_anim.gif'

function printVersion() {
	
	if(document.getElementById) {
		var printWin = launchPopup("/templates/print_template.html","scrollbars=yes,width=600,menubar=yes",true)
		
		printWin.focus()
		
		}
	else {alert("Sorry, your browser does not support this facility")}
	
	}


function prodListOver(index,direction) {
	
	if(document.getElementById) {
		
		//document.getElementById("product_list_top_border_"+index).style.backgroundColor = direction=="out" ? "#f2f2f2" : "#000000"
		//document.getElementById("product_list_top_border_"+(index+1)).style.backgroundColor = direction=="out" ? "#f2f2f2" : "#000000"
		
		changeOpac(direction=="out" ? 100 : 50,"product_list_"+index)
		
		}
	
	}

function changeOpac(opacity,id,obj) { 
    if(document.getElementById) {
		var obj = obj ? obj : document.getElementById(id)
		if(obj.tagName.toLowerCase()=="tr") {
			changeOpac(opacity,false,obj.cells[obj.cells.length-1])
			}	
				
		else {	
			var object = obj.style; 
    		object.opacity = (opacity / 100); 
    		object.MozOpacity = (opacity / 100); 
   			object.filter = "alpha(opacity=" + opacity + ")"; 
				
			}
    	}
	} 


var mainTableLeft = 0

function setMenusLeft()
{
	
	if(!document.getElementById) {return false}
	
	mainTableLeft = Math.floor((document.body.clientWidth-document.getElementById("Main_Template_Inner1").width)/2)
	
	for (var i=0;i<menus.length;i++)
	{
		if (menus[i].topLevel)
		{
			document.getElementById("menu_"+i).style.left=menus[i].left+mainTableLeft
			//menus[i].left=menus[i].initLeft+document.getElementById("Main_Template_Inner1").offsetLeft
		}
	}
}



var menus=[{"label":"Home","link":"/default.asp","section":"home","topLevel":true,"left":30,"DBItems":new Array(),"menuItems":new Array()},{"label":"Company","link":"/company/","section":"company","attributes":{"onMouseOver":"showMenu(1)","onMouseOut":"hideMenu(1)"},"topLevel":true,"left":80,"DBItems":[{"title":"Key Maxatec Milestones","ID":"3","scriptPath":"/company/default.asp","pageLabel":"history"},{"title":"Policy / ISO Approval","ID":"4","scriptPath":"/company/default.asp","pageLabel":"policy"},{"title":"Associated Membership","ID":"37","scriptPath":"/company/default.asp","pageLabel":"membership"},{"title":"Maxatec News & Press","ID":"5","scriptPath":"/company/news.asp","pageLabel":"news"},{"title":"Maxatec Events","ID":"6","scriptPath":"/company/events.asp","pageLabel":"events"},{"title":"Customer Case Studies","ID":"10","scriptPath":"/company/cs.asp","pageLabel":"cs"},{"title":"Our Markets","ID":"20","scriptPath":"/company/default.asp","pageLabel":"markets"},{"title":"Maxatec Manufacturing Partners","ID":"27","scriptPath":"/company/partners.asp","pageLabel":"partners"},{"title":"Maxatec Quality Policy","ID":"38","scriptPath":"/company/default.asp","pageLabel":"quality"}],"menuItems":[{"content":"Key Maxatec Milestones","link":"/company/default.asp?pageID=3"},{"content":"Policy / ISO Approval","link":"/company/default.asp?pageID=4"},{"content":"Associated Membership","link":"/company/default.asp?pageID=37"},{"content":"Maxatec News &amp; Press","link":"/company/news.asp?pageID=5","childMenu":5},{"content":"Maxatec Events","link":"/company/events.asp?pageID=6"},{"content":"Customer Case Studies","link":"/company/cs.asp?pageID=10"},{"content":"Our Markets","link":"/company/default.asp?pageID=20","childMenu":6},{"content":"Maxatec Manufacturing Partners","link":"/company/partners.asp?pageID=27","childMenu":7},{"content":"Maxatec Quality Policy","link":"/company/default.asp?pageID=38"}]},{"label":"Products","link":"/products/","section":"products","attributes":{"onMouseOver":"showMenu(2)","onMouseOut":"hideMenu(2)"},"topLevel":true,"left":148,"DBItems":[{"title":"Point of Sale (POS) Printers","ID":"12","scriptPath":"/products/default.asp","pageLabel":"pos"},{"title":"Bar Code, Label & Ticket Printers","ID":"43","scriptPath":"/products/list.asp","pageLabel":"barcode"},{"title":"Portable Printers","ID":"44","scriptPath":"/products/list.asp","pageLabel":"portables"},{"title":"Printing Software","ID":"45","scriptPath":"/products/list.asp","pageLabel":"software"},{"title":"Aftersales Solutions & Support","ID":"50","scriptPath":"/products/default.asp","pageLabel":"aftermarket"},{"title":"Additional Printer Information","ID":"51","scriptPath":"/contact/form.asp","pageLabel":"product_info"}],"menuItems":[{"content":"Point of Sale (POS) Printers","link":"/products/default.asp?pageID=12","childMenu":8},{"content":"Bar Code, Label &amp; Ticket Printers","link":"/products/list.asp?pageID=43"},{"content":"Portable Printers","link":"/products/list.asp?pageID=44"},{"content":"Printing Software","link":"/products/list.asp?pageID=45"},{"content":"Aftersales Solutions &amp; Support","link":"/products/default.asp?pageID=50"},{"content":"Additional Printer Information","link":"/contact/form.asp?pageID=51"}]},{"label":"Support","link":"/support/","section":"support","attributes":{"onMouseOver":"showMenu(3)","onMouseOut":"hideMenu(3)"},"topLevel":true,"left":216,"DBItems":[{"title":"Technical Support Enquiries","ID":"22","scriptPath":"/contact/form.asp","pageLabel":"aftersales"},{"title":"Technical Services","ID":"54","scriptPath":"/support/default.asp","pageLabel":"services"},{"title":"Printing Product Documentation","ID":"23","scriptPath":"/support/documentation.asp","pageLabel":"doc_search"},{"title":"Maxatec Training Programmes","ID":"24","scriptPath":"/products/default.asp","pageLabel":"training"},{"title":"FAQ","ID":"26","scriptPath":"/support/faq.asp","pageLabel":"faq"},{"title":"Request RMA","ID":"31","scriptPath":"/support/rma.asp","pageLabel":"rma"},{"title":"Media Supplies","ID":"25","scriptPath":"/products/default.asp","pageLabel":"supplies"},{"title":"Bar Code Consumables Application Tips","ID":"53","scriptPath":"/support/default.asp","pageLabel":"barcode"},{"title":"Printer Drivers Support","ID":"60","scriptPath":"/support/drivers.asp","pageLabel":"drivers"}],"menuItems":[{"content":"Technical Support Enquiries","link":"/contact/form.asp?pageID=22"},{"content":"Technical Services","link":"/support/default.asp?pageID=54"},{"content":"Printing Product Documentation","link":"/support/documentation.asp?pageID=23"},{"content":"Maxatec Training Programmes","link":"/products/default.asp?pageID=24"},{"content":"FAQ","link":"/support/faq.asp?pageID=26"},{"content":"Request RMA","link":"/support/rma.asp?pageID=31","childMenu":9},{"content":"Media Supplies","link":"/products/default.asp?pageID=25"},{"content":"Bar Code Consumables Application Tips","link":"/support/default.asp?pageID=53"},{"content":"Printer Drivers Support","link":"/support/drivers.asp?pageID=60"}]},{"label":"Distributors","link":"/distributors/","section":"distributors","topLevel":true,"left":284,"DBItems":new Array(),"menuItems":new Array()},{"menuItems":[{"content":"2003 Archive","link":"/company/news.asp?pageID=206"},{"content":"2002 Archive","link":"/company/news.asp?pageID=207"},{"content":"eNewsletter Subscription","link":"/contact/form.asp?pageID=181"},{"content":"Unsubscribe","link":"/unsubscribe/default.asp?pageID=230"}]},{"menuItems":[{"content":"Transport Ticketing","link":"/company/markets.asp?pageID=67"},{"content":"Retail","link":"/company/markets.asp?pageID=62"},{"content":"Hospitality &amp; Leisure","link":"/company/markets.asp?pageID=63"},{"content":"Banking","link":"/company/markets.asp?pageID=64"},{"content":"Healthcare &amp; Pharmacy","link":"/company/markets.asp?pageID=65"},{"content":"Utilities &amp; Meter Readings","link":"/company/markets.asp?pageID=66"},{"content":"Warehouse &amp; Storage Handling","link":"/company/markets.asp?pageID=68"},{"content":"Post &amp; Parcel","link":"/company/markets.asp?pageID=69"}]},{"menuItems":[{"content":"TPG (Axiohm)","link":"/company/partners.asp?pageID=55"},{"content":"Extech","link":"/company/partners.asp?pageID=56"},{"content":"Cognitive","link":"/company/partners.asp?pageID=57"},{"content":"Blazepoint","link":"/company/partners.asp?pageID=58"},{"content":"NiceLabel from Europlus","link":"/company/partners.asp?pageID=59"}]},{"menuItems":[{"content":"Portable Point of Sale Printers","link":"/products/list.asp?pageID=39"},{"content":"Single-Station Printers","link":"/products/list.asp?pageID=40"},{"content":"Multi-Function Printers","link":"/products/list.asp?pageID=41"}]},{"menuItems":[{"content":"RMA Request Form","link":"/contact/form.asp?pageID=182"}]}]

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function loaded() {

	setMenusLeft()
	
	window.onresize=setMenusLeft
}
var btnWhichButton; 

function CheckForm_1(formobj)
	{
		var alertMsg = "Please complete the following fields:\n";
		var l_Msg = alertMsg.length;
				
		if ( formobj.company.value == "" )
		{
			alertMsg += " - " + "Please enter your company Name" + "\n";
		}
		if ( formobj.contact.value == "" )
		{
			alertMsg += " - " + "Please enter your Name" + "\n";
		}
		if ( formobj.phone.value == "" ) 
		{
			alertMsg += " - " + "Please enter your Phone Number" + "\n";
		}
		if ( formobj.email.value == "" ) 
		{
			alertMsg += " - " + "Please enter your email address" + "\n";
		}
		if ( formobj.address1.value == "" ) 
		{
			alertMsg += " - " + "Please enter your address" + "\n";
		}
		if ( formobj.address3.value == "" ) 
		{
			alertMsg += " - " + "Please enter your city" + "\n";
		}
		if ( formobj.address4.value == "" ) 
		{
			alertMsg += " - " + "Please enter your postal code" + "\n";
		}
		if ( formobj.address5.value == "" ) 
		{
			alertMsg += " - " + "Please enter your country" + "\n";
		}
		if ( formobj.printeradded.value == "false" ) 
		{
			alertMsg += " - " + "Please enter at least one printer" + "\n";
		}
						
		if (echeck(formobj.email.value)==false)
		{
			alertMsg += " - " + "Please enter A valid email address" + "\n";
			formobj.email.focus()
		}
				
		if ( btnWhichButton == "this"  )
		{
			
			if ( formobj.serial.value == "" )
			{
				alertMsg = " - " + "Please enter the serial details" + "\n";
			}
			else if ( formobj.model.value == "" )
			{
				alertMsg = " - " + "Please enter the model details" + "\n";
			}
			else if ( formobj.fault.value == "" )
			{
				alertMsg = " - " + "Please enter the fault details" + "\n";
			}
			else
			{
				return true;
			}
		}
		
		if ( alertMsg.length == l_Msg )
		{
			//formobj.btnSubmit.disabled=true
			return true;
		}
		else
		{
			alert(alertMsg);
			return false;
		}
	}
	
	

/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		//   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		//   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	//	    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		//    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		//    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		//    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		//    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){
	var emailID=document.frmSample.txtEmail
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }



