// JavaScript Document
function getRefToDiv(divID) {
    if( document.layers ) { //Netscape layers
        return document.layers[divID]; }
    if( document.getElementById ) { //DOM; IE5, NS6, Mozilla, Opera
        return document.getElementById(divID); }
    if( document.all ) { //Proprietary DOM; IE4
        return document.all[divID]; }
    if( document[divID] ) { //Netscape alternative
        return document[divID]; }
    return false;
}
				function ShowMenu()
				{
						//get window size
						//opera Netscape 6 Netscape 4x Mozilla 
						if (window.innerWidth || window.innerHeight)
						{ 
							docwidth = window.innerWidth; 
						} 
						//IE Mozilla 
						if (document.body.clientWidth || document.body.clientHeight)
						{ 
							docwidth = document.body.clientWidth; 
						}
						
					shopPos=findPos(getRefToDiv("shopMenuButton"));
					ShowLevel(section_tree, undefined,docwidth/2-290,shopPos[1]);
				}
				
				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 MoveMenu()
				{
				//get window size
				//opera Netscape 6 Netscape 4x Mozilla
				if (window.innerWidth || window.innerHeight)
				{
					docwidth = window.innerWidth;
				}
				//IE Mozilla
				if (document.body.clientWidth || document.body.clientHeight)
				{
					docwidth = document.body.clientWidth;
				}
				PositionMenu(docwidth/2-290);
			}
			
			function showSpec(page)
			{ 
			  newwin=window.open("/sections/specs/window_specs/window_spec.php?product="+page, "spec", "menubar=no, toolbar=no, scrollbars=yes, width=610");	
			  if (window.focus) {newwin.focus();}
			}
			
			
			function showPrintSpec(page)
			{
			  newwin=window.open("/sections/specs/printable/index.php?product="+page, "printSpec", "menubar=yes, toolbar=yes, scrollbars=yes");
			  if (window.focus) {newwin.focus();}
			}
			
			function lnkhover()
			{
				this.style.cursor='hand';
			}
			
			
			
   function LoginToThisPageLink(pageId)
   {
	 document.write("<a href=\"http://www.cop-eu.com/cgi-bin/ss000001.pl?ACTINIC_REFERRER=http%3A//www.cop-eu.com/acatalog/&SECTIONID=index.html\" onclick=\"setSectionId('"+pageId+"');\"\">Login to view prices!</a>");

   }
   
   function setSectionId(pageId)
   {
	 //using mootools
     var from  = Cookie.write('shFrom', pageId, {domain: 'cop-eu.com', path:'/'});
   }
   
   
   function redirectLogin()
   {
	  //if from cookie set, clear it and redirect to appropriate page - using mootools
	  var shFrom = Cookie.read("shFrom");
	  Cookie.dispose('shFrom', {domain: 'cop-eu.com', path:'/'});
      
	  if (shFrom!=null) 
	  {
		 this.location.href = "http://www.cop-eu.com/cgi-bin/ss000001.pl??ACTINIC_REFERRER=http%3A//www.cop-eu.com/acatalog/&SECTIONID="+shFrom;
	  }
   }