//ns4 = (document.layers)? true: false;
//ie4 = (document.all)? true: false;

var ns4 = (document.layers);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);

var img1X, img2X, img3X, img4X, img5X, img6X, img7X;
var img1Y, img2Y, img3Y, img4Y, img5Y, img6Y, img7Y;

var imgOffset;
isMac = (navigator.userAgent.indexOf("Mac") != -1);
isWin = (navigator.userAgent.indexOf("Win") != -1);
	
if(ns4){
  var wWidth, wHeight, leftMargin;
  //wWidth=window.innerWidth;
  //wHeight=window.innerHeight;
  img1Y = 160;
  img2Y = 160;
  img3Y = 160;
  img4Y = 160;
  img5Y = 160;
  img6Y = 160;
  img7Y = 160;
  img8Y = 160;
  imgOffset= -4;

  if(isMac){
	imgFixY=152;
      	img1Y = imgFixY;
  	img2Y = imgFixY;
  	img3Y = imgFixY;
  	img4Y = imgFixY;
  	img5Y = imgFixY;
  	img6Y = imgFixY;
  	img7Y = imgFixY;
  	img8Y = imgFixY;
    	imgOffset = -8;
    
  }
  
}// NS4
else{
var wWidth, wHeight, leftMargin;
//wWidth=document.body.clientWidth;
//wHeight=document.body.clientHeight;

if(ns6){
   
   if(isWin){
   imgFixY=153;
   img1Y = imgFixY;
   img2Y = imgFixY;
   img3Y = imgFixY;
   img4Y = imgFixY;
   img5Y = imgFixY;
   img6Y = imgFixY;
   img7Y = imgFixY;
   img8Y = imgFixY;
   imgOffset=6;
   }
   if(isMac){
	imgFixY=160;
   	img1Y = imgFixY;
   	img2Y = imgFixY;
   	img3Y = imgFixY;
   	img4Y = imgFixY;
   	img5Y = imgFixY;
   	img6Y = imgFixY;
   	img7Y = imgFixY;
   	img8Y = imgFixY;
   	imgOffset=6;
   }
}else{
   imgFixY=160;
   img1Y = imgFixY;
   img2Y = imgFixY;
   img3Y = imgFixY;
   img4Y = imgFixY;
   img5Y = imgFixY;
   img6Y = imgFixY;
   img7Y = imgFixY;
   img8Y = imgFixY;
   imgOffset=6;
}
  if(isMac){

  	imgOffset = 2;
	imgFixY=160;
  	img1Y = imgFixY;
  	img2Y = imgFixY;
  	img3Y = imgFixY;
  	img4Y = imgFixY;
  	img5Y = imgFixY;
  	img6Y = imgFixY;
  	img7Y = imgFixY;
  	img8Y = imgFixY;

  }
}// -- else

if(wWidth > 750){
    wWidth -= 10;

    leftMargin = (wWidth-750)/2;	
}else{
    leftMargin=8;
    if(ie4)
	leftMargin = 0;
    if(isMac)
	leftMargin = 8;
}

  if(leftMargin < 0)
	leftMargin=0;

  if(ns6)
    img1X=188;
  else
    img1X=190;

  img2X=287;
  img3X=385;
  img4X=483;
  img5X=581;
  img6X=679;
  img7X=597;
  img8X=605;
  
  if(isMac){
	
     if(ns4 || ns6){
	img1X -=3;
	img2X -=3;
	img3X -=3;
	img4X -=3;
	img5X -=3;
	img6X -=3;
	
	img7X +=1;
      }	
      else{
	img1X +=1;
	img2X +=1;
	img3X +=1;
	img4X +=1;
	img5X +=1;
	img6X +=1;
	img7X +=0
      }
  }
    
  onresize=function(){
    //location.reload();
  }


