
// --------------------  ** Go Menu **  ----------------->
function go(){
	(document.links.gomenu.options[document.links.gomenu.selectedIndex].value != "null") ? location.href=document.links.gomenu.options[document.links.gomenu.selectedIndex].value : alert("Please make a valid selection");
	document.links.gomenu.selectedIndex = 0;
}



// --------------------  ** Browser Detection **  ----------------->

   bName = navigator.appName;
   bVersion = parseFloat(navigator.appVersion);
   r = 'false';

if (bName == "Netscape" && bVersion >= 3.0){
        //alert(bName+bVersion);
	document.write('<link rel=stylesheet type="text/css" href="css/netscape.css">');
        r = 'true';
	}
else if (bName == "Microsoft Internet Explorer" && bVersion >= 3.0)
	{
	document.write('<link rel=stylesheet type="text/css" href="css/default.css">');
	r = 'true';
	}
else
	{
	//alert("Niether");
	r = 'false';
	document.write('<link rel=stylesheet type="text/css" href="css/default.css">');
}
// --------------------  ** DOM Detection **  ----------------->
  	     
var b // Check DOM 

if (document.getElementById) {
        //alert("This browser is WC3 DOM Compliant! IE 5.5 or Netscape 6");
        	if (bName == "Netscape" && bVersion >= 4.0){
        	
        		var NS6 = true; //It is Netscape 6
			b="WC3";
			
  		}else{
  			b="WC3"; 
  			var NS6 = false;
  			
  		}
  	}
else if(document.all){
	//alert("This browser is IE!");
	b="IE";
	}
else if (document.layers) {
  	//alert("This browser is Netscape!");
    	b="N";
}

//alert(b);   


// --------------------  ** Image Rollover Function **  ----------------->

function msover(img,ref){
	if (r == 'true'){
		document.images[img].src = ref;
	}
}

function msout(img,ref){
	if (r == 'true'){
		document.images[img].src = ref;
	}
}
   
// --------------------  ** New Window Function **  ----------------->  
   
function openWin(thepage,winname,iwidth,iheight,scroll,resize) {
   
	if (parseInt(navigator.appVersion) >= 4) {
		var winl = (screen.width - iwidth) / 2;
		var wint = (screen.height - iheight) / 2;
		winargs = 'height='+iheight+',width='+iwidth+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resize
		win = window.open(thepage,winname,winargs)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } 
		} 
      
		else
      
		{
		winargs = 'height='+iheight+',width='+iwidth+ ', scrollbars='+scroll
		window.open(thepage,winname,winargs)
		}
}
         
// --------------------  ** Flash Detection **  ----------------->

var targetVersion = 4;
var hasFlash = false;
var isIexplorer = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWindows = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;
 
if(isIexplorer && isWindows){
	var flash4 = false;
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('flash4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('</SCR' + 'IPT\> \n');
    
		if(flash4){
		hasFlash = true;
		}
	}

function inquireFlash(){

if (navigator.plugins){

	if (navigator.plugins["Shockwave Flash"]) {
		var flashDesc = navigator.plugins["Shockwave Flash"].description;
		var flashVersion = parseInt(flashDesc.charAt(flashDesc.indexOf(".") - 1));
    
			if (flashVersion >= 4){
				hasFlash = true;
			}

		}

	}

}

inquireFlash();
// -->
//alert("This User has flash? " + hasFlash);

// function used to insert flash content or alternate content
function insertflashContent(flashMovie,imageName,iwidth,iheight,hasFlash) {

	if (hasFlash){
		var strHTML = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
		+ ' WIDTH="' + iwidth + '" HEIGHT="' + iheight +'" '
		+ 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
		+ '<PARAM NAME="MOVIE" VALUE="' + flashMovie + '">'
		+ '<PARAM NAME="PLAY" VALUE="true">'
		+ '<PARAM NAME="LOOP" VALUE="false">'
		+ '<PARAM NAME="QUALITY" VALUE="high">'
		+ '<PARAM NAME="MENU" VALUE="false">'
		+ '<EMBED SRC="'  + flashMovie + '"'
		+ ' WIDTH="'+ iwidth + '" HEIGHT="' + iheight +'" '
		+ 'PLAY="true"'
		+ 'LOOP="false"'
		+ 'QUALITY="high"'
		+ 'MENU="false"'
		+ 'TYPE="application/x-shockwave-flash"'
		+ 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
		+ '</EMBED>'
		+ '</OBJECT>';
        	//alert(strHTML);

	} else {
		var strHTML = '<IMG SRC="' + imageName + '" HEIGHT="' + iheight + '" WIDTH="' + iwidth +'">'	+ '<BR>';
        //alert(strHTML);
	}

return strHTML;

}

// use to redirect flash or non flash content
function flashPage(flash,nonflash,hasFlash){
	if (hasFlash){
		window.location = flash;
        }else{
        	window.location = nonflash;
        }
 }

// --------------------  ** Form Validaton **  ----------------->

function checkrequired(which) {
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if (tempobj.name.substring(0,8)=="required") {
if (((tempobj.type=="text"||tempobj.type=="textarea")&&
tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
tempobj.selectedIndex==0)) {
pass=false;
break;
         }
      }
   }
}
if (!pass) {
shortFieldName=tempobj.name.substring(8,30).toUpperCase();
alert("Please enter a  "+shortFieldName+" !");
return false;
}
else
return true;

}


