function isLoggedIn( ) { strRegistryId = new String( Registry_getCookie( "registry" ) ); if ( strRegistryId.length == 7 ) return true; else return false; } function addRegistryProduct( strId, strUrl ) { var optionEl = document.getElementById( 'item' + strId + '_selectoptions' ); if ( optionEl ) { productOptions = reconstructOptions( optionEl ); } else { productOptions = ""; } var intQuant = eval( 'document.forms.item' + strId + '_buynow.Order_ItemQuantity.value' ); location.href = strUrl + (strUrl.indexOf("?") < 0 ? "?" : "" ) + "intProductId=" + strId + "&intQuantity=" + intQuant + "&productOptions=" + productOptions; } //For order form (not inquiry), reconstruct all the options to a single variable // formObj would be something like document.forms.selectoptions function reconstructOptions(formObj) { var strOptions=""; var hasComma=0; for ( var rdxI = 0; rdxI < formObj.childNodes.length; rdxI++ ) { var childNode = formObj.childNodes[rdxI]; if ( childNode.nodeName == "SELECT" ) { if ( childNode.name && childNode.name == "Order_ItemOptions" ) { for ( var valIdx = 0; valIdx < childNode.childNodes.length; valIdx++ ) { var valueNode = childNode.childNodes[valIdx]; if ( valueNode.value && valueNode.selected ) { var optionValue = valueNode.value; nLen=optionValue.length; if (nLen > 2 && optionValue.charAt(nLen-1)=='&' && optionValue.charAt(nLen-2)==':') { strOptions += optionValue.substring(0,nLen-1); // strip the & at the end } else { strOptions += optionValue; strOptions += ","; hasComma=1; } } } } } else if ( childNode.hasChildNodes() ) { strOptions += reconstructOptions( childNode ); } } //if (hasComma==1) //cant seem to get it to work for some reason. eliminates all commas // strOptions=strOptions.substring(0, strOptions.length-1); return strOptions; } function getQueryString( key ) { param = location.search; if ( param.length == 0 ) return null; re = new RegExp( "[\\?&]" + key + "=([^&]*)&", "i" ) res = re.exec( param + "&" ); if ( !res ) return null; return res[1]; } function DetectBrowsers() { if (document.layers) return "nn4"; if (document.all) return "ie"; if (window.navigator.userAgent.toLowerCase().match("gecko")) return "gecko"; } function Registry_getCookie( name ) { if ( document.cookie == null ) return null; var cookies = document.cookie; var index = cookies.indexOf(name + "="); if ( index == -1 ) return null; index = cookies.indexOf("=", index) + 1; var endstr = cookies.indexOf(";", index); if ( endstr == -1 ) endstr = cookies.length; return unescape( cookies.substring( index, endstr ) ); } // Send back logout people if ( getQueryString( "loggedout" ) == "yes" ) { var dtExpire = new Date( "1900/1/1" ); document.cookie = "registry=; Version=1; Path=/; expires=" + dtExpire.toGMTString( ); document.cookie = "blnAdmin=; Version=1; Path=/; expires=" + dtExpire.toGMTString( ); history.back(); } function resetBackCookie() { document.cookie = "blnDidOrder=no; Version=1; Path=/;"; } function basketOrderClicked( ) { if ( subtotal == 0 ) { alert("There are no items in your basket."); return false; } var popunder = window.open('http://www.babyproofingplus.com/ordrconf.htm', 'popunderWindow', 'toolbar=no,width=500,height=320' ); window.focus(); return true; }