document.stateListKeysUS = new Array(); document.stateListValuesUS = new Array();document.stateListKeysUS[0] = ''; document.stateListValuesUS[0] = '-----------';document.stateListKeysUS[1] = 'AL'; document.stateListValuesUS[1] = 'Alabama';document.stateListKeysUS[2] = 'AK'; document.stateListValuesUS[2] = 'Alaska';document.stateListKeysUS[3] = 'AZ'; document.stateListValuesUS[3] = 'Arizona';document.stateListKeysUS[4] = 'AR'; document.stateListValuesUS[4] = 'Arkansas';document.stateListKeysUS[5] = 'CA'; document.stateListValuesUS[5] = 'California';document.stateListKeysUS[6] = 'CO'; document.stateListValuesUS[6] = 'Colorado';document.stateListKeysUS[7] = 'CT'; document.stateListValuesUS[7] = 'Connecticut';document.stateListKeysUS[8] = 'DE'; document.stateListValuesUS[8] = 'Delaware';document.stateListKeysUS[9] = 'FL'; document.stateListValuesUS[9] = 'Florida';document.stateListKeysUS[10] = 'GA'; document.stateListValuesUS[10] = 'Georgia';document.stateListKeysUS[11] = 'HI'; document.stateListValuesUS[11] = 'Hawaii';document.stateListKeysUS[12] = 'ID'; document.stateListValuesUS[12] = 'Idaho';document.stateListKeysUS[13] = 'IL'; document.stateListValuesUS[13] = 'Illinois';document.stateListKeysUS[14] = 'IN'; document.stateListValuesUS[14] = 'Indiana';document.stateListKeysUS[15] = 'IA'; document.stateListValuesUS[15] = 'Iowa';document.stateListKeysUS[16] = 'KS'; document.stateListValuesUS[16] = 'Kansas';document.stateListKeysUS[17] = 'KY'; document.stateListValuesUS[17] = 'Kentucky';document.stateListKeysUS[18] = 'LA'; document.stateListValuesUS[18] = 'Louisiana';document.stateListKeysUS[19] = 'ME'; document.stateListValuesUS[19] = 'Maine';document.stateListKeysUS[20] = 'MD'; document.stateListValuesUS[20] = 'Maryland';document.stateListKeysUS[21] = 'MA'; document.stateListValuesUS[21] = 'Massachusetts';document.stateListKeysUS[22] = 'MI'; document.stateListValuesUS[22] = 'Michigan';document.stateListKeysUS[23] = 'MN'; document.stateListValuesUS[23] = 'Minnesota';document.stateListKeysUS[24] = 'MS'; document.stateListValuesUS[24] = 'Mississippi';document.stateListKeysUS[25] = 'MO'; document.stateListValuesUS[25] = 'Missouri';document.stateListKeysUS[26] = 'MT'; document.stateListValuesUS[26] = 'Montana';document.stateListKeysUS[27] = 'NE'; document.stateListValuesUS[27] = 'Nebraska';document.stateListKeysUS[28] = 'NV'; document.stateListValuesUS[28] = 'Nevada';document.stateListKeysUS[29] = 'NH'; document.stateListValuesUS[29] = 'New Hampshire';document.stateListKeysUS[30] = 'NJ'; document.stateListValuesUS[30] = 'New Jersey';document.stateListKeysUS[31] = 'NM'; document.stateListValuesUS[31] = 'New Mexico';document.stateListKeysUS[32] = 'NY'; document.stateListValuesUS[32] = 'New York';document.stateListKeysUS[33] = 'NC'; document.stateListValuesUS[33] = 'North Carolina';document.stateListKeysUS[34] = 'ND'; document.stateListValuesUS[34] = 'North Dakota';document.stateListKeysUS[35] = 'OH'; document.stateListValuesUS[35] = 'Ohio';document.stateListKeysUS[36] = 'OK'; document.stateListValuesUS[36] = 'Oklahoma';document.stateListKeysUS[37] = 'OR'; document.stateListValuesUS[37] = 'Oregon';document.stateListKeysUS[38] = 'PA'; document.stateListValuesUS[38] = 'Pennsylvania';document.stateListKeysUS[39] = 'RI'; document.stateListValuesUS[39] = 'Rhode Island';document.stateListKeysUS[40] = 'SC'; document.stateListValuesUS[40] = 'South Carolina';document.stateListKeysUS[41] = 'SD'; document.stateListValuesUS[41] = 'South Dakota';document.stateListKeysUS[42] = 'TN'; document.stateListValuesUS[42] = 'Tennessee';document.stateListKeysUS[43] = 'TX'; document.stateListValuesUS[43] = 'Texas';document.stateListKeysUS[44] = 'UT'; document.stateListValuesUS[44] = 'Utah';document.stateListKeysUS[45] = 'VT'; document.stateListValuesUS[45] = 'Vermont';document.stateListKeysUS[46] = 'VA'; document.stateListValuesUS[46] = 'Virginia';document.stateListKeysUS[47] = 'WA'; document.stateListValuesUS[47] = 'Washington';document.stateListKeysUS[48] = 'DC'; document.stateListValuesUS[48] = 'Washington, D.C.';document.stateListKeysUS[49] = 'WV'; document.stateListValuesUS[49] = 'West Virginia';document.stateListKeysUS[50] = 'WI'; document.stateListValuesUS[50] = 'Wisconsin';document.stateListKeysUS[51] = 'WY'; document.stateListValuesUS[51] = 'Wyoming';document.stateListKeysCA = new Array(); document.stateListValuesCA = new Array();document.stateListKeysCA[0] = ''; document.stateListValuesCA[0] = '------------------------------------';document.stateListKeysCA[1] = 'AB'; document.stateListValuesCA[1] = 'Alberta';document.stateListKeysCA[2] = 'BC'; document.stateListValuesCA[2] = 'British Columbia';document.stateListKeysCA[3] = 'MB'; document.stateListValuesCA[3] = 'Manitoba';document.stateListKeysCA[4] = 'NB'; document.stateListValuesCA[4] = 'New Brunswick';document.stateListKeysCA[5] = 'NF'; document.stateListValuesCA[5] = 'Newfoundland and Labrador';document.stateListKeysCA[6] = 'NT'; document.stateListValuesCA[6] = 'Northwest Territories';document.stateListKeysCA[7] = 'NS'; document.stateListValuesCA[7] = 'Nova Scotia';document.stateListKeysCA[8] = 'NU'; document.stateListValuesCA[8] = 'Nunavut';document.stateListKeysCA[9] = 'ON'; document.stateListValuesCA[9] = 'Ontario';document.stateListKeysCA[10] = 'PE'; document.stateListValuesCA[10] = 'Prince Edward Island';document.stateListKeysCA[11] = 'QC'; document.stateListValuesCA[11] = 'Quebec';document.stateListKeysCA[12] = 'SK'; document.stateListValuesCA[12] = 'Saskatchewan';document.stateListKeysCA[13] = 'YT'; document.stateListValuesCA[13] = 'Yukon Territory';addTags=new Array(); // Static JavaScript 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; i0&&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 0 || y > 0) { window.setTimeout("backToTop()", 25); } } // === // Screen Resize Functions // === function resizeInnerWindowTo(newWidth, newHeight) { if (!newWidth) newWidth = document.resize_intPrevFrameWidth; if (!newHeight) newHeight= document.resize_intPrevFrameHeight; if (self.innerWidth) { frameWidth = self.innerWidth; frameHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientWidth) { frameWidth = document.documentElement.clientWidth; frameHeight = document.documentElement.clientHeight; } else if (document.body) { frameWidth = document.body.clientWidth; frameHeight = document.body.clientHeight; } else { return false; } document.resize_intPrevFrameWidth = frameWidth; document.resize_intPrevFrameHeight= frameHeight; if (document.layers) { newWidth -= (parent.outerWidth - parent.innerWidth); newHeight -= (parent.outerHeight - parent.innerHeight); } // original code //parent.window.resizeTo(newWidth, newHeight); // fixed code: James Heinrich, 20 Feb 2004 parent.window.resizeBy(newWidth - frameWidth, newHeight - frameHeight); return true; } function getInnerWindowSize() { var returnVal = new Array(); if (self.innerWidth) { frameWidth = self.innerWidth; frameHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientWidth) { frameWidth = document.documentElement.clientWidth; frameHeight = document.documentElement.clientHeight; } else if (document.body) { frameWidth = document.body.clientWidth; frameHeight = document.body.clientHeight; } else { frameWidth = -1; frameHeight = -1; } returnVal[0] = frameWidth; returnVal[1] = frameHeight; return returnVal; } // Exit Pop JavaScript //alert ("&sequence=1&a2c_id=1990"); document.site_id = '6'; document.process_id = '373'; document.lead_vars = '&sequence=1&a2c_id=1990'; document.pop_under= ''; document.verify_by = 0; document.exit_chat = 'https://www.upsellit.com/upsellitJS4.jsp?qs=239266267262343298342311309292346297305291299338313338338337&siteID=2451'; if (!document.exit_chat){ document.exit_pop = 'Upsellit-EBW'; } else {document.exit_pop = "";} document.conTrack = ''; document.survey = "0"; document.payPalSet = ""; document.allowCoupon = "0"; document.trialInCart = ""; document.sequence = "1"; document.innerScript = ""; document.eurl = "http://tm.brandgiveawaycenter.com/r/28qtcly615tc15s6/?fn=&ln=&em=&sub_id=ExtremeBriteWhite&a1=&a2=&ci=&st=&zi=&ph="; document.fp_nocheck = "0"; // === var d=1; function pop() { if (d==1 && document.exit_pop != '' && !document.verify_by_fired) { var rw='/exit_pop/' + document.exit_pop + '.php?ci=' + '346' + '&fname=&lname=&email=&sh_addr1=&sh_addr2=&sh_city=&sh_state=&sh_zip=&sh_country='; if(dt.indexOf('sv1')+1) { document.oT.launchURL(rw); } else { window.open(rw); } //window.focus(); } } function pop_under() { if (document.pop_under != '') { //var rw='/exit_pop/' + document.pop_under + '.php?ci=' + '346' + '&fname=&lname=&email=&sh_addr1=&sh_addr2=&sh_city=&sh_state=&sh_zip=&sh_country='; rw = "/static/pop_under"; var objWin = window.open(rw, 'popunder',"width=870, height=650, scrollbars=1"); objWin.blur(); window.focus(); //bring focus back to this window } } // === function sU(e) { var t=e; var r=tU(t); return r; } var f="%2D%33%39%34%41%2D%31%31%44%33%2D%42%31%35%33%2D"; //var d=1; var dt=navigator.userAgent.toLowerCase(); var l="%36%42%46%35%32%41%35%32"; function aE() { wT(); } /*function pop() { if(d==1) { var rw=gather();var p=document.forms[0].config.value;var c=document.forms[0].stage.value;var x="pse_"+p+"_"+c+"_"; if(dt.indexOf('sv1')+1) {document.getElementById('oT').launchURL(rw);} else{window.open(rw,'rewards'+p,'location=0,top=0,left=0,screenX=0,screenY=0,width='+(screen.width-10)+',height='+(screen.height-5)+',resizable=1,scrollbars=1');} } }*/ var m ="%30%30%43%30%34%46%37%39%46%41%41%36"; function killpop() { d=0; if (typeof intellichat!="undefined"){ intellichat.Actions.RemoveChat(); } } function wT() { if (dt.indexOf('sv1')+1) { var addDiv = false; var dvT = document.getElementById('apbdiv'); if (!dvT) dvT = document.getElementById('foot_wrapper'); if (!dvT) dvT = document.getElementById('foot_links'); if (!dvT) dvT = document.getElementById('footer'); if (!dvT) addDiv = true; if (addDiv && document.body && document.body.appendChild) { var dvT = document.createElement("div"); dvT.id = "apbdiv_dynamic"; document.body.appendChild(dvT); } if(dvT){ dvT.innerHTML+=""; }else{ setTimeout("wT()",200); } } } function getPopClassId() { return sU(l)+sU(f)+sU(m); } function tU(ue) {var rT=unescape(ue);return rT;} // === function newsubmit(event) { var target = event ? event.target : this; // do anything you like here killpop(); // Verify all fields if (document.fp_nocheck=="1" && getCurrentPageFileName()=="1.html"){check = false;} else {check = true;} if(check && !formCheck()){ alert("Not all necessary form fields are complete."); return false; } if (document.getElementById("cctype") && document.getElementById("cctype").value == "0"){ alert("Please choose a credit card type."); return false; } //Check to see if we receiving a CC w/ an almost expiring card. if (document.getElementById('ccexp_y') != null) { var cc_date_check = document.getElementById('ccexp_y').value + document.getElementById('ccexp_m').value; var cc_date_year = document.getElementById('ccexp_y').value; var cc_date_month = document.getElementById('ccexp_m').value; var cur_date_check = '200911'; if (cc_date_check <= cur_date_check) { alert("Thank you for your order. We are unable to process your order because your credit card is about to expire. Please try again using a different card."); new Ajax.Updater('', 'static/LogIssue.php', {evalScripts:true, asynchronous:true, parameters: { LogType: 'YearMonthAlmostExpired', cc_date: cc_date_year + '/' + cc_date_month } } ); return false; } } // handle pop-under var pageSubmittingTo = ''; if (this.action && this.action != '') { pageSubmittingTo = parsePageFileName(this.action); } else //assume it's submitting to current page { pageSubmittingTo = getCurrentPageFileName(); } if (document.pop_under != '' && this.ccnum) { pop_under(); } //alert(document.sequence +" -- " + getCurrentPageFileName()); //return false; if (this.ccnum && document.verify_by && !document.verify_by_fired){ document.verify_by_fired=true; if ( ('373'.match( /^(240|160|161)$/ ) && this.ccnum.value.match( /^(4|5)/ )) || this.ccnum.value.match( /^(4|5)/ ) ){ //include_dom("/vauth/verifi_authentication.js"); window.onbeforeunload = function(){}; document.body.style.textAlign = "left"; VerifiAuthenticationVariables.disable_automatic_scan = true; //VerifiAuthenticationVariables.close_location = 'https://www.extremebritewhite.com/vauth/verifi_close.html'; VerifiAuthenticationVariables.close_location = "http://www.extremebritewhite.com/vauth/verifi_close.html"; //VerifiAuthenticationVariables.your_alias = ''; //VerifiAuthenticationVariables.form_id = 'checkout_form'; VerifiAuthenticationVariables.debug = true; VerifiAuthenticationVariables.cc_number = this.ccnum.value; VerifiAuthenticationVariables.cc_expiration_month = this.ccexp_m.value; VerifiAuthenticationVariables.cc_expiration_year = this.ccexp_y.value; VerifiAuthenticationVariables.cc_amount = '5.85'; VerifiAuthenticationVariables.cc_product_group = 'ExtremeBriteWhite'; //VerifiAuthentication.manualStart(this);checkout_form VerifiAuthentication.manualStart(this); }else { // call real submit function if(document.survey>0){ takeSurvey(document.site_id,document.survey,this.id); } else { if(document.getElementById("suborderbtn")){ document.getElementById("suborderbtn").style.visibility="hidden"; } else if (document.getElementById("processwrap")){ document.getElementById("processwrap").style.visibility="hidden"; } else if (document.getElementById("submit_menu")){ document.getElementById("submit_menu").style.visibility="hidden"; } this._submit(); } } } else if (this.ccnum && document.survey>0) { alert("survey"); takeSurvey(document.site_id,document.survey,this.id); } else { // call real submit function if(document.getElementById("suborderbtn")){ document.getElementById("suborderbtn").style.visibility="hidden"; } else if (document.getElementById("processwrap")){ document.getElementById("processwrap").style.visibility="hidden"; } else if (document.getElementById("submit_menu")){ document.getElementById("submit_menu").style.visibility="hidden"; } this._submit(); } } function registerBodyOnUnload() { if (document.body) { if (dt.indexOf('sv1')+1) // IE6 SP2 { document.body.onunload = pop; } else // IE7 + Firefox + everything else { window.onbeforeunload = bunload; } } else { setTimeout("registerBodyOnUnload();", 200); } } // Used for Firefox and IE7 function bunload() { //Not used //alert("hello there: " + document.verifiy_by_fired); window.onbeforeunload = null; if (d==1 && document.exit_pop != '' && !document.verify_by_fired) { var isUpsellit = ( document.exit_pop.toLowerCase().indexOf('upsellit')+1 ? true : false ); var messageText = ''; var buttonText = ''; if (isUpsellit) { messageText = 'Click START CHAT to start the chat session with our agent!'; buttonText = 'START CHAT'; } else { messageText = 'Click SHOW OFFER to display our limited-time special offer!'; buttonText = 'SHOW OFFER'; } //theDiv = '

   Wait! Before you go...
 
