function pause(Amount)
{
	d = new Date() //today's date
	while (1)
	{
		mill=new Date() // Date Now
		diff = mill-d //difference in milliseconds
		if( diff > Amount ) {break;}
	}
}

activateMenu = function(nav) {
    /* currentStyle restricts the Javascript to IE only */
	if (document.all && document.getElementById(nav).currentStyle) 
	{	  
        var navroot = document.getElementById(nav);
        
        /* Get all the list items within the menu */
        var lis=navroot.getElementsByTagName("LI");  
        
        for (i=0; i<lis.length; i++) 
        {
			/* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL")
            {
				 /* assign the function to the LI */
             	lis[i].onmouseover=function() 
             	{	
                   /* display the inner menu */
                   this.lastChild.style.display="block";
                }
                lis[i].onmouseout=function() 
                {
				   pause(100);                       
                   this.lastChild.style.display="none";
                }
            }
        }
    }
}




var ua = navigator.userAgent; 
var ual = ua.toLowerCase(); 
var brokenHover = ((ual.indexOf("msie") != -1) && (ual.indexOf("konqueror") == -1)); 
var mozPosBug = false; 
var bd = ua.match(/Gecko\/(\d+)/); 
if (bd) 
{ 
try { 
	var d = new Date(bd[1].substr(0, 4), bd[1].substr(4,2), bd[1].substr(6,2)); 
	if (d <= new Date( 2003, 10, 18 )) { 
		mozPosBug = true; 
	} 
} catch (e) {} }

// Display the sub menu 
function dSM(id) 
{
	if (brokenHover) 
	{ 
		activateMenu(id);
		var sm = document.getElementById(id); 
		sm.style.display = "block"; 
	} 
	else if (mozPosBug) 
	{		
		var sm = document.getElementById(id); 
		sm.style.marginTop = "0"; 
	} 
} 

// Hide the sub menu 
function hSM(id) 
{ 
	if (!brokenHover) 
		return; 
	
	var sm = document.getElementById(id); 
	sm.style.display = "none"; 
}


//==========================================================
//	Name: MyAlt
//	This function creates and custimises an Alt box 
//	when the mouse goes over
//==========================================================
function openMyAlt(name, s_x, s_y){		
	document.getElementById(name).style.display=''
	document.getElementById(name).style.padding= "3px";

	document.getElementById(name).style.width= "300px";
	//document.getElementById(name).style.height= s_height + "px";
	document.getElementById(name).style.left= s_x + "px";
	document.getElementById(name).style.top = s_y + "px";
}

// Dynamic version - not in use
/*function openMyAlt(name,s_width,s_height, s_x, s_y)
{
	if (s_width!='' or s_width = null){
		s_width = 300;
	}
	
	if (document.all){// Internet Explorer
		xMousePos = window.event.x+document.body.scrollLeft;
		yMousePos = window.event.y+document.body.scrollTop;
		
  	}
	else if (document.getElementById) { // Netcsape 6
		xMousePos = 500;
		yMousePos = 300;
	}
  	
	document.getElementById(name).style.display=''
	document.getElementById(name).style.padding= "3px";

	document.getElementById(name).style.width= s_width + "px";
	document.getElementById(name).style.height= s_height + "px";
	document.getElementById(name).style.left= xMousePos + "px";
	document.getElementById(name).style.top = yMousePos + "px";
}
*/

function closeMyAlt(name)
{
	document.getElementById(name).style.display="none"
}

//================================================================

//for the blue imge

if (document.images) {
	
	var tri_g = new Image();
	tri_g.src = "/imgs/tri_g.gif";
	
	var tri_b = new Image();
	tri_b.src = "/imgs/tri_b.gif";
}


function grey(name) {
  if (document.images) {
    document[name].src = tri_g.src
  }
}

function black(name) {
  if (document.images) {
    document[name].src = tri_b.src
  }
}


function searchsubmit()
{
	document.fSearch.submit();
	return true;
}

function OpenProductClip1(URL,ID)
{
open(URL,ID,'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=800,height=600');
}
function OpenProductClip2(URL,ID)
{
open(URL,ID,'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=640,height=480');
}


//==========================================================
//	Name: HomeAlt
//	This function creates and custimises an Alt box 
//	when the mouse goes over
//==========================================================
function openHomeAlt(name,s_width,s_height)
{
	 if (document.all){// Internet Explorer
		xMousePos = window.event.x+document.body.scrollLeft;
		yMousePos = window.event.y+document.body.scrollTop;
  	}
  	else if (document.getElementById) { // Netcsape 6
		xMousePos = 500;
		yMousePos = 300;
	}
  	
	document.getElementById(name).style.display=''
	document.getElementById(name).style.padding= "3px";

	document.getElementById(name).style.width= s_width  + "px";
	document.getElementById(name).style.height= s_height + "px";
	document.getElementById(name).style.left= xMousePos - 170 + "px";
	document.getElementById(name).style.top = yMousePos - (-20) + "px";
	document.getElementById(name).style.padding = "10px";
}

function closeHomeAlt(name)
{
	document.getElementById(name).style.display="none"
}



//================================================================
//	This function opens a new window with a specific size
//==========================================================
function openImageWindow(iWidth, iHeight, iOption)
{
	window.open('/displayImage.asp?opt=' + iOption, '_blank'); 
}

//================================================================
//	This function opens the mail window 
//================================================================
function openMailWindow(sUrl)
{
	window.open(sUrl, '_blank', 'height=522,width=365,status=no,toolbar=no,menubar=no,location=no,screenX=15,screenY=15, directories=no,resizable=no,scrollbars=no,titlebar=no');
}
