// Left menu structure and repositioning function

function menuPos(tableLeft,tableTop)
{
	var tY = 0;
	var tX = 'center';
	var tW = 770;
	
	var toFix=-4;
	if(bw.moz)toFix=-50;
	if(bw.ns4)toFix=-20;
	if(bw.ns6)toFix=-14;
	
	mX=cmpage.x2 - (tW) + tableLeft + toFix;
	
	if(mX<tableLeft) mX = tableLeft;
	
	mY = tableTop;

	return [mX,mY]
}

function findPos(){
  if(bw.ns4){   //Netscape 4
    x = document.layers.layerMenu.pageX
    y = document.layers.layerMenu.pageY
  }else{ //other browsers
    x=0; y=0; var el,temp
    el = bw.ie4?document.all["divMenu"]:document.getElementById("divMenu");
    if(el.offsetParent){
      temp = el
      while(temp.offsetParent){ //Looping parent elements to get the offset of them as well
        temp=temp.offsetParent; 
        x+=temp.offsetLeft
        y+=temp.offsetTop;
      }
    }
    x+=el.offsetLeft
    y+=el.offsetTop
  }
  //Returning the x and y as an array
  return [x,y]
}



// Left menu construct
oLM=new makeCM("oLM");
oLM.resizeCheck=1;
oLM.rows=0;
oLM.onlineRoot="";
oLM.pxBetween=1; 
oLM.fillImg="/images/cm_fill.gif";
oLM.wait=300;
oLM.zIndex=400;

pos = findPos();
oLM.fromLeft=pos[0]+5;
oLM.fromTop=pos[1];
oLM.onresize="pos=findPos();oLM.fromLeft=pos[0]+5;oLM.fromTop=pos[1];";

oLM.useBar=1;
oLM.barWidth="menu";
oLM.barHeight="menu";
oLM.barX="menu";
oLM.barY="menu";
oLM.barClass="lmBar";
oLM.barBorderClass="lmBarB";
oLM.barBorderX=1;
oLM.barBorderY=1;

oLM.menuPlacement=0;

// myCoolMenu.level[x]=new cm_makeLevel(width, height, regClass, overClass, borderX, borderY, borderClass, rows, align, offsetX, offsetY, arrow, arrowWidth, arrowHeight, roundBorder)
oLM.level[0]=new cm_makeLevel(130,18,"lmT","lmTover",0,0,"lmTB",0,"right",-8,5,"/images/template/navbar/arrows.gif",8,8);
oLM.level[1]=new cm_makeLevel(0,0,"lmS","lmSover",1,1,"lmSB",0,"right",0,0,0,0,0);
oLM.level[2]=new cm_makeLevel();
oLM.level[3]=new cm_makeLevel();