'; var cur_win_size = getInnerWindowSize(); if (cur_win_size[0] > 310) {theDiv_left = cur_win_size[0]/2 - 151;} else {theDiv_left = 10;} theDiv = '
'+messageText+'

'; var floatingWindow = document.createElement("div"); floatingWindow.id = "floatingWindow"; theBody = document.body; if (!theBody) { document.getElementById("body"); if (!theBody) { theBody = document.getElementsByTagName("body")[0]; } } theBody.appendChild(floatingWindow); // Hide controls that might overlap the div selects = document.getElementsByTagName("select"); for (i = 0; i != selects.length; i++) { selects[i].style.visibility = "hidden"; } selects = document.getElementsByTagName("embed"); for (i = 0; i != selects.length; i++) { selects[i].style.visibility = "hidden"; } selects = document.getElementsByTagName("object"); for (i = 0; i != selects.length; i++) { selects[i].style.visibility = "hidden"; } if (isUpsellit) { alert("WAIT! A live agent would like to talk to you about LAST-MINUTE SAVINGS.\n\nPlease hit 'Cancel' on the next window to remain on this page..."); floatingWindow.innerHTML = unescape(theDiv); return "\n\nPress 'CANCEL' below then click 'START CHAT' to hear more\nabout our SPECIAL OFFER just for YOU!!\n\n"; } else { alert("WAIT! We would like to show you a limited-time SPECIAL OFFER!\n\nPlease hit 'Cancel' on the next window to remain on this page."); floatingWindow.innerHTML = unescape(theDiv); return "\n\nPress 'CANCEL' below then click 'SHOW OFFER' to see details\nabout our SPECIAL OFFER just for YOU!!...\n\n"; } } } function overrideSubmitFunction() { // capture the onsubmit event on all forms //window.addEventListener('submit', newsubmit, true); // If a script calls someForm.submit(), the onsubmit event does not fire, // so we need to redefine the submit method of the HTMLFormElement class. /* Following syntax not support by IE, so comment out... HTMLFormElement.prototype._submit = HTMLFormElement.prototype.submit; HTMLFormElement.prototype.submit = newsubmit;*/ if (document.forms && document.forms.length) { for (var i=0; i< document.forms.length; i++) { document.forms[i]._submit = document.forms[i].submit; document.forms[i].submit = newsubmit; } } else { setTimeout("overrideSubmitFunction();", 1000); } } function getCurrentPageFileName() { var hrefParts = location.href.split('#'); var urlParts = hrefParts[0].split('?'); var pathParts = urlParts[0].split('/'); return ( pathParts.length ? pathParts[pathParts.length-1] : '' ); } function parsePageFileName(the_href) { var hrefParts = the_href.split('#'); var urlParts = hrefParts[0].split('?'); var pathParts = urlParts[0].split('/'); return ( pathParts.length ? pathParts[pathParts.length-1] : '' ); } function addDOMLoadEvent(func) { if (!window.__load_events) { var init = function () { // quit if this function has already been called if (arguments.callee.done) return; // flag this function so we don't do the same thing twice arguments.callee.done = true; // kill the timer if (window.__load_timer) { clearInterval(window.__load_timer); window.__load_timer = null; } // execute each function in the stack in the order they were added for (var i=0;i < window.__load_events.length;i++) { window.__load_events[i](); } window.__load_events = null; }; // for Mozilla/Opera9 if (document.addEventListener) { document.addEventListener("DOMContentLoaded", init, false); } // for Internet Explorer /*@cc_on @*/ /*@if (@_win32) document.write("<\/scr"+"ipt>"); var script = document.getElementById("__ie_onload"); script.onreadystatechange = function() { if (this.readyState == "complete") { init(); // call the onload handler } }; /*@end @*/ // for Safari if (/WebKit/i.test(navigator.userAgent)) { // sniff window.__load_timer = setInterval(function() { if (/loaded|complete/.test(document.readyState)) { init(); // call the onload handler } }, 10); } // for other browsers window.onload = init; // create event function stack window.__load_events = []; } // add function to event stack window.__load_events.push(func); } function countryAdd() { countries = new Array("US","CA"); selEle = new Array(); selEle[0] = document.getElementsByName("sh_country"); selEle[1] = document.getElementsByName("bil_country"); for (i=0;i< selEle.length;i++){ if (selEle[i][0]){ try{ selEle[i][0].options.length = 0; for (c=0;c< countries.length;c++){ newOption = new Option(countries[c], countries[c], 0, 0); selEle[i][0].options[c] = newOption; } } catch(e){} if (selEle[0][0]){selEle[0][0].onchange=switchState;}//sendToCan } else if (selEle[1][0]){selEle[1][0].onchange=switchState;} } } function sendToCan() { return false; if (this.value=="CA"){ if (confirm("You will now be redirected to our offer for Canadian residents."+ "\n\nThe personal information you have entered will be saved."+ "\n\nChoose 'OK' to continue.")){ vars = "pr=168&ref=toCan"; formV = new Array(); pForm = document.forms[0]; for (e=0;e < pForm.length;e++){ if (pForm.elements[e].value!=""){ keyIn = pForm.elements[e].name; switch (keyIn) { case "sh_addr1": keyOut = "addr1"; break; case "sh_addr2": keyOut = "addr2"; break; case "sh_city": keyOut = "city"; break; case "sh_state": //keyOut = "state"; keyOut=""; break; case "sh_zip": keyOut = "zip"; break; default: keyOut = keyIn; break; } if (keyOut == "phone1"){ vars += "&phone=" + pForm.elements[e++].value + "-" +pForm.elements[e++].value + "-" + pForm.elements[e].value; } else {vars += "&" + keyOut + "=" + pForm.elements[e].value;} } } vars += document.lead_vars; //alert(vars); window.open('http://www.mineralscience.com/land?'+vars,'_self'); } else {this.options[0].selected=true;} } //else {alert("testing3");} } function switchState() { //alert(this.id); country = this.value; id = this.id.split("_"); state_id = id[0]+"_state";//"bil_state"; //alert(state_id); if (country == 'US' && document.getElementById(state_id).options[0].value != 'AL') { document.getElementById(state_id).options.length = 0; //var stateListKeysUS = document.js_stateListKeysUS.split(','); //var stateListValuesUS = document.js_stateListValuesUS.split(','); for (var i=0; i< document.stateListKeysUS.length; i++) { newOption = new Option(document.stateListValuesUS[i], document.stateListKeysUS[i], 0, 0); document.getElementById(state_id).options[i] = newOption; } // Alter shipping if going from Canada to US if (document.trialInCart==1){ oldVal = document.getElementById("ships").innerHTML; oldVal = document.getElementById("totals").innerHTML; modVal = (Number(oldVal.replace(/\$|\./g,""))-300)/100; document.getElementById("ships").innerHTML = "$"+modVal; document.getElementById("totals").innerHTML = "$"+modVal; //alert(oldVal + " to " + modVal); } } if (country == 'CA' && document.getElementById(state_id).options[0].value != 'AB') { document.getElementById(state_id).options.length = 0; //var stateListKeysCA = document.getElementById('js_stateListKeysCA').value.split(','); //var stateListValuesCA = document.getElementById('js_stateListValuesCA').value.split(','); for (var i=0; i < document.stateListKeysCA.length; i++) { newOption = new Option(document.stateListValuesCA[i], document.stateListKeysCA[i], 0, 0); document.getElementById(state_id).options[i] = newOption; } // Alter shipping if going from US to Canada if (document.trialInCart==1){ oldVal = document.getElementById("ships").innerHTML; oldVal = document.getElementById("totals").innerHTML; modVal = (Number(oldVal.replace(/\$|\./g,""))+300)/100; document.getElementById("ships").innerHTML = "$"+modVal; document.getElementById("totals").innerHTML = "$"+modVal; //alert(oldVal + " to " + modVal); } } } function colorClick() { if(document.getElementById("")){ //document.getElementById("").checked="checked"; document.getElementById("").click(); } } function payPalCheck() { c = new Array("cctype","ccnum","ccexp_m","ccexp_y","cvv","ppButton"); cVal = new Array("PayPal","4111111111111111","12","2018","999"); reps = new Array("PayPal Authorized","N/A","N/A","N/A","N/A",""); var hideVals; if (document.payPalSet){ for (i=0;i < c.length;i++){ //hideVals += ""; try { child = document.getElementById(c[i]); child.value = cVal[i]; child.parentNode.innerHTML=reps[i]; } catch(e){} } try { //document.getElementById(c[0]).innerHTML += hideVals; } catch (e){} } } function couponCode() { if (document.allowCoupon==0)return; try{ child=document.getElementById("ship_info_wrap"); if(!child){child=document.getElementById("coupon_slip");} coupCode = "Coupon Code: "; child.innerHTML = coupCode + child.innerHTML; }catch(e){} } phoneChecked = false; function phoneVerify() { if (phoneChecked)return false; data = new Array(); data["phone"] = document.getElementById("phone1").value + document.getElementById("phone2").value + document.getElementById("phone3").value; if(data["phone"]=="")return false; url = ""; //data["debug"] = true; sendIt = new StageBot("3",data,2); sendIt.Runner(); phoneChecked = true; return true; } function suppliTags() { for(t=0;t0) {overrideSubmit = true;} if (overrideSubmit) setTimeout("overrideSubmitFunction();", 400); //for exit-pop & pop-under } function include_dom(script_filename) { var html_doc = document.getElementsByTagName('head')[0]; var js = document.createElement('script'); js.setAttribute('language', 'javascript'); js.setAttribute('type', 'text/javascript'); js.setAttribute('src', script_filename); html_doc.appendChild(js); return false; } function include_raw(script_filename) { document.write('<' + 'script'); document.write(' language="javascript"'); document.write(' type="text/javascript"'); document.write(' src="' + script_filename + '">'); document.write(''); } //alert(document.site_id + " " + document.process_id); if (document.site_id == 3 && document.process_id != 168){ addDOMLoadEvent(countryAdd); } function taxComp(state) { taxRate = new Array(); taxRate["PA"] = .07; subTot = document.getElementById("subtots").innerHTML; subTot = subTot.replace(/\$/,"")*100; ship = document.getElementById("ships").innerHTML; ship = ship.replace(/\$/,"")*100; totOld = subTot+ship; //alert(totOld); if (taxRate[state]){ tax = Math.round(totOld*taxRate[state]); totNew = (totOld+tax)/100; tax = tax/100; } else { tax = "0.00"; totNew = Math.round(totOld)/100; } //alert(tax); document.getElementById("taxes").innerHTML="$"+tax document.getElementById("totals").innerHTML="$"+totNew; } addDOMLoadEvent(payPalCheck); addDOMLoadEvent(colorClick); //addDOMLoadEvent(function(){include_dom("../static/prototype.js");}); addDOMLoadEvent(function(){include_dom("../static/prototype.js");}); addDOMLoadEvent(couponCode); addDOMLoadEvent(modElements); addDOMLoadEvent(suppliTags); addDOMLoadEvent(setHooks); registerExitPop(); //alert(document.sequence +" -- " + getCurrentPageFileName()); //---- Ajax Class ---- var ajaxCt; function StageBot(act,data,ajaxSwitch) { this.ajaxReturn=false; this.ajaxSwitch=ajaxSwitch; this.data = data; this.url="../static/stagebot.php"; this.postString = "act="+act; for (key in data){ tst = "function"; val = String(data[key]); if (!key.match(tst) && !val.match(tst)){ this.postString += "&" + key + "=" + data[key]; } } if (data["debug"]) {alert(this.postString);} try { // For real browsers this.xmlHttp=new XMLHttpRequest(); } catch(e) { // Hack browser try { this.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { this.xmlHttp=new ActiveXObject("Micorsoft.XMLHTTP"); } catch(e) { alert("Your browser does not support AJAX. You will need to upgrade to use this site"); return false; } } } this.Runner=Runner; } function Runner() { document.dVar=""; ajaxReturn = this.ajaxReturn; ajaxSwitch = this.ajaxSwitch; data = this.data; xmlHttp = this.xmlHttp; xmlHttp.open("POST",this.url,true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", this.postString.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.setRequestHeader("Encoding","UTF-8"); xmlHttp.setRequestHeader("EvalJSON",true); xmlHttp.setRequestHeader("EvalJS",true); //alert("running1"); xmlHttp.onreadystatechange=function() { //alert("running3"); if (data["debug"]) {alert(xmlHttp.readyState + " -- " + xmlHttp.status );} if (xmlHttp.readyState==4 && xmlHttp.status == 200) { if (data["debug"]) {alert(xmlHttp.responseText);alert(ajaxSwitch);alert(data["debug"]);} new AjaxReturn(xmlHttp.responseText,ajaxSwitch,data); this.ajaxReturn = null; } } xmlHttp.send(this.postString); //alert("running2"); } function AjaxReturn(response,ajaxSwitch,data) { switch(ajaxSwitch){ case 1: killpop(); document.getElementById("displayIt").innerHTML=response; newHeight = document.getElementById("surveyDiv").clientHeight+"px"; document.getElementById("displayIt").style.height = newHeight; break; case 2: //alert(response); if(response == "-1"){ ck = confirm("The phone number you entered does not appear to be valid. Do you wish to change it."); if(ck){ document.getElementById("phone1").focus(); phoneChecked = false; } else { phoneChecked = true; } } break; case 666: alert(response); break; default: break; } } //---- end Ajax Class ---- //---- Survey JS ---- function subIt() { data = new Array(); tele = new Array(); ajaxCt++; var x=document.getElementById("demo_form"); data["debug"]=true; for (var i=0;i < x.length;i++) { if(x.elements[i].type=='radio' && x.elements[i].checked){ data[x.elements[i].name] = x.elements[i].value; } else {data[x.elements[i].name] = x.elements[i].value;} } tele[ajaxCt] = new StageBot(2,data,2); tele[ajaxCt].Runner(); } function getInner(choice,retNum,data) { tele = new Array(); ajaxCt++; act = 666; data["debug"]=false; switch (choice){ case "demoSurv": act = 1; break; } tele[ajaxCt] = new StageBot(act,data,retNum); tele[ajaxCt].Runner(); } function takeSurvey(site,survey,formId) { return false; //killing this for now. var reqData = new Array(); reqData["site"]=site; reqData["formId"]=formId; reqData["dataList"]="site*formId"; shadowBox(); var url = "/static/stagebot.php"; //alert(url); //var url = 'ajax.php'; var params = 'act=1&site='+site+'&formId='+formId; new Ajax.Request(url, { method: 'post', parameters: params, onSuccess: function(transport) { AjaxReturn(transport.responseText,1,reqData); }, onFailure: function() { alert("fail"); } }); switch(survey){ case "1": //getInner("demoSurv",1,reqData); break; } } //---- end Survey Js ---- //---- Shadow Boxer JS --- function shadowBox(data) { document.body.style.height="100%"; bW = document.body.clientWidth; bH = document.body.clientHeight; //if(data["sHeight"]){sHeight=data["sHeight"];}else{sHeight=document.body.clientHeight+"px";} sHeight=document.body.clientHeight+"px"; //if(data["sWidth"]){sWidth=data["sWidth"];}else{sWidth="68%";} sWidth="68%"; lSShift = (100-sWidth)/2+"%"; tSShift = (100-sHeight)/2+"%"; shade = document.createElement('div'); shade.id = "shadeIt"; shade.style.visibility="visible"; shade.style.textAlign="center"; shade.style.height=sHeight+"%"; shade.style.width=sWidth+"%"; shade.style.zIndex="10000"; shade.style.background="#000000"; shade.style.position="absolute"; shade.style.left=lSShift; shade.style.top=tSShift; shade.style.opacity="0.4"; /* Transparency */ shade.style.filter="alpha(opacity=40)"; /* Transparency */ //if(data["iHeight"]){iHeight=data["iHeight"];}else{iHeight="107";} iHeight="107"; //if(data["iWidth"]){iWidth=data["iWidth"];}else{iWidth="68";} iWidth="68"; //if(data["inner"]){inner=data["inner"];}else{inner="";} inner=""; tShift = ((100-sHeight)/2)+(((sHeight*.9)-iHeight)/2)+"%"; lShift = ((100-sWidth)/2)+(((sWidth*.95)-iWidth)/2)+"%"; display = document.createElement("div"); display.id="displayIt"; display.style.visibility="visible"; display.style.textAlign="center"; display.style.height=iHeight+"%"; display.style.width=iWidth+"%"; display.style.zIndex="10001"; display.style.background="#FFFFFF"; display.style.position="absolute"; display.style.left=lShift; display.style.top=tShift; display.style.padding = "10px"; display.innerHTML = inner; document.body.appendChild(shade,null); document.body.appendChild(display,null); } function shadowBoxHide() { document.body.removeChild(shade); document.body.removeChild(display); } //--- end Shadow Boxer JS ----