// --------------------  ** Begin Menu Functions **  ----------------->

// choose colors for menu

menuColor="#ffffff"

// PSP Red
menuColorOn="#FF0000"

fontColorOn="#FFFFFF"
fontColorOff="#000000"
lineColor = "#000000"

separator="<img src=images/spacer.gif height=1 width=1>"




// --------------------  ** Show Menu **  -------------------------->
// Show the user the menu depending on browser type.

function showMenu(sMenu){
var theMenuObj;
	
if(b=="WC3"){ // Netscape 6  or IE 5.0 +

	theMenuObj = document.getElementById(sMenu);
	theMenuObj.style.visibility = 'visible';
	}
	
else if(b=="IE"){ // IE 4
	
	theMenuObj = document.all[sMenu];
	theMenuObj.style.visibility = 'visible';
	}
	
else if(b=="N"){ // Netscape 4 +
	theMenuObj = document.layers[sMenu];
	theMenuObj.visibility = 'show';
	}
}


// --------------------  ** Hide Menu **  ----------------->
// Hide the menu depending on browser type.

function hideMenu(sMenu){
var theMenuObj;
	
if(b=="WC3"){ // Netscape 6  or IE 5.0 +

	theMenuObj = document.getElementById(sMenu);
	theMenuObj.style.visibility = 'hidden';
	}
	
else if(b=="IE"){ // IE 4
	
	theMenuObj = document.all[sMenu];
	theMenuObj.style.visibility = 'hidden';
	}
	
else if(b=="N"){ // Netscape 4 +
	theMenuObj = document.layers[sMenu];
	theMenuObj.visibility = 'hide';
	}
}



// --------------------  ** Menu Div Over **  ----------------->

function divOver(sMenu){

var theMenuObj;

if(b=="WC3"){ // Netscape 6  or IE 5.0 +

	theMenuObj = document.getElementById(sMenu);
	theMenuObj.style.backgroundColor=menuColorOn;
	theMenuObj.style.color=fontColorOn;
	}
	
else if(b=="IE"){ // IE 4
	
	theMenuObj = document.all[sMenu];
	theMenuObj.style.backgroundColor=menuColorOn;
	theMenuObj.style.color=fontColorOn;
	}
	else{return}
	
}

// --------------------  ** Menu Div Out **  ----------------->

function divOut(sMenu){

var theMenuObj;

if(b=="WC3"){ // Netscape 6  or IE 5.0 +

	theMenuObj = document.getElementById(sMenu);
	theMenuObj.style.backgroundColor=menuColor;
	theMenuObj.style.color=fontColorOff;
	}
	
else if(b=="IE"){ // IE 4
	
	theMenuObj = document.all[sMenu];
	theMenuObj.style.backgroundColor=menuColor;
	theMenuObj.style.color=fontColorOff;
	}
	else{return}
	
}


function menuOver(){
	var args, theMenu;
	args = menuOver.arguments;
	theMenu = eval(args[0]);
	theMenu.bgColor=menuColorOn; 
	
}


function menuOut(){
	var args, theMenu;
	args = menuOut.arguments;
	theMenu = eval(args[0]);
	theMenu.bgColor=menuColor; 
	
}

// --------------------  ** Get Url Out **  ----------------->

function gotoUrl(){
var args, tempStr, strURL, strPos, myLen, myStr;
args = gotoUrl.arguments;
tempStr = args[0]
strPos = tempStr.indexOf(",");
myLen = tempStr.length;
if (strPos != -1){
	strURL = tempStr.slice(0,strPos)
	myStr =  tempStr.slice(strPos +1 , myLen)
 }
 else
 {
	strURL = tempStr
	myStr  = -1
}
if ( myStr != -1){
	if (myStr == "TARGETMAIN"){
        	//alert("TARGET MAIN");
        	//alert(strURL);
        	// open page with target of main
      		window.parent.main.location.href=strURL;
         }
      	if (myStr == "NEWWINDOW"){
      		//alert("NEW WINDOW");
      		//alert(strURL);
      		// open page in new window
      		window.open(strURL);
      	}
      	
 }else{
	//alert(strURL);
	// open window with target of _top
	window.parent.top.location.href=strURL;
     }
}


// --------------------  ** Build Divs **  ----------------->

var tdID = 0

function doDiv(){
	args = doDiv.arguments;
	var divID = args[0];
	var x = args[1];
	var divLeft = args[2];
	var divTop = args[3];
	
	if (NS6) {
	
	objDiv = "<div id=\"" + divID + "\" style=\"position:absolute; width:107px; z-index:2; top:"+ divTop +"px; left: " + divLeft + "; background-color: #000000; border:1 solid #000000; visibility: hidden;\" onMouseover=\"showMenu(\'"+ divID +"\');\"  onMouseout=\"hideMenu(\'" + divID + "\');\">"
       	objDiv += "<div id=\"spacer\" style=\"position:relative; height:3px; width:105px; z-index:0; left: 0; font-size:1;\"></div>"
             
         for (y = 0; y < 15; y++){
               if(menuData[x][y][0]!=null){
           	objDiv += "<div id=\"bar\" style=\"position:relative; height:1; width:105px; z-index:3; left: 0; background-color:" + lineColor + ";\">" + separator + "</div>"
            	objDiv += "<div id=\"x" + tdID + "\" style=\"position:relative; background-color:"+ menuColor +";  height:15px; width:105px; z-index:3; left: 1;\" onMouseover=\"divOver(\'x" + tdID + "\');\" onMouseout=\"divOut(\'x" + tdID + "\');\" class=\"dhtmlNav\" onClick=\"gotoUrl('"+menuData[x][y][1]+"')\">&nbsp;"+ menuData[x][y][0] +"&nbsp;</div>"
         	tdID = tdID +1
         	}
           	}
	
	//objDiv += "<div id=\"bar\" style=\"position:relative; height:1; width:105px; z-index:3; left: 0; background-color:" + lineColor + ";\">" + separator + "</div>"
	objDiv += "<div id=\"spacer\" style=\"position:relative; height:5px; width:105px; z-index:3; left: 5; font-size:1;\"></div></div>"
		
	document.write(objDiv);  
        //alert(objDiv);
        
        }else{
        
        objDiv = "<div id=\"" + divID + "\" style=\"position:absolute; width:105px; z-index:2; top:"+ divTop +"px; left: " + divLeft + "; background-color: #000000; border:1 solid #000000; visibility: hidden;\" onMouseover=\"showMenu(\'"+ divID +"\');\"  onMouseout=\"hideMenu(\'" + divID + "\');\">"
	       	objDiv += "<div id=\"spacer\" style=\"position:relative; height:1px; width:105px; z-index:0; left: 0; font-size:1;\"></div>"
	             
	         for (y = 0; y < 15; y++){
	               if(menuData[x][y][0]!=null){
	           	objDiv += "<div id=\"bar\" style=\"position:relative; height:1; width:105px; z-index:3; left: 0; background-color:" + lineColor + ";\">" + separator + "</div>"
	            	objDiv += "<div id=\"x" + tdID + "\" style=\"position:relative; background-color:"+ menuColor +"; height:15px; width:105px; z-index:3; left: 0;\" onMouseover=\"divOver(\'x" + tdID + "\');\" onMouseout=\"divOut(\'x" + tdID + "\');\" class=\"dhtmlNav\" onClick=\"gotoUrl('"+menuData[x][y][1]+"'); document.location.href='header-prod.asp';\">&nbsp;"+ menuData[x][y][0] +"&nbsp;</div>"
	         	tdID = tdID +1
	         	}
	           	}
		
		//objDiv += "<div id=\"bar\" style=\"position:relative; height:0; width:105px; z-index:3; left: 0; background-color:" + lineColor + ";\">" + separator + "</div>"
		objDiv += "<div id=\"spacer\" style=\"position:relative; height:3px; width:105px; z-index:3; left: 5; font-size:1;\"></div></div>"
			
		document.write(objDiv);  
        //alert(objDiv);
        
        }

}

