function enlarge(_1){
window.open(_1,"productphoto","menubar=0,resizable=1,width=400,height=400");
}
function validateAddToCart(e){
if(!document.getElementById("fQty").value.match(/\D/)){
document.getElementById("frmCart").submit();
}else{
alert("Please enter a quantity of at least 1.");
return false;
}
}
function initAccountForm(){
addEvent(document.getElementById("fShipSameAsBill"),"click",cloneShippingToggle);
if(document.getElementById("fShipSameAsBill").checked){
setShippingDisabled(true);
cloneShippingInfo();
}
}
cloneShippingToggle=function(){
setShippingDisabled(this.checked);
if(this.checked){
cloneShippingInfo();
}
var _3=["fShippingName","fShippingAddress","fShippingAddress2","fShippingCountry","fShippingCity","fShippingState","fShippingZip","fShippingPhone"];
for(var i=0;i<_3.length;i++){
addEvent(document.getElementById(_3[i]),"change",cloneShippingInfo);
}
};
function cloneShippingInfo(){
if(document.getElementById("fShipSameAsBill").checked){
document.getElementById("fBillingName").value=document.getElementById("fShippingName").value;
document.getElementById("fBillingAddress").value=document.getElementById("fShippingAddress").value;
document.getElementById("fBillingAddress2").value=document.getElementById("fShippingAddress2").value;
document.getElementById("fBillingCountry").selectedIndex=document.getElementById("fShippingCountry").selectedIndex;
to_country_onchange("fBillingState","fBillingCountry");
document.getElementById("fBillingCity").value=document.getElementById("fShippingCity").value;
document.getElementById("fBillingState").selectedIndex=document.getElementById("fShippingState").selectedIndex;
document.getElementById("fBillingZip").value=document.getElementById("fShippingZip").value;
document.getElementById("fBillingPhone").value=document.getElementById("fShippingPhone").value;
}
}
function setShippingDisabled(_5){
var _6=["fBillingName","fBillingAddress","fBillingAddress2","fBillingCountry","fBillingCity","fBillingState","fBillingZip","fBillingPhone"];
for(var i=0;i<_6.length;i++){
document.getElementById(_6[i]).disabled=_5;
}
}
function internationalshipping(e){
var _9=false;
var _a="";
if(document.getElementById("fShippingState")){
_a=document.getElementById("fShippingState").value;
if(_a=="XX"||_a=="AE"||_a=="AP"||_a=="AA"){
_9=true;
}
}
if(document.getElementById("ship_to_state")){
_a=document.getElementById("ship_to_state").value;
if(_a=="XX"||_a=="AE"||_a=="AP"||_a=="AA"){
_9=true;
}
}
if(!_9){
return validateFieldInd(e,"validateconditional-internationalshipping-");
}else{
return true;
}
}
function internationalbilling(e){
var _c=false;
var _d="";
if(document.getElementById("bill_to_state")){
_d=document.getElementById("bill_to_state").value;
if(_d=="XX"||_d=="AE"||_d=="AP"||_d=="AA"){
_c=true;
}
}
if(document.getElementById("fBillingState")){
_d=document.getElementById("fBillingState").value;
if(_d=="XX"||_d=="AE"||_d=="AP"||_d=="AA"){
_c=true;
}
}
if(!_c){
return validateFieldInd(e,"validateconditional-internationalbilling-");
}else{
return true;
}
}
function showEmailForm(el){
if(el){
$(el.parentNode.parentNode).find(".tellafriend-sms").hide();
$(el.parentNode.parentNode).find(".tellafriend-email").slideDown("normal");
}else{
$("#tellafriend-sms").hide();
$("#tellafriend-email").slideDown("normal");
}
}
function showSMSForm(el){
if(el){
$(el.parentNode.parentNode).find(".tellafriend-email").hide();
$(el.parentNode.parentNode).find(".tellafriend-sms").slideDown("normal");
}else{
$("#tellafriend-email").hide();
$("#tellafriend-sms").slideDown("normal");
}
}
function cancel(el){
$(el.parentNode.parentNode).slideUp("fast");
}
function hideSMSForm(){
$("#tellafriend-sms").slideUp("fast");
}
function hideEmailForm(){
$("#tellafriend-email").slideUp("fast");
}
function toggleContactForm(id){
var el=$("#contact"+id);
$("*[@id*='contact']").each(function(){
var t=$(this);
if(t.is("#contact"+id)){
if(t.is(".hide")){
t.removeClass("hide");
}else{
t.addClass("hide");
}
}else{
t.addClass("hide");
}
});
}
function toggleNotes(id){
var el=$("#note"+id);
if(el.is(".hide")){
el.removeClass("hide");
}else{
el.addClass("hide");
}
}
function toggleIcon(el){
if($(el).is(".disclosure-expanded")){
$(el).removeClass("disclosure-expanded");
}else{
$(el).addClass("disclosure-expanded");
}
el.blur();
}
function toggleFields(_17,_18,_19){
if(typeof (_18)=="string"){
document.getElementById(_18).disabled=(_19)?_17.checked:!_17.checked;
}else{
if(typeof (_18)=="object"){
for(var i=0;i<_18.length;i++){
document.getElementById(_18[i]).disabled=(_19)?_17.checked:!_17.checked;
}
}
}
}
function disableEnterKeypress(e){
if(!e){
var e=window.event;
}
if(e.keyCode){
if(e.keyCode==13){
return false;
}
}else{
if(e.which){
if(e.which==13){
return false;
}
}
}
}
function clearErrorFlash(){
$("#flash,.error").hide();
}
function setFocusOnError(){
if($("select,input").filter(".error").size()>0){
var frm=$("#content").find("form").get(0);
for(var i=0;i<frm.elements.length;i++){
if($(frm.elements[i]).is(".error")){
frm.elements[i].focus();
break;
}
}
}
}
function enableSimpleFormValidation(){
$("form.form-validate").submit(function(e){
if(e.preventDefault){
e.preventDefault();
e.stopPropagation();
}else{
e.returnValue=false;
e.cancelBubble=true;
}
if(validateForm(this)==true){
this.submit();
return true;
}else{
alert("There is a problem with the information you have entered.");
setFocusOnError();
return false;
}
});
}
function validateForm(frm){
var _20=true;
$("*[@class*='validate-'][@disabled='']",frm).each(function(){
_20=(validateField(this))?_20:false;
});
$("*[@class*='validateconditional-'][@disabled='']",frm).each(function(){
_20=(validateConditionalField(this))?_20:false;
});
return _20;
}
function validateField(e){
return validateFieldInd(e,"validate-");
}
function validateFieldInd(e,_23){
var _24=e.className.split(" ");
var _25=true;
var _26="";
for(var i=0;i<_24.length;i++){
if(_24[i].indexOf(_23)>-1){
var _28=_24[i].substring(_23.length);
switch(_28){
case ("required"):
switch(e.tagName){
case "INPUT":
if(e.type=="checkbox"){
if(e.checked!=true){
_26="This checkbox is required.";
_25=false;
}
}else{
if(e.value.length<1){
_26="This field is required.";
_25=false;
}
}
break;
case "TEXTAREA":
if(e.value.length<1){
_26="This field is required.";
_25=false;
}
break;
case "SELECT":
if(e.selectedIndex==0){
_26="Please make a selection.";
_25=false;
}
break;
}
break;
case ("email"):
var _29=/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if(!(e.value.match(_29))){
_26="Please enter a valid email address.";
_25=false;
}
break;
case ("phone"):
var _29=/^\(?\d{3}\)?(\s|-|\.)?\d{3}?(\s|-|\.)?\d{4}$/;
if(!(e.value.match(_29))){
_26="Please enter a valid phone number (###-###-####).";
_25=false;
}
break;
case ("zip"):
var _29=/\d{5}(-\d{4})?|[A-Z]\d[A-Z]\s\d[A-Z]\d/;
if(!(e.value.match(_29))){
_26="Please enter a valid ZIP Code (#####) or Postal Code (A#A #A#).";
_25=false;
}
break;
case ("currency"):
var _29=/^\s*[$]?\s*\d+(\.\d{2})?\s*$/;
if(!(e.value.match(_29))){
_26="Please enter a valid currency amount.";
_25=false;
}
break;
case ("isbn"):
var _29=/(?=.{13}$)\d{1,5}([-])\d{1,7}\1\d{1,6}\1(\d|X)$|(^\d{9}[0-9xX]{1}$)/;
var _2a=/([\d]{10}|[\d]{9}[xX])|([\d]{13})$/;
if(!(e.value.match(_29)||e.value.match(_2a))){
_26="Please enter a valid IBSN.";
_25=false;
}
break;
}
}
if(_25==false){
break;
}
}
if(_25==false){
displayError(e,_26);
}else{
if($(e).is(".error")==true){
removeError(e);
}
}
return _25;
}
function validateConditionalField(e){
var _2c;
var _2d=true;
var _2e=e.className.split(" ");
for(var i=0;i<_2e.length;i++){
if(_2e[i].indexOf("validateconditional-")>-1){
var _30=_2e[i].split("-");
_2c=eval(_30[1]);
if(_2c){
_2d=(_2c(e))?_2d:false;
}
}
}
return _2d;
}
function validateFieldOnce(e){
return validateFieldInd(e,"validateonce-");
}
function displayError(e,msg){
$(e).addClass("error");
$("//label[@for='"+e.id+"']").addClass("error");
if(document.getElementById(e.name+"-error")){
var _34=document.getElementById(e.name+"-error");
msg=(_34.title)?_34.title:msg;
$(document.getElementById(e.name+"-error")).html("<p>"+msg+"</p>");
$(document.getElementById(e.name+"-error")).show();
}else{
if(e.type=="checkbox"){
$("label",e.parentNode).after("<div id='"+e.name+"-error' class='error checkbox'><p>"+msg+"</p></div>");
}else{
$(e).after("<div id='"+e.name+"-error' class='error'><p>"+msg+"</p></div>");
}
}
}
function removeError(e){
$(document.getElementById(e.name+"-error")).html("").hide();
$(e).removeClass("error");
$("//label[@for='"+e.id+"']").removeClass("error");
}
function limitText(_36,_37){
if(_36.value.length>_37){
_36.value=_36.value.substring(0,_37);
alert("The maximum length of this field is "+_37+" characters.");
}
}
function addEvent(obj,_39,fn){
if(obj.addEventListener){
obj.addEventListener(_39,fn,false);
EventCache.add(obj,_39,fn);
}else{
if(obj.attachEvent){
obj["e"+_39+fn]=fn;
obj[_39+fn]=function(){
obj["e"+_39+fn](window.event);
};
obj.attachEvent("on"+_39,obj[_39+fn]);
EventCache.add(obj,_39,fn);
}else{
obj["on"+_39]=obj["e"+_39+fn];
}
}
}
var EventCache=function(){
var _3b=[];
return {listEvents:_3b,add:function(_3c,_3d,_3e){
_3b.push(arguments);
},flush:function(){
var i,item;
for(i=_3b.length-1;i>=0;i=i-1){
item=_3b[i];
if(item[0].removeEventListener){
item[0].removeEventListener(item[1],item[2],item[3]);
}
if(item[1].substring(0,2)!="on"){
item[1]="on"+item[1];
}
if(item[0].detachEvent){
item[0].detachEvent(item[1],item[2]);
}
item[0][item[1]]=null;
}
}};
}();
addEvent(window,"unload",EventCache.flush);
Array.prototype.inArray=function(_40){
var i;
for(i=0;i<this.length;i++){
if(this[i]===_40){
return true;
}
}
return false;
};
var sweetTitles={xCord:0,yCord:0,tipElements:["a","abbr","acronym"],obj:Object,tip:Object,active:0,init:function(){
if(!document.getElementById||!document.createElement||!document.getElementsByTagName){
return;
}
var i,j;
this.tip=document.createElement("div");
this.tip.id="toolTip";
document.getElementsByTagName("body")[0].appendChild(this.tip);
this.tip.style.top="0";
this.tip.style.visibility="hidden";
$("#nav").find("a").each(function(){
addEvent(this,"mouseover",sweetTitles.tipOver);
addEvent(this,"mouseout",sweetTitles.tipOut);
this.setAttribute("tip",this.title);
this.removeAttribute("title");
});
},updateXY:function(e){
if(document.captureEvents){
sweetTitles.xCord=e.pageX;
sweetTitles.yCord=e.pageY;
}else{
if(window.event.clientX){
sweetTitles.xCord=window.event.clientX+document.documentElement.scrollLeft;
sweetTitles.yCord=window.event.clientY+document.documentElement.scrollTop;
}
}
},tipOut:function(){
if(window.tID){
clearTimeout(tID);
}
if(window.opacityID){
clearTimeout(opacityID);
}
sweetTitles.tip.style.visibility="hidden";
},checkNode:function(){
var _44=this.obj;
if(this.tipElements.inArray(_44.nodeName.toLowerCase())){
return _44;
}else{
return _44.parentNode;
}
},tipOver:function(e){
sweetTitles.obj=this;
tID=window.setTimeout("sweetTitles.tipShow()",500);
sweetTitles.updateXY(e);
},tipShow:function(){
var _46=Number(this.xCord);
var _47=Number(this.yCord);
var tp=parseInt(_47+15);
var lt=parseInt(_46+10);
var _4a=this.checkNode();
var _4b="";
if(_4a.nodeName.toLowerCase()=="a"){
var _4b=(_4a.accessKey?" <span>["+_4a.accessKey+"]</span> ":"");
}else{
}
this.tip.innerHTML="<p>"+_4a.getAttribute("tip")+"<em>"+_4b+"</em></p>";
if(parseInt(document.documentElement.clientWidth+document.documentElement.scrollLeft)<parseInt(this.tip.offsetWidth+lt)){
this.tip.style.left=parseInt(lt-(this.tip.offsetWidth+10))+"px";
}else{
this.tip.style.left=lt+"px";
}
if(parseInt(document.documentElement.clientHeight+document.documentElement.scrollTop)<parseInt(this.tip.offsetHeight+tp)){
this.tip.style.top=parseInt(tp-(this.tip.offsetHeight+10))+"px";
}else{
this.tip.style.top=tp+"px";
}
this.tip.style.visibility="visible";
this.tip.style.opacity=".1";
this.tipFade(10);
},tipFade:function(_4c){
var _4d=parseInt(_4c);
var _4e=parseInt(_4d+10);
if(_4e<80){
this.tip.style.opacity="."+_4e;
this.tip.style.filter="alpha(opacity:"+_4e+")";
opacityID=window.setTimeout("sweetTitles.tipFade('"+_4e+"')",20);
}else{
this.tip.style.opacity=".80";
this.tip.style.filter="alpha(opacity:80)";
}
}};
function pageLoader(){
sweetTitles.init();
}
addEvent(window,"load",pageLoader);
function autoLinkInit(){
if(!document.getElementsByTagName){
return;
}
var _4f=document.getElementsByTagName("a");
for(var i=0;i<_4f.length;i++){
var _51=_4f[i];
if(_51.getAttribute("href")){
var _52=_51.getAttribute("rel");
switch(_52){
case ("external"):
_51.target="_blank";
break;
case ("popup"):
_51.onclick=popup;
break;
}
}
}
}
function popup(){
var URL=this.getAttribute("href");
window.open(URL,"autopopup","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=400,left=312,top=234");
return false;
}
function insertHtmlBefore(_54,_55){
$(_55).before($(_54).html());
}
function insertHtmlAfter(_56,_57){
$(_57).after($(_56).html());
}
function replaceHtml(_58,_59){
$(_59).html($(_58).html());
}
function prependHtml(_5a,_5b){
$(_5b).prepend($(_5a).html());
}
function appendHtml(_5c,_5d){
$(_5d).append($(_5c).html());
}

