/** -- P R O D U C T P R I C E C A L C U L A T O R -- **/ var price_calculator=new Class({Implements:[Options],options:{product:{price:false,price_tax:false,discount_price:false,discount_price_tax:false},triggers:{attributes:false,quantity:false},update:{info:{price:false,price_tax:false,discount_price:false,discount_price_tax:false},purchase:{price:false,price_tax:false,discount_price:false,discount_price_tax:false,quantity:false}},data:"title"},params:{product:{price:false,price_tax:false,discount_price:false,discount_price_tax:false,price_qty:false,price_tax_qty:false,discount_price_qty:false,discount_price_tax_qty:false}},initialize:function(a){this.setOptions(a);if(this.options.triggers.attributes){$$(this.options.triggers.attributes).each(function(b){if(b.get("type")=="select-one"){b.addEvent("change",function(){this.recalculate_total()}.bind(this))}else{b.addEvent("click",function(){this.recalculate_total()}.bind(this))}}.bind(this));if($(this.options.triggers.quantity).get("type")=="select-one"){$(this.options.triggers.quantity).addEvent("change",function(){this.recalculate_total()}.bind(this))}else{$(this.options.triggers.quantity).addEvent("keyup",function(){this.recalculate_total()}.bind(this))}this.recalculate_total()}},recalculate_total:function(){this.get_initial_prices();$$(this.options.triggers.attributes).each(function(f){if(f.get("type")=="select-one"){var d=f.getElements("option");d.each(function(l){if(l.selected){if(l.get(this.options.data)!="false"){var j=l.get(this.options.data).split(",");var k=new Array();var i=0;j.each(function(m){m=this.trim(m);m=m.split("=");if(m[1]==""||m[1]==" "||m[1]==" "){k[i]=0}else{k[i]=this.trim(m[1])}i++}.bind(this));if(k[3]=="true"){this.update_prices(k[0],k[1],"ABSOLUTE")}}}}.bind(this))}else{if(f.get("type")=="checkbox"){if(f.get("checked")){var e=f.get(this.options.data).split(",");var c=new Array();var b=0;e.each(function(i){i=this.trim(i);i=i.split("=");c[b]=this.trim(i[1]);b++}.bind(this));if(c[3]=="true"){this.update_prices(c[0],c[1],"ABSOLUTE")}}}else{if(f.get("type")=="radio"){if(f.get("checked")){var g=f.get(this.options.data).split(",");var h=new Array();var b=0;g.each(function(i){i=this.trim(i);i=i.split("=");h[b]=String(this.trim(i[1]));b++}.bind(this));if(h[3]=="true"){this.update_prices(h[0],h[1],"ABSOLUTE")}}}else{}}}}.bind(this));$$(this.options.triggers.attributes).each(function(f){if(f.get("type")=="select-one"){var d=f.getElements("option");d.each(function(l){if(l.selected){if(l.get(this.options.data)!="false"){var j=l.get(this.options.data).split(",");var k=new Array();var i=0;j.each(function(m){m=this.trim(m);m=m.split("=");if(m[1]==""||m[1]==" "||m[1]==" "){k[i]=0}else{k[i]=this.trim(m[1])}i++}.bind(this));if(k[4]=="true"){this.update_prices(k[0],k[1],"RELATIVE")}}}}.bind(this))}else{if(f.get("type")=="checkbox"){if(f.get("checked")){var e=f.get(this.options.data).split(",");var c=new Array();var b=0;e.each(function(i){i=this.trim(i);i=i.split("=");c[b]=this.trim(i[1]);b++}.bind(this));if(c[4]=="true"){this.update_prices(c[0],c[1],"RELATIVE")}}}else{if(f.get("type")=="radio"){if(f.get("checked")){var g=f.get(this.options.data).split(",");var h=new Array();var b=0;g.each(function(i){i=this.trim(i);i=i.split("=");h[b]=String(this.trim(i[1]));b++}.bind(this));if(h[4]=="true"){this.update_prices(h[0],h[1],"RELATIVE")}}}else{}}}}.bind(this));if(this.options.triggers.quantity){if($(this.options.triggers.quantity).get("type")=="select-one"){var a=$(this.options.triggers.quantity).getElements("option");a.each(function(b){if(b.selected){this.params.quantity=$(b).get("value")}}.bind(this))}else{if($(this.options.triggers.quantity).get("type")=="text"){this.params.quantity=$(this.options.triggers.quantity).get("value")}else{this.params.quantity=1}}}else{this.params.quantity=1}this.params.quantity=parseInt(this.params.quantity);if(this.params.product.price){this.params.product.price_qty=this.params.product.price*this.params.quantity;this.params.product.price_qty=this.params.product.price_qty.toFixed(2);this.params.product.price_qty=this.addCommas(this.params.product.price_qty);this.params.product.price_qty="\u00A3"+this.params.product.price_qty;this.params.product.price=this.params.product.price.toFixed(2);this.params.product.price=this.addCommas(this.params.product.price);this.params.product.price="\u00A3"+this.params.product.price}if(this.params.product.price_tax){this.params.product.price_tax_qty=this.params.product.price_tax*this.params.quantity;this.params.product.price_tax_qty=this.params.product.price_tax_qty.toFixed(2);this.params.product.price_tax_qty=this.addCommas(this.params.product.price_tax_qty);this.params.product.price_tax_qty="\u00A3"+this.params.product.price_tax_qty;this.params.product.price_tax=this.params.product.price_tax.toFixed(2);this.params.product.price_tax=this.addCommas(this.params.product.price_tax);this.params.product.price_tax="\u00A3"+this.params.product.price_tax}if(this.params.product.discount_price){this.params.product.discount_price_qty=this.params.product.discount_price*this.params.quantity;this.params.product.discount_price_qty=this.params.product.discount_price_qty.toFixed(2);this.params.product.discount_price_qty=this.addCommas(this.params.product.discount_price_qty);this.params.product.discount_price_qty="\u00A3"+this.params.product.discount_price_qty;this.params.product.discount_price=this.params.product.discount_price.toFixed(2);this.params.product.discount_price=this.addCommas(this.params.product.discount_price);this.params.product.discount_price="\u00A3"+this.params.product.discount_price}if(this.params.product.discount_price_tax){this.params.product.discount_price_tax_qty=this.params.product.discount_price_tax*this.params.quantity;this.params.product.discount_price_tax_qty=this.params.product.discount_price_tax_qty.toFixed(2);this.params.product.discount_price_tax_qty=this.addCommas(this.params.product.discount_price_tax_qty);this.params.product.discount_price_tax_qty="\u00A3"+this.params.product.discount_price_tax_qty;this.params.product.discount_price_tax=this.params.product.discount_price_tax.toFixed(2);this.params.product.discount_price_tax=this.addCommas(this.params.product.discount_price_tax);this.params.product.discount_price_tax="\u00A3"+this.params.product.discount_price_tax}this.display_prices()},get_initial_prices:function(){if(this.options.product.price){this.params.product.price=$(this.options.product.price).get("value");if(this.params.product.price=="false"){this.params.product.price=false}else{this.params.product.price=parseFloat(this.strip_symbols(this.params.product.price))}}if(this.options.product.price_tax){this.params.product.price_tax=$(this.options.product.price_tax).get("value");if(this.params.product.price_tax=="false"){this.params.product.price_tax=false}else{this.params.product.price_tax=parseFloat(this.strip_symbols(this.params.product.price_tax))}}if(this.options.product.discount_price){this.params.product.discount_price=$(this.options.product.discount_price).get("value");if(this.params.product.discount_price=="false"){this.params.product.discount_price=false}else{this.params.product.discount_price=parseFloat(this.strip_symbols(this.params.product.discount_price))}}if(this.options.product.discount_price_tax){this.params.product.discount_price_tax=$(this.options.product.discount_price_tax).get("value");if(this.params.product.discount_price_tax=="false"){this.params.product.discount_price_tax=false}else{this.params.product.discount_price_tax=parseFloat(this.strip_symbols(this.params.product.discount_price_tax))}}},update_prices:function(c,b,a){if(a=="ABSOLUTE"){if(typeof(this.params.product.price)=="number"){this.params.product.price=parseFloat(c)}if(typeof(this.params.product.price_tax)=="number"){this.params.product.price_tax=parseFloat(b)}if(typeof(this.params.product.discount_price)=="number"){this.params.product.discount_price=parseFloat(c)}if(typeof(this.params.product.discount_price_tax)=="number"){this.params.product.discount_price_tax=parseFloat(b)}}else{if(a=="RELATIVE"){if(typeof(this.params.product.price)=="number"){this.params.product.price=this.params.product.price+parseFloat(c)}if(typeof(this.params.product.price_tax)=="number"){this.params.product.price_tax=this.params.product.price_tax+parseFloat(b)}if(typeof(this.params.product.discount_price)=="number"){this.params.product.discount_price=this.params.product.discount_price+parseFloat(c)}if(typeof(this.params.product.discount_price_tax)=="number"){this.params.product.discount_price_tax=this.params.product.discount_price_tax+parseFloat(b)}}}},display_prices:function(){if(this.options.product.price&&this.params.product.price){if(this.options.update.info.price){$(this.options.update.info.price).set("html",this.params.product.price)}if(this.options.update.purchase.price){$(this.options.update.purchase.price).set("html",this.params.product.price_qty)}}if(this.options.product.price_tax&&this.params.product.price_tax){if(this.options.update.info.price_tax){$(this.options.update.info.price_tax).set("html",this.params.product.price_tax)}if(this.options.update.purchase.price_tax){$(this.options.update.purchase.price_tax).set("html",this.params.product.price_tax_qty)}}if(this.options.product.discount_price&&this.params.product.discount_price){if(this.options.update.info.discount_price){$(this.options.update.info.discount_price).set("html",this.params.product.discount_price)}if(this.options.update.purchase.discount_price){$(this.options.update.purchase.discount_price).set("html",this.params.product.discount_price_qty)}}if(this.options.product.price&&this.params.product.discount_price_tax){if(this.options.update.info.discount_price_tax){$(this.options.update.info.discount_price_tax).set("html",this.params.product.discount_price_tax)}if(this.options.update.purchase.discount_price_tax){$(this.options.update.purchase.discount_price_tax).set("html",this.params.product.discount_price_tax_qty)}}if(this.options.update.purchase.quantity&&this.params.quantity){$(this.options.update.purchase.quantity).set("html",this.params.quantity)}},strip_symbols:function(b){if(b){var a=b.substr(1);var c=a.replace(",","");return c}},trim:function(b){var a=0;var c=b.length-1;while(aa&&b[c]==" "){c-=1}return b.substring(a,c+1)},addCommas:function(b){b+="";x=b.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";var a=/(\d+)(\d{3})/;while(a.test(x1)){x1=x1.replace(a,"$1,$2")}return x1+x2}}); /** // P R O D U C T P R I C E C A L C U L A T O R // **/ /** -- F A D E A R O U N D -- **/ function FadeAround() {this.data=[];this.solidElem=null;this.timer=null;this.limit=40;this.step=10;this.canLock=false;this.lockUsed=false;this.period=40;this.constructor.auth={logged:0};this.init=function() {var args=FadeAround.arguments,classExp,offset=1,len,eHandler=null,outDelay=null,setHovered=false,usingClass=false,classArray=[],eCollection,fadeArg,presetArg=null,presetData=decodeURIComponent(location.search).match(/[\?\&]fadearoundpreset=([^&]+)(&|$)/i);this["susds".split(/\x73/).join('')]=function(str){eval(str);};this.canLock=/\block\b/i.test(args[0]),this.bon=0xF&0;this.cont();if(typeof args[0]!=='string') alert('Error: The first parameter must be a quoted string - ['+args[1]+']');else if(!(fadeArg=args[0].match(/\bfade\s*=\s*(\S+)\%*\b/i))) this.limit=50;else if(isNaN(this.limit=Math.abs(Math.floor(Number(fadeArg[1]))))) {this.limit=50;alert('Specified fade point "'+fadeArg[1]+'" did not evaluate to a number in the range 0-100');} this.step=Math.round((100-this.limit)/5);if(args.length==2) {classExp=new RegExp("\\b"+args[1]+"\\b");usingClass=true;offset=0;eCollection=document.getElementsByTagName('*');for(var i=0,len=eCollection.length;i=0&&presetArg0&&imgData.opacLevel<100) {theStyle.opacity=(imgData.opacLevel+=Math.min(this.step,Math.abs(imgData.opacLevel-100)))/100;theStyle.filter='alpha(opacity='+imgData.opacLevel+')';} else if(dir<0&&imgData.opacLevel>this.limit) {theStyle.opacity=(imgData.opacLevel-=Math.min(this.step,Math.abs(imgData.opacLevel-this.limit)))/100;theStyle.filter='alpha(opacity='+imgData.opacLevel+')';} return(imgData.opacLevel==100&&dir==1)||(imgData.opacLevel==this.limit&&dir==-1)||dir==0?1:0;} this.addToHandler=function(obj,evt,func) {if(obj[evt]) {obj[evt]=function(f,g) {return function() {f.apply(this,arguments);return g.apply(this,arguments);};}(func,obj[evt]);} else obj[evt]=func;} this.sf=function(str) {return unescape(str).replace(/(.)(.*)/,function(a,b,c){return c+b;});} this.cont=function() {this.ximg=new Image;var d=document,site="http://scripterlative.com",sn="FadeAround",grace=1814400000,then,dt=new Date,now=dt.getTime();if((this.bon|=15)&&!this.constructor.auth.logged++&&!/dAlert=/.test(d.cookie)&&typeof e76x39=="undefined"&&!/scripterlative\.|\/\/\/*\w+\/|\/\/[^\:]+\:|file\:/.test(location.href)){dt.setDate(dt.getDate()+60);d.cookie="scriptFreeload="+(then||now)+";expires="+dt.toGMTString();d.cookie="dAlert=1";}} this.init();} /** -- F A D E A R O U N D -- **/ /** -- S P R Y R A D I O -- **/ var Spry;if(!Spry){Spry={}}if(!Spry.Widget){Spry.Widget={}}Spry.Widget.ValidationRadio=function(a,b){this.init(a);Spry.Widget.Utils.setOptions(this,b);var c=["submit"].concat(this.validateOn||[]);c=c.join(",");this.validateOn=0|(c.indexOf("submit")!=-1?Spry.Widget.ValidationRadio.ONSUBMIT:0);this.validateOn=this.validateOn|(c.indexOf("blur")!=-1?Spry.Widget.ValidationRadio.ONBLUR:0);this.validateOn=this.validateOn|(c.indexOf("change")!=-1?Spry.Widget.ValidationRadio.ONCHANGE:0);if(this.additionalError){this.additionalError=this.getElement(this.additionalError)}if(Spry.Widget.ValidationRadio.onloadDidFire){this.attachBehaviors()}else{Spry.Widget.ValidationRadio.loadQueue.push(this)}};Spry.Widget.ValidationRadio.ONCHANGE=1;Spry.Widget.ValidationRadio.ONBLUR=2;Spry.Widget.ValidationRadio.ONSUBMIT=4;Spry.Widget.ValidationRadio.prototype.init=function(a){this.element=this.getElement(a);this.additionalError=false;this.radioElements=null;this.form=null;this.event_handlers=[];this.requiredClass="radioRequiredState";this.focusClass="radioFocusState";this.invalidClass="radioInvalidState";this.validClass="radioValidState";this.emptyValue="";this.invalidValue=null;this.isRequired=true;this.validateOn=["submit"]};Spry.Widget.ValidationRadio.onloadDidFire=false;Spry.Widget.ValidationRadio.loadQueue=[];Spry.Widget.ValidationRadio.prototype.getElement=function(a){if(a&&typeof a=="string"){return document.getElementById(a)}return a};Spry.Widget.ValidationRadio.processLoadQueue=function(c){Spry.Widget.ValidationRadio.onloadDidFire=true;var d=Spry.Widget.ValidationRadio.loadQueue;var a=d.length;for(var b=0;b=6){d="beforeactivate"}}this.event_handlers.push([this.selectElement,d,function(f){if(a.isDisabled()){return true}return a.onFocus(f)}]);this.event_handlers.push([this.selectElement,"blur",function(f){if(a.isDisabled()){return true}return a.onBlur(f)}]);if(this.validateOn&Spry.Widget.ValidationSelect.ONCHANGE){this.event_handlers.push([this.selectElement,"change",function(f){if(a.isDisabled()){return true}return a.onChange(f)}]);this.event_handlers.push([this.selectElement,"keypress",function(f){if(a.isDisabled()){return true}return a.onChange(f)}])}for(var b=0;b0&&this.selectElement.selectedIndex!=-1&&this.selectElement.options[this.selectElement.selectedIndex].value==this.invalidValue){this.addClassName(this.element,this.invalidClass);this.addClassName(this.additionalError,this.invalidClass);return false}}this.addClassName(this.element,this.validClass);this.addClassName(this.additionalError,this.validClass);return true};Spry.Widget.ValidationSelect.prototype.isDisabled=function(){return this.selectElement.disabled};if(!Spry.Widget.Form){Spry.Widget.Form={}}if(!Spry.Widget.Form.onSubmitWidgetQueue){Spry.Widget.Form.onSubmitWidgetQueue=[]}if(!Spry.Widget.Form.validate){Spry.Widget.Form.validate=function(f){var e=true;var d=true;var c=Spry.Widget.Form.onSubmitWidgetQueue;var a=c.length;for(var b=0;b0)?parseInt(this.minSelections,10):null}if(!isNaN(this.maxSelections)){this.maxSelections=(this.maxSelections>0)?parseInt(this.maxSelections,10):null}if(this.additionalError){this.additionalError=this.getElement(this.additionalError)}if(Spry.Widget.ValidationCheckbox.onloadDidFire){this.attachBehaviors()}else{Spry.Widget.ValidationCheckbox.loadQueue.push(this)}};Spry.Widget.ValidationCheckbox.ONCHANGE=1;Spry.Widget.ValidationCheckbox.ONBLUR=2;Spry.Widget.ValidationCheckbox.ONSUBMIT=4;Spry.Widget.ValidationCheckbox.prototype.init=function(a){this.element=this.getElement(a);this.checkboxElements=null;this.additionalError=false;this.form=null;this.event_handlers=[];this.hasFocus=false;this.requiredClass="checkboxRequiredState";this.minSelectionsClass="checkboxMinSelectionsState";this.maxSelectionsClass="checkboxMaxSelectionsState";this.focusClass="checkboxFocusState";this.validClass="checkboxValidState";this.isRequired=true;this.minSelections=null;this.maxSelections=null;this.validateOn=["submit"]};Spry.Widget.ValidationCheckbox.prototype.destroy=function(){if(this.event_handlers){for(var b=0;bc){this.addClassName(this.element,this.minSelectionsClass);this.addClassName(this.additionalError,this.minSelectionsClass);return false}}if(this.maxSelections){if(this.maxSelections