//myCoolMenu.makeMenu(name, parent_name, text, link, target, width, height, regImage, overImage, regClass, overClass , align, rows,&nbsp;nolink, onclick, onmouseover, onmouseout)
oLM.makeMenu('root1','',menu_login_text,menu_login_url);
oLM.makeMenu('root2','','Your&nbsp;Secure&nbsp;Site','/customhomepage.asp');
oLM.makeMenu('root3','','Products','/products/products.asp');
oLM.makeMenu('root4','','Shopping&nbsp;/&nbsp;Cart');
oLM.makeMenu('root5','','Online&nbsp;Services');
oLM.makeMenu('root6','','Drivers');
oLM.makeMenu('root7','','Administration');
oLM.makeMenu('root8','','Contact&nbsp;Us');
menu_width = 180;
oLM.makeMenu('products7','root3','Regularly&nbsp;Ordered&nbsp;Products','','',menu_width,0);
oLM.makeMenu('products1','root3','Browse&nbsp;Products&nbsp;&amp;&nbsp;Services','/products/products.asp','',menu_width,0);
oLM.makeMenu('products2','root3','&nbsp;&nbsp;-&nbsp;Printers','/products/printers/filter.asp','',menu_width,0);
oLM.makeMenu('products8','root3','&nbsp;&nbsp;-&nbsp;Multifunction&nbsp;Printers','/products/printers/filter.asp?categoryid=6','',menu_width,0);
oLM.makeMenu('products9','root3','&nbsp;&nbsp;-&nbsp;Rental&nbsp;Printers','/products/printerrental.asp','',menu_width,0);
oLM.makeMenu('products3','root3','&nbsp;&nbsp;-&nbsp;Consumables','/products/relatedproducts.asp?typeid=1','',menu_width,0);
oLM.makeMenu('products4','root3','&nbsp;&nbsp;-&nbsp;Options','/products/relatedproducts.asp?typeid=3','',menu_width,0);
oLM.makeMenu('products5','root3','&nbsp;&nbsp;-&nbsp;Support&nbsp;Options','/products/relatedproducts.asp?typeid=4','',menu_width,0);
oLM.makeMenu('products6','root3','Printer&nbsp;Search&nbsp;&amp;&nbsp;Compare','/products/printers/search.asp','',menu_width,0);
menu_width = 115;
oLM.makeMenu('regularlyordered1','products7','Display&nbsp;All','/products/regularlyordered.asp','',menu_width,0);
oLM.makeMenu('regularlyordered2','products7','Printers','/products/regularlyordered.asp?typeid=2','',menu_width,0);
oLM.makeMenu('regularlyordered3','products7','Consumables','/products/regularlyordered.asp?typeid=1','',menu_width,0);
oLM.makeMenu('regularlyordered4','products7','Options','/products/regularlyordered.asp?typeid=3','',menu_width,0);
oLM.makeMenu('regularlyordered5','products7','Support&nbsp;Options','/products/regularlyordered.asp?typeid=4','',menu_width,0);
menu_width = 180;
oLM.makeMenu('shopping1','root4','Regularly&nbsp;Ordered&nbsp;Products','','',menu_width,0);
oLM.makeMenu('shopping2','root4','View&nbsp;Cart&nbsp;('+menu_cartqty_text+')','/cart/showcart.asp','',menu_width,0);
oLM.makeMenu('shopping3','root4','Check&nbsp;Out','/cart/checkout.asp','',menu_width,0);
menu_width = 115;
oLM.makeMenu('regularlyorderedproducts1','shopping1','Display&nbsp;All','/products/regularlyordered.asp','',menu_width,0);
oLM.makeMenu('regularlyorderedproducts2','shopping1','Printers','/products/regularlyordered.asp?typeid=2','',menu_width,0);
oLM.makeMenu('regularlyorderedproducts3','shopping1','Consumables','/products/regularlyordered.asp?typeid=1','',menu_width,0);
oLM.makeMenu('regularlyorderedproducts4','shopping1','Options','/products/regularlyordered.asp?typeid=3','',menu_width,0);
oLM.makeMenu('regularlyorderedproducts5','shopping1','Support&nbsp;Options','/products/regularlyordered.asp?typeid=4','',menu_width,0);
menu_width = 150;
oLM.makeMenu('onlineservices1','root5','Printer&nbsp;Service&nbsp;Call','/onlineservices/logservicecall.asp','',menu_width,0);
oLM.makeMenu('onlineservices2','root5','OPS&nbsp;Toner&nbsp;Recycling','/onlineservices/tonerrecyclingrequest.asp','',menu_width,0);
oLM.makeMenu('onlineservices3','root5','Printer&nbsp;Search','/products/printers/search.asp','',menu_width,0);
oLM.makeMenu('onlineservices4','root5','Product&nbsp;Search','/products/search.asp','',menu_width,0);
menu_width = 150;
oLM.makeMenu('drivers1','root6','Lexmark','http://www.lexmark.com/uncomplicate/channel/frameset/home_no_nav/0,7060,241429423_241544111_0_en,00.html','_blank',menu_width,0);
oLM.makeMenu('drivers2','root6','Hewlett&nbsp;Packard','http://h20180.www2.hp.com/apps/Nav?h_pagetype=s-001&h_lang=en&h_cc=us&h_product=18972&h_page=hpcom&cc=us&lang=en&h_client=S-A-R163-1','_blank',menu_width,0);
oLM.makeMenu('drivers3','root6','Fuji&nbsp;Xerox,&nbsp;Tektronix','http://www.officeprinting.xerox.com/cgi-bin/DriverD.pl','_blank',menu_width,0);
oLM.makeMenu('drivers4','root6','Canon','http://www.canon.com.au/drivers/index.html','_blank',menu_width,0);
menu_width = 140;
oLM.makeMenu('administration1','root7','Create&nbsp;Users','/customeradmin/addusergroup.asp');
oLM.makeMenu('administration2','root7','View&nbsp;/&nbsp;Edit Users','/customeradmin/modifyusergroup.asp');
menu_width = 170;
oLM.makeMenu('contact1','root8','General&nbsp;Contact&nbsp;Info','/contact.asp','',menu_width,0);
oLM.makeMenu('contact2','root8','Contact&nbsp;Account&nbsp;Manager','/contactbyemail.asp?recipient='+menu_accman_email,'',menu_width,0);
oLM.makeMenu('contact3','root8','Report&nbsp;a&nbsp;Bug','/contactbyemail.asp?recipient=webmaster@oem.co.nz&subject=Website%20Bug%20Report','',menu_width,0);

oLM.construct();
