// OPEN SOURCE BROWSER & PLATFORM DETECTION  
    var agt=navigator.userAgent.toLowerCase();
    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);
    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    var is_nav6 = (is_nav && (is_major == 5));
    var is_nav6up = (is_nav && (is_major >= 5));
    var is_gecko = (agt.indexOf('gecko') != -1);
    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
    var is_ie4up  = (is_ie && (is_major >= 4));
    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
    var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
    var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);
    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
    var is_aol   = (agt.indexOf("aol") != -1);
    var is_aol3  = (is_aol && is_ie3);
    var is_aol4  = (is_aol && is_ie4);
    var is_aol5  = (agt.indexOf("aol 5") != -1);
    var is_aol6  = (agt.indexOf("aol 6") != -1);
    var is_opera = (agt.indexOf("opera") != -1);
    var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);
    var is_webtv = (agt.indexOf("webtv") != -1); 
    var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    var is_AOLTV = is_TVNavigator;
    var is_hotjava = (agt.indexOf("hotjava") != -1);
    var is_hotjava3 = (is_hotjava && (is_major == 3));
    var is_hotjava3up = (is_hotjava && (is_major >= 3));
    // *** JAVASCRIPT VERSION CHECK ***
    var is_js;
    if (is_nav2 || is_ie3) is_js = 1.0;
    else if (is_nav3) is_js = 1.1;
    else if (is_opera5up) is_js = 1.3;
    else if (is_opera) is_js = 1.1;
    else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2;
    else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3;
    else if (is_hotjava3up) is_js = 1.4;
    else if (is_nav6 || is_gecko) is_js = 1.5;
    // NOTE: In the future, update this code when newer versions of JS
    // are released. For now, we try to provide some upward compatibility
    // so that future versions of Nav and IE will show they are at
    // *least* JS 1.x capable. Always check for JS version compatibility
    // with > or >=.
    else if (is_nav6up) is_js = 1.5;
    // NOTE: ie5up on mac is 1.4
    else if (is_ie5up) is_js = 1.3
    // HACK: no idea for other browsers; always check for JS version with > or >=
    else is_js = 0.0;
    // *** PLATFORM ***
    var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
    // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
    //        Win32, so you can't distinguish between Win95 and WinNT.
    var is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
    // is this a 16 bit compiled version?
    var is_win16 = ((agt.indexOf("win16")!=-1) || 
               (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) || 
               (agt.indexOf("windows 16-bit")!=-1) );  
    var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
                    (agt.indexOf("windows 16-bit")!=-1));
    var is_winme = ((agt.indexOf("win 9x 4.90")!=-1));
    var is_win2k = ((agt.indexOf("windows nt 5.0")!=-1));
    // NOTE: Reliable detection of Win98 may not be possible. It appears that:
    //       - On Nav 4.x and before you'll get plain "Windows" in userAgent.
    //       - On Mercury client, the 32-bit version will return "Win98", but
    //         the 16-bit version running on Win98 will still return "Win95".
    var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
    var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
    var is_win32 = (is_win95 || is_winnt || is_win98 || 
                    ((is_major >= 4) && (navigator.platform == "Win32")) ||
                    (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));
    var is_os2   = ((agt.indexOf("os/2")!=-1) || 
                    (navigator.appVersion.indexOf("OS/2")!=-1) ||   
                    (agt.indexOf("ibm-webexplorer")!=-1));
    var is_mac    = (agt.indexOf("mac")!=-1);
    // hack ie5 js version for mac
    if (is_mac && is_ie5up) is_js = 1.4;
    var is_mac68k = (is_mac && ((agt.indexOf("68k")!=-1) || 
                               (agt.indexOf("68000")!=-1)));
    var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) || 
                                (agt.indexOf("powerpc")!=-1)));
    var is_safari   = (agt.indexOf("safari")!=-1);
    var is_sun   = (agt.indexOf("sunos")!=-1);
    var is_sun4  = (agt.indexOf("sunos 4")!=-1);
    var is_sun5  = (agt.indexOf("sunos 5")!=-1);
    var is_suni86= (is_sun && (agt.indexOf("i86")!=-1));
    var is_irix  = (agt.indexOf("irix") !=-1);    // SGI
    var is_irix5 = (agt.indexOf("irix 5") !=-1);
    var is_irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
    var is_hpux  = (agt.indexOf("hp-ux")!=-1);
    var is_hpux9 = (is_hpux && (agt.indexOf("09.")!=-1));
    var is_hpux10= (is_hpux && (agt.indexOf("10.")!=-1));
    var is_aix   = (agt.indexOf("aix") !=-1);      // IBM
    var is_aix1  = (agt.indexOf("aix 1") !=-1);    
    var is_aix2  = (agt.indexOf("aix 2") !=-1);    
    var is_aix3  = (agt.indexOf("aix 3") !=-1);    
    var is_aix4  = (agt.indexOf("aix 4") !=-1);    
    var is_linux = (agt.indexOf("inux")!=-1);
    var is_sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
    var is_unixware = (agt.indexOf("unix_system_v")!=-1); 
    var is_mpras    = (agt.indexOf("ncr")!=-1); 
    var is_reliant  = (agt.indexOf("reliantunix")!=-1);
    var is_dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) || 
           (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) || 
           (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)); 
    var is_sinix = (agt.indexOf("sinix")!=-1);
    var is_freebsd = (agt.indexOf("freebsd")!=-1);
    var is_bsd = (agt.indexOf("bsd")!=-1);
    var is_unix  = ((agt.indexOf("x11")!=-1) || is_sun || is_irix || is_hpux || 
                 is_sco ||is_unixware || is_mpras || is_reliant || 
                 is_dec || is_sinix || is_aix || is_linux || is_bsd || is_freebsd);
    var is_vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
