

/**
 * DHTML dropdown menu script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
 //window.resizeTo(768,1124);
 
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS6 = (bName == "Netscape" && bVer >= 5);
 var NS4 = (bName == "Netscape" && bVer >= 4 && bVer < 5);
 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);

 window.onerror = null;
 var menuActive = 0
 var menuOn = 0
 var g_sOnLayer
 var timeOn = null // LAYER SWITCHING CODE
 if (NS4 || IE4 || NS6 || (navigator.userAgent.indexOf("Opera")!=-1)) {

	 if (navigator.appName == "Netscape" && !document.getElementById){
		 layerStyleRef="layer.";
		 layerRef="document.layers";
		 styleSwitch="";
		 layerVis="show";
		 layerHid="hide";
	 }
	 else if (!document.all && document.getElementById) {
		 layerStyleRef="layer.style.";
		 layerRef="document.getElementById";
		 styleSwitch=".style";
		 layerVis="visible";
		 layerHid="hidden";
	 }
	 else {
		 layerStyleRef="layer.style.";
		 layerRef="document.all";
		 styleSwitch=".style";
		 layerVis="visible";
		 layerHid="hidden";
	 } // else 
 } // if

	browser_version = parseInt(navigator.appVersion);
	browser_type = navigator.appName;

	if (browser_type == "Microsoft Internet Explorer" && (browser_version >= 4)) {
		document.write("<style type='text/css'>");
		document.write("div.mainbodywithborder{height:600px;}");
		document.write("</style>");
	} // if
	else if (browser_type == "Netscape" && (browser_version >= 4)) {
		document.write("<style type='text/css'>");
		document.write("div.mainbodywithborder{min-height:600px;}");
		document.write("</style>");
	} // else if
	else{
		document.write("<style type='text/css'>");
		document.write("div.mainbodywithborder{height:600px;}");
		document.write("</style>");
	} // else
	
	if (document.images) {
	     button1 = new Image
	     button2 = new Image
	
	     button1.src = './images/chinese1.gif'
	     button2.src = './images/chinese-over1.gif'
	} // if

// SHOW MENU
function shLayer(layerName)
{
	 img = getImage("imgTabs");
	 x = getImagePageLeft(img);
	 y = getImagePageTop(img);
	  var nLeftSpace = x;
	// if ((navigator.userAgent.indexOf("Opera")!=-1)||(navigator.userAgent.indexOf("Opera/6")!=-1)||(navigator.userAgent.indexOf("Opera 6")!=-1)){
	  	menuTop = y + 74 ; // LAYER TOP POSITION
	// }
	// else if (NS6){
	//  	menuTop = y + 74 ; // LAYER TOP POSITION
	// }
	// else{ 
	/// 	menuTop = y + 74 ; // LAYER TOP POSITION
	// }
	
	 prodsL =  x + 110 ; // 'Ser' LAYER LEFT POSITION
	 DloadL = x + 215 ;  // 'Rat' LAYER LEFT POSITION
	 purchL = x + 350 ;  // 'Pro' LAYER LEFT POSITION
	 SerL = x + 458 ; // 'Ser' LAYER LEFT POSITION 
	 rhinoL =  x + 590; // 'Ser' LAYER LEFT POSITION 

	switch(layerName)
	{
		case "ProdDropMenu":
			nLeftSpace = x + 110 ;
		  	break;
		case "Dload":
			nLeftSpace =  x + 215
		  	break;
		case "purch":
			nLeftSpace = x + 350 ;
		  	break;
		case "Ser":
			nLeftSpace = x + 458 ;
		  	break;
		case "rhino":
			nLeftSpace = x + 590;
		  	break;
	} // switch


	//if (NS4 || IE4 || NS6 || (navigator.userAgent.indexOf("Opera")!=-1)) {
		if (timeOn != null) {
			clearTimeout(timeOn)
			hideLayer(g_sOnLayer)
		}

		//if (NS4  || IE4) {
		//	 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerVis+'"');
		//	 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top="'+menuTop+'"');
		//	 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
		//} 
		//else if (NS6 || (navigator.userAgent.indexOf("Opera")!=-1)) {
			// eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerVis+'"');
			 //eval(layerRef+'("'+layerName+'")'+styleSwitch+'.top="'+menuTop+'"');
			 //eval(layerRef+'("'+layerName+'")'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
		// } 
			document.getElementById(layerName).style.visibility = "visible";
			document.getElementById(layerName).style.top = menuTop + "px";
			document.getElementById(layerName).style.left = nLeftSpace + "px";

		 g_sOnLayer = layerName ;
	//}
}// shLayer


function hideLayer(layerName){
	if (menuActive == 0) {
		document.getElementById(layerName).style.visibility = "hidden";
		/*if (NS4  || IE4) {
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerHid+'"');
		}
		else if (NS6 || (navigator.userAgent.indexOf("Opera")!=-1)) {
			eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerHid+'"');
		}*/
	}
}// TIMER FOR BUTTON MOUSE OUT