// --------------------  ** Build Layers **  ----------------->

function doLayer(){
	args = doLayer.arguments;
	var nestLayerID=0
	var layerID = args[0];
	var x = args[1];
	var layerLeft = args[2];
	var layerTop = args[3];

	if(navigator.platform.indexOf("Win") < 0){layerInc=16;layerStyle="netMenuMac";}
	else{layerInc=15;layerStyle="netMenu";}	
		
	objDiv = "<layer id=\""+ layerID +"\" Z-INDEX=1 BGCOLOR=\""+ "#000000" +"\"  width=105 HEIGHT=4 LEFT="+ layerLeft +" TOP="+ layerTop +" VISIBILITY=HIDE onmouseover=\"showMenu(\'"+ layerID +"\');\" onmouseout=\"hideMenu(\'"+ layerID +"\');\">"
	
	var nestTop=3
		for (y = 0; y < 15; y++){
		    if(menuData[x][y][0]!=null){
			objDiv += "<layer id=\"line2\" BGCOLOR=\""+ lineColor +"\" WIDTH=103 HEIGHT=1 Z-INDEX=4 LEFT=1 TOP="+ nestTop +">"+ separator +"</layer>"
			objDiv += "<layer id=\"x"+nestLayerID+"\" class=\""+ layerStyle +"\" Z-INDEX=3 BGCOLOR=\""+ menuColor +"\" HEIGHT=16 WIDTH=103 LEFT=1 TOP="+ nestTop +" onmouseover=\"menuOver('document.layers[\\'"+ layerID +"\\'].document.layers[\\'x"+nestLayerID+"\\']')\" onmouseout=\"menuOut('document.layers[\\'"+ layerID +"\\'].document.layers[\\'x"+nestLayerID+"\\']')\" onClick=\"gotoUrl('"+menuData[x][y][1]+"'); document.location='header-prod.asp';\"><a id=navstyle  href=javascript:gotoUrl('"+menuData[x][y][1]+"')><font color=" + fontColorOff + ">"+ menuData[x][y][0]
			objDiv +="</font></a></layer>"		
			nestLayerID=nestLayerID+1
			nestTop=nestTop+layerInc+1
			}
		}
		objDiv += "<layer id=\"line2\" BGCOLOR=\""+ lineColor +"\" width=105  HEIGHT=1 Z-INDEX=2 TOP="+ nestTop +">"+ separator +"</layer>"
		objDiv +="<layer id=\"lineEnd\" BGCOLOR=\""+ "#000000" +"\" width=105 HEIGHT=4 Z-INDEX=4 TOP="+ nestTop +"></layer></layer>"

	document.write(objDiv)
	//alert(objDiv);
}


// --------------------  ** Menu Divs and Layers **  ----------------->

if(b=="WC3" || b=="IE"){

	//doDiv('productmenu',0,142,12);
	
	//alert("WC3");
}

else if(b=="N"){

	//doLayer('productmenu',0,142,12)

	//alert("N");
}



// -->
