N   = (document.layers) ? true:false;                 // netscape 4
I   = (document.all) ? true:false;                    // ie4+
DOM = ((document.getElementById)&&(!I))?true:false;   // ns6 etc.
MAC = (navigator.platform=="MacPPC")?true:false;   // Mac
SAFARI = (navigator.userAgent.indexOf('Safari')>-1)?true:false;   // Mac
Ixp   = (document.all)&&(navigator.userAgent.indexOf('Windows NT 5.1')>-1) ? true:false;                    // windows xp 

//jump menus
function jumpTo(targ,sel){ 
  eval(targ+".location='"+sel.options[sel.selectedIndex].value+"'");
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0 revised by FMI
	if(selObj.options[selObj.selectedIndex].text.indexOf('Choose')>-1){return}
  else{eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;}
}

//Search clear quotes
function clearQuotes(d){
d.keywords.value=d.keywords.value.replace(/["]/g,"");
return 
}

//Script for Go Back button
function goBack () {
window.history.go (-1);
}

//standard pop-up
function stdPop(where,title,w,h){
	window.open(where, title, 'toolbar=no,scrollbars=yes,resizable=yes,width='+w+',height='+h+',top=100,left=100')
}
//OverView Pop-up
function overPop(){
	window.open('/downloads/overview/overview.html', 'Overview', 'toolbar=no,scrollbars=no,resizable=yes,width=800,height=600,top=100,left=100')
}

function clik(){
  var u=document.cookie.split(';'),i,p
  re=/http\W{3}\D*[.]com\W/
  p=location.href.replace(re,',').replace('.html','').replace('/',':')
  for (i=0;i<u.length;i++){
  	if(u[i].indexOf('fmi_cookie=')>-1){u=u[i];break}
	}
  if (u<10){u='noSID;'}   
  src='<img src="http://ghsrenal.com/ghsfiles/files/images/c.gif?'+u+'" width="1" height="1" id="clear">'//+p
  document.write(src)
}

//Special Charactor Removal
function specialChar(field) {
        var re=/[*]|["]|[']/g;
		adjusted=field.value.replace(re, "");field.value=adjusted;
}

//Techinfo search functions
var ti='http://ghsrenal.com/'; 

function smartClear(formText){
	if (formText.value=='Type search words here'||formText.value=='Type article number here')formText.value=''
}
function goArtNum(){
		var num=document.artNum.num
		if (isNaN(num.value)||num.value.length!=6){
			alert('Please type the 6 digit article number.');}
	else eval("location='"+ti+num.value+".html'")
}
function validSurvey(d){
	var e=new Date()
	var year=e.getTime()+(365*24*60*60*1000)
	e.setTime(year)
	if (document.cookie.indexOf(d.survey.value)>-1)(d.key.value=2)
	if (document.cookie.indexOf(d.survey.value)<0)(d.key.value=1)
	if (document.cookie==''){document.cookie="key="+d.survey.value+"; expires=" + e.toGMTString()}
	else {if(document.cookie.indexOf(d.survey.value)<0){document.cookie+=d.survey.value+"; expires=" + e.toGMTString()}return}
}

function validate(d){
	var e=new Date()
	var year=e.getTime()+(365*24*60*60*1000)
	e.setTime(year)
	if (document.cookie.indexOf(d.survey.value)>-1)(d.key.value=2)
	if (document.cookie.indexOf(d.survey.value)<0)(d.key.value=1)
	if (document.cookie==''){document.cookie="key="+d.survey.value+"; expires=" + e.toGMTString()}
	else {if(document.cookie.indexOf(d.survey.value)<0){document.cookie+=d.survey.value+"; expires=" + e.toGMTString()}return}
}


function MM_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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//ALL NEW
// JavaScript Document

var obj;
var objChild;
function init() 
{
	cssjsmenu('globalHelp');
	cssjsmenu('globalNav');//alert('Done');
	MM_preloadImages('http://ghsrenal.com/ghsfiles/files/images/header_downarrow.gif')
}

function setMouseOverStyles(obj){
	//I added which turns on the style to match the rollover effect on the nested list			 
	hideCountry();
			  //New delete--obj.childNodes[0].style.backgroundImage = 'url(http://ghsrenal.com/ghsfiles/files/images/global_pulldown_sm_top_left.gif)';
			  //New delete--obj.childNodes[0].style.backgroundPosition = 'left top';
			
			 obj.style.borderTop = '#9CCBB2 solid 2px';
			  
			  //New delete--obj.childNodes[0].style.backgroundRepeat = 'no-repeat';
			  //New delete--obj.childNodes[0].style.backgroundColor = '#30649D';
			  //New delete--obj.childNodes[0].style.color = '#FFFFFF';
			  //New delete--obj.style.backgroundImage = 'url(http://ghsrenal.com/ghsfiles/files/images/global_pulldown_sm_top_r.gif)';
			  //New delete--obj.style.backgroundPosition = '100% 0';
			  //New delete--if(I&&!MAC){obj.style.backgroundPosition = '100% 0px';}
			  //New delete--if(MAC&&!SAFARI){obj.style.backgroundPosition = '100% 0';}
			 //New delete-- obj.style.backgroundRepeat = 'no-repeat';
}
function setMouseOutStyles(){
//Added which turns off the style implemented by the js
				//New delete--obj.childNodes[0].style.backgroundColor = 'white';
				//New delete--obj.childNodes[0].style.color = '#313131';
				//New delete--obj.style.backgroundImage = 'url(none)';
				//New delete--obj.childNodes[0].style.backgroundImage = 'url(none)';
				objChild.style.visibility = 'hidden';
				obj.style.border = '#ffffff solid 2px';
				if(!SAFARI){obj.style.borderBottom = '#ffffff solid 0px'}
				//New delete--if(obj.parentNode.id=="globalHelp"){
					//New delete--obj.childNodes[0].style.color = '#999999'}
//End add
}

function elementContains(elmOuter, elmInner){
  while (elmInner && elmInner != elmOuter)
  {elmInner = elmInner.parentNode;}
  if (elmInner == elmOuter){
    return true;}
  return false;
}
function getPageXY(elm)
{
  var point = { x: 0, y: 0 };
  while (elm)
  {
		point.x += elm.offsetLeft;
    	point.y += elm.offsetTop;
    	elm = elm.offsetParent;
	 }
return point;
}

function setPageXY(elm, x, y){
  var parentXY = {x: 0, y: 0 };
  if (elm.offsetParent){
    parentXY = getPageXY(elm.offsetParent);}
	if(DOM){y+=2}//Mine to give some distance from the parent li
	elm.style.left = (x) + 'px';elm.style.top = (y) + 'px';
}

function cssjsmenu(menuid){
  var i;
  var j;
  var node;
  var child;
  var parent;
  if (!document.getElementById)
  {
    return true;
  }
  var version;
  var offset;

  offset = navigator.userAgent.indexOf('Opera');
  if (offset != -1){
    version = parseInt('0' + navigator.userAgent.substr(offset + 6), 10);
		if (version < 7){
      return true;}
  }
var menudiv = document.getElementById(menuid);
  // ul
  var ul = new Array();
  for (i = 0; i < menudiv.childNodes.length; i++){
	node = menudiv.childNodes[i];
    if (node.nodeName.toUpperCase() == 'UL'){
      ul[ul.length] = node;}
  }

  // ul > li
  var ul_gt_li = new Array();

  for (i = 0; i < ul.length; i++){
    node = ul[i];for (j = 0; j < node.childNodes.length; j++)
    {
      child = node.childNodes[j];
      if (child.nodeName.toUpperCase() == 'LI'){
        ul_gt_li[ul_gt_li.length] = child;
        child.style.display = 'inline';
        child.style.listStyle = 'none';
        child.style.position = 'static';
		 if(!SAFARI){child.style.borderBottom = '#ffffff solid 0px'} }
    }
  }

  // ul > li > ul
  var ul_gt_li_gt_ul = new Array();

  for (i = 0; i < ul_gt_li.length; i++)
  {
    node = ul_gt_li[i];
    for (j = 0; j < node.childNodes.length; j++)
    {
      child = node.childNodes[j];
      if (child.nodeName.toUpperCase() == 'UL')
      {
        ul_gt_li_gt_ul[ul_gt_li_gt_ul.length] = child;
 
 		parent = child.parentNode; 
        parent.onmouseover = function (e)
        {
          var i;
          var child;
          var point;
          // stop the pure css hover effect
          this.style.paddingBottom = '0';
          for (i = 0; i < this.childNodes.length; i++)
          {
            child = this.childNodes[i];
            if (child.nodeName.toUpperCase() == 'UL')
            {
              point = getPageXY(this);
              setPageXY(child, point.x, point.y + this.offsetHeight);
              child.style.visibility = 'visible';
			 setMouseOverStyles(this);}
			}
          return false;
        };
        parent.onmouseout = function (e)
        {
          var relatedTarget = null;
          if (e){//Nescape&Mozilla&Safari 
		  
            relatedTarget = e.relatedTarget;
	    	if (navigator.product == 'Gecko' && navigator.platform.indexOf('Linux') != -1 && !relatedTarget){
	      		relatedTarget = e.originalTarget;}
          }
          else if (window.event){//IE
          	relatedTarget = window.event.toElement;}

          	if (elementContains(this, relatedTarget)){
            return false;}

          var i;
          var child;
          for (i = 0; i < this.childNodes.length; i++)
          {
            child = this.childNodes[i];
            if (child.nodeName.toUpperCase() == 'UL')
            {
					obj=this;
					objChild=child;
					setMouseOutStyles();
            }
          }
          return false;
        };
      }
    }
  }
  return true;
}

function featureTour(){
	window.open('/products/fm7_tour_nc/intro.html','FeatureTour','toolbar=no,scrollbars=no,resizable=yes,width=710,height=310,top=100,left=100')
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//---------------Needs cleaning----------------
var interval=200,b,selectObjActive=false
function countryList(a){
b=a;
document.getElementById(a).style.display="none";
document.getElementById('selectBox').style.display="inline";
//setInterval("hideMe()",interval)
document.getElementById('selectBox').focus();
}
function hideCountry(){//alert(document.getElementById('selectBox').focus())
//alert(b.parentNode.childNodes[2].style.display);return false;
document.getElementById('selectBox').selectedIndex=0;
document.getElementById('selectBox').style.display="none";
document.getElementById('listItem').style.display="inline";
changeImg("off")

}
function activeSel(){//alert(selectObjActive)
	if(selectObjActive=true){selectObjActive=false;hideCountry()}
	if(selectObjActive==false){selectObjActive=true}
}
function changeImg(g){
	if(g=="on"){
	document.getElementById('globe').src="http://ghsrenal.com/ghsfiles/files/images/header_downarrow.gif"}
	if(g=="off"){
	document.getElementById('globe').src="http://ghsrenal.com/ghsfiles/files/images/header_globe.gif"}
}
//------------------------End of cleaning-------
window.onload=init;

var clips=new Array();
clips[0]="/downloads/quicktime/customer_ilm_high.mov"
clips[1]="/downloads/quicktime/customer_prog_solutions_high.mov"
clips[2]="/downloads/quicktime/customer_herrera_high.mov"
clips[3]="/downloads/quicktime/customer_ilm_low.mov"
clips[4]="/downloads/quicktime/customer_prog_solutions_low.mov"
clips[5]="/downloads/quicktime/customer_herrera_low.mov"
function popClip(whichClip){
	window.open(clips[whichClip], "Customer_Video", 'toolbar=no,scrollbars=yes,resizable=yes,width=340,height=260,top=100,left=100')

}