//function loadMenuBar(){

	
   // ------------ Business -------------------------  

   window.PGQ_Menu = new Menu('root', 130, 15, "Arial", 10, "#000000", "#FFFFFF", "#CCCC66", "#003366");
   window.PGQ_Menu.addMenuItem("Company Overview", "window.open('/about/overview.htm', '_self');");
   window.PGQ_Menu.addMenuItem("PGQ Staff/Contributors", "window.open('/about/staff.htm', '_self');");
   window.PGQ_Menu.addMenuItem("Archives & Back Issues", "window.open('/back_issues/index.htm', '_self');");
   window.PGQ_Menu.addMenuItem("About GPQ", "window.open('http://www.glasspatterns.com/index.htm', 'new');");
   window.PGQ_Menu.addMenuItem("How to Advertise", "window.open('/advertise/index.htm', '_self');");
   
   window.newsMenu = new Menu('root', 130, 15, "Arial", 10, "#000000", "#FFFFFF", "#CCCC66", "#003366");
   window.newsMenu.addMenuItem("Industry News", "window.open('http://www.glass-source.com/bg/index.cgi?search_to_go=%2Fbg%2Findex.cgi%3Fcat1_2%3D%26cat2_2%3D%26cat3_2%3D%26cat4_2%3D%26search_type%3Dproduct&super_cat=%2Fbg%2Findex.cgi%3Fcat1_2%3Dall%26search_type%3Dproduct&keywords=Industry+News&state=&search=Search&final_cat1=&final_cat2=&final_cat3=&final_cat4=&search=Search&cat1_2=&cat2_2=&cat3_2=&cat4_2=&search_type=product', '_self');");
   window.newsMenu.addMenuItem("New Products", "window.open('http://www.glass-source.com/bg/index.cgi?search_to_go=%2Fbg%2Findex.cgi%3Fcat1_2%3D%26cat2_2%3D%26cat3_2%3D%26cat4_2%3D%26search_type%3Dproduct&super_cat=%2Fbg%2Findex.cgi%3Fcat1_2%3Dall%26search_type%3Dproduct&keywords=new+product&state=&search=Search&final_cat1=&final_cat2=&final_cat3=&final_cat4=&search=Search&cat1_2=&cat2_2=&cat3_2=&cat4_2=&search_type=product', '_self');");
   window.newsMenu.addMenuItem("New Books", "window.open('http://www.glass-source.com/bg/index.cgi?search_to_go=%2Fbg%2Findex.cgi%3Fcat1_2%3D%26cat2_2%3D%26cat3_2%3D%26cat4_2%3D%26search_type%3Dproduct&super_cat=%2Fbg%2Findex.cgi%3Fcat1_2%3Dall%26search_type%3Dproduct&keywords=new+books&state=&search=Search&final_cat1=&final_cat2=&final_cat3=&final_cat4=&search=Search&cat1_2=&cat2_2=&cat3_2=&cat4_2=&search_type=product', '_self');");
   window.newsMenu.addMenuItem("What's Hot", "window.open('http://www.glass-source.com/bg/index.cgi?search_to_go=%2Fbg%2Findex.cgi%3Fcat1_2%3D%26cat2_2%3D%26cat3_2%3D%26cat4_2%3D%26search_type%3Dproduct&super_cat=%2Fbg%2Findex.cgi%3Fcat1_2%3Dall%26search_type%3Dproduct&keywords=What%27s+Hot&state=&search=Search&final_cat1=&final_cat2=&final_cat3=&final_cat4=&search=Search&cat1_2=&cat2_2=&cat3_2=&cat4_2=&search_type=product', '_self');");
 
   window.profileMenu = new Menu('root', 130, 15, "Arial", 10, "#000000", "#FFFFFF", "#CCCC66", "#003366");
   window.profileMenu.addMenuItem("Hot Glass Profiles", "window.open('/profiles/hotglass/index.htm', '_self');");
   window.profileMenu.addMenuItem("Art Glass Studio Profiles", "window.open('/profiles/studio/index.htm', '_self');");
   window.profileMenu.addMenuItem("Retailer Profiles", "window.open('/profiles/retailer/index.htm', '_self');");
   window.profileMenu.addMenuItem("Educational Profiles", "window.open('/profiles/teacher/index.htm', '_self');");

   window.busCornerMenu = new Menu('root', 130, 15, "Arial", 10, "#000000", "#FFFFFF", "#CCCC66", "#003366");
   window.busCornerMenu.addMenuItem("Management", "window.open('/biz_corner/management/index.htm', '_self');");
   window.busCornerMenu.addMenuItem("Marketing", "window.open('/biz_corner/marketing/index.htm', '_self');");
   window.busCornerMenu.addMenuItem("Personal Development", "window.open('/biz_corner/development/index.htm', '_self');");
   window.busCornerMenu.addMenuItem("Tech Talk", "window.open('/biz_corner/techtalk/index.htm', '_self');");
   window.busCornerMenu.addMenuItem("Industry Directory", "window.open('http://www.glass-source.com/bg', '_self');");
   window.busCornerMenu.addMenuItem("Classifieds", "window.open('/biz_corner/classifieds/index.htm', '_self');");
   window.busCornerMenu.addMenuItem("Resources & Links", "window.open('/biz_corner/resources/index.htm', '_self');");

   
   window.glassTalkMenu=new Menu('root', 100, 15, "Arial", 10, "#000000", "#FFFFFF", "#CCCC66", "#003366");
   window.glassTalkMenu.addMenuItem("Discussion Forums", "window.open('http://www.glass-source.com/glasstalk/', '_self');");

   window.PGQ_Menu.writeMenus();

function menuOut(){
  mouseoutMenu();
}