//--> end hide JavaScript

//THIS BLOCK OF JAVASCRIPT IS FOR POP-UP WINDOWS...
function openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}
function openOffsiteWindow(theURL,winWidth,winHeight) {
  features = "top=50,left=50,width=" +winWidth+ ",height=" +winHeight+ ",scrollbars=yes,toolbar=yes,location=yes,status=yes,menubar=yes,resizable=yes";
  window.open(theURL,"offsite",features);
}
function openOnsiteWindow01(theURL,winWidth,winHeight) {
  features = "top=50,left=50,width=" +winWidth+ ",height=" +winHeight+ ",scrollbars=yes,toolbar=no,location=no,status=no,menubar=no,resizable=yes";
  window.open(theURL,"onsite01",features);
}
function loadMoviePlayer(listId,winTitle){
    winTitle = (winTitle)?winTitle:"CEMECA";
    listId = (listId)?listId:"idcintro";
    theURL = "/swf/moviePlayer.swf?mxml=%2FflashMoviePlayerXML%2Ehtml%3FlistId%3D" + listId;
    features = "top=50,left=50,width=574,height=282,scrollbars=no,toolbar=no,location=no,status=no,menubar=no,directories=no,resizable=yes";
    flashWin = window.open("","",features);   
    with(flashWin.document){
        open ('text/html');
        writeln('<html><head><title>'+winTitle+'</title></head><frameset rows="*" frameborder="0" border="0">');
        writeln('<frame src="'+theURL+'" scrolling="no" marginheight="0" marginwidth="0" noresize="noresize"/>');
        writeln('</frameset></html>');
        close ();
    }  
}
<!--
function findObj(n, d) { //finds document objects
  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=findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function showHideLayers() { //for showing and hiding layers
  var i,p,v,obj,args=showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=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 changeProp(objName,x,theProp,theValue) { //for nav cell color changing rollovers
  var obj = findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function preloadImages() { //preloads images
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}


function reloadPage(init) {  //reloads the window if Nav4 resized - Solves DHTML Netscape Problem
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);

<!-- //THIS BLOCK OF JAVASCRIPT IS FOR JUMP SELECT MENUS...
var jumpMenuActive = false;
function jumpMenu(targ,selObj,restore){ 
  if(selObj.options[selObj.selectedIndex].value && !jumpMenuActive){
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    jumpMenuActive = true;
  }
  if (restore) selObj.selectedIndex=0;
}
var showPageActive = false;
function showPage(url){
    if(url && url!=0 && !showPageActive){
        document.location = url;
        showPageActive = true;
    }
}
//-->

/* Create XMLHttpRequest and set response to global variable called reqXMLDoc */
/* url is the URL of XML doc */
/* reqFuncis the name of function (as a string) that will be called when the XML returns */
/* added by Wade Harrell 12/21/2004 1:17:49 PM */

var reqXMLDoc;
function loadXMLDoc(url,reqFunc) {
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        reqXMLDoc = new XMLHttpRequest();
        reqXMLDoc.onreadystatechange = eval(reqFunc);
        reqXMLDoc.open("GET", url, true);
        reqXMLDoc.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        reqXMLDoc = new ActiveXObject("MSXML2.XMLHTTP");
        if (reqXMLDoc) {
            reqXMLDoc.onreadystatechange = eval(reqFunc);
            reqXMLDoc.open("GET", url, true);
            reqXMLDoc.send();
        }
    }
}
/* Clear (remove all) form select options */
/* frmElmnt is a DOM reference to the select element */
/* optString is an otional String to place in the single remaining option of the cleared select */
/* added by Wade Harrell 12/21/2004 1:18:25 PM */
function resetOptions(frmElmnt,optString){
    frmElmnt.length = (document.all)? 0 : 1;
    frmElmnt.length = 0;
    tempOption = new Option();
    tempOption.text = (optString)? optString : '' ;
    tempOption.value = '' ;
    (document.all)? frmElmnt.add(tempOption,1) : frmElmnt[0] = tempOption;
}
/* Submit form when enter key is pressed while form element has focus */
/* USAGE: onkeypress="checkEnter(event,this.form);" */
/* added by Wade Harrell 12/21/2004 1:18:47 PM */
function checkEnter(e,theForm){ //e is event object passed from function invocation
    characterCode = (e && e.which)? e.which : event.keyCode;
    if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
        theForm.submit();
        return false;
    }else{
        return true;
    }
}
/* START PRIMARY NAV FUNCTIONS */
var primaryNavInit = false; // boolean to indicate if the nav has been initialized
var crrntElemTop, crrntElemBottom, crrntElemLeft, crrntElemRight; // variables used to create the active area of a nav iten
var theNavItems; // array of nav items

function primaryNavL1Over(evt){
    if(!primaryNavInit){initGlobalNav();}
    evt = (evt) ? evt : ((event) ? event : null);    
    if(evt){
        elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
        while(elem.id!='navDiv'){
            elem = elem.parentNode;
        }
        if (elem.className=='gnLevelOneOver'){
            return;
        }else{
            clearPrimaryNav();
            elem.className='gnLevelOneOver';
            crrntElemTop = elem.offsetTop;
            crrntElemBottom = crrntElemTop + elem.offsetHeight;
            crrntElemLeft = elem.offsetLeft;
            crrntElemRight = crrntElemLeft + elem.offsetWidth;
            firstDiv = getLevelTwoDiv(elem);
            if(firstDiv){
                crrntElemBottom = crrntElemBottom + firstDiv.offsetHeight;
                crrntElemRight = crrntElemRight + firstDiv.offsetWidth - elem.offsetWidth;
            }
        }
    }
}

function primaryNavL1Out(evt){
    evt = (evt) ? evt : ((event) ? event : null);    
    if(evt){
        elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
        if(elem.id == 'navDiv' || elem.tagName != 'A'){
            clearPrimaryNav();
        }else{
            if(evt.clientX <= crrntElemLeft+2 ||
               evt.clientX >= crrntElemRight-2 ||
               evt.clientY <= crrntElemTop+2 ||
               evt.clientY >= crrntElemBottom-2){
                clearPrimaryNav();
            }           
        }
    }
    crrntPrimaryNavL1Obj = null;
}

function clearPrimaryNav(){
    for(i=0;i < theNavItems.length;i++){
        theNavItems[i].className='gnLevelOne';
    }
}

function getLevelTwoDiv(trgt){
    var gnLevelTwoDiv = false;
    for(cNode=0;cNode < trgt.childNodes.length;cNode++){
        if(trgt.childNodes[cNode].id=="gnLevelTwo"){
            gnLevelTwoDiv = trgt.childNodes[cNode];
        }
    }
    return gnLevelTwoDiv;
}
function initGlobalNav(){
    var brwsr = navigator.userAgent.toLowerCase();
    theNavItems = document.getElementsByName('navDiv');
    for(i=0;i < theNavItems.length;i++){
        firstDiv = getLevelTwoDiv(theNavItems[i]);          
        if(theNavItems[i].offsetHeight && firstDiv){
            if((brwsr.indexOf('firefox')>-1 
                || brwsr.indexOf('msie')>-1 
                || brwsr.indexOf('mozilla')>-1 
                || brwsr.indexOf('safari')>-1)
                && brwsr.indexOf('netscape')<0){
                firstDiv.style.top = theNavItems[i].offsetHeight+"px";    
                if(brwsr.indexOf('msie')!=-1){ 
                // create an iframe to mask out form select elements under the drop down div
                    firstDiv.childNodes[0].style.position = "relative";
                    ieIFrame = document.createElement("IFRAME");
                    ieIFrame.setAttribute("src", "/images/spacer.gif");
                    ieIFrame.setAttribute("id", "gnLevelTwoIFrame");
                    ieIFrame.setAttribute("name", "gnLevelTwoIFrame");
                    ieIFrame.setAttribute("frameborder", "no");
                    ieIFrame.style.width = firstDiv.offsetWidth+"px";
                    ieIFrame.style.height = firstDiv.offsetHeight+"px";
                    firstDiv.appendChild(ieIFrame);
                    if(document.getElementById("productDropDownLayer")){
                        document.getElementById("productDropDownLayer").style.zIndex = -1;
                    }
                }
            }else{
                firstDiv.style.left = theNavItems[i].offsetLeft -1+"px";
                firstDiv.style.top = theNavItems[i].offsetHeight + theNavItems[i].offsetTop+"px";
            }
        }
    }
    primaryNavInit = true;
}
/* END PRIMARY NAV FUNCTIONS */

/* Clears all the elements in a form. NOTE: fields where elementType == 'hidden' are not cleared */
function clearForm(theForm) {
    for (var i = 0, j = theForm.elements.length; i < j; i++) {
        elementType = theForm.elements[i].type;
        if (elementType == 'password' || elementType == 'text' || elementType == 'textarea') {
            theForm.elements[i].value = "";
            if (theForm.elements[i].defaultValue) {
                theForm.elements[i].defaultValue = "";
            }
        }
        if (elementType == 'checkbox' || elementType == 'radio') {
            theForm.elements[i].checked = false;
            theForm.elements[i].defaultChecked = false;
        }
        if (elementType == 'select-one' || elementType == 'select-multiple') {
            for (var k = 0, m = theForm.elements[i].options.length; k < m; k++) {
                theForm.elements[i].options[k].selected = false; 
                theForm.elements[i].options[k].defaultSelected = false;
            }
        }
    }
    if (window.toggleLocalStep) {
        toggleLocalStep(0);
    }
    if (window.stateCountryCheck) {
        stateCountryCheck();
    }
}

// -->