function btnTimer() {
 	timeOn = setTimeout("btnOut()",1000);
}// BUTTON MOUSE OUT


function btnOut() {

 if (menuActive == 0) {
	hideLayer(g_sOnLayer);
 }
}// MENU MOUSE OVER 


function menuOver(itemName) {
 clearTimeout(timeOn);
 menuActive = 1;
}// MENU MOUSE OUT 


function menuOut(itemName) {
 	menuActive = 0 ;
	timeOn = setTimeout("hideLayer(g_sOnLayer)", 400);
}// SET BACKGROUND COLOR 


function getImage(name) {
  if (NS4 || NS6) {
    return findImage(name, document);
  }
  if (IE4 || NS6 || (navigator.userAgent.indexOf("Opera")!=-1))
    return eval('document.all.' + name);
  return null;
}


function findImage(name, doc) {
  var i, img;
  for (i = 0; i < doc.images.length; i++)
    if (doc.images[i].name == name)
      return doc.images[i];
  for (i = 0; i < doc.layers.length; i++)
    if ((img = findImage(name, doc.layers[i].document)) != null) {
      img.container = doc.layers[i];
      return img;
    }
  return null;
}


function getImagePageLeft(img) {
  var x, obj;
  if (NS4 || NS6) {
    if (img.container != null)
      return img.container.pageX + img.x - 1;
    else
      return img.x - 1;
  }
  if (IE4 || (navigator.userAgent.indexOf("Opera")!=-1)) {
    x = 0;
    obj = img;
    while (obj.offsetParent != null) {
      x += obj.offsetLeft;
      obj = obj.offsetParent;
    }
    x += obj.offsetLeft;
    return x;
  }
  return -1;
}


function getImagePageTop(img) {
  var y, obj;
  if (NS4 || NS6) {
    if (img.container != null)
      return img.container.pageY + img.y;
    else
      return img.y;
  }
  if (IE4 || (navigator.userAgent.indexOf("Opera")!=-1)) {
    y = 0;
    obj = img;
    while (obj.offsetParent != null) {
      y += obj.offsetTop;
      obj = obj.offsetParent;
    }
    y += obj.offsetTop;
    return y;
  }
  return -1;
}


// SET BACKGROUND COLOR 
function setBgColor(layer, color) {
  if (NS6 || (navigator.userAgent.indexOf("Opera")!=-1)){
    eval('document.getElementById("'+layer+'").style.backgroundColor="'+color+'"');
  }
  else if (NS4){
    eval('window.document.layers["'+layer+'"].document.bgColor="'+color+'"');
	eval('window.document.layers["'+layer+'"].saveColor="'+color+'"');
  }
  else if (IE4){
    eval('document.all.'+layer+'.style.backgroundColor="'+color+'"');
  }
}


function FM_showHideLayers() { //v3.0
	var i,p,v,obj,args=FM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=FM_findObj(args[i]))!=null) { v=args[i+2];
		if (obj.style) { 
			obj=obj.style; 
			v=(v=='show')?'visible':(v='hide')?'hidden':v; 
		}// if
		obj.visibility=v;	
	} // for
} // func


function FM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=FM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n);
   return x;
}


function openkb(refno,prod)
{
window.top.location.href='KBArticle.asp?RefNo=' + refno + '&prod=' + prod ;
}


function enlarge(image_loc, img)
{
HTML = "<html><style>body{margin:0px 0px 20px 0px;font-size:9pt; font-family:arial;}</style><body onBlur='top.close()'><center><img src='"+ image_loc +"' border=0 name=load_image onLoad='window.resizeTo(document.load_image.width+20,document.load_image.height+100)'></center><br><center><a href='javascript:window.close();'><strong>Close Window</strong></a></center></body></html>"; 
popupImage = window.open('','_blank','toolbar=no,scrollbars=no'); 
popupImage.document.open(); 
popupImage.document.write(HTML); 
popupImage.document.close(); 
}


function openLearnMoreWindow(page)
{
	popupWin = window.open(page , 'open_window',
	'scrollbars=yes,dependent,width=600,height=525,left=200,top=75');
}


