// JavaScript Document
function TreeCollection(){this.nodes=new Array()}TreeCollection.prototype.addChild=function(a){this.nodes[this.nodes.length]=a;return this.nodes[this.nodes.length-1]};TreeCollection.prototype.getNodeById=function(d){var b=(typeof arguments[1]=="undefined")?this:arguments[1];for(var c in b.nodes){if(b.nodes[c].id==d){return b.nodes[c]}if(b.nodes[c].hasChildren()){var a=this.getNodeById(d,b.nodes[c]);if(a){return a}}}return false};TreeCollection.prototype.getNodeByName=function(d){var b=(typeof arguments[1]=="undefined")?this:arguments[1];for(var c in b.nodes){if(b.nodes[c].name==d){return b.nodes[c]}if(b.nodes[c].hasChildren()){var a=this.getNodeByName(d,b.nodes[c]);if(a){return a}}}return false};TreeCollection.prototype.removeNode=function(b){for(var a in this.nodes){if(this.nodes[a].id==b){this.nodes.splice(a,1);return true}if(this.nodes[a].hasChildren()){this.nodes[a].removeNode(b)}}};TreeCollection.prototype.hasChildren=function(){return(this.nodes.length>0)};var __treenodes=[];function TreeNode(){var a;while(a=this.generateID()){if(!__treenodes[a]){break}}this.id=__treenodes[a]=a;this.name=(typeof arguments[0]=="undefined")?null:arguments[0];this.data=(typeof arguments[1]=="undefined")?null:arguments[1];this.nodes=(typeof arguments[2]=="undefined")?new Array():arguments[2]}TreeNode.prototype.generateID=function(){return Math.floor(Math.random()*999999-100000+1)+999999};TreeNode.prototype.addChild=function(a){this.nodes[this.nodes.length]=a;return this.nodes[this.nodes.length-1]};TreeNode.prototype.addChildren=function(a){for(var b in a){this.nodes[this.nodes.length]=a[b]}};TreeNode.prototype.removeNode=function(b){for(var a in this.nodes){if(this.nodes[a].id==b){this.nodes.splice(a,1);return true}if(this.nodes[a].hasChildren()){this.nodes[a].removeNode(b)}}};TreeNode.prototype.clearNodes=function(){this.nodes.length=0};TreeNode.prototype.hasChildren=function(){return(this.nodes.length>0)};TreeNode.prototype.toString=function(){return this.id};var WZS_NORMAL=1;var WZS_DISPOSABLE=2;var WZS_CONDITIONAL=3;function Wizard(){this.activeStep=null;this.activeStepNum=-1;try{this.steps=new TreeCollection()}catch(a){alert("Error\n\nCould not load TreeCollection.")}this.stepChanged=null}Wizard.prototype.totalSteps=function(){return this.steps.nodes.length};Wizard.prototype.getStep=function(a){return this.steps.nodes[(a-1)]};Wizard.prototype.addStep=function(c,d,b){if(d==null){return false}var a=this.steps.addChild(new TreeNode(c,d));a.wzsType=b;switch(b){case WZS_DISPOSABLE:a.wzsDisposed=false;break;case WZS_CONDITIONAL:a.wzsCondition=arguments[3];break;default:case WZS_NORMAL:break}a.StepNum=this.steps.nodes.length;return a};Wizard.prototype._getCurrentStepIndex=function(){for(var a in this.steps.nodes){if(this.steps.nodes[a].StepNum==this.activeStepNum){return parseInt(a)}}};Wizard.prototype.InitializeStep=function(a){if(this.activeStep==a){a.data.style.display="block"}else{a.data.style.display="none"}};Wizard.prototype.Initialize=function(){if(this.activeStep==null){this.activeStep=this.steps.nodes[0];this.activeStepNum=this.activeStep.StepNum;if(this.activeStep.wzsType==WZS_DISPOSABLE){this.activeStep.wzsDisposed=true}}for(var a in this.steps.nodes){this.InitializeStep(this.steps.nodes[a])}};Wizard.prototype.Refresh=function(){for(var a in this.steps.nodes){this.InitializeStep(this.steps.nodes[a])}};Wizard.prototype.showStep=function(c){var b=c>this.activeStepNum?"Next":"Back";var a;if(c==this.activeStepNum){return false}while(this.activeStepNum!=c&&(a=this[b](true))){}this.stepChanged()};Wizard.prototype.Next=function(bFromShowStep){if(this.activeStep==this.steps.nodes[this.steps.nodes.length-1]){return false}if(eval("(typeof "+this.activeStep.data.id+'_onexit == "function"); ')){if(false===eval(this.activeStep.data.id+"_onexit(true); ")){return false}}this.activeStep.data.style.display="none";var stepContinue=true;var step_change=1;while(stepContinue){var prevstep=this.activeStep;var tn=this.steps.nodes[(this._getCurrentStepIndex()+step_change)];if(typeof tn=="undefined"){return false}switch(tn.wzsType){default:case WZS_NORMAL:this.activeStep=tn;this.activeStepNum=tn.StepNum;stepContinue=false;break;case WZS_DISPOSABLE:if(!tn.wzsDisposed){this.activeStep=tn;this.activeStepNum=tn.StepNum;tn.wzsDisposed=true;stepContinue=false;break}else{step_change++;break}case WZS_CONDITIONAL:var val=(typeof tn.wzsCondition=="function")?tn.wzsCondition():tn.wzsCondition;if(val){this.activeStep=tn;this.activeStepNum=tn.StepNum;stepContinue=false;break}else{step_change++;break}}}prevstep.complete=true;if(eval("(typeof "+this.activeStep.data.id+'_onenter == "function"); ')){eval(this.activeStep.data.id+"_onenter(); ")}this.activeStep.data.style.display="block";if(this.stepChanged!=null&&!bFromShowStep){this.stepChanged()}return true};Wizard.prototype.Back=function(bFromShowStep){if(this.activeStep==this.steps.nodes[0]){return false}if(eval("(typeof "+this.activeStep.data.id+'_onexit == "function"); ')){if(false===eval(""+this.activeStep.data.id+"_onexit(); ")){return false}}this.activeStep.data.style.display="none";var stepContinue=true;var step_change=1;while(stepContinue){var tn=this.steps.nodes[(this._getCurrentStepIndex()-step_change)];if(typeof tn=="undefined"){return false}switch(tn.wzsType){default:case WZS_NORMAL:this.activeStep=tn;this.activeStepNum=tn.StepNum;stepContinue=false;break;case WZS_DISPOSABLE:if(!tn.wzsDisposed){this.activeStep=tn;this.activeStepNum=tn.StepNum;tn.wzsDisposed=true;stepContinue=false;break}else{step_change++;break}case WZS_CONDITIONAL:var val=(typeof tn.wzsCondition=="function")?tn.wzsCondition():tn.wzsCondition;if(val){this.activeStep=tn;this.activeStepNum=tn.StepNum;stepContinue=false;break}else{step_change++;break}}}if(eval("(typeof "+this.activeStep.data.id+'_onenter == "function"); ')){eval(""+this.activeStep.data.id+"_onenter(); ")}this.activeStep.data.style.display="block";if(this.stepChanged!=null&&!bFromShowStep){this.stepChanged()}return true};function update_total(b,d){var c=0;for(var a in DesignPrices){if(DesignPrices[a].selected!=null){if(a=="coupon-code"&&d){continue}c+=typeof DesignPrices[a].selected=="function"?DesignPrices[a].selected(c):DesignPrices[a][DesignPrices[a].selected]}}if(b){return c.toFixed(2)}else{get("total").innerHTML=c.toFixed(2)}}function update_price_label(a,b){if(typeof b=="undefined"){a.style.display="none";return}a.style.display="block";a.innerHTML=b==0?"Included":("$"+parseFloat(b).toFixed(2))}function update_list(f,b,e){if(!f.options||b==""){return}var h,a,c,g;for(var d=0;d<f.options.length;d++){h=f.options[d].value;a=f.options[d].text;if(typeof DesignPrices[f.name][h]=="undefined"){continue}g=e?DesignPrices[f.name][h].toFixed(2):(0-(DesignPrices[f.name][b]-DesignPrices[f.name][h])).toFixed(2);c=a.indexOf("[ ")>-1?a.split("[ ")[0]:a;if(b==h){f.options[d].text=c}else{f.options[d].text=c+" [ "+(g.substr(0,1)=="-"?("subtract $"+g.substr(1)):("add $"+g))+" ]"}}}_noindic=0;var DesignEvents={init:false,always:function(a){if(a.options||typeof a.checked!="undefined"){update_total()}if(!DesignEvents.init){return}if(a.options){check_coupon()}if(_noindic===0){show_indicator()}else{(_noindic===2)}show_indicator(true)},_default:function(b,a,c){if(typeof DesignPrices[a.name]!="undefined"&&a.options){DesignPrices[a.name].selected=c;DesignPrices[a.name].selectedtxt=a.options[a.selectedIndex].text.split("[")[0].replace(/^\s+|\s+$/g,"");update_list(a,c);update_price_label(get("price-"+a.name),DesignPrices[a.name][c])}},"extra-photogallery":function(b,a,c){var d=get("ddnPhotos");if(a.checked){d.disabled=false;DesignEvents._default(b,d,d.options[d.selectedIndex].value)}else{get("ddnPhotos").disabled=true;DesignPrices["extra-photogallery-additional"].selected=null;get("price-extra-photogallery-additional").style.display="none"}},"extra-dataforms":function(d,b,f){var a=get("ddnDataContact");var c=get("ddnDataRegistration");if(b.checked){a.disabled=c.disabled=false;DesignEvents._default(d,a,a.options[a.selectedIndex].value);DesignEvents._default(d,c,c.options[c.selectedIndex].value)}else{a.disabled=c.disabled=true;DesignPrices["extra-dataforms-contact"].selected=null;DesignPrices["extra-dataforms-registration"].selected=null;get("price-extra-dataforms-contact").style.display="none";get("price-extra-dataforms-registration").style.display="none"}},"extra-paypal":function(b,a,c){var d=get("ddnPaypal");if(a.checked){d.disabled=false;DesignEvents._default(b,d,d.options[d.selectedIndex].value)}else{d.disabled=true;DesignPrices["extra-paypal-products"].selected=null;get("price-extra-paypal-products").style.display="none"}},"extra-forum":function(c,b,d){var a=get("ddnForum");if(b.checked){a.disabled=false;DesignEvents._default(c,a,a.options[a.selectedIndex].value)}else{a.disabled=true;DesignPrices["extra-forum-product"].selected=null;get("price-extra-forum-product").style.display="none"}},"extra-blog":function(c,b,d){var a=get("ddnBlog");if(b.checked){a.disabled=false;DesignEvents._default(c,a,a.options[a.selectedIndex].value)}else{a.disabled=true;DesignPrices["extra-blog-product"].selected=null;get("price-extra-blog-product").style.display="none"}},"extra-sesubmission":function(c,b,d){var a=get("ddnSESubmission");if(b.checked){a.disabled=false;DesignEvents._default(c,a,a.options[a.selectedIndex].value)}else{a.disabled=true;DesignPrices["extra-sesubmission-packages"].selected=null;get("price-extra-sesubmission-packages").style.display="none"}},"extra-seo":function(c,b,d){var a=get("ddnSEO");DesignPrices["extra-seo-packages"].basic=(DesignPrices.pages.selected!=null?parseInt(DesignPrices.pages.selected):5)*10;DesignPrices["extra-seo-packages"].plus=(DesignPrices.pages.selected!=null?parseInt(DesignPrices.pages.selected):5)*17;if(b.checked){a.disabled=false;DesignEvents._default(c,a,a.options[a.selectedIndex].value)}else{a.disabled=true;DesignPrices["extra-seo-packages"].selected=null;get("price-extra-seo-packages").style.display="none"}},"extra-seo-packages":function(b,a,c){this["extra-seo"](b,get("chkSEO"),c)}};_active_el_cont=false;function para_active(b){var a=evsrc(b);var d=hasclass(a,"element")?a:findParentNode(a,"DIV");if(_active_el_cont){_active_el_cont.className="element"}_active_el_cont=d;d.className="element active"}function bind_field_events(){var b;for(var a=0;a<document.forms[0].elements.length;a++){b=document.forms[0].elements[a];if(b.nodeName=="HIDDEN"){continue}if(b.nodeName.toString().inn("INPUT","TEXTAREA")){if(b.type.toString()=="checkbox"){addEvent(b,"change",field_updated)}else{addEvent(b,"keyup",field_updated)}}else{if(b.nodeName=="SELECT"){addEvent(b,"change",field_updated)}}field_updated(false,b)}}function field_updated(a){var c=arguments[1]?arguments[1]:false;if(!c&&!a){var a=window.event}if(a){c=evsrc(a)}if(c.disabled){return}var b=get_field_value(c);if(b==""){return}if(typeof DesignEvents[c.name]=="function"){DesignEvents[c.name](a,c,b)}else{DesignEvents._default(a,c,b)}DesignEvents.always(c)}function get_field_value(c){switch(c.type){default:return c.value;case"radio":case"checkbox":return(c.checked?"t":"f");case"select-multiple":var b=[];for(var a=0;a<c.options.length;a++){if(c.options[a].selected){b.push(c.options[a].value)}}return simple_json(b);case"select-one":return c.options[c.selectedIndex].value}return""}function simple_json(a,c){var d="";for(var b in a){d+=', "'+b+'" : "'+(c?a[b].replace(/"/g,'\\"').replace(/\n/g,"{{*NL}}").replace(/\r/g,""):a[b])+'"'}return"{ "+d.substr(2)+" }"}function show_indicator(a){if(w.activeStepNum==8){return}if(a){setTimeout("if(w.activeStepNum=="+w.activeStepNum+") show_indicator();",2000)}else{get("indicator").style.visibility="visible";if(get("guarantee")){get("guarantee").style.visibility="hidden"}_noindic=1}}function get(a){return document.getElementById(a)}String.prototype.toArray=function(){var b=this.split("&");var a=new Array();for(var d in b){var c=b[d].split("=");a[c[0]]=c[1]}return a};String.prototype.inn=function(){var a=[];if(arguments.length>1){for(var b=0;b<arguments.length;b++){a[b]=arguments[b]}}else{if(typeof arguments[0]=="string"&&arguments[0].indexOf(",")>-1){a=arguments[0].split(",")}else{a=arguments[0]}}for(var b in a){if(a[b]==this){return true}}return false};String.prototype.repeat=function(a){return new Array(a+1).join(this)};function isDescendantOf(c,b){try{if(b.contains){if(b.contains(c)&&!b.contains(get("__!)(@&__"))){return true}}}catch(a){}var d=c;while(d.parentNode&&false!=(d=d.parentNode)){if(d==b){return true}}return false}function getChildren(c){var b=[];if(c&&c.hasChildNodes()){for(var a in c.childNodes){if(c.childNodes[a]&&c.childNodes[a].nodeType==1){b[b.length]=c.childNodes[a]}}}return b}function getNextSibling(a){if(!a||!a.nextSibling){return false}do{a=a.nextSibling}while(a.nextSibling&&a.nodeType!=1);return a.nodeType!=1?false:a}function getPrevSibling(a){if(!a||!a.previousSibling){return false}do{a=a.previousSibling}while(a.previousSibling&&a.nodeType!=1);return a.nodeType!=1?false:a}function getParentNode(b){var a;while((a=b.parentNode)&&a!=document){}return !a||a==document?false:a}function findParentNode(d,e,c){var b=0;var a=1000;if(!c){c=document.body}do{d=d.parentNode;b++;if(b>=a||d==c){return false}}while(d.nodeName!=e);return d==c?false:d}function findChildById(e,f,h,d){if(false===h){h=5}if(h==0){return false}if(!d){d="id"}var g=getChildren(e);var a;for(var b=0;b<g.length;b++){if(g[b][d]==f){return g[b]}if(g[b].hasChildNodes()&&false!=(a=findChildById(g[b],f,(h-1)))){return a}}return false}function findParentById(c,d,f,b){if(typeof f=="undefined"){f=5}if(f==0){console.log("max depth...");return false}if(!b){b="id"}var e=getParentNode(c);if(!e){console.log("now parent...");return false}console.info("Parent: ",e);var a;if(e[b]==d){return e}if(false!=(a=findParentById(e,d,(f-1)))){return a}return false}function newElement(a){return document.createElement(a)}function getMousePos(b){var a=0;var c=0;if(!b){var b=window.event}if(b.pageX||b.pageY){a=b.pageX;c=b.pageY}else{if(b.clientX||b.clientY){a=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;c=b.clientY+document.body.scrollTop+document.documentElement.scrollTop}}return{x:a,y:c}}function addEvent(c,b,a){if(c.addEventListener){c.addEventListener(b,a,false)}else{if(c.attachEvent){c["e"+b+a]=a;c[b+a]=function(){c["e"+b+a](window.event)};c.attachEvent("on"+b,c[b+a])}}}function removeEvent(c,b,a){if(c.removeEventListener){c.removeEventListener(b,a,false)}else{if(c.detachEvent){c.detachEvent("on"+b,c[b+a]);c[b+a]=null;c["e"+b+a]=null}}}function evsrc(a){var b=false;if(a.target){b=a.target}else{if(a.srcElement){b=a.srcElement}}if(b.nodeType==3){b=b.parentNode}return b}function hasclass(c,d){if(!c||!c.className){return false}var b=c.className.split(" ");for(var a=0;a<b.length;a++){if(b[a]==d){return true}}return false}function evstop(b,a,c){if(!b){return}if(a){b.cancelBubble=true;if(b.stopPropagation){b.stopPropagation()}}if(c){if(b.preventDefault){b.preventDefault()}b.returnValue=false;return false}}function height(c){var b=parseInt(computed(c,"margin-top"))||0;var e=parseInt(computed(c,"margin-bottom"))||0;var a=parseInt(computed(c,"border-top-width"))||0;var d=parseInt(computed(c,"border-bottom-width"))||0;return(c.offsetHeight+b+e+a+d)}function computed(a,c){if(a.currentStyle){if(c.indexOf("-")>-1){c=c.split("-")[0]+c.split("-")[1].substr(0,1).toUpperCase()+c.split("-")[1].substr(1)}var b=a.currentStyle[c]}else{if(window.getComputedStyle){var b=document.defaultView.getComputedStyle(a,"").getPropertyValue(c)}}return b}var Tabs={inst:[],listtype:"UL",bodyinst:[],init:function(c,a,b){if(!b){b=0}var d=this.inst.length;c.tabId=d;this.inst[d]=c;this.bodyinst[d]=a;addEvent(c,"click",Tabs.click);this.select(d,b)},instance:function(b){if(b.nodeName!=Tabs.listtype){b=findParentNode(b,Tabs.listtype)}for(var a=0;a<Tabs.inst.length;a++){if(Tabs.inst[a]==b){return a}}return false},select:function(a,e){var f=Tabs.inst[a];var h=getChildren(f);var g=getChildren(Tabs.bodyinst[a]);if(typeof console!="undefined"&&h.length!=g.length){return console.error("Tabs: The number of elements in the tabs and body do not match.")}var d=typeof e=="number"?h[e]:e;for(var b=0;b<h.length;b++){h[b].className=g[b].className=(h[b]==d?"selected":"")}},click:function(c,d){var b=evsrc(c);var a=Tabs.instance(b);if(b==Tabs.inst[a]){return false}if(b.nodeName!="LI"){b=findParentNode(b,"LI",Tabs.inst[a])}Tabs.select(a,b)}};var extras=get("extras").getElementsByTagName("LI");for(var i=0;i<extras.length;i++){var chk=extras[i].getElementsByTagName("INPUT");var bod;if(chk.length>0){addEvent(chk[0],"click",extra_clicked);extra_clicked(false,chk[0])}}function extra_clicked(f,d){var c=!f?d:evsrc(f);var a=findParentNode(c,"LI");var b,g;var g=findChildById(a,"header");g.className=c.checked?"active":"";if(false!=(b=findChildById(a,"body"))){if(c.checked){b.style.display="block"}else{b.style.display="none"}}c.blur();evstop(f,true);return false}document.forms[0].reset();if(typeof AUTOSEL_OPTIONS!="undefined"){var el;for(var i in AUTOSEL_OPTIONS){el=get(i);if(el.options){for(var opt=0;opt<el.options.length;opt++){if(el.options[opt].value==AUTOSEL_OPTIONS[i]){el.selectedIndex=opt;break}}}}}var coupontxt=get("txtCouponCode");coupontxt.readOnly=false;coupontxt.className="";var disabled=["ddnPhotos","ddnDataContact","ddnDataRegistration","ddnForum","ddnPaypal","ddnSESubmission","ddnSEO"];var bod;for(var i=0;i<disabled.length;i++){get(disabled[i]).disabled=true}w=new Wizard();w.addStep("",get("design"));w.addStep("",get("pages"));w.addStep("",get("logodesign"));w.addStep("",get("extras"));w.addStep("",get("updates"));w.addStep("",get("webhosting"));w.addStep("",get("coupon"));w.addStep("",get("confirm"));function step_verify(e,c){if(typeof e!="object"){e=[e]}if(typeof c!="object"){c=[c]}var d;var a=true;for(var b=0;b<e.length;b++){d=get(e[b]);if(d.options[d.selectedIndex].value==""){findParentNode(d,"DIV").className="error";alert(c[b]);a=false}else{findParentNode(d,"DIV").className=""}}return a}function design_onexit(a){if(!a){return true}return step_verify("ddnDesign","A design for your website is required.  You must select one of the options from the dropdown menu.")}function pages_onexit(a){if(!a){return true}return step_verify("ddnPages","At the very least, a website requires one page.  Choose the number of web pages you require from the dropdown menu.")}function confirm_onenter(){var d='<p>Verify that your order is correct and then click one of the "Checkout" buttons.</p>';var f="";var a;var e="";var g=0;for(var b in DesignPrices){if(DesignPrices[b].selected==null||DesignPrices[b].selected=="no"){continue}e=g%2?' style="background:#eaeaea;"':' style="background:#fafafa;"';a=typeof DesignPrices[b].selected=="function"?DesignPrices[b].selected(update_total(true,true)):DesignPrices[b][DesignPrices[b].selected];f=DesignPrices[b][DesignPrices[b].selected]==0?"<em>Included</em>":("$"+a.toFixed(2));d+="<tr"+e+"><td colspan=2><strong>"+DesignPrices[b].name+(DesignPrices[b].group?(" ("+DesignPrices[b].group+")"):"")+'</strong> <sup><a href="#" onclick="w.showStep('+DesignPrices[b].step+'); return false;">edit</a></sup></td></tr><tr'+e+'><td style="padding-left:30px;">'+DesignPrices[b].selectedtxt+'</td><td align="right"'+(parseFloat(f.substr(1))<0?' class="highlight"':"")+">"+f+"</td></tr>";g++}d+='<tr><td colspan=2 align="right" style="border-top:2px solid #ccc; padding:7px 0 7px 7px;"><strong>Total $'+get("total").innerHTML+"</strong></td></tr>";get("order-confirm").innerHTML='<table cellpadding=3 cellspacing=0 border=0 width="100%">'+d+"</table>"}w.Initialize();w.stepChanged=function(){HashHistory.historyLoad(w.activeStepNum);if(_noindic===1){get("indicator").style.visibility="hidden";if(get("guarantee")){get("guarantee").style.visibility="visible"}_noindic=2}if(w.activeStepNum>=8){get("next").innerHTML=get("continue").innerHTML="Submit &amp; Pay &raquo;"}else{if(w.activeStepNum<8&&get("next").innerHTML.indexOf("Next")<0){get("continue").innerHTML=get("next").innerHTML="Continue &raquo;"}}var b;switch(w.activeStepNum){case 3:b=get("ddnLogo");DesignEvents._default(false,b,b.options[b.selectedIndex].value);break;case 4:DesignEvents["extra-seo"](false,get("chkSEO"),"basic");break}var d=getChildren(get("iconabbrev"));for(var a=0;a<d.length;a++){if(d[a].id=="icon-abbrev"){d[a].className=(a+1)==w.activeStepNum?"active":""}}};bind_field_events();Tabs.init(get("design-tabs"),get("design-tabbody"));Tabs.init(get("pages-tabs"),get("pages-tabbody"));Tabs.init(get("logo-tabs"),get("logo-tabbody"));Tabs.init(get("updates-tabs"),get("updates-tabbody"));Tabs.init(get("hosting-tabs"),get("hosting-tabbody"));addEvent(get("back"),"click",next_click);addEvent(get("next"),"click",next_click);addEvent(get("continue"),"click",next_click);function next_click(b){var a=evsrc(b);if(w.activeStepNum==8&&a.id!="back"){document.forms[0].submit()}else{if(a.id=="back"){w.Back()}else{w.Next()}a.blur()}if(a.id!="continue"){if(b.stopPropagation){b.stopPropagation();b.preventDefault()}b.cancelBubble=true;b.returnValue=false;return false}}function xget(d,a,c){var b=false;if(window.XMLHttpRequest){b=new XMLHttpRequest()}else{if(window.ActiveXObject){b=new ActiveXObject("Microsoft.XMLHTTP")}}b.open("GET",d,true);b.onreadystatechange=function(){if(b.readyState==4&&b.status==200){if(typeof a=="function"){a(b.responseText,c)}}else{if(b.readyState==4&&b.status!=200){alert("Error performing the request.")}}};b.send(null)}var HashHistory={ismsie:false,issafari:false,historyCurrentHash:null,historyCallback:null,historyInit:function(e){HashHistory.ismsie=(navigator.userAgent.toLowerCase().indexOf("msie")>-1&&!window.opera);HashHistory.issafari=(navigator.userAgent.toLowerCase().indexOf("webkit")>-1);HashHistory.historyCallback=e;var d=location.hash;HashHistory.historyCurrentHash=d;if(HashHistory.ismsie){if(HashHistory.historyCurrentHash==""){HashHistory.historyCurrentHash="#"}var b=newElement("IFRAME");b.id="iHashHistory";b.style.display="none";document.body.insertBefore(b,getChildren(document.body)[0]);var a=get("iHashHistory");var c=a.contentWindow.document;c.open();c.close();c.location.hash=d}else{if(HashHistory.issafari){HashHistory.historyBackStack=[];HashHistory.historyBackStack.length=history.length;HashHistory.historyForwardStack=[];HashHistory.isFirst=true}}HashHistory.historyCallback(d.replace(/^#/,""));setInterval(HashHistory.historyCheck,100)},historyAddHistory:function(a){HashHistory.historyBackStack.push(a);HashHistory.historyForwardStack.length=0;HashHistory.isFirst=true},historyCheck:function(){if(HashHistory.ismsie){var a=get("iHashHistory");var d=a.contentDocument||a.contentWindow.document;var f=d.location.hash;if(f!=HashHistory.historyCurrentHash){location.hash=f;HashHistory.historyCurrentHash=f;HashHistory.historyCallback(f.replace(/^#/,""))}}else{if(HashHistory.issafari){if(!HashHistory.dontCheck){var b=history.length-HashHistory.historyBackStack.length;if(b){HashHistory.isFirst=false;if(b<0){for(var c=0;c<Math.abs(b);c++){HashHistory.historyForwardStack.unshift(HashHistory.historyBackStack.pop())}}else{for(var c=0;c<b;c++){HashHistory.historyBackStack.push(HashHistory.historyForwardStack.shift())}}var e=HashHistory.historyBackStack[HashHistory.historyBackStack.length-1];if(e!=null){HashHistory.historyCurrentHash=location.hash;HashHistory.historyCallback(e)}}else{if(HashHistory.historyBackStack[HashHistory.historyBackStack.length-1]==null&&!HashHistory.isFirst){if(document.URL.indexOf("#")>=0){HashHistory.historyCallback(document.URL.split("#")[1])}else{var f=location.hash;HashHistory.historyCallback("")}HashHistory.isFirst=true}}}}else{var f=location.hash;if(f!=HashHistory.historyCurrentHash){HashHistory.historyCurrentHash=f;HashHistory.historyCallback(f.replace(/^#/,""))}}}},historyLoad:function(d){var e;if(HashHistory.issafari){e=d}else{e="#"+d;location.hash=e}HashHistory.historyCurrentHash=e;if(HashHistory.ismsie){var a=get("iHashHistory");var c=a.contentWindow.document;c.open();c.close();c.location.hash=e;HashHistory.historyCallback(d)}else{if(HashHistory.issafari){HashHistory.dontCheck=true;this.historyAddHistory(d);var b=function(){HashHistory.dontCheck=false};window.setTimeout(b,200);HashHistory.historyCallback(d);location.hash=e}else{HashHistory.historyCallback(d)}}}};function hashchanged(a){if(!w.getStep(1).complete||parseInt(a).toString()=="NaN"){return}w.showStep(a)}addEvent(window,"load",function(){HashHistory.historyInit(hashchanged);DesignEvents.init=true});addEvent(get("update-coupon"),"click",get_coupon);CouponCache={code:null,data:{}};function check_coupon(){var a=get("txtCouponCode");var b=a.value;reset_coupon();a.value=b;get_coupon()}function get_coupon(c){var b=get("update-coupon");var a=get("txtCouponCode");if(a.value!=""){if(b.innerHTML=="Change"){reset_coupon()}else{reset_coupon();if(a.value==CouponCache.code){coupon_returned(CouponCache.data,CouponCache.code)}else{xget("?aj=coupon&code="+escape(a.value),coupon_returned,a.value)}}b.blur()}if(c){if(c.stopPropagation){c.stopPropagation();c.preventDefault()}c.returnValue=false;c.cancelBubble=true}return false}function reset_coupon(d){DesignPrices["coupon-code"].selected=null;var b=get("coupon-error");var c=get("update-coupon");var a=get("txtCouponCode");if(!d){b.innerHTML="";b.style.display="none"}a.readOnly=false;a.className="";c.innerHTML="Update";update_total();get("price-coupon-code").style.display="none"}function coupon_returned(data,code){reset_coupon();CouponCache.code=code;CouponCache.data=data;var data=eval("("+data+")");var error=get("coupon-error");var btn=get("update-coupon");var txt=get("txtCouponCode");txt.readOnly=true;txt.className="readonly";btn.innerHTML="Change";if(data==null){error.innerHTML="The coupon code you entered is not valid.";error.style.display="block";update_total();reset_coupon(true);return}var field,m;var allmatched=true;for(var i=0;i<document.forms[0].elements.length;i++){field=document.forms[0].elements[i];if(field.nodeName=="HIDDEN"){continue}for(var ii in data.match){if(ii==field.name){m=in_array(get_field_value(field),data.match[ii]);if(!m){allmatched=false;break}}}}if(allmatched){if(typeof data.total=="string"){coupon_total=data.total;DesignPrices["coupon-code"].selected=function(){if(DesignPrices[coupon_total].selected!=null){return(0-DesignPrices[coupon_total][DesignPrices[coupon_total].selected])}else{return null}}}else{coupon_total=parseFloat(data.total);DesignPrices["coupon-code"].selected=function(total){if(coupon_total<1){return(0-(total*coupon_total))}else{return(0-data.total)}}}update_price_label(get("price-coupon-code"),DesignPrices["coupon-code"]["selected"](parseFloat(get("total").innerHTML)));DesignPrices["coupon-code"].selectedtxt=data.name;update_total()}else{error.innerHTML="Your order does not qualify for the coupon code you entered.";error.style.display="block";update_total();reset_coupon(true);return}}function in_array(c,a){for(var b=0;b<a.length;b++){if(a[b]==c){return true}}return false};