
function doHilite(ctrl)
{
	//toggles between: picname_over.gif and picname.gif
	var sUrl = ctrl.src;
	var sNoExt = sUrl.substring(0, sUrl.length - 4)
	var sRight = sUrl.substring(sNoExt.length - 4, sNoExt.length);

	if (sRight == "over")
	{
		sUrl = sNoExt.substring(0, sNoExt.length - 5) + ".gif";
	}
	else
	{
		sUrl = sNoExt + "_over.gif";
	}
    ctrl.src = sUrl;
}

function doNavigate(sURL)
{
   window.location = sURL;
}
function goToQuote()
{
    var sDomain = window.location.hostname;
    var sURL = "http://" + sDomain + "/apps/login/customerlogin.asp?redirect=https://" + sDomain + "/apps/secure/en61/displayForm.aspx";
    window.location = sURL;
}
var WindowObjectReference = null; // global variable                                          
function openPopup()                                                                          
{                                                                                             
  if(WindowObjectReference == null || WindowObjectReference.closed)                           
  /* if the pointer to the window object in memory does not exist                             
     or if such pointer exists but the window was closed */                                   
  {                                                                                           
    WindowObjectReference = window.open("/help/helpfiles/ensure.html",
    "CRL", "width=700,height=500,resizable=yes,scrollbars=no,status=no,left=100,top=100");
    /* then create it. The new window will be created and                                     
       will be brought on top of any other window. */                                         
  }                                                                                           
  else                                                                                        
  {                                                                                           
    WindowObjectReference.focus();      
    /* else the window reference must exist and the window                                    
       is not closed; therefore, we can bring it back on top of any other                     
       window with the focus() method. There would be no need to re-create                    
       the window or to reload the referenced resource. */                                    
  };                                                                                          
}    

//start Change Country  ******************************

function changeCountry()
{
    var sDomain;
    var rdos = document.getElementsByName("rdoCountry");
    for (var i = 0; i < rdos.length; i++)
    {
        if (rdos[i].checked == true)
        {
            sDomain = rdos[i].value; break;
        }
    }

    var sZip = "";
    var sState = "";
    var sID = "";

    switch (sDomain)
    {
        case "au":
            sZip= "Postal&nbsp;code";  
            sState = "Territory";
            sID = "hdnau";
            break;
        case "ca":
            sZip= "Postal&nbsp;code";  
            sState = "Province";
            sID = "hdnca";
            break;
        case "us":
            sZip= "Zip";
            sState = "State";
            sID = "hdnus";
            break;
        case "other":
            sZip= "Zip/<br>Postal&nbsp;code";
            sState = "Country";
            sID = "hdnother";
            break;
    }
    document.getElementById("lblZip").innerHTML = sZip + ":<font size='2'>*</font>";
    document.getElementById("lblState").innerHTML = sState + ":<font size='2'>*</font>";

    var ddl = document.getElementById("ddlState");
    sString = document.getElementById(sID).value;
    removeChildren(ddl);

    var arrState = sString.split("|")
    for (var i = 0; i < arrState.length; i++) 
    {
	    var arrVal = arrState[i].split(";")
        var opt = new Option(arrVal[0], arrVal[1]);
        var optionRank = ddl.options.length;
        ddl.options[optionRank]=opt;
    }

    ddl.className = "ErrState";    
}//changeCountry

function removeChildren(s)
{
    while (s.hasChildNodes())
        s.removeChild(s.childNodes[0]);
}
//End Change Country ******************************
