﻿function tg(obj, p)
{

  var x = obj.src;
  var i = x.lastIndexOf('.');

  if (p == 1)
  {
    obj.src = x.substring(0, i) + "hl" + x.substring(i);
  }
  else
  {
    obj.src = x.substring(0, i - 2) + x.substring(i);
  }
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function showCSMenu (obj)
{
 var x = 0; var y = 0;
 var coors = findPos(obj);
 if (obj.offsetParent == null)
 {
   x = 308; y=176;
 }
 else
 {
   while (obj!=null){
     x+=obj.offsetLeft-obj.scrollLeft;
     y+=obj.offsetTop-obj.scrollTop;
     obj=obj.offsetParent;
   }
  }
  
  if (document.all || document.getElementById) 
  {
//    window.showMenu(window.csMenu, 306,153);
//    window.showMenu(window.csMenu, 308,176);
//    window.showMenu(window.csMenu, x + 2, y + 23);
      window.showMenu(window.csMenu, coors[0] + 2,coors[1] + 23);

  }
}
function hideCSMenu()
{
  if (document.all || document.getElementById) 
    window.hideMenu(window.csMenu);
}

function loadMenu ()
{
  if (document.all || document.getElementById) 
  {
  
    window.csMenu = new Menu("Customer Service");
   
    var bcolor = "#000066";
//    csMenu.addMenuItem("<img src='/images/menu/csother.jpg'>");
 //   csMenu.addMenuItem("<div class='csmenu'><a href='/dealer.html'>Find a Dealer</a></div>");
 //   csMenu.addMenuItem("<div class='csmenu'><a href='http://www.prodregister.com/emerson/' target='_blank'>Product Registration</a></div>");
    csMenu.addMenuItem("<div class='csmenu'><a href='/Registration.html'>Product Registration</a></div>");
    csMenu.addMenuItem("<div class='csmenu'><a href='/manualsen.html'>Product Manuals - English</a></div>");
    csMenu.addMenuItem("<div class='csmenu'><a href='/manualsfr.html'>Product Manuals - French</a></div>");
		csMenu.addMenuItem("<div class='csmenu'><a href='/troubleshooting.html'>TroubleShooting</a></div>");
	  csMenu.addMenuItem("<div class='csmenu'><a href='/warranty.html'>Warranty</a></div>");
    csMenu.addMenuItem("<div class='csmenu'><a href='/contact.html'>Contact Us</a></div>");
    csMenu.fontColor = "white";
    csMenu.bgColor = bcolor;
    csMenu.fontColorHilite = "cyan";
    csMenu.disableDrag = "true";
    csMenu.menuItemBgColor = bcolor;
    csMenu.menuLiteBgColor = bcolor;
    csMenu.menuBorderBgColor = bcolor;
    csMenu.menuHiliteBgColor = bcolor;
    csMenu.menuContainerBgColor = bcolor;
    csMenu.writeMenus();
		

  }
}
