function createCookie(c,d,e){if(e){var b=new Date();b.setTime(b.getTime()+(e*24*60*60*1000));var a="; expires="+b.toGMTString()}else{var a=""}document.cookie=c+"="+d+a+"; path=/"}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length)}if(f.indexOf(e)==0){return f.substring(e.length,f.length)}}return null}function eraseCookie(a){createCookie(a,"",-1)}function editCookie(a){if(readCookie(a)==0){createCookie(a,1,7)}else{createCookie(a,0,7)}}function cookieRules(a){if(readCookie(a)==1){if($(a)){Element.toggle(a)}}}function trackSearch(b,a){var c=new Image(1,1);var d=1;c.src="http://analytics.nextopia.net/x.php?r="+Math.floor(Math.random()*200)+"&amp;v=<%= this.Keyword %>&amp;w="+b+"&amp;x="+a+"&amp;z="+d+"&amp;y=";document.getElementById("cbs").innerHTML="<img src='"+c.src+"' alt='Nextopia Search Tracking' />";return true}function toggleTags(b){if($(b)){var a=$(b);a.each(function(c){$(this).toggle(c)})}}function getPageScroll(){var a;if(self.pageYOffset){a=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body){a=document.body.scrollTop}}}return a}function getPageSize(){var c,a;if(window.innerHeight&&window.scrollMaxY){c=document.body.scrollWidth;a=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){c=document.body.scrollWidth;a=document.body.scrollHeight}else{c=document.body.offsetWidth;a=document.body.offsetHeight}}var b,d;if(self.innerHeight){b=self.innerWidth;d=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){b=document.documentElement.clientWidth;d=document.documentElement.clientHeight}else{if(document.body){b=document.body.clientWidth;d=document.body.clientHeight}}}if(a<d){pageHeight=d}else{pageHeight=a}if(c<b){pageWidth=b}else{pageWidth=c}arrayPageSize=new Array(pageWidth,pageHeight,b,d);return arrayPageSize}function imgActions(d,c){src=d.src;var a=src.substr(src.lastIndexOf("."),src.length);if(c=="over"){var b=src.substr(0,src.lastIndexOf("."));overSrc=b+"_h"+a;return overSrc}if(c=="out"){var b=src.substr(0,src.lastIndexOf("_"));outSrc=b+a;return outSrc}if(c=="click"){var b=src.substr(0,src.lastIndexOf("_"));clickSrc=b+"_c"+a;return clickSrc}}function enterSubmitFix(b,c){if((c.which&&c.which==13)||(c.keyCode&&c.keyCode==13)){var a=document.getElementById(b.split(":").join("_"));if(a.type=="button"||a.type=="image"||a.type=="submit"){a.focus();a.click()}else{__doPostBack(b.split(":").join("$"),"")}return false}else{return true}}function setFocus(a){setFocusWithScroll(a,false)}function setFocusWithScroll(a,b){var c=document.getElementById(a);c.focus();if(b){c.scrollIntoView()}}function HashTable(){this.hashTable=new Array();this.length=0;this.get=hash_get;this.put=hash_put}function hash_get(a){return this.hashTable[a]}function hash_put(a,b){if(a!=null&&b!=null){this.hashTable[a]=b;this.length++}}function addErrorNotification(c){var a=document.getElementById("divNotifications");var b=document.getElementById("notificationMessages");a.style.color="#ec0088";addNotificationMessage(a,b,c)}function addNotification(c){var a=document.getElementById("divNotifications");var b=document.getElementById("notificationMessages");a.style.color="#000";addNotificationMessage(a,b,c)}function addNotificationMessage(a,b,c){a.style.visibility="visible";b.innerHTML+="<li>"+c+"</li>"}function clearNotifications(){var a=document.getElementById("notificationMessages");a.innerHTML=""}function hasNotifications(){var a=document.getElementById("notificationMessages");if(a.innerHTML.length>0){return true}else{return false}}function offerBoxSelected(a){var b=document.getElementById("viewCart_offerCodeCheckbox_offerCode");if(b==null){b=document.getElementById("checkOutShipMethods_offerCodeCheckbox_offerCode")}if(a.checked){b.value="true"}else{b.value="false"}}function checkEmail(a){var b=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(b.test(a)){return true}return false}function GetDeliveryDates(c,g){var b=["January","February","March","April","May","June","July","August","September","October","November","December"];clearNotifications();var a=document.getElementById(c);var d=document.getElementById(g);var f=/^\d{5}([\-]\d{4})?$/;if(d.value.match(f)==null){addErrorNotification("Please enter valid U.S. Zip Code.")}if(!hasNotifications()){var e=postdataStart+'<EstimatedDeliveryDatesDomestic xmlns="http://tempuri.org/">\n<PostalCode>'+d.value+"</PostalCode>\n<State>"+a.options[a.selectedIndex].value+"</State>\n</EstimatedDeliveryDatesDomestic>\n"+postdataEnd;var h=new Array("Content-Type","text/xml; charset=utf-8","Content-Length",e.length,"SOAPAction","http://tempuri.org/EstimatedDeliveryDatesDomestic","Host",location.hostname);$.ajax({type:"POST",url:"http://"+location.hostname+"/WebServices.asmx?WSDL",data:e,headers:h,contentType:"text/xml; charset=utf8",dataType:"xml",success:function(p){var s=p.getElementsByTagName("ShipMethod");if(s.length>0){var q=$("#divDeliveryDates");q.show();var w=$("#tblDeliveryDates");var o="<thead><th>Ship Method</th><th>Estimated Delivery Date</th></thead>";for(var n=0;n<s.length;n++){var k="";var l="";for(var m=0;m<s[n].childNodes.length;m++){var t=s[n].childNodes[m].nodeName;var r=s[n].childNodes[m].firstChild.nodeValue;if(t=="EstimatedDelivery"){l=r.split(" ")[0]}else{if(t=="Name"){k=r}}}var u=l.split("/");var v="<tr>";v+="<td>"+k+"</td><td>"+b[parseInt(u[0])-1]+", "+u[1]+" "+u[2]+"</td>";v+="</tr>";o+=v}w.html(o)}},error:function(i){addErrorNotification("An error has occurred retrieving estimated delivery dates.")}})}};
