function com_stewartspeak_replacement(){var testURL="/images/test.png";var doNotPrintImages=false;var printerCSS="/replacement-print.css";var hideFlicker=false;var hideFlickerCSS="/replacement-screen.css";var hideFlickerTimeout=1000;var items;var imageLoaded=false;var documentLoaded=false;function replaceSelector(selector,url,wordwrap,font,size,foreground,background,store){if(typeof items=="undefined"){items=new Array();}
items[items.length]={selector:selector,url:url,wordwrap:wordwrap,font:font,size:size,foreground:foreground,background:background,store:store};}
if(hideFlicker){document.write('<link id="hide-flicker" rel="stylesheet" media="screen" href="'+hideFlickerCSS+'" />');window.flickerCheck=function(){if(!imageLoaded){setStyleSheetState('hide-flicker',false);}};setTimeout('window.flickerCheck();',hideFlickerTimeout)}
if(doNotPrintImages){document.write('<link id="print-text" rel="stylesheet" media="print" href="'+printerCSS+'" />');}
var test=new Image();test.onload=function(){imageLoaded=true;if(documentLoaded)replacement();};test.src=testURL+"?date="+(new Date()).getTime();addLoadHandler(function(){documentLoaded=true;if(imageLoaded)replacement();});function documentLoad(){documentLoaded=true;if(imageLoaded){replacement();}}
function replacement(){if(items){for(var i=0;i<items.length;i++){var elements=getElementsBySelector(items[i].selector);if(elements.length>0)for(var j=0;j<elements.length;j++){if(!elements[j]){continue;}
var text=extractText(elements[j]);while(elements[j].hasChildNodes()){elements[j].removeChild(elements[j].firstChild);}
var tokens=items[i].wordwrap?text.split(' '):[text];for(var k=0;k<tokens.length;k++){var url=items[i].url+"?text="+escape(tokens[k]+' ')+"&selector="+escape(items[i].selector)+"&font="+escape(items[i].font)+"&size="+escape(items[i].size)+"&foreground="+escape(items[i].foreground)+"&background="+escape(items[i].background)+"&store="+escape(items[i].store);var image=document.createElement("img");image.className="replacement";image.alt=tokens[k];image.src=url;elements[j].appendChild(image);}
if(doNotPrintImages){var span=document.createElement("span");span.style.display='none';span.className="print-text";span.appendChild(document.createTextNode(text));elements[j].appendChild(span);}}}
if(hideFlicker){setStyleSheetState('hide-flicker',false);}}}
function addLoadHandler(handler){if(window.addEventListener){window.addEventListener("load",handler,false);}else if(window.attachEvent){window.attachEvent("onload",handler);}else if(window.onload){var oldHandler=window.onload;window.onload=function piggyback(){oldHandler();handler();};}else{window.onload=handler;}}
function setStyleSheetState(id,enabled){var sheet=document.getElementById(id);if(sheet){sheet.disabled=(!enabled);}}
function extractText(element){if(typeof element=="string"){return element;}else if(typeof element=="undefined"){return element;}else if(element.innerText){return element.innerText;}
var text="";var kids=element.childNodes;for(var i=0;i<kids.length;i++){if(kids[i].nodeType==1){text+=extractText(kids[i]);}else if(kids[i].nodeType==3){text+=kids[i].nodeValue;}}
return text;}
function getElementsBySelector(selector){var tokens=selector.split(' ');var currentContext=new Array(document);for(var i=0;i<tokens.length;i++){token=tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');if(token.indexOf('#')>-1){var bits=token.split('#');var tagName=bits[0];var id=bits[1];var element=document.getElementById(id);if(tagName&&element.nodeName.toLowerCase()!=tagName)
return new Array();currentContext=new Array(element);continue;}
if(token.indexOf('.')>-1){var bits=token.split('.');var tagName=bits[0];var className=bits[1];if(!tagName){tagName='*';}
var found=new Array;var foundCount=0;for(var h=0;h<currentContext.length;h++){var elements;if(tagName=='*'){elements=currentContext[h].all?currentContext[h].all:currentContext[h].getElementsByTagName('*');}else{elements=currentContext[h].getElementsByTagName(tagName);}
for(var j=0;j<elements.length;j++){found[foundCount++]=elements[j];}}
currentContext=new Array;var currentContextIndex=0;for(var k=0;k<found.length;k++){if(found[k].className&&found[k].className.match(new RegExp('\\b'+className+'\\b'))){currentContext[currentContextIndex++]=found[k];}}
continue;}
if(token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)){var tagName=RegExp.$1;var attrName=RegExp.$2;var attrOperator=RegExp.$3;var attrValue=RegExp.$4;if(!tagName){tagName='*';}
var found=new Array;var foundCount=0;for(var h=0;h<currentContext.length;h++){var elements;if(tagName=='*'){elements=currentContext[h].all?currentContext[h].all:currentContext[h].getElementsByTagName('*');}else{elements=currentContext[h].getElementsByTagName(tagName);}
for(var j=0;j<elements.length;j++){found[foundCount++]=elements[j];}}
currentContext=new Array;var currentContextIndex=0;var checkFunction;switch(attrOperator){case'=':checkFunction=function(e){return(e.getAttribute(attrName)==attrValue);};break;case'~':checkFunction=function(e){return(e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b')));};break;case'|':checkFunction=function(e){return(e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?')));};break;case'^':checkFunction=function(e){return(e.getAttribute(attrName).indexOf(attrValue)==0);};break;case'$':checkFunction=function(e){return(e.getAttribute(attrName).lastIndexOf(attrValue)==e.getAttribute(attrName).length-attrValue.length);};break;case'*':checkFunction=function(e){return(e.getAttribute(attrName).indexOf(attrValue)>-1);};break;default:checkFunction=function(e){return e.getAttribute(attrName);};break;}
currentContext=new Array;var currentContextIndex=0;for(var k=0;k<found.length;k++){if(checkFunction(found[k])){currentContext[currentContextIndex++]=found[k];}}
continue;}
tagName=token;var found=new Array;var foundCount=0;for(var h=0;h<currentContext.length;h++){var elements=currentContext[h].getElementsByTagName(tagName);for(var j=0;j<elements.length;j++){found[foundCount++]=elements[j];}}
currentContext=found;}
return currentContext;}}
/*if(document.createElement&&document.getElementsByTagName&&!navigator.userAgent.match(/opera\/?6/i)){com_stewartspeak_replacement();}*/
function go(form){window.location=form.range.options[form.range.selectedIndex].value;}
function preload_images(){var d=document;if(!d.imgs){d.imgs=new Array();}
var j=d.imgs.length,args=preload_images.arguments,i;for(i=0;i<args.length;i++){d.imgs[j]=new Image;d.imgs[j].src=args[i];j++;}}
function bookmark(title){var urlAddress=location.href;var pageName=title;var browser=navigator.appName;if(browser=='Microsoft Internet Explorer'){window.external.AddFavorite(urlAddress,pageName)}else if(browser=='Netscape'){alert("Your browser does not support this feature.  Use CTRL-D to bookmark this page");}else{alert("Your browser does not support this feature.");}}
function getCookie(Name){var search=Name+"=";var returnvalue="";if(document.cookie.length>0){offset=document.cookie.indexOf(search)
if(offset!=-1){offset+=search.length}
end=document.cookie.indexOf(";",offset);if(end==-1){end=document.cookie.length;}
returnvalue=unescape(document.cookie.substring(offset,end))}
return returnvalue;}
function setCookie(name,num){document.cookie=name+"="+num;}
function isCookied(name,num){if(getCookie(name)!=num){return true;}else{return false;}}
function priceChange(id,oper,num){if(num==''){num=document.getElementById('hidden_price_'+id).value;}
if(oper=='dynamic'){var num2=0;var qty=document.getElementById('qty_'+id).value;if(qty<1||qty==''){document.getElementById('price_'+id).value='$'+num;}else{num2=num.replace(',','')*document.getElementById('qty_'+id).value;document.getElementById('price_'+id).value='$'+num2.toFixed(2);}}
if(oper=='add'){++document.getElementById('qty_'+id).value;var qty=document.getElementById('qty_'+id).value;if(qty<1){document.getElementById('qty_'+id).value='1';document.getElementById('price_'+id).value='$'+num;}else{num2=num.replace(',','')*document.getElementById('qty_'+id).value;document.getElementById('price_'+id).value='$'+num2.toFixed(2);}}
if(oper=='sub'){--document.getElementById('qty_'+id).value;var qty=document.getElementById('qty_'+id).value;if(qty<1){document.getElementById('qty_'+id).value='1';document.getElementById('price_'+id).value='$'+num;}else{num2=num.replace(',','')*document.getElementById('qty_'+id).value;}}
if(oper=='dropdown'){var qty=document.getElementById('qty_'+id).value;if(qty<1){document.getElementById('qty_'+id).value='1';document.getElementById('price_'+id).value='$'+num;}else{num2=num.replace(',','')*document.getElementById('qty_'+id).value;}}
if(num2!=''){if(!isNaN(num2)){document.getElementById('price_'+id).value='$'+num2.toFixed(2);}else{document.getElementById('price_'+id).value='$'+num;document.getElementById('qty_'+id).value='';}}}
function cartChange(id,num,qty,total,name){var num2=0;var qty2=document.getElementById('qty_'+id).value;if(isNaN(qty2)){document.getElementById('qty_'+id).value='';qty2='';}
var num3=document.getElementById('price_'+id).value.split("$");var num3=num3[1].replace(',','');if(qty!='0'||!qty){var rPrice=num.replace(',','')/qty;}else{document.getElementById('price_'+id).value='$0.00';}
num2=(rPrice*qty2);document.getElementById('price_'+id).value='$'+num2.toFixed(2);if(total==document.getElementById('total').value){total=total-num3;total=total+num2;document.getElementById('total').value='$'+total.toFixed(2);}else{var fake_total=document.getElementById('total').value.split("$");fake_total=fake_total[1].replace(',','');total=fake_total-num3;total=total+num2;document.getElementById('total').value='$'+total.toFixed(2);}
var nQty=getCookie(name);arQty=nQty.split('|');cntQty=arQty.length-1;for(i=0;i<cntQty;i++){arID=arQty[i].split(',');if(document.getElementById('qty_'+arID[0]).value==arID[1]){document.getElementById('hasUpdated').value='1';document.getElementById('update_msg').style.color='#000';continue;}else{document.getElementById('hasUpdated').value='0';document.getElementById('update_msg').style.color='#F00';break;}}}
function hasUpdated(){if(typeof document.getElementById('hasUpdated')!='undefined'){var hUpdated=document.getElementById('hasUpdated').value;if(hUpdated!='1'){alert('You have not updated your cart since last changing your quantities.\nPlease press the \'Update Cart\' button before continuing.');return false;}}}
function verifyRecipients(theForm){var intLength=theForm.length;var firstStep=1,shipTos=new Array();for(var i=0;i<intLength;i++){if(firstStep&&theForm.elements[i].name.substr(0,4)=='recp'){var numShipTos=+theForm.elements[i].options.length-1;firstStep=0;}
if(theForm.elements[i].name.substr(0,4)=='recp'&&theForm.elements[i].value==''){alert('You must choose a recipient for each of the products you are purchasing.');return false;}else if(theForm.elements[i].name.substr(0,4)=='recp'){var shipTo=theForm.elements[i].selectedIndex;if(!in_array(shipTo,shipTos)){var stLen=shipTos.length;shipTos.push(shipTo);}}}
if(shipTos.length!=numShipTos){var verifyShipTos=confirm("Some of your shipping address do not have products assigned to them.\n\nDo you wish to continue anyway?");if(verifyShipTos){return true;}else{return false;}}
return true;}
function in_array(needle,haystack){if(typeof needle==undefined){alert("Needle is undefined.\nError: in_array");return false;}else if(typeof haystack==undefined){alert("Needle is undefined.\nError: in_array");return false;}
for(i=0,n=haystack.length;i<n;i++){if(haystack[i]==needle){return true;}}
return false;}
function noHammer(theForm){if(typeof theForm.submit!='undefined'){theForm.submit.disabled=true;theForm.submit.value='Wait...';return true;}}
function validateForgotForm(theForm){var theEmail=theForm.email;var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if((theEmail.value==null)||(theEmail.value=="")){document.getElementById('errorMsg').innerHTML="<br />Please enter a valid e-mail address before continuing.";theEmail.focus();return false;}else{if(!filter.test(theEmail.value)){document.getElementById('errorMsg').innerHTML="<br />Please enter a valid e-mail address before continuing.";theEmail.value="";theEmail.focus();return false;}}
return true;}
function hideShowCalc(recip){recip=(recip!='')?'_'+recip:'';if(document.getElementById('cart_ship_estimator'+recip)!=null&&typeof document.getElementById('cart_ship_estimator'+recip)!='undefined'){var div=document.getElementById('cart_ship_estimator'+recip);var link=document.getElementById('hideShowCalc'+recip);}else{return false;}
div.style.display=(div.style.display=='block')?'none':'block';link.innerHTML=(div.style.display=='block')?'Hide Details':'Show Details';}
function MM_openBrWindow(theURL,winName,features){window.open(theURL,winName,features);}
function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&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<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}<!--Copyright 2006,2007 Bontrager Connection,LLC
var cX=0;var cY=0;var rX=0;var rY=0;function UpdateCursorPosition(e){cX=e.pageX;cY=e.pageY;}
function UpdateCursorPositionDocAll(e){cX=event.clientX;cY=event.clientY;}
if(document.all){document.onmousemove=UpdateCursorPositionDocAll;}
else{document.onmousemove=UpdateCursorPosition;}
function AssignPosition(d){if(self.pageYOffset){rX=self.pageXOffset;rY=self.pageYOffset;}
else if(document.documentElement&&document.documentElement.scrollTop){rX=document.documentElement.scrollLeft;rY=document.documentElement.scrollTop;}
else if(document.body){rX=document.body.scrollLeft;rY=document.body.scrollTop;}
if(document.all){cX+=rX;cY+=rY;}
d.style.left=(cX+10)+"px";d.style.top=(cY+10)+"px";}
function HideContent(d){if(d.length<1){return;}
document.getElementById(d).style.display="none";}
function ShowContent(d){if(d.length<1){return;}
var dd=document.getElementById(d);AssignPosition(dd);dd.style.display="block";}
function ReverseContentDisplay(d){if(d.length<1){return;}
var dd=document.getElementById(d);AssignPosition(dd);if(dd.style.display=="none"){dd.style.display="block";}
else{dd.style.display="none";}}
function switchAttys(option,pids){pids=pids.split(",");for(var i=0;i<pids.length-1;i++){document.getElementById('option1_'+pids[i]).value=option;}}
function swapMainImg(path){largePath=path.replace('thumb','small');popupPath=path.replace('thumb','big');document.mainImg.src=largePath;document.getElementById('zoom1').href=popupPath;}
function checkConfirmEmail(){var email1=document.ship_form.email.value;var email2=document.ship_form.conemail.value;if(email1!=email2){alert('Your e-mail addresses do not match.\nPlease check them and try again.');return false;}}
function checkConfirmEmailUpdate(){var email1=document.update_form.email.value;var email2=document.update_form.conemail.value;if(email1!=email2){alert('Your e-mail addresses do not match.\nPlease check them and try again.');return false;}}
function checkConfirmEmailRegister(){var email1=document.register_form.email.value;var email2=document.register_form.conemail.value;if(email1!=email2){alert('Your e-mail addresses do not match.\nPlease check them and try again.');return false;}}
function ManageTabPanelDisplay123(){var idlist=new Array('tab1focus','tab2focus','tab3focus','tab1ready','tab2ready','tab3ready','content1','content2','content3');if(arguments.length<1){return;}
for(var i=0;i<idlist.length;i++){var block=false;for(var ii=0;ii<arguments.length;ii++){if(idlist[i]==arguments[ii]){block=true;break;}}
if(block){document.getElementById(idlist[i]).style.display="block";}
else{document.getElementById(idlist[i]).style.display="none";}}}
function ManageTabPanelDisplay1234(){var idlist=new Array('tab1focus','tab2focus','tab3focus','tab4focus','tab1ready','tab2ready','tab3ready','tab4ready','content1','content2','content3','content4');if(arguments.length<1){return;}
for(var i=0;i<idlist.length;i++){var block=false;for(var ii=0;ii<arguments.length;ii++){if(idlist[i]==arguments[ii]){block=true;break;}}
if(block){document.getElementById(idlist[i]).style.display="block";}
else{document.getElementById(idlist[i]).style.display="none";}}}
function ManageTabPanelDisplay1235(){var idlist=new Array('tab1focus','tab2focus','tab3focus','tab5focus','tab1ready','tab2ready','tab3ready','tab5ready','content1','content2','content3','content5');if(arguments.length<1){return;}
for(var i=0;i<idlist.length;i++){var block=false;for(var ii=0;ii<arguments.length;ii++){if(idlist[i]==arguments[ii]){block=true;break;}}
if(block){document.getElementById(idlist[i]).style.display="block";}
else{document.getElementById(idlist[i]).style.display="none";}}}
function ManageTabPanelDisplay12345(){var idlist=new Array('tab1focus','tab2focus','tab3focus','tab4focus','tab5focus','tab1ready','tab2ready','tab3ready','tab4ready','tab5ready','content1','content2','content3','content4','content5');if(arguments.length<1){return;}
for(var i=0;i<idlist.length;i++){var block=false;for(var ii=0;ii<arguments.length;ii++){if(idlist[i]==arguments[ii]){block=true;break;}}
if(block){document.getElementById(idlist[i]).style.display="block";}
else{document.getElementById(idlist[i]).style.display="none";}}}
function goID(id){window.location=document.getElementById(id);}
function sendEmail(){var to=document.checkout.to.value;var from=document.checkout.from.value;to=to.split('|');from=from.split('|');document.checkout.to.value=atob(to[0])+'@'+atob(to[1]);document.checkout.from.value=atob(from[0])+'@'+atob(from[1]);}
function checkTotalOrderQty(){var toqty=parseInt(document.product_form.total_order_qty.value);var ae=document.activeElement.name;if(ae!="wishlist_add"){return true;}else{if(toqty>1){return true;}
alert("You have not yet added this product to your Wishlist.\n\nPlease add quantities for each of the configurations\nyou would like and then click Wishlist again.\n\nThank you.");return false;}}
function checkrevform(f)
{
if(f.creator_name.value=="")
{alert('All fields are required to submit the review.\n\nPlease fill in your Nickname.');return false;}
else if(f.city.value=="")
{alert('All fields are required to submit the review.\n\nPlease fill in your Location.');return false;}
else if(f.title.value=="")
{alert('All fields are required to submit the review.\n\nPlease fill in a Title for your review.');return false;}
else if(f.rating.value=="0")
{alert('All fields are required to submit the review.\n\nPlease click the grey stars to enter a rating, where 5 is highest and 1 is lowest.');return false;}
else if(f.comments.value=="")
{alert('All fields are required to submit the review.\n\nPlease provide Comments for your review.');return false;}
return true;

}