function openNewWindow(page)
{
	popupWin = window.open(page , 'open_window',
	'scrollbars,dependent,width=600,height=600,left=200,top=75');
}


function openPrintWindow(page)
{
	popupWin = window.open(page , 'open_window',
	'scrollbars,dependent,resizable=1,width=800,height=600,left=20,top=75');
}


function opencurrencyconvert(page)
{
	popupWin = window.open(page , 'open_window',
	'scrollbars,dependent,resizable=yes,width=525,height=475,left=300,top=400');
}


function checkIfSpecialCharacter(event) {
   if (event.keyCode){
      key = event.keyCode;
}
   else if (event.which){
      key = event.which;
}
   if ((key> 32 && key< 48) || (key > 57 && key < 65) || (key > 90 && key < 97) ||  (key > 122)) {  
    alert("Illegal character: " + String.fromCharCode(key));
    event.returnValue = false;
    return false;
  }
}


function swap(id, bNoHide){
	if (document.getElementById(id).style.display=="none" || bNoHide == true){
		newShow(id);
	} else {
		newHide(id);
	}
}


function newShow(id,setPosition){
	document.getElementById(id).style.display="block";
}


function newHide(id,setPosition){
	document.getElementById(id).style.display="none";
}


function Validate()
	{
		// basic validation...
		var sEmail = document.info.email.value;
		var sFName = document.info.fname.value;
		var sLName = document.info.lname.value;
		sLName = sLName.replace(/^\s*|\s*$/,"");
		sFName = sFName.replace(/^\s*|\s*$/,"");
		sEmail = sEmail.replace(/^\s*|\s*$/,"");
		
		// must have values
		if ((sEmail == "") || (sFName == "") || (sLName == ""))
		{
			alert("Please fill in all required fields before downloading.");
			return false;
		} // if
		else	{	return true;	} // else
	} 


function opentutorial(linkurl)
{
	window.open(linkurl,'_blank','height=600,width=800,status=yes,toolbar=no,menubar=no,location=no');
} // opentutorial


function submitform(f)
{
	eval('document.'+ f + '.submit();')
}

function checkit(prod)
{
	if (eval("document.Sent."+prod+".checked == true"))
	{
	eval("document.Sent."+prod+".checked = false");
	}
	else if(eval("document.Sent."+prod+".checked == false"))
	{
	eval("document.Sent."+prod+".checked = true");
	}
}


function OnViewLink(sLink)
{
	location.href = sLink;
} // OnViewLink

	
// **************** Global Dialog Functions *************************
function GlobalShowDialog(sDialogId)
{
	//glv(sDialogId);
	cgtb(sDialogId);
} // GlobalShowDialog


function GlobalHideDialog(sDialogId)
{
	//yjd(sDialogId);
	gjwb(sDialogId);
} // GlobalHideDialog


function GlobalCloseImageDialog()
{
	//kmq();
	vlnb();
	document.getElementById("ImageContainer").src = "";
} // GlobalCloseImageDialog


function GlobalAdDialogShow(sDialogId,sDialogContainer,sImage)
{

//	adqnl(sDialogId, sDialogContainer, sImage);
//	qdcb(sDialogId, sDialogContainer, sImage);
	adtpdb(sDialogId, sDialogContainer, sImage);

} // GlobalAdDialogShow


function GlobalImageDialogShow(sImage, nWidth, nHeight, sText, fn_CloseCallback, sTitle)
{
	//dljb(sImage,nWidth,nHeight,sText,fn_CloseCallback,sTitle)
	ftb(sImage,nWidth,nHeight,sText,fn_CloseCallback,sTitle);
} // GlobalImageDialogShow


function ShowDiscount(objPricingTable,imgObj,sArrowType)
{
	if(sArrowType == undefined){
		sArrowFile = "pricing" ;
		sArrowFileDown = "" ;
	}
	else{
		sArrowFile = sArrowType ;
		sArrowFileDown = "-" + sArrowType ;
	}
	if(document.getElementById(objPricingTable).style.display == "none")
		document.getElementById(imgObj).src = "images/listarrow" + sArrowFileDown + "-down.gif";
	else
		document.getElementById(imgObj).src = "images/listarrow-" + sArrowFile + ".gif";
		
   	new Effect.toggle(objPricingTable, 'Blind');  
		
		
	//Effect.toggle(objPricingTable, 'Blind'); 
	//return false;
}
	
//resizeTo(1152,864);
// -->