

/**
 * 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 onLayer
 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";
	 }
 
 }

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>");
} 

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{
document.write("<style type='text/css'>");
document.write("div.mainbodywithborder{height:600px;}");
document.write("</style>");
} 
if (document.images) {
    // button1 = new Image
    // button2 = new Image

     //button1.src = './images/chinese1.gif'
     //button2.src = './images/chinese-over1.gif'
 }

// SHOW MENU
function shLayer(layerName){
 img = getImage("imgTabs");
 x = getImagePageLeft(img);
 y = getImagePageTop(img);
 
 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
if (NS4 || IE4 || NS6 || (navigator.userAgent.indexOf("Opera")!=-1)) {
 if (timeOn != null) {
 clearTimeout(timeOn)
 hideLayer(onLayer)
 }
 if (NS4 || IE4 || (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')+'"');
 } 
 if (NS6) {
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerVis+'"');
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.top="'+menuTop+'"');
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
 } 
 onLayer = layerName ;
 }
}// HIDE MENU
function hideLayer(layerName){
 if (menuActive == 0) {
 if (NS4 || IE4 || (navigator.userAgent.indexOf("Opera")!=-1)) {
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerHid+'"');
 }
 if (NS6) {
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerHid+'"');
 }
 }
}// TIMER FOR BUTTON MOUSE OUT
function btnTimer() {
 timeOn = setTimeout("btnOut()",1000);
}// BUTTON MOUSE OUT
function btnOut(layerName) {
 if (menuActive == 0) {
 hideLayer(onLayer);
 }
}// MENU MOUSE OVER 
function menuOver(itemName) {
 clearTimeout(timeOn);
 menuActive = 1;
}// MENU MOUSE OUT 
function menuOut(itemName) {
 menuActive = 0 ;
 timeOn = setTimeout("hideLayer(onLayer)", 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; }
    obj.visibility=v;
	
	}
	}

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=525,height=525,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){
	if (document.getElementById(id).style.display=="none"){
		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');
	}
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");
	}
}
//resizeTo(1152,864);
// -->
