// FROM: http://www.coffeeforless.com/js/jquery/corner_min.js
/*!
 * jQuery corner plugin: simple corner rounding
 * Examples and documentation at: http://jquery.malsup.com/corner/
 * version 2.11 (15-JUN-2010)
 * Requires jQuery v1.3.2 or later
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Authors: Dave Methvin and Mike Alsup
 */
(function($){var style=document.createElement("div").style,moz=style.MozBorderRadius!==undefined,webkit=style.WebkitBorderRadius!==undefined,radius=style.borderRadius!==undefined||style.BorderRadius!==undefined,mode=document.documentMode||0,noBottomFold=$.browser.msie&&(($.browser.version<8&&!mode)||mode<8),expr=$.browser.msie&&(function(){var div=document.createElement("div");try{div.style.setExpression("width","0+0");div.style.removeExpression("width")}catch(e){return false}return true})();$.support=$.support||{};$.support.borderRadius=moz||webkit||radius;function sz(el,p){return parseInt($.css(el,p))||0}function hex2(s){var s=parseInt(s).toString(16);return(s.length<2)?"0"+s:s}function gpc(node){while(node){var v=$.css(node,"backgroundColor"),rgb;if(v&&v!="transparent"&&v!="rgba(0, 0, 0, 0)"){if(v.indexOf("rgb")>=0){rgb=v.match(/\d+/g);return"#"+hex2(rgb[0])+hex2(rgb[1])+hex2(rgb[2])}return v}if(node.nodeName.toLowerCase()=="html"){break}node=node.parentNode}return"#ffffff"}function getWidth(fx,i,width){switch(fx){case"round":return Math.round(width*(1-Math.cos(Math.asin(i/width))));case"cool":return Math.round(width*(1+Math.cos(Math.asin(i/width))));case"sharp":return Math.round(width*(1-Math.cos(Math.acos(i/width))));case"bite":return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));case"slide":return Math.round(width*(Math.atan2(i,width/i)));case"jut":return Math.round(width*(Math.atan2(width,(width-i-1))));case"curl":return Math.round(width*(Math.atan(i)));case"tear":return Math.round(width*(Math.cos(i)));case"wicked":return Math.round(width*(Math.tan(i)));case"long":return Math.round(width*(Math.sqrt(i)));case"sculpt":return Math.round(width*(Math.log((width-i-1),width)));case"dogfold":case"dog":return(i&1)?(i+1):width;case"dog2":return(i&2)?(i+1):width;case"dog3":return(i&3)?(i+1):width;case"fray":return(i%2)*width;case"notch":return width;case"bevelfold":case"bevel":return i+1}}$.fn.corner=function(options){if(this.length==0){if(!$.isReady&&this.selector){var s=this.selector,c=this.context;$(function(){$(s,c).corner(options)})}return this}return this.each(function(index){var $this=$(this),o=[$this.attr($.fn.corner.defaults.metaAttr)||"",options||""].join(" ").toLowerCase(),keep=/keep/.test(o),cc=((o.match(/cc:(#[0-9a-f]+)/)||[])[1]),sc=((o.match(/sc:(#[0-9a-f]+)/)||[])[1]),width=parseInt((o.match(/(\d+)px/)||[])[1])||10,re=/round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog/,fx=((o.match(re)||["round"])[0]),fold=/dogfold|bevelfold/.test(o),edges={T:0,B:1},opts={TL:/top|tl|left/.test(o),TR:/top|tr|right/.test(o),BL:/bottom|bl|left/.test(o),BR:/bottom|br|right/.test(o)},strip,pad,cssHeight,j,bot,d,ds,bw,i,w,e,c,common,$horz;if(!opts.TL&&!opts.TR&&!opts.BL&&!opts.BR){opts={TL:1,TR:1,BL:1,BR:1}}if($.fn.corner.defaults.useNative&&fx=="round"&&(radius||moz||webkit)&&!cc&&!sc){if(opts.TL){$this.css(radius?"border-top-left-radius":moz?"-moz-border-radius-topleft":"-webkit-border-top-left-radius",width+"px")}if(opts.TR){$this.css(radius?"border-top-right-radius":moz?"-moz-border-radius-topright":"-webkit-border-top-right-radius",width+"px")}if(opts.BL){$this.css(radius?"border-bottom-left-radius":moz?"-moz-border-radius-bottomleft":"-webkit-border-bottom-left-radius",width+"px")}if(opts.BR){$this.css(radius?"border-bottom-right-radius":moz?"-moz-border-radius-bottomright":"-webkit-border-bottom-right-radius",width+"px")}return}strip=document.createElement("div");$(strip).css({overflow:"hidden",height:"1px",minHeight:"1px",fontSize:"1px",backgroundColor:sc||"transparent",borderStyle:"solid"});pad={T:parseInt($.css(this,"paddingTop"))||0,R:parseInt($.css(this,"paddingRight"))||0,B:parseInt($.css(this,"paddingBottom"))||0,L:parseInt($.css(this,"paddingLeft"))||0};if(typeof this.style.zoom!=undefined){this.style.zoom=1}if(!keep){this.style.border="none"}strip.style.borderColor=cc||gpc(this.parentNode);cssHeight=$(this).outerHeight();for(j in edges){bot=edges[j];if((bot&&(opts.BL||opts.BR))||(!bot&&(opts.TL||opts.TR))){strip.style.borderStyle="none "+(opts[j+"R"]?"solid":"none")+" none "+(opts[j+"L"]?"solid":"none");d=document.createElement("div");$(d).addClass("jquery-corner");ds=d.style;bot?this.appendChild(d):this.insertBefore(d,this.firstChild);if(bot&&cssHeight!="auto"){if($.css(this,"position")=="static"){this.style.position="relative"}ds.position="absolute";ds.bottom=ds.left=ds.padding=ds.margin="0";if(expr){ds.setExpression("width","this.parentNode.offsetWidth")}else{ds.width="100%"}}else{if(!bot&&$.browser.msie){if($.css(this,"position")=="static"){this.style.position="relative"}ds.position="absolute";ds.top=ds.left=ds.right=ds.padding=ds.margin="0";if(expr){bw=sz(this,"borderLeftWidth")+sz(this,"borderRightWidth");ds.setExpression("width","this.parentNode.offsetWidth - "+bw+'+ "px"')}else{ds.width="100%"}}else{ds.position="relative";ds.margin=!bot?"-"+pad.T+"px -"+pad.R+"px "+(pad.T-width)+"px -"+pad.L+"px":(pad.B-width)+"px -"+pad.R+"px -"+pad.B+"px -"+pad.L+"px"}}for(i=0;i<width;i++){w=Math.max(0,getWidth(fx,i,width));e=strip.cloneNode(false);e.style.borderWidth="0 "+(opts[j+"R"]?w:0)+"px 0 "+(opts[j+"L"]?w:0)+"px";bot?d.appendChild(e):d.insertBefore(e,d.firstChild)}if(fold&&$.support.boxModel){if(bot&&noBottomFold){continue}for(c in opts){if(!opts[c]){continue}if(bot&&(c=="TL"||c=="TR")){continue}if(!bot&&(c=="BL"||c=="BR")){continue}common={position:"absolute",border:"none",margin:0,padding:0,overflow:"hidden",backgroundColor:strip.style.borderColor};$horz=$("<div/>").css(common).css({width:width+"px",height:"1px"});switch(c){case"TL":$horz.css({bottom:0,left:0});break;case"TR":$horz.css({bottom:0,right:0});break;case"BL":$horz.css({top:0,left:0});break;case"BR":$horz.css({top:0,right:0});break}d.appendChild($horz[0]);var $vert=$("<div/>").css(common).css({top:0,bottom:0,width:"1px",height:width+"px"});switch(c){case"TL":$vert.css({left:width});break;case"TR":$vert.css({right:width});break;case"BL":$vert.css({left:width});break;case"BR":$vert.css({right:width});break}d.appendChild($vert[0])}}}}})};$.fn.uncorner=function(){if(radius||moz||webkit){this.css(radius?"border-radius":moz?"-moz-border-radius":"-webkit-border-radius",0)}$("div.jquery-corner",this).remove();return this};$.fn.corner.defaults={useNative:true,metaAttr:"data-corner"}})(jQuery);

/*-----------------------------------------------------------------------------------------------*/

// FROM: http://live.coffeeforless.com/js/jquery.cookie.js
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        var path = options.path ? '; path=' + options.path : '';
        var domain = options.domain ? '; domain=' + options.domain : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

/*-----------------------------------------------------------------------------------------------*/


// FROM: http://live.coffeeforless.com/js/lib/ccard_min.js
function validateCreditCard(s){var v="0123456789";var w="";for(i=0;i<s.length;i++){x=s.charAt(i);if(v.indexOf(x,0)!=-1){w+=x}}j=w.length/2;k=Math.floor(j);m=Math.ceil(j)-k;c=0;for(i=0;i<k;i++){a=w.charAt(i*2+m)*2;c+=a>9?Math.floor(a/10+a%10):a}for(i=0;i<k+m;i++){c+=w.charAt(i*2+1-m)*1}return(c%10==0)};

// FROM: http://live.coffeeforless.com/js/application_min.js
jQuery(document).ready(function(){
//try{if(jQuery("#messages_product_view .messages .success-msg").length==1){Enterprise.TopCart.showCart(7)}}catch(e){}
jQuery(".panel").each(function(index,element){try{jQuery(element).corner("bottom")}catch(e){}});jQuery(".accountPanel").each(function(index,element){try{jQuery(element).corner("bottom")}catch(e){}});jQuery("#topCartContent").each(function(index,element){try{jQuery(element).corner("10px")}catch(e){}});jQuery(".cartContent").each(function(index,element){try{jQuery(element).corner("6px")}catch(e){}});jQuery(".cartHeader").each(function(index,element){try{jQuery(element).corner("6px")}catch(e){}});jQuery(".totalContent").each(function(index,element){try{jQuery(element).corner("6px")}catch(e){}});jQuery(".totalsHeader").each(function(index,element){try{jQuery(element).corner("6px")}catch(e){}});jQuery(".deals").each(function(index,element){try{jQuery(element).corner("6px")}catch(e){}});jQuery(".cart .page-title").each(function(index,element){try{jQuery(element).corner("6px")}catch(e){}})});

// FROM: http://live.coffeeforless.com/js/prototype/validation_min.js
var Validator=Class.create();Validator.prototype={initialize:function(c,b,d,a){if(typeof d=="function"){this.options=$H(a);this._test=d}else{this.options=$H(d);this._test=function(){return true}}this.error=b||"Validation failed.";this.className=c},test:function(a,b){return(this._test(a,b)&&this.options.all(function(c){return Validator.methods[c.key]?Validator.methods[c.key](a,b,c.value):true}))}};Validator.methods={pattern:function(a,c,b){return Validation.get("IsEmpty").test(a)||b.test(a)},minLength:function(a,c,b){return a.length>=b},maxLength:function(a,c,b){return a.length<=b},min:function(a,c,b){return a>=parseFloat(b)},max:function(a,c,b){return a<=parseFloat(b)},notOneOf:function(a,c,b){return $A(b).all(function(d){return a!=d})},oneOf:function(a,c,b){return $A(b).any(function(d){return a==d})},is:function(a,c,b){return a==b},isNot:function(a,c,b){return a!=b},equalToField:function(a,c,b){return a==$F(b)},notEqualToField:function(a,c,b){return a!=$F(b)},include:function(a,c,b){return $A(b).all(function(d){return Validation.get(d).test(a,c)})}};var Validation=Class.create();Validation.defaultOptions={onSubmit:true,stopOnFirst:false,immediate:false,focusOnError:true,useTitles:false,addClassNameToContainer:false,containerClassName:".input-box",onFormValidate:function(a,b){},onElementValidate:function(a,b){}};Validation.prototype={initialize:function(b,a){this.form=$(b);if(!this.form){return}this.options=Object.extend({onSubmit:Validation.defaultOptions.onSubmit,stopOnFirst:Validation.defaultOptions.stopOnFirst,immediate:Validation.defaultOptions.immediate,focusOnError:Validation.defaultOptions.focusOnError,useTitles:Validation.defaultOptions.useTitles,onFormValidate:Validation.defaultOptions.onFormValidate,onElementValidate:Validation.defaultOptions.onElementValidate},a||{});if(this.options.onSubmit){Event.observe(this.form,"submit",this.onSubmit.bind(this),false)}if(this.options.immediate){Form.getElements(this.form).each(function(c){if(c.tagName.toLowerCase()=="select"){Event.observe(c,"blur",this.onChange.bindAsEventListener(this))}if(c.type.toLowerCase()=="radio"||c.type.toLowerCase()=="checkbox"){Event.observe(c,"click",this.onChange.bindAsEventListener(this))}else{Event.observe(c,"change",this.onChange.bindAsEventListener(this))}},this)}},onChange:function(a){Validation.isOnChange=true;Validation.validate(Event.element(a),{useTitle:this.options.useTitles,onElementValidate:this.options.onElementValidate});Validation.isOnChange=false},onSubmit:function(a){if(!this.validate()){Event.stop(a)}},validate:function(){var a=false;var b=this.options.useTitles;var d=this.options.onElementValidate;try{if(this.options.stopOnFirst){a=Form.getElements(this.form).all(function(e){if(e.hasClassName("local-validation")&&!this.isElementInForm(e,this.form)){return true}return Validation.validate(e,{useTitle:b,onElementValidate:d})},this)}else{a=Form.getElements(this.form).collect(function(e){if(e.hasClassName("local-validation")&&!this.isElementInForm(e,this.form)){return true}return Validation.validate(e,{useTitle:b,onElementValidate:d})},this).all()}}catch(c){}if(!a&&this.options.focusOnError){try{Form.getElements(this.form).findAll(function(e){return $(e).hasClassName("validation-failed")}).first().focus()}catch(c){}}this.options.onFormValidate(a,this.form);return a},reset:function(){Form.getElements(this.form).each(Validation.reset)},isElementInForm:function(c,b){var a=c.up("form");if(a==b){return true}return false}};Object.extend(Validation,{validate:function(c,a){a=Object.extend({useTitle:false,onElementValidate:function(d,e){}},a||{});c=$(c);var b=$w(c.className);return result=b.all(function(d){var e=Validation.test(d,c,a.useTitle);a.onElementValidate(e,c);return e})},insertAdvice:function(d,b){var a=$(d).up(".field-row");if(a){Element.insert(a,{after:b})}else{if(d.up("td.value")){d.up("td.value").insert({bottom:b})}else{if(d.advaiceContainer&&$(d.advaiceContainer)){$(d.advaiceContainer).update(b)}else{switch(d.type.toLowerCase()){case"checkbox":case"radio":var c=d.parentNode;if(c){Element.insert(c,{bottom:b})}else{Element.insert(d,{after:b})}break;default:Element.insert(d,{after:b})}}}}},showAdvice:function(c,b,a){if(!c.advices){c.advices=new Hash()}else{c.advices.each(function(d){this.hideAdvice(c,d.value)}.bind(this))}c.advices.set(a,b);if(typeof Effect=="undefined"){b.style.display="block"}else{if(!b._adviceAbsolutize){new Effect.Appear(b,{duration:1})}else{Position.absolutize(b);b.show();b.setStyle({top:b._adviceTop,left:b._adviceLeft,width:b._adviceWidth,"z-index":1000});b.addClassName("advice-absolute")}}},hideAdvice:function(b,a){if(a!=null){a.hide()}},updateCallback:function(elm,status){if(typeof elm.callbackFunction!="undefined"){eval(elm.callbackFunction+"('"+elm.id+"','"+status+"')")}},ajaxError:function(e,d){var c="validate-ajax";var b=Validation.getAdvice(c,e);if(b==null){b=this.createAdvice(c,e,false,d)}this.showAdvice(e,b,"validate-ajax");this.updateCallback(e,"failed");e.addClassName("validation-failed");e.addClassName("validate-ajax");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var a=e.up(Validation.defaultOptions.containerClassName);if(a&&this.allowContainerClassName(e)){a.removeClassName("validation-passed");a.addClassName("validation-error")}}},allowContainerClassName:function(a){if(a.type=="radio"||a.type=="checkbox"){return a.hasClassName("change-container-classname")}return true},test:function(d,i,g){var b=Validation.get(d);var h="__advice"+d.camelize();try{if(Validation.isVisible(i)&&!b.test($F(i),i)){var c=Validation.getAdvice(d,i);if(c==null){c=this.createAdvice(d,i,g)}this.showAdvice(i,c,d);this.updateCallback(i,"failed");i[h]=1;if(!i.advaiceContainer){i.removeClassName("validation-passed");i.addClassName("validation-failed")}if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var a=i.up(Validation.defaultOptions.containerClassName);if(a&&this.allowContainerClassName(i)){a.removeClassName("validation-passed");a.addClassName("validation-error")}}return false}else{var c=Validation.getAdvice(d,i);this.hideAdvice(i,c);this.updateCallback(i,"passed");i[h]="";i.removeClassName("validation-failed");i.addClassName("validation-passed");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var a=i.up(Validation.defaultOptions.containerClassName);if(a&&!a.down(".validation-failed")&&this.allowContainerClassName(i)){if(!Validation.get("IsEmpty").test(i.value)||!this.isVisible(i)){a.addClassName("validation-passed")}else{a.removeClassName("validation-passed")}a.removeClassName("validation-error")}}return true}}catch(f){throw (f)}},isVisible:function(a){while(a.tagName!="BODY"){if(!$(a).visible()){return false}a=a.parentNode}return true},getAdvice:function(a,b){return $("advice-"+a+"-"+Validation.getElmID(b))||$("advice-"+Validation.getElmID(b))},createAdvice:function(b,h,i,c){var j=Validation.get(b);var f=i?((h&&h.title)?h.title:j.error):j.error;if(c){f=c}try{if(Translator){f=Translator.translate(f)}}catch(g){}advice='<div class="validation-advice" id="advice-'+b+"-"+Validation.getElmID(h)+'" style="display:none">'+f+"</div>";Validation.insertAdvice(h,advice);advice=Validation.getAdvice(b,h);if($(h).hasClassName("absolute-advice")){var a=$(h).getDimensions();var d=Position.cumulativeOffset(h);advice._adviceTop=(d[1]+a.height)+"px";advice._adviceLeft=(d[0])+"px";advice._adviceWidth=(a.width)+"px";advice._adviceAbsolutize=true}return advice},getElmID:function(a){return a.id?a.id:a.name},reset:function(b){b=$(b);var a=$w(b.className);a.each(function(e){var f="__advice"+e.camelize();if(b[f]){var d=Validation.getAdvice(e,b);if(d){d.hide()}b[f]=""}b.removeClassName("validation-failed");b.removeClassName("validation-passed");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var c=b.up(Validation.defaultOptions.containerClassName);if(c){c.removeClassName("validation-passed");c.removeClassName("validation-error")}}})},add:function(d,c,e,b){var a={};a[d]=new Validator(d,c,e,b);Object.extend(Validation.methods,a)},addAllThese:function(a){var b={};$A(a).each(function(c){b[c[0]]=new Validator(c[0],c[1],c[2],(c.length>3?c[3]:{}))});Object.extend(Validation.methods,b)},get:function(a){return Validation.methods[a]?Validation.methods[a]:Validation.methods._LikeNoIDIEverSaw_},methods:{_LikeNoIDIEverSaw_:new Validator("_LikeNoIDIEverSaw_","",{})}});Validation.add("IsEmpty","",function(a){return(a==""||(a==null)||(a.length==0)||/^\s+$/.test(a))});Validation.addAllThese([["validate-select","Please select an option.",function(a){return((a!="none")&&(a!=null)&&(a.length!=0))}],["required-entry","This is a required field.",function(a){return !Validation.get("IsEmpty").test(a)}],["validate-number","Please enter a valid number in this field.",function(a){return Validation.get("IsEmpty").test(a)||(!isNaN(parseNumber(a))&&!/^\s+$/.test(parseNumber(a)))}],["validate-digits","Please use numbers only in this field. please avoid spaces or other characters such as dots or commas.",function(a){return Validation.get("IsEmpty").test(a)||!/[^\d]/.test(a)}],["validate-digits-range","The value is not within the specified range.",function(c,d){var b=Validation.get("IsEmpty").test(c)||!/[^\d]/.test(c);var a=new RegExp(/^digits-range-[0-9]+-[0-9]+$/);$w(d.className).each(function(g,f){if(g.match(a)&&b){var h=parseInt(g.split("-")[2],10);var e=parseInt(g.split("-")[3],10);var i=parseInt(c,10);b=(c>=h)&&(c<=e)}});return b}],["validate-alpha","Please use letters only (a-z or A-Z) in this field.",function(a){return Validation.get("IsEmpty").test(a)||/^[a-zA-Z]+$/.test(a)}],["validate-code","Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.",function(a){return Validation.get("IsEmpty").test(a)||/^[a-z]+[a-z0-9_]+$/.test(a)}],["validate-alphanum","Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.",function(a){return Validation.get("IsEmpty").test(a)||/^[a-zA-Z0-9]+$/.test(a)
/*!/\W/.test(v)*/
}],["validate-street","Please use only letters (a-z or A-Z) or numbers (0-9) or spaces and # only in this field.",function(a){return Validation.get("IsEmpty").test(a)||/^[ \w]{3,}([A-Za-z]\.)?([ \w]*\#\d+)?(\r\n| )[ \w]{3,}/.test(a)}],["validate-phoneStrict","Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.",function(a){return Validation.get("IsEmpty").test(a)||/^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(a)}],["validate-phoneLax","Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.",function(a){return Validation.get("IsEmpty").test(a)||/^((\d[-. ]?)?((\(\d{3}\))|\d{3}))?[-. ]?\d{3}[-. ]?\d{4}$/.test(a)}],["validate-fax","Please enter a valid fax number. For example (123) 456-7890 or 123-456-7890.",function(a){return Validation.get("IsEmpty").test(a)||/^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(a)}],["validate-date","Please enter a valid date.",function(a){var b=new Date(a);return Validation.get("IsEmpty").test(a)||!isNaN(b)}],["validate-email","Please enter a valid email address. For example johndoe@domain.com.",function(a){return Validation.get("IsEmpty").test(a)||/^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(a)}],["validate-emailSender","Please use only visible characters and spaces.",function(a){return Validation.get("IsEmpty").test(a)||/^[\S ]+$/.test(a)}],["validate-password","Please enter 6 or more characters. Leading or trailing spaces will be ignored.",function(a){var b=a.strip();return !(b.length>0&&b.length<6)}],["validate-admin-password","Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.",function(a){var b=a.strip();if(0==b.length){return true}if(!(/[a-z]/i.test(a))||!(/[0-9]/.test(a))){return false}return !(b.length<7)}],["validate-cpassword","Please make sure your passwords match.",function(a){var b=$("confirmation")?$("confirmation"):$$(".validate-cpassword")[0];var e=false;if($("password")){e=$("password")}var f=$$(".validate-password");for(var c=0;c<f.size();c++){var d=f[c];if(d.up("form").id==b.up("form").id){e=d}}if($$(".validate-admin-password").size()){e=$$(".validate-admin-password")[0]}return(e.value==b.value)}],["validate-url","Please enter a valid URL. Protocol is required (http://, https:// or ftp://)",function(a){return Validation.get("IsEmpty").test(a)||/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(a)}],["validate-clean-url","Please enter a valid URL. For example http://www.example.com or www.example.com",function(a){return Validation.get("IsEmpty").test(a)||/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+.(com|org|net|dk|at|us|tv|info|uk|co.uk|biz|se)$)(:(\d+))?\/?/i.test(a)||/^(www)((\.[A-Z0-9][A-Z0-9_-]*)+.(com|org|net|dk|at|us|tv|info|uk|co.uk|biz|se)$)(:(\d+))?\/?/i.test(a)}],["validate-identifier",'Please enter a valid URL Key. For example "example-page", "example-page.html" or "anotherlevel/example-page".',function(a){return Validation.get("IsEmpty").test(a)||/^[A-Z0-9][A-Z0-9_\/-]+(\.[A-Z0-9_-]+)*$/i.test(a)}],["validate-xml-identifier","Please enter a valid XML-identifier. For example something_1, block5, id-4.",function(a){return Validation.get("IsEmpty").test(a)||/^[A-Z][A-Z0-9_\/-]*$/i.test(a)}],["validate-ssn","Please enter a valid social security number. For example 123-45-6789.",function(a){return Validation.get("IsEmpty").test(a)||/^\d{3}-?\d{2}-?\d{4}$/.test(a)}],["validate-zip","Please enter a valid zip code. For example 90602 or 90602-1234.",function(a){return Validation.get("IsEmpty").test(a)||/(^\d{5}$)|(^\d{5}-\d{4}$)/.test(a)}],["validate-zip-international","Please enter a valid zip code.",function(a){return true}],["validate-date-au","Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.",function(a){if(Validation.get("IsEmpty").test(a)){return true}var b=/^(\d{2})\/(\d{2})\/(\d{4})$/;if(!b.test(a)){return false}var c=new Date(a.replace(b,"$2/$1/$3"));return(parseInt(RegExp.$2,10)==(1+c.getMonth()))&&(parseInt(RegExp.$1,10)==c.getDate())&&(parseInt(RegExp.$3,10)==c.getFullYear())}],["validate-currency-dollar","Please enter a valid $ amount. For example $100.00.",function(a){return Validation.get("IsEmpty").test(a)||/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/.test(a)}],["validate-one-required","Please select one of the above options.",function(a,d){var c=d.parentNode;var b=c.getElementsByTagName("INPUT");return $A(b).any(function(e){return $F(e)})}],["validate-one-required-by-name","Please select one of the options.",function(b,e){var a=$$('input[name="'+e.name.replace(/([\\"])/g,"\\$1")+'"]');var c=1;for(var d=0;d<a.length;d++){if((a[d].type=="checkbox"||a[d].type=="radio")&&a[d].checked==true){c=0}if(Validation.isOnChange&&(a[d].type=="checkbox"||a[d].type=="radio")){Validation.reset(a[d])}}if(c==0){return true}else{return false}}],["validate-not-negative-number","Please enter a valid number in this field.",function(a){a=parseNumber(a);return(!isNaN(a)&&a>=0)}],["validate-state","Please select State/Province.",function(a){return(a!=0||a=="")}],["validate-new-password","Please enter 6 or more characters. Leading or trailing spaces will be ignored.",function(a){if(!Validation.get("validate-password").test(a)){return false}if(Validation.get("IsEmpty").test(a)&&a!=""){return false}return true}],["validate-greater-than-zero","Please enter a number greater than 0 in this field.",function(a){if(a.length){return parseFloat(a)>0}else{return true}}],["validate-zero-or-greater","Please enter a number 0 or greater in this field.",function(a){if(a.length){return parseFloat(a)>=0}else{return true}}],["validate-cc-number","Please enter a valid credit card number.",function(a,c){var b=$(c.id.substr(0,c.id.indexOf("_cc_number"))+"_cc_type");if(b&&typeof Validation.creditCartTypes.get(b.value)!="undefined"&&Validation.creditCartTypes.get(b.value)[2]==false){if(!Validation.get("IsEmpty").test(a)&&Validation.get("validate-digits").test(a)){return true}else{return false}}return validateCreditCard(a)}],["validate-cc-type","Credit card number does not match credit card type.",function(b,e){e.value=removeDelimiters(e.value);b=removeDelimiters(b);var d=$(e.id.substr(0,e.id.indexOf("_cc_number"))+"_cc_type");if(!d){return true}var c=d.value;if(typeof Validation.creditCartTypes.get(c)=="undefined"){return false}if(Validation.creditCartTypes.get(c)[0]==false){return true}var a="";Validation.creditCartTypes.each(function(f){if(f.value[0]&&b.match(f.value[0])){a=f.key;throw $break}});if(a!=c){return false}if(d.hasClassName("validation-failed")&&Validation.isOnChange){Validation.validate(d)}return true}],["validate-cc-type-select","Card type does not match credit card number.",function(b,c){var a=$(c.id.substr(0,c.id.indexOf("_cc_type"))+"_cc_number");if(Validation.isOnChange&&Validation.get("IsEmpty").test(a.value)){return true}if(Validation.get("validate-cc-type").test(a.value,a)){Validation.validate(a)}return Validation.get("validate-cc-type").test(a.value,a)}],["validate-cc-exp","Incorrect credit card expiration date.",function(a,g){var f=a;var e=$(g.id.substr(0,g.id.indexOf("_expiration"))+"_expiration_yr").value;var d=new Date();var c=d.getMonth()+1;var b=d.getFullYear();if(f<c&&e==b){return false}return true}],["validate-cc-cvn","Please enter a valid credit card verification number.",function(a,e){var d=$(e.id.substr(0,e.id.indexOf("_cc_cid"))+"_cc_type");if(!d){return true}var b=d.value;if(typeof Validation.creditCartTypes.get(b)=="undefined"){return false}var c=Validation.creditCartTypes.get(b)[1];if(a.match(c)){return true}return false}],["validate-ajax","",function(a,b){return true}],["validate-data","Please use only letters (a-z or A-Z), numbers (0-9) or underscore(_) in this field, first character should be a letter.",function(a){if(a!=""&&a){return/^[A-Za-z]+[A-Za-z0-9_]+$/.test(a)}return true}],["validate-css-length","Please input a valid CSS-length. For example 100px or 77pt or 20em or .5ex or 50%.",function(a){if(a!=""&&a){return/^[0-9\.]+(px|pt|em|ex|%)?$/.test(a)&&(!(/\..*\./.test(a)))&&!(/\.$/.test(a))}return true}],["validate-length","Text length does not satisfy specified text range.",function(b,e){var c=new RegExp(/^maximum-length-[0-9]+$/);var d=new RegExp(/^minimum-length-[0-9]+$/);var a=true;$w(e.className).each(function(g,f){if(g.match(c)&&a){var h=g.split("-")[2];a=(b.length<=h)}if(g.match(d)&&a&&!Validation.get("IsEmpty").test(b)){var h=g.split("-")[2];a=(b.length>=h)}});return a}],["validate-percents","Please enter a number lower than 100.",{max:100}],["required-file","Please select a file",function(b,c){var a=!Validation.get("IsEmpty").test(b);if(a===false){ovId=c.id+"_value";if($(ovId)){a=!Validation.get("IsEmpty").test($(ovId).value)}}return a}],["validate-cc-ukss","Please enter issue number or start date for switch/solo card type.",function(i,e){var a;if(e.id.match(/(.)+_cc_issue$/)){a=e.id.indexOf("_cc_issue")}else{if(e.id.match(/(.)+_start_month$/)){a=e.id.indexOf("_start_month")}else{a=e.id.indexOf("_start_year")}}var d=e.id.substr(0,a);var b=$(d+"_cc_type");if(!b){return true}var h=b.value;if(["SS","SM","SO"].indexOf(h)==-1){return true}$(d+"_cc_issue").advaiceContainer=$(d+"_start_month").advaiceContainer=$(d+"_start_year").advaiceContainer=$(d+"_cc_type_ss_div").down("ul li.adv-container");var f=$(d+"_cc_issue").value;var g=$(d+"_start_month").value;var j=$(d+"_start_year").value;var c=(g&&j)?true:false;if(!c&&!f){return false}return true}]]);function removeDelimiters(a){a=a.replace(/\s/g,"");a=a.replace(/\-/g,"");return a}function parseNumber(a){if(typeof a!="string"){return parseFloat(a)}var c=a.indexOf(".");var b=a.indexOf(",");if(c!=-1&&b!=-1){if(b>c){a=a.replace(".","").replace(",",".")}else{a=a.replace(",","")}}else{if(b!=-1){a=a.replace(",",".")}}return parseFloat(a)}Validation.creditCartTypes=$H({SO:[new RegExp("^(6334[5-9]([0-9]{11}|[0-9]{13,14}))|(6767([0-9]{12}|[0-9]{14,15}))$"),new RegExp("^([0-9]{3}|[0-9]{4})?$"),true],SM:[new RegExp("(^(5[0678])[0-9]{11,18}$)|(^(6[^05])[0-9]{11,18}$)|(^(601)[^1][0-9]{9,16}$)|(^(6011)[0-9]{9,11}$)|(^(6011)[0-9]{13,16}$)|(^(65)[0-9]{11,13}$)|(^(65)[0-9]{15,18}$)|(^(49030)[2-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49033)[5-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49110)[1-2]([0-9]{10}$|[0-9]{12,13}$))|(^(49117)[4-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49118)[0-2]([0-9]{10}$|[0-9]{12,13}$))|(^(4936)([0-9]{12}$|[0-9]{14,15}$))"),new RegExp("^([0-9]{3}|[0-9]{4})?$"),true],VI:[new RegExp("^4[0-9]{12}([0-9]{3})?$"),new RegExp("^[0-9]{3}$"),true],MC:[new RegExp("^5[1-5][0-9]{14}$"),new RegExp("^[0-9]{3}$"),true],AE:[new RegExp("^3[47][0-9]{13}$"),new RegExp("^[0-9]{4}$"),true],DI:[new RegExp("^6011[0-9]{12}$"),new RegExp("^[0-9]{3}$"),true],JCB:[new RegExp("^(3[0-9]{15}|(2131|1800)[0-9]{11})$"),new RegExp("^[0-9]{4}$"),true],OT:[false,new RegExp("^([0-9]{3}|[0-9]{4})?$"),false]});

// FROM: http://live.coffeeforless.com/js/varien/js_min.js
function popWin(url,win,para){var win=window.open(url,win,para);win.focus()}function setLocation(url){window.location.href=url}function setPLocation(url,setFocus){if(setFocus){window.opener.focus()}window.opener.location.href=url}function setLanguageCode(code,fromCode){var href=window.location.href;var after="",dash;if(dash=href.match(/\#(.*)$/)){href=href.replace(/\#(.*)$/,"");after=dash[0]}if(href.match(/[?]/)){var re=/([?&]store=)[a-z0-9_]*/;if(href.match(re)){href=href.replace(re,"$1"+code)}else{href+="&store="+code}var re=/([?&]from_store=)[a-z0-9_]*/;if(href.match(re)){href=href.replace(re,"")}}else{href+="?store="+code}if(typeof(fromCode)!="undefined"){href+="&from_store="+fromCode}href+=after;setLocation(href)}function decorateGeneric(elements,decorateParams){var allSupportedParams=["odd","even","first","last"];var _decorateParams={};var total=elements.length;if(total){if(typeof(decorateParams)=="undefined"){decorateParams=allSupportedParams}if(!decorateParams.length){return}for(var k in allSupportedParams){_decorateParams[allSupportedParams[k]]=false}for(var k in decorateParams){_decorateParams[decorateParams[k]]=true}if(_decorateParams.first){Element.addClassName(elements[0],"first")}if(_decorateParams.last){Element.addClassName(elements[total-1],"last")}for(var i=0;i<total;i++){if((i+1)%2==0){if(_decorateParams.even){Element.addClassName(elements[i],"even")}}else{if(_decorateParams.odd){Element.addClassName(elements[i],"odd")}}}}}function decorateTable(table,options){var table=$(table);if(table){var _options={tbody:false,"tbody tr":["odd","even","first","last"],"thead tr":["first","last"],"tfoot tr":["first","last"],"tr td":["last"]};if(typeof(options)!="undefined"){for(var k in options){_options[k]=options[k]}}if(_options.tbody){decorateGeneric(table.select("tbody"),_options.tbody)}if(_options["tbody tr"]){decorateGeneric(table.select("tbody tr"),_options["tbody tr"])}if(_options["thead tr"]){decorateGeneric(table.select("thead tr"),_options["thead tr"])}if(_options["tfoot tr"]){decorateGeneric(table.select("tfoot tr"),_options["tfoot tr"])}if(_options["tr td"]){var allRows=table.select("tr");if(allRows.length){for(var i=0;i<allRows.length;i++){decorateGeneric(allRows[i].getElementsByTagName("TD"),_options["tr td"])}}}}}function decorateList(list,nonRecursive){if($(list)){if(typeof(nonRecursive)=="undefined"){var items=$(list).select("li")}else{var items=$(list).childElements()}decorateGeneric(items,["odd","even","last"])}}function decorateDataList(list){list=$(list);if(list){decorateGeneric(list.select("dt"),["odd","even","last"]);decorateGeneric(list.select("dd"),["odd","even","last"])}}function parseSidUrl(baseUrl,urlExt){sidPos=baseUrl.indexOf("/?SID=");sid="";urlExt=(urlExt!=undefined)?urlExt:"";if(sidPos>-1){sid="?"+baseUrl.substring(sidPos+2);baseUrl=baseUrl.substring(0,sidPos+1)}return baseUrl+urlExt+sid}function formatCurrency(price,format,showPlus){precision=isNaN(format.precision=Math.abs(format.precision))?2:format.precision;requiredPrecision=isNaN(format.requiredPrecision=Math.abs(format.requiredPrecision))?2:format.requiredPrecision;precision=requiredPrecision;integerRequired=isNaN(format.integerRequired=Math.abs(format.integerRequired))?1:format.integerRequired;decimalSymbol=format.decimalSymbol==undefined?",":format.decimalSymbol;groupSymbol=format.groupSymbol==undefined?".":format.groupSymbol;groupLength=format.groupLength==undefined?3:format.groupLength;if(showPlus==undefined||showPlus==true){s=price<0?"-":(showPlus?"+":"")}else{if(showPlus==false){s=""}}i=parseInt(price=Math.abs(+price||0).toFixed(precision))+"";pad=(i.length<integerRequired)?(integerRequired-i.length):0;while(pad){i="0"+i;pad--}j=(j=i.length)>groupLength?j%groupLength:0;re=new RegExp("(\\d{"+groupLength+"})(?=\\d)","g");r=(j?i.substr(0,j)+groupSymbol:"")+i.substr(j).replace(re,"$1"+groupSymbol)+(precision?decimalSymbol+Math.abs(price-i).toFixed(precision).replace(/-/,0).slice(2):"");if(format.pattern.indexOf("{sign}")==-1){pattern=s+format.pattern}else{pattern=format.pattern.replace("{sign}",s)}return pattern.replace("%s",r).replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function expandDetails(el,childClass){if(Element.hasClassName(el,"show-details")){$$(childClass).each(function(item){item.hide()});Element.removeClassName(el,"show-details")}else{$$(childClass).each(function(item){item.show()});Element.addClassName(el,"show-details")}}var isIE=navigator.appVersion.match(/MSIE/)=="MSIE";if(!window.Varien){var Varien=new Object()}Varien.showLoading=function(){Element.show("loading-process")};Varien.hideLoading=function(){Element.hide("loading-process")};Varien.GlobalHandlers={onCreate:function(){Varien.showLoading()},onComplete:function(){if(Ajax.activeRequestCount==0){Varien.hideLoading()}}};Ajax.Responders.register(Varien.GlobalHandlers);Varien.searchForm=Class.create();Varien.searchForm.prototype={initialize:function(form,field,emptyText){this.form=$(form);this.field=$(field);this.emptyText=emptyText;Event.observe(this.form,"submit",this.submit.bind(this));Event.observe(this.field,"focus",this.focus.bind(this));Event.observe(this.field,"blur",this.blur.bind(this));this.blur()},submit:function(event){if(this.field.value==this.emptyText||this.field.value==""){Event.stop(event);return false}return true},focus:function(event){if(this.field.value==this.emptyText){this.field.value=""}},blur:function(event){if(this.field.value==""){this.field.value=this.emptyText}},initAutocomplete:function(url,destinationElement){new Ajax.Autocompleter(this.field,destinationElement,url,{paramName:this.field.name,method:"get",minChars:2,updateElement:this._selectAutocompleteItem.bind(this),onShow:function(element,update){if(!update.style.position||update.style.position=="absolute"){update.style.position="absolute";Position.clone(element,update,{setHeight:false,offsetTop:element.offsetHeight})}Effect.Appear(update,{duration:0})}})},_selectAutocompleteItem:function(element){if(element.title){this.field.value=element.title}this.form.submit()}};Varien.Tabs=Class.create();Varien.Tabs.prototype={initialize:function(selector){var self=this;$$(selector+" a").each(this.initTab.bind(this))},initTab:function(el){el.href="javascript:void(0)";if($(el.parentNode).hasClassName("active")){this.showContent(el)}el.observe("click",this.showContent.bind(this,el))},showContent:function(a){var li=$(a.parentNode),ul=$(li.parentNode);ul.getElementsBySelector("li","ol").each(function(el){var contents=$(el.id+"_contents");if(el==li){el.addClassName("active");contents.show()}else{el.removeClassName("active");contents.hide()}})}};Varien.DateElement=Class.create();Varien.DateElement.prototype={initialize:function(type,content,required,format){if(type=="id"){this.day=$(content+"day");this.month=$(content+"month");this.year=$(content+"year");this.full=$(content+"full");this.advice=$(content+"advice")}else{if(type=="container"){this.day=content.day;this.month=content.month;this.year=content.year;this.full=content.full;this.advice=content.advice}else{return}}this.required=required;this.format=format;this.day.addClassName("validate-custom");this.day.validate=this.validate.bind(this);this.month.addClassName("validate-custom");this.month.validate=this.validate.bind(this);this.year.addClassName("validate-custom");this.year.validate=this.validate.bind(this);this.year.setAttribute("autocomplete","off");this.advice.hide()},validate:function(){var error=false;if(this.day.value==""&&this.month.value==""&&this.year.value==""){if(this.required){error="This date is a required value."}else{this.full.value=""}}else{if(this.day.value==""||this.month.value==""||this.year.value==""){error="Please enter a valid full date."}else{var date=new Date();if(this.day.value<1||this.day.value>31){error="Please enter a valid day (1-31)."}else{if(this.month.value<1||this.month.value>12){error="Please enter a valid month (1-12)."}else{if(this.year.value<1900||this.year.value>date.getFullYear()){error="Please enter a valid year (1900-"+date.getFullYear()+")."}else{this.full.value=this.format.replace(/(%m|%b)/i,this.month.value).replace(/(%d|%e)/i,this.day.value).replace(/%y/i,this.year.value);var testFull=this.month.value+"/"+this.day.value+"/"+this.year.value;var test=new Date(testFull);if(isNaN(test)){error="Please enter a valid date."}}}}}}if(error!==false){try{this.advice.innerHTML=Translator.translate(error)}catch(e){this.advice.innerHTML=error}this.advice.show();return false}this.day.removeClassName("validation-failed");this.month.removeClassName("validation-failed");this.year.removeClassName("validation-failed");this.advice.hide();return true}};Varien.DOB=Class.create();Varien.DOB.prototype={initialize:function(selector,required,format){var el=$$(selector)[0];var container={};container.day=Element.select(el,".dob-day input")[0];container.month=Element.select(el,".dob-month input")[0];container.year=Element.select(el,".dob-year input")[0];container.full=Element.select(el,".dob-full input")[0];container.advice=Element.select(el,".validation-advice")[0];new Varien.DateElement("container",container,required,format)}};Varien.FileElement=Class.create();Varien.FileElement.prototype={initialize:function(id){this.fileElement=$(id);this.hiddenElement=$(id+"_value");this.fileElement.observe("change",this.selectFile.bind(this))},selectFile:function(event){this.hiddenElement.value=this.fileElement.getValue()}};Validation.addAllThese([["validate-custom"," ",function(v,elm){return elm.validate()}]]);function truncateOptions(){$$(".truncated").each(function(element){Event.observe(element,"mouseover",function(){if(element.down("div.truncated_full_value")){element.down("div.truncated_full_value").addClassName("show")}});Event.observe(element,"mouseout",function(){if(element.down("div.truncated_full_value")){element.down("div.truncated_full_value").removeClassName("show")}})})}Event.observe(window,"load",function(){truncateOptions()});Element.addMethods({getInnerText:function(element){element=$(element);if(element.innerText&&!Prototype.Browser.Opera){return element.innerText}return element.innerHTML.stripScripts().unescapeHTML().replace(/[\n\r\s]+/g," ").strip()}});if(!("console" in window)||!("firebug" in console)){var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var i=0;i<names.length;++i){window.console[names[i]]=function(){}}}function fireEvent(element,event){if(document.createEventObject){var evt=document.createEventObject();return element.fireEvent("on"+event,evt)}else{var evt=document.createEvent("HTMLEvents");evt.initEvent(event,true,true);return !element.dispatchEvent(evt)}};


// FROM: http://live.coffeeforless.com/js/varien/form_min.js
VarienForm=Class.create();VarienForm.prototype={initialize:function(c,b){this.form=$(c);if(!this.form){return}this.cache=$A();this.currLoader=false;this.currDataIndex=false;this.validator=new Validation(this.form);this.elementFocus=this.elementOnFocus.bindAsEventListener(this);this.elementBlur=this.elementOnBlur.bindAsEventListener(this);this.childLoader=this.onChangeChildLoad.bindAsEventListener(this);this.highlightClass="highlight";this.extraChildParams="";this.firstFieldFocus=b||false;this.bindElements();if(this.firstFieldFocus){try{Form.Element.focus(Form.findFirstElement(this.form))}catch(a){}}},submit:function(a){if(this.validator&&this.validator.validate()){this.form.submit()}return false},bindElements:function(){var a=Form.getElements(this.form);for(var b in a){if(a[b].id){Event.observe(a[b],"focus",this.elementFocus);Event.observe(a[b],"blur",this.elementBlur)}}},elementOnFocus:function(b){var a=Event.findElement(b,"fieldset");if(a){Element.addClassName(a,this.highlightClass)}},elementOnBlur:function(b){var a=Event.findElement(b,"fieldset");if(a){Element.removeClassName(a,this.highlightClass)}},setElementsRelation:function(a,d,b,c){if(a=$(a)){if(!this.cache[a.id]){this.cache[a.id]=$A();this.cache[a.id]["child"]=d;this.cache[a.id]["dataUrl"]=b;this.cache[a.id]["data"]=$A();this.cache[a.id]["first"]=c||false}Event.observe(a,"change",this.childLoader)}},onChangeChildLoad:function(a){element=Event.element(a);this.elementChildLoad(element)},elementChildLoad:function(a,b){this.callback=b||false;if(a.value){this.currLoader=a.id;this.currDataIndex=a.value;if(this.cache[a.id]["data"][a.value]){this.setDataToChild(this.cache[a.id]["data"][a.value])}else{new Ajax.Request(this.cache[this.currLoader]["dataUrl"],{method:"post",parameters:{parent:a.value},onComplete:this.reloadChildren.bind(this)})}}},reloadChildren:function(transport){var data=eval("("+transport.responseText+")");this.cache[this.currLoader]["data"][this.currDataIndex]=data;this.setDataToChild(data)},setDataToChild:function(c){if(c.length){var d=$(this.cache[this.currLoader]["child"]);if(d){var b='<select name="'+d.name+'" id="'+d.id+'" class="'+d.className+'" title="'+d.title+'" '+this.extraChildParams+">";if(this.cache[this.currLoader]["first"]){b+='<option value="">'+this.cache[this.currLoader]["first"]+"</option>"}for(var a in c){if(c[a].value){b+='<option value="'+c[a].value+'"';if(d.value&&(d.value==c[a].value||d.value==c[a].label)){b+=" selected"}b+=">"+c[a].label+"</option>"}}b+="</select>";Element.insert(d,{before:b});Element.remove(d)}}else{var d=$(this.cache[this.currLoader]["child"]);if(d){var b='<input type="text" name="'+d.name+'" id="'+d.id+'" class="'+d.className+'" title="'+d.title+'" '+this.extraChildParams+">";Element.insert(d,{before:b});Element.remove(d)}}this.bindElements();if(this.callback){this.callback()}}};RegionUpdater=Class.create();RegionUpdater.prototype={initialize:function(b,c,d,f,a,e){this.countryEl=$(b);this.regionTextEl=$(c);this.regionSelectEl=$(d);this.zipEl=$(e);this.regions=f;this.disableAction=(typeof a=="undefined")?"hide":a;this.zipOptions=(typeof zipOptions=="undefined")?false:zipOptions;if(this.regionSelectEl.options.length<=1){this.update()}Event.observe(this.countryEl,"change",this.update.bind(this))},update:function(){if(this.regions[this.countryEl.value]){var a,c,e,d;if(this.regionTextEl){d=this.regionTextEl.value.toLowerCase();this.regionTextEl.value=""}if(!d){d=this.regionSelectEl.getAttribute("defaultValue")}this.regionSelectEl.options.length=1;for(regionId in this.regions[this.countryEl.value]){e=this.regions[this.countryEl.value][regionId];c=document.createElement("OPTION");c.value=regionId;c.text=e.name;if(this.regionSelectEl.options.add){this.regionSelectEl.options.add(c)}else{this.regionSelectEl.appendChild(c)}if(regionId==d||e.name.toLowerCase()==d||e.code.toLowerCase()==d){this.regionSelectEl.value=regionId}}if(this.disableAction=="hide"){if(this.regionTextEl){this.regionTextEl.style.display="none"}this.regionSelectEl.style.display=""}else{if(this.disableAction=="disable"){if(this.regionTextEl){this.regionTextEl.disabled=true}this.regionSelectEl.disabled=false}}this.setMarkDisplay(this.regionSelectEl,true)}else{if(this.disableAction=="hide"){if(this.regionTextEl){this.regionTextEl.style.display=""}this.regionSelectEl.style.display="none";Validation.reset(this.regionSelectEl)}else{if(this.disableAction=="disable"){if(this.regionTextEl){this.regionTextEl.disabled=false}this.regionSelectEl.disabled=true}else{if(this.disableAction=="nullify"){this.regionSelectEl.options.length=1;this.regionSelectEl.value="";this.regionSelectEl.selectedIndex=0;this.lastCountryId=""}}}this.setMarkDisplay(this.regionSelectEl,false)}var b=new ZipUpdater(this.countryEl.value,this.zipEl);b.update()},setMarkDisplay:function(b,c){b=$(b);var a=b.up(0).down("label > span.required")||b.up(1).down("label > span.required")||b.up(0).down("label.required > em")||b.up(1).down("label.required > em");if(a){inputElement=a.up().next("input");if(c){a.show();if(inputElement){inputElement.addClassName("required-entry")}}else{a.hide();if(inputElement){inputElement.removeClassName("required-entry")}}}}};ZipUpdater=Class.create();ZipUpdater.prototype={initialize:function(b,a){this.country=b;this.zipElement=$(a)},update:function(){if(typeof optionalZipCountries=="undefined"){return false}if(this.zipElement!=undefined){this._setPostcodeOptional()}else{Event.observe(window,"load",this._setPostcodeOptional.bind(this))}},_setPostcodeOptional:function(){this.zipElement=$(this.zipElement);if(this.zipElement==undefined){return false}var a=$$('label[for="'+this.zipElement.id+'"]')[0];if(a!=undefined){var b=a.down("em")||a.down("span.required")}if(optionalZipCountries.indexOf(this.country)!=-1){while(this.zipElement.hasClassName("required-entry")){this.zipElement.removeClassName("required-entry")}if(b!=undefined){b.hide()}}else{this.zipElement.addClassName("required-entry");if(b!=undefined){b.show()}}}};


// FROM: http://live.coffeeforless.com/js/varien/menu_min.js
var mainNav=function(){var a={obj_nav:$(arguments[0])||$("nav"),settings:{show_delay:0,hide_delay:0,_ie6:/MSIE 6.+Win/.test(navigator.userAgent),_ie7:/MSIE 7.+Win/.test(navigator.userAgent)},init:function(b,c){b.lists=b.childElements();b.lists.each(function(d,e){a.handlNavElement(d);if((a.settings._ie6||a.settings._ie7)&&c){a.ieFixZIndex(d,e,b.lists.size())}});if(a.settings._ie6&&!c){document.execCommand("BackgroundImageCache",false,true)}},handlNavElement:function(b){if(b!==undefined){b.onmouseover=function(){a.fireNavEvent(this,true)};b.onmouseout=function(){a.fireNavEvent(this,false)};if(b.down("ul")){a.init(b.down("ul"),true)}}},ieFixZIndex:function(d,c,b){if(d.tagName.toString().toLowerCase().indexOf("iframe")==-1){d.style.zIndex=b-c}else{d.onmouseover="null";d.onmouseout="null"}},fireNavEvent:function(c,b){if(b){c.addClassName("over");c.down("a").addClassName("over");if(c.childElements()[1]){a.show(c.childElements()[1])}}else{c.removeClassName("over");c.down("a").removeClassName("over");if(c.childElements()[1]){a.hide(c.childElements()[1])}}},show:function(b){if(b.hide_time_id){clearTimeout(b.hide_time_id)}b.show_time_id=setTimeout(function(){if(!b.hasClassName("shown-sub")){b.addClassName("shown-sub")}},a.settings.show_delay)},hide:function(b){if(b.show_time_id){clearTimeout(b.show_time_id)}b.hide_time_id=setTimeout(function(){if(b.hasClassName("shown-sub")){b.removeClassName("shown-sub")}},a.settings.hide_delay)}};if(arguments[1]){a.settings=Object.extend(a.settings,arguments[1])}if(a.obj_nav){a.init(a.obj_nav,false)}};document.observe("dom:loaded",function(){mainNav("nav",{show_delay:"100",hide_delay:"100"})});


// FROM: http://live.coffeeforless.com/js/mage/translate_min.js
var Translate=Class.create();Translate.prototype={initialize:function(a){this.data=$H(a)},translate:function(){var a=arguments;var b=arguments[0];if(this.data.get(b)){return this.data.get(b)}return b},add:function(){if(arguments.length>1){this.data.set(arguments[0],arguments[1])}else{if(typeof arguments[0]=="object"){$H(arguments[0]).each(function(a){this.data.set(a.key,a.value)}.bind(this))}}}};


// FROM: http://live.coffeeforless.com/js/mage/cookies_min.js
if(!window.Mage){var Mage={}}Mage.Cookies={};Mage.Cookies.expires=null;Mage.Cookies.path="/";Mage.Cookies.domain=null;Mage.Cookies.secure=false;Mage.Cookies.set=function(c,e){var a=arguments;var h=arguments.length;var b=(h>2)?a[2]:Mage.Cookies.expires;var g=(h>3)?a[3]:Mage.Cookies.path;var d=(h>4)?a[4]:Mage.Cookies.domain;var f=(h>5)?a[5]:Mage.Cookies.secure;document.cookie=c+"="+escape(e)+((b==null)?"":("; expires="+b.toGMTString()))+((g==null)?"":("; path="+g))+((d==null)?"":("; domain="+d))+((f==true)?"; secure":"")};Mage.Cookies.get=function(d){var b=d+"=";var f=b.length;var a=document.cookie.length;var e=0;var c=0;while(e<a){c=e+f;if(document.cookie.substring(e,c)==b){return Mage.Cookies.getCookieVal(c)}e=document.cookie.indexOf(" ",e)+1;if(e==0){break}}return null};Mage.Cookies.clear=function(a){if(Mage.Cookies.get(a)){document.cookie=a+"=; expires=Thu, 01-Jan-70 00:00:01 GMT"}};Mage.Cookies.getCookieVal=function(b){var a=document.cookie.indexOf(";",b);if(a==-1){a=document.cookie.length}return unescape(document.cookie.substring(b,a))};


// FROM: http://live.coffeeforless.com/js/kampyle.js
<!--Start Kampyle Exit-Popup Code--> 

if (window.location.href.search("/onestepcheckout") != -1){
showThisVisitor=0;
}else{
showThisVisitor=10;
}
	var k_push_vars = {
    "display_after": 90,
	"view_percentage": showThisVisitor,
	"popup_font_color": "#000000",
	"popup_background": "#ffffff",
	"popup_separator": "#D4E2F0",
	"header": "Your feedback is important to us!",
	"question": "Would you be willing to give us a short (1 minute) feedback?",
	"footer": "Thank you for helping us improve our website",
	"remind": "Remind me later",
	"remind_font_color": "#3882C3",	
	"yes": "Yes",
	"no": "No",
	"text_direction": "ltr",
	"images_dir": "/kampyle/images/",
	"yes_background": "#76AC78",
	"no_background": "#8D9B86",
	"site_code": 7009223}
<!--End Kampyle Exit-Popup Code-->

// FROM: http://live.coffeeforless.com/js/k_push.js

var k_push_js_revision='$Rev: 14179 $';var k_button1={"Set_Cookie":function(name,value,expires,path,domain,secure)
{var today=new Date();today.setTime(today.getTime());if(expires)
expires=expires*1000*60*60*24;var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
((secure)?";secure":"");},"Get_Cookie":function(name)
{var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length)))
return null;if(start==-1)return null;var end=document.cookie.indexOf(";",len);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(len,end));},"get_main_domain":function()
{var domain=document.domain;var main_domain='';if(document.domain!="undefined"&&document.domain!=="")
{if(document.domain!='localhost')
{var dots=domain.split(/\./g);var tld=dots[dots.length-1];var sTlds=['COM','EDU','NET','ORG','GOV','MIL','INT'];var mDotsLength=3;for(var i in sTlds)
{if(sTlds[i]==tld.toUpperCase())
mDotsLength=2;}
if(dots.length>mDotsLength)
{main_domain=dots.slice(dots.length-mDotsLength).join('.');}
else
{main_domain=domain;}}}
else
{main_domain='';}
return main_domain;}};if(typeof(k_push_vars)=="undefined")
var k_push_vars={};var k_push={"after_time":20,"after_time_on_page":0,"popup_w":380,"popup_h":185,"popup_h_brand":200,"myWidth":0,"myHeight":0,"popup_open":false,"counter":0,"branding":1,"lastPosy":null,"cookie_expiration_time_no":21,"getSize":function(){if(typeof(window.innerWidth)=='number'){k_push.myWidth=window.innerWidth;k_push.myHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){k_push.myWidth=document.documentElement.clientWidth;k_push.myHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){k_push.myWidth=document.body.clientWidth;k_push.myHeight=document.body.clientHeight;}},"getScrollY":function(){var scrOfY=0;if(typeof(window.pageYOffset)=='number')
scrOfY=window.pageYOffset;else if(document.body&&(document.body.scrollTop))
scrOfY=document.body.scrollTop;else if(document.documentElement&&(document.documentElement.scrollTop))
scrOfY=document.documentElement.scrollTop;return scrOfY;},"mousePos":function(e){if(k_push.popup_open||k_push_vars.popup_manual)
return;k_push.getSize();var posy=0;if(!e)e=window.event;if(e.pageX||e.pageY)
posy=e.pageY;else if(e.clientX||e.clientY)
posy=e.clientY+k_push.getScrollY();if(k_push.lastPosy===null)
k_push.lastPosy=posy;else
{if(k_push.lastPosy<posy)
k_push.lastPosy=posy;else
{if(posy<k_push.getScrollY()+15)
k_push.openPopup();}}},"popup_init":function(){if(k_push.popup)
k_push.popup.parentNode.removeChild(k_push.popup);k_push.getSize();if(window.addEventListener)
window.addEventListener('mousemove',k_push.mousePos,false);else
document.attachEvent('onmousemove',k_push.mousePos);var maskBG=document.createElement('div');maskBG.setAttribute('id','k_maskBG');document.body.appendChild(maskBG);var popup=document.createElement('div');var use_brand=k_push.branding&&!k_push_vars.no_brand?true:false;popup.setAttribute('id','k_popup');popup.style.width=(k_push_vars.popup_w?k_push_vars.popup_w:k_push.popup_w)+'px';if(!k_push_vars.popup_h)
popup.style.lineHeight="normal";popup.style.color=(k_push_vars.popup_font_color)?k_push_vars.popup_font_color:'#000000';k_push.ff_link_id=(k_push_vars.ff_link_id)?k_push_vars.ff_link_id:'kampylink';k_push.ff_params=(k_push_vars.ff_params)?k_push_vars.ff_params:false;k_push.header=(k_push_vars.header)?k_push_vars.header:'Your feedback is important to us!';k_push.question=(k_push_vars.question)?k_push_vars.question:'Would you be willing to give us a short (1 minute) feedback?';k_push.footer=(k_push_vars.footer)?k_push_vars.footer:'Thank you for helping us improve our website';k_push.yes=(k_push_vars.yes)?k_push_vars.yes:'Yes';k_push.no=(k_push_vars.no)?k_push_vars.no:'No';k_push.yes_background=(k_push_vars.yes_background)?k_push_vars.yes_background:'#76AC78';k_push.no_background=(k_push_vars.no_background)?k_push_vars.no_background:'#8D9B86';k_push.dir=(k_push_vars.text_direction=='rtl')?'rtl':'ltr';k_push.remind=k_push_vars.remind?k_push_vars.remind:'Remind me later';k_push.remind_font_color=(k_push_vars.remind_font_color)?k_push_vars.remind_font_color:'#3882C3';if(k_push.dir=='ltr')
{k_push.yes_float='left';k_push.no_float='right';}
else
{k_push.yes_float='right';k_push.no_float='left';}
k_push.images_dir=(k_push_vars.images_dir)?k_push_vars.images_dir:'http://cf.kampyle.com/';k_push.separator=k_push_vars.popup_separator?k_push_vars.popup_separator:"#ffffff";var landingPage;var rand=Math.random()*3;if(rand<1)
landingPage="/feedback-tool/";else if(rand<2)
landingPage="/feedback-form-registration/";else
landingPage="/feedback-form-registration-nb/";var branding=use_brand?"<a target='_blank' style='position:relative;bottom:3px' href='http://www.kampyle.com"+landingPage+"?r=push'>Feedback Analytics by</a>"+" &nbsp;<a target='_blank' href='http://www.kampyle.com"+landingPage+"?r=push_logo'><img src='"+k_push.images_dir+"logo.gif' /></a>"+"<div id='k_pop_whatisthis'><a href='http://www.kampyle.com"+landingPage+"?r=push_wist&amp;sid="+k_push_vars.site_code+"' target='_blank' style='position: relative; bottom: -3px;'><img src='"+k_push.images_dir+"help.gif' style='vertical-align:bottom;' /></a><a href='http://www.kampyle.com/feedback-form-registration?r=push_wist&amp;sid="+k_push_vars.site_code+"' target='_blank' style='position: relative; bottom: -3px;left:-5px;'>What is this?</a></div>":"";popup.innerHTML=""+"<div id='k_popup_inner'>"+"<div id='k_pop_header' style='border-color: "+k_push.separator+"; direction:"+k_push.dir+"'>"+k_push.header+"</div>"+"<div id='k_pop_question_container' style='border-color:"+k_push.separator+"; direction:"+k_push.dir+"'>"+
k_push.question+"<div id='k_pop_yes_no'>"+"<a id='k_pop_yes_btn' style='background-color:"+k_push.yes_background+"; float: "+k_push.yes_float+";' onclick='k_push.handleYes(); return false;'>"+
k_push.yes+"</a>"+"<a id='k_pop_no_btn' style='background-color:"+k_push.no_background+"; float: "+k_push.no_float+";' onclick='k_push.handleNo(); return false;'>"+
k_push.no+"</a><br /><br />"+"<a id='k_pop_remind' onclick='k_push.handleRemind()' style='color: "+k_push.remind_font_color+";'>"+
k_push.remind+"</a>"+"</div><br />"+
k_push.footer+"</div>"+"<div id='k_pop_branding'>"+branding+"</div>"+"</div>";popup.style.background=(k_push_vars.popup_background)?k_push_vars.popup_background:'#FFFFFF';popup.style.borderColor=k_push.separator;k_push.popup=popup;document.body.appendChild(popup);},"handlePostYes":function(){},"handlePostNo":function(){},"handlePostRemind":function(){},"handleYes":function()
{if(k_push.ff_params&&typeof(k_button)!="undefined")
{k_button.open_ff(k_push.ff_params+"&push=1");}
else
{var ff_link=document.getElementById(k_push.ff_link_id);if(ff_link)
{ff_link.rel="&push=1";ff_link.onclick();}}
k_push.closePopup();},"handleNo":function()
{k_push.closePopup();},"handleRemind":function()
{k_push.closePopup();k_push.counter=0;var timeForPopup=(new Date()).getTime()+parseInt((1000*60*2),10);var main_domain=k_button1.get_main_domain();k_button1.Set_Cookie("push_time_start",timeForPopup,0,"/",main_domain,'');k_button1.Set_Cookie("k_push8",0,0,"/",main_domain,'');},"remind_later":function()
{k_push.handleRemind();},"openPopup":function()
{if(!k_push_vars.popup_manual)
{var timeNow=(new Date()).getTime();var timeLeft=k_push.initData.timeForPopup-timeNow;if(timeLeft>0)
return;if(k_button1.Get_Cookie('k_push8')&&k_button1.Get_Cookie('k_push8')!==0&&!k_push_vars.disable_cookie)
return;if((k_push.popup_open)||(k_push.counter>0)||(!document.getElementById(k_push.ff_link_id)))
return;}
var main_domain=k_button1.get_main_domain();var cookie_expiration_time_no=k_push_vars.cookie_expiration_time_no!==undefined?k_push_vars.cookie_expiration_time_no:k_push.cookie_expiration_time_no;k_button1.Set_Cookie('k_push8','1',cookie_expiration_time_no,'/',main_domain,'');k_push.counter++;k_push.popup_open=true;var maskBG=document.getElementById('k_maskBG');var popup=document.getElementById('k_popup');var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;popup.style.top=(k_push.myHeight/2)-(k_push.popup_h/2)+scrollTop+'px';popup.style.left=k_push.myWidth/2-k_push.popup_w/2+'px';popup.style.display='block';var inner=document.getElementById("k_popup_inner");maskBG.innerHTML='<div style="width: 100%; height: 100%; opacity: 0.6; filter: alpha(opacity=60); background-color:#111111;"></div>';maskBG.style.position='absolute';maskBG.style.top='0px';maskBG.style.left='0px';maskBG.style.zIndex='9998';var w=(document.documentElement.scrollWidth>document.body.scrollWidth)?document.documentElement.scrollWidth:document.body.scrollWidth;maskBG.style.width=w+'px';var h=(document.documentElement.scrollHeight>document.body.scrollHeight)?document.documentElement.scrollHeight:document.body.scrollHeight;maskBG.style.height=h+'px';maskBG.style.display='block';if(document.all)
k_push.toggleSelects('hidden');},"closePopup":function()
{var main_domain=k_button1.get_main_domain();k_button1.Set_Cookie("push_time_start","0",0,"/",main_domain,'');k_push.popup_open=false;var maskBG=document.getElementById('k_maskBG');var popup=document.getElementById('k_popup');popup.style.display='none';maskBG.style.display='none';if(document.all)
k_push.toggleSelects('visible');},"toggleSelects":function(visibility){try{var selects=document.getElementsByTagName('select');for(var i=0;i<selects.length;i++)
selects[i].style.visibility=visibility;}
catch(err)
{}},"initData":{},"init":function(){if(k_button1.Get_Cookie("push_time_start")>0)
{k_push.initData.timeForPopupSession=parseInt(k_button1.Get_Cookie("push_time_start"),10);}
else
{var seconds_to_delay=k_push_vars.display_after!==undefined?k_push_vars.display_after:k_push.after_time;k_push.initData.timeForPopupSession=(new Date()).getTime()+seconds_to_delay*1000;var main_domain=k_button1.get_main_domain();k_button1.Set_Cookie("push_time_start",k_push.initData.timeForPopupSession,0,"/",main_domain,'');}
var seconds_to_delay_page=k_push_vars.display_after_on_page!==undefined?k_push_vars.display_after_on_page:k_push.after_time_on_page;k_push.initData.timeForPopupPage=(new Date()).getTime()+seconds_to_delay_page*1000;k_push.initData.timeForPopup=Math.max(k_push.initData.timeForPopupSession,k_push.initData.timeForPopupPage);if(!k_push_vars.view_percentage)
k_push.n=0;else
k_push.n=(k_push_vars.view_percentage&&((k_push_vars.view_percentage>=0)&&(k_push_vars.view_percentage<=100)))?k_push_vars.view_percentage:10;k_push.initData.shouldLoad=false;if(k_push_vars.popup_manual)
{k_push.initData.shouldLoad=true;}
else if(((k_push.n===null)||(((Math.random()*100)<k_push.n))))
{if(k_push_vars.disable_cookie)
k_push.initData.shouldLoad=true;else if(!k_button1.Get_Cookie('k_push8')||k_button1.Get_Cookie('k_push8')===0)
k_push.initData.shouldLoad=true;}
if(k_push.initData.shouldLoad)
{if(window.addEventListener)
window.addEventListener('load',k_push.popup_init,false);else
window.attachEvent('onload',k_push.popup_init);}}};k_push.init();

// FROM: http://live.coffeeforless.com/js/k_button.js


var k_button_js_revision='$Rev: 14180 $';var k_button={"ff_link":document.getElementById("kampylink"),"help_button":document.getElementById("k_help_button"),"k_slogan":document.getElementById("k_slogan"),"close_button":document.getElementById("k_close_button"),"extra_params":null,"newwindow":'',"popitup":function(url,longUrl){if(!this.newwindow.closed&&this.newwindow.location)
this.newwindow.location.href=url;else
{if(!this.window_width)
this.window_width=440;if(!this.window_height)
this.window_height=502;this.newwindow=window.open(url+"",'kampyle_ff','left='+((window.screenX||window.screenLeft)+10)+',top='+((window.screenY||window.screenTop)+10)+',height='+this.window_height+'px,width='+this.window_width+'px,resizable=false');if(!this.newwindow)
{this.newwindow='';return;}
if(!this.newwindow.opener)this.newwindow.opener=self;}
if(window.focus)
this.newwindow.focus();if(longUrl!='kampyle_ff')
this.newwindow.name=longUrl;return false;},"Set_Cookie":function(name,value,expires,path,domain,secure)
{var today=new Date();today.setTime(today.getTime());if(expires)
expires=expires*1000*60*60*24;var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
((secure)?";secure":"");},"Get_Cookie":function(name)
{var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length)))
return null;if(start==-1)
return null;var end=document.cookie.indexOf(";",len);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(len,end));},"get_main_domain":function()
{var main_domain='';var domain=document.domain;if(document.domain!="undefined"&&document.domain!=="")
{if(document.domain!='localhost')
{var dots=domain.split(/\./g);var tld=dots[dots.length-1];var sTlds=['COM','EDU','NET','ORG','GOV','MIL','INT'];var mDotsLength=3;for(var i in sTlds)
{if(sTlds[i]==tld.toUpperCase())
mDotsLength=2;}
if(dots.length>mDotsLength)
{main_domain=dots.slice(dots.length-mDotsLength).join('.');}
else
{main_domain=domain;}}}
return main_domain;},"generate_pre_id":function()
{var vector1=Math.floor(Math.random()*(Math.pow(2,48)));var vector2=new Date().getTime();return vector1+"_"+vector2;},"open_ff":function(ff_params,url)
{var urlObject=this.create_ff_url(ff_params,url);this.popitup(urlObject.shortUrl,urlObject.longUrl);},"create_ff_url":function(ff_params,url,form_data)
{var stats_kvp=[];var matches=false;if(typeof(k_button_js_revision)!='undefined')
{matches=k_button_js_revision.match(/\d+/);if(matches!==false)
{stats_kvp.push('k_button_js_revision='+matches[0]);}}
if(typeof(k_push_js_revision)!='undefined')
{matches=k_push_js_revision.match(/\d+/);if(matches!==false)
{stats_kvp.push('k_push_js_revision='+matches[0]);}}
var cookie_expiration_time_yes=21;if(typeof(k_push_vars)!='undefined')
{if(typeof(k_push_vars.view_percentage)!='undefined')
stats_kvp.push('view_percentage='+k_push_vars.view_percentage);if(typeof(k_push_vars.display_after)!='undefined')
stats_kvp.push('display_after='+k_push_vars.display_after);if(typeof(k_push_vars.cookie_expiration_time_yes)!='undefined')
cookie_expiration_time_yes=k_push_vars.cookie_expiration_time_yes;}
var stats_string=stats_kvp.join("&");var main_domain=k_button.get_main_domain();k_button.Set_Cookie('k_push8','1',cookie_expiration_time_yes,'/',main_domain,'');var url2send=url||window.location.href;url2send=encodeURIComponent(url2send);var ff_url='';if(!ff_params)
{ff_url=k_button.ff_link.href;if(k_button.ff_link.rel=='&push=1')
ff_url=ff_url+k_button.ff_link.rel;}
else
{var ff_link_rel='';if(k_button.ff_link)
{ff_link_rel=k_button.ff_link.rel;k_button.ff_link.href="javascript:void(0);";k_button.ff_link.target="";k_button.ff_link.rel='';if(ff_link_rel=='nofollow')
ff_link_rel='';}
var main_url='';if((k_button.ff_link)&&k_button.ff_link.getAttribute('ref_server')!==null){var urlParts=k_button.ff_link.getAttribute('ref_server').split("/");main_url=urlParts[2];}
else{main_url='www.kampyle.com';}
if(!this.loader_url)
this.loader_url='/feedback_form/ff-feedback-form.php?';var protocol=document.location.protocol;if(protocol!="http:"&&protocol!="https:")
{protocol="http:";}
ff_url=protocol+'//'+main_url+this.loader_url+ff_params+ff_link_rel;}
if(window.pageTracker&&window.pageTracker._trackEvent)
{var vectors=this.generate_pre_id();window.pageTracker._trackEvent("KampyleFeedback","NewFeedback",vectors);if(!this.extra_params)
this.extra_params={};this.extra_params.vectors=vectors;}
if(this.extra_params)
{var extra_params=this.make_query_string(this.extra_params);ff_url=ff_url+'&'+extra_params;}
if(k_button.Get_Cookie("session_start_time")!==null)
{var startTime=k_button.Get_Cookie("session_start_time");var now=(new Date()).getTime();var numOfSecondsElapsed=Math.round((now-startTime)/1000);ff_url=ff_url+'&time_on_site='+numOfSecondsElapsed;}
if(stats_string!=='')
{ff_url=ff_url+'&stats='+encodeURIComponent(stats_string);}
var ga_url='';if(k_button.Get_Cookie("__utmz")!==null)
{ga_url='&utmz='+encodeURIComponent(k_button.Get_Cookie("__utmz"))+'&utma='+encodeURIComponent(k_button.Get_Cookie("__utma"))+'&utmv='+encodeURIComponent(k_button.Get_Cookie("__utmv"));}
else if(k_button.Get_Cookie("k_visit")!==null)
{ga_url='&kvisit='+encodeURIComponent(k_button.Get_Cookie("k_visit"));}
var ct_url='';var ct_pid='';if(typeof(ClickTaleGetPID)=='function')
ct_pid=ClickTaleGetPID();if(ct_pid==''&&typeof(KampyleGetClickTalePID)=='function')
ct_pid=KampyleGetClickTalePID();if(ct_pid!==''&&typeof(ClickTaleGetUID)=='function'&&typeof(ClickTaleGetSID)=='function')
{var ct_uid=ClickTaleGetUID();var ct_sid=ClickTaleGetSID();ct_url='&ctdata=0';if(ct_uid!==null&&ct_sid!==null)
{ct_url='&ctdata='+ct_pid+'..'+ct_uid+'..'+ct_sid;}}
var longUrl='kampyle_ff';if((ff_url.length+url2send.length)>1024)
{longUrl=url2send;url2send='noUrl';}
k_button.Set_Cookie("k_vectors",null,-1,"/",k_button.get_main_domain(),'');return{"shortUrl":ff_url+'&url='+url2send+ga_url+ct_url,"longUrl":longUrl};},"hide_button":function()
{k_button.ff_link.style.display="none";k_button.close_button.style.display="none";if(k_button.k_slogan)
k_button.k_slogan.style.display="none";},"make_query_string":function(params)
{var query_string='';var params_tmp=[];for(var s in params)
{if((s=='u_id')||(s=='u_email'))
params[s]=params[s].replace('+','KAMP_SPEC2B');params_tmp.push(s+'='+encodeURIComponent(params[s]));}
query_string=params_tmp.join('&');return query_string;},"addCss":function(path)
{var fileref=document.createElement("link");fileref.setAttribute("rel","stylesheet");fileref.setAttribute("type","text/css");fileref.setAttribute("href",path);if(typeof fileref!="undefined")
document.getElementsByTagName("head")[0].appendChild(fileref);},"setupSC":function(sc_instance,sc_evar)
{var vectors=k_button.Get_Cookie("k_vectors");if(vectors===null)
{vectors=k_button.generate_pre_id();k_button.Set_Cookie("k_vectors",vectors,0,"/",k_button.get_main_domain(),'');sc_instance[sc_evar]=vectors;}
if(!k_button.extra_params)
{k_button.extra_params={};}
k_button.extra_params.vectors=vectors;},"setCustomVariable":function(paramId,paramValue)
{if(!k_button.extra_params)
{k_button.extra_params={};}
k_button.extra_params['param['+paramId+"]"]=paramValue;},"init":function()
{if(k_button.Get_Cookie("session_start_time")===null)
{var main_domain=k_button.get_main_domain();k_button.Set_Cookie("session_start_time",(new Date()).getTime(),0,"/",main_domain,'');if(k_button.Get_Cookie("k_visit")===null)
{k_button.Set_Cookie('k_visit','1','365','/',main_domain,'');}
else
{k_button.Set_Cookie('k_visit',parseInt(k_button.Get_Cookie("k_visit"),10)+1,'365','/',main_domain,'');}
k_button.newSession=true;}
var ua=navigator.userAgent;var isWebkitMobile=(ua.indexOf(" AppleWebKit")>=0&&ua.indexOf("Mobile")>=0)||ua.indexOf("Nokia")>=0||ua.indexOf("BlackBerry")>=0;if(isWebkitMobile)
{var positionButton=function(){var but=k_button.ff_link;if(but.className.indexOf("k_bottom")>=0)
{var topHeight=Math.max(document.documentElement.offsetHeight,screen.height)-k_button.ff_link.children[0].offsetHeight;k_button.ff_link.style.top=topHeight+"px";k_button.ff_link.className+=" absolute";}};window.addEventListener("orientationchange",positionButton,false);window.addEventListener("resize",positionButton,false);window.addEventListener('load',positionButton,false);positionButton();}
else if(((screen.width<=800)&&(screen.height<=600))&&(k_button.ff_link.className!='k_static')&&k_button.close_button)
{k_button.close_button.onclick=k_button.hide_button;k_button.close_button.innerHTML='X';k_button.close_button.style.display="block";}
if(k_button.k_slogan===null)
{if(k_button.ff_link)
k_button.ff_link.className=k_button.ff_link.className.replace("_sl","");if(k_button.help_button)
k_button.help_button.className=k_button.help_button.className.replace("_sl","");if(k_button.close_button)
k_button.close_button.className=k_button.close_button.className.replace("_sl","");}
if(typeof(k_sc)=="object"&&k_sc.vectors)
{k_button.extra_params={'vectors':k_sc.vectors};}}};var k_button1=k_button;k_button.init();

// FROM: http://live.coffeeforless.com/js/bannerRotator.js
function bannerRotator(selector, scrollTime, pauseTime, nav){
  
  jQuery(selector+" li:first").css("display", "block"); //show the first list item
  var count = jQuery(selector+" li").size(); //get total number of list items
  if(count > 1){ //dont do anything if there is only one list item.  
	
	  if(scrollTime == null){ var scrollTime=500; } //default scroll time (length of transition)
    if(pauseTime== null){ var pauseTime=5000; } //default pause time (how long to hold the image between transitions)
    
    jQuery(selector+" li").each(function( intIndex ){ jQuery(this).attr('rel', (intIndex+1)); }); //add the list position to the each of the items

    if(nav != null){
      var i = 1;
      jQuery(selector).append("<div id='bannerNav'></div>"); //create navigation buttons
      while(i <= count){
	      if(i == jQuery(selector+" li:visible").attr('rel')){  //if its the nav item that belongs to the visible image, mark it as the active nav item
          jQuery('#bannerNav').append("<a class='active' rel='"+i+"' href='#'></a> ");
	      } 
	      else{
	        jQuery('#bannerNav').append("<a rel='"+i+"' href='#'></a> ");
	      }
	      i++;
   	  }
      jQuery('#bannerNav').append("<span class='pause'></span> "); //pause button
      jQuery('#bannerNav').append("<span href='#' class='play' style='display:none;'></span> "); //play button

      jQuery("#bannerNav a").click(function () { //handle navigation by clicking nav items
        jQuery("#bannerNav a.active").removeClass('active');									
	      jQuery(this).addClass('active'); //move the active nav item to this item
	      var currentClassName = jQuery(selector+" li:visible").attr('rel');
	      var nextClassName = jQuery(this).attr('rel');
	      var storedTimeoutID = jQuery("#bannerNav").attr('timeoutID');

	      clearTimeout(storedTimeoutID);//stop the images from looping when a nav button is pressed
	      jQuery("span.pause").hide();
	      jQuery("span.play").show();
	
	      if( nextClassName != currentClassName ){ //only change images if they clicked on a new item (not the one they are viewing)
		    jQuery(selector+" li:visible").fadeOut(scrollTime);
	        jQuery(selector+" li[rel="+nextClassName+"]").fadeIn(scrollTime);
	      }
	      return false;
      });
    
      jQuery("span.pause").click(function () { //stop the images looping on pause click
        var storedTimeoutID = jQuery("#bannerNav").attr('timeoutID');
	      clearTimeout(storedTimeoutID);
	      jQuery("span.pause").hide();
	      jQuery("span.play").show();
      });
    
      jQuery("span.play").click(function () { //start the images looping on play click
        scrollImages(count, selector, scrollTime, pauseTime);
	      jQuery("span.play").hide();
	      jQuery("span.pause").show();
      });
    }
    
    var timeout = setTimeout(function(){ 
      scrollImages(count, selector, scrollTime, pauseTime);
    }, pauseTime);
    
    jQuery("#bannerNav").attr('timeoutID', timeout); //save the timeout id so we can cancel the loop later if a nav button is pressed
  }
}

function scrollImages(count, selector, scrollTime, pauseTime){
  currentClass = jQuery(selector+" li:visible").attr('rel'); //get the list position of the current image
  nextClass = jQuery(selector+" li:visible").attr('rel'); //open a new variable for the next class
  if (currentClass == count ){ nextClass=1; } //if you've reached the end of the images... start from number 1 again
  else{ nextClass++; } //if not just add one to the last number
    
  jQuery(selector+" li[rel="+currentClass+"]").fadeOut(scrollTime); //fade out old image
  jQuery("#bannerNav a.active").removeClass('active'); //remove active class from our nav
	
  jQuery(selector+" li[rel="+nextClass+"]").fadeIn(scrollTime); //fade in new image
  jQuery("#bannerNav a[rel="+nextClass+"]").addClass('active'); //add new active class to the next nav item
  
  var timeout = setTimeout(function(){ scrollImages(count, selector, scrollTime, pauseTime); }, pauseTime); //scroll the banners again after waiting for pauseTime  
  jQuery("#bannerNav").attr('timeoutID', timeout); //save the timeout id so we can cancel the loop later if a nav button is pressed
}


// FROM: http://live.coffeeforless.com/js/varien/product_min.js
if(typeof Product=="undefined"){var Product={};}Product.Zoom=Class.create();Product.Zoom.prototype={initialize:function(imageEl,trackEl,handleEl,zoomInEl,zoomOutEl,hintEl){this.containerEl=$(imageEl).parentNode;this.imageEl=$(imageEl);this.handleEl=$(handleEl);this.trackEl=$(trackEl);this.hintEl=$(hintEl);this.containerDim=Element.getDimensions(this.containerEl);this.imageDim=Element.getDimensions(this.imageEl);this.imageDim.ratio=this.imageDim.width/this.imageDim.height;this.floorZoom=1;if(this.imageDim.width>this.imageDim.height){this.ceilingZoom=this.imageDim.width/this.containerDim.width;}else{this.ceilingZoom=this.imageDim.height/this.containerDim.height;}if(this.imageDim.width<=this.containerDim.width&&this.imageDim.height<=this.containerDim.height){this.trackEl.up().hide();this.hintEl.hide();this.containerEl.removeClassName("product-image-zoom");return;}this.imageX=0;this.imageY=0;this.imageZoom=1;this.sliderSpeed=0;this.sliderAccel=0;this.zoomBtnPressed=false;this.showFull=false;this.selects=document.getElementsByTagName("select");this.draggable=new Draggable(imageEl,{starteffect:false,reverteffect:false,endeffect:false,snap:this.contain.bind(this)});this.slider=new Control.Slider(handleEl,trackEl,{axis:"horizontal",minimum:0,maximum:Element.getDimensions(this.trackEl).width,alignX:0,increment:1,sliderValue:0,onSlide:this.scale.bind(this),onChange:this.scale.bind(this)});this.scale(0);Event.observe(this.imageEl,"dblclick",this.toggleFull.bind(this));Event.observe($(zoomInEl),"mousedown",this.startZoomIn.bind(this));Event.observe($(zoomInEl),"mouseup",this.stopZooming.bind(this));Event.observe($(zoomInEl),"mouseout",this.stopZooming.bind(this));Event.observe($(zoomOutEl),"mousedown",this.startZoomOut.bind(this));Event.observe($(zoomOutEl),"mouseup",this.stopZooming.bind(this));Event.observe($(zoomOutEl),"mouseout",this.stopZooming.bind(this));},toggleFull:function(){this.showFull=!this.showFull;if(typeof document.body.style.maxHeight=="undefined"){for(i=0;i<this.selects.length;i++){this.selects[i].style.visibility=this.showFull?"hidden":"visible";}}val_scale=!this.showFull?this.slider.value:1;this.scale(val_scale);this.trackEl.style.visibility=this.showFull?"hidden":"visible";this.containerEl.style.overflow=this.showFull?"visible":"hidden";this.containerEl.style.zIndex=this.showFull?"1000":"9";return this;},scale:function(v){var centerX=(this.containerDim.width*(1-this.imageZoom)/2-this.imageX)/this.imageZoom;var centerY=(this.containerDim.height*(1-this.imageZoom)/2-this.imageY)/this.imageZoom;var overSize=(this.imageDim.width>this.containerDim.width&&this.imageDim.height>this.containerDim.height);this.imageZoom=this.floorZoom+(v*(this.ceilingZoom-this.floorZoom));if(overSize){if(this.imageDim.width>this.containerDim.width){this.imageEl.style.width=(this.imageZoom*this.containerDim.width)+"px";}if(this.containerDim.ratio){this.imageEl.style.height=(this.imageZoom*this.containerDim.width*this.containerDim.ratio)+"px";}}else{this.slider.setDisabled();}this.imageX=this.containerDim.width*(1-this.imageZoom)/2-centerX*this.imageZoom;this.imageY=this.containerDim.height*(1-this.imageZoom)/2-centerY*this.imageZoom;this.contain(this.imageX,this.imageY,this.draggable);return true;},startZoomIn:function(){if(!this.slider.disabled){this.zoomBtnPressed=true;this.sliderAccel=0.002;this.periodicalZoom();this.zoomer=new PeriodicalExecuter(this.periodicalZoom.bind(this),0.05);}return this;},startZoomOut:function(){if(!this.slider.disabled){this.zoomBtnPressed=true;this.sliderAccel=-0.002;this.periodicalZoom();this.zoomer=new PeriodicalExecuter(this.periodicalZoom.bind(this),0.05);}return this;},stopZooming:function(){if(!this.zoomer||this.sliderSpeed==0){return;}this.zoomBtnPressed=false;this.sliderAccel=0;},periodicalZoom:function(){if(!this.zoomer){return this;}if(this.zoomBtnPressed){this.sliderSpeed+=this.sliderAccel;}else{this.sliderSpeed/=1.5;if(Math.abs(this.sliderSpeed)<0.001){this.sliderSpeed=0;this.zoomer.stop();this.zoomer=null;}}this.slider.value+=this.sliderSpeed;this.slider.setValue(this.slider.value);this.scale(this.slider.value);return this;},contain:function(x,y,draggable){var dim=Element.getDimensions(draggable.element);var xMin=0,xMax=this.containerDim.width-dim.width;var yMin=0,yMax=this.containerDim.height-dim.height;x=x>xMin?xMin:x;x=x<xMax?xMax:x;y=y>yMin?yMin:y;y=y<yMax?yMax:y;if(this.containerDim.width>dim.width){x=(this.containerDim.width/2)-(dim.width/2);}if(this.containerDim.height>dim.height){y=(this.containerDim.height/2)-(dim.height/2);}this.imageX=x;this.imageY=y;this.imageEl.style.left=this.imageX+"px";this.imageEl.style.top=this.imageY+"px";return[x,y];}};Product.Config=Class.create();Product.Config.prototype={initialize:function(config){this.config=config;this.taxConfig=this.config.taxConfig;this.settings=$$(".super-attribute-select");this.state=new Hash();this.priceTemplate=new Template(this.config.template);this.prices=config.prices;this.settings.each(function(element){Event.observe(element,"change",this.configure.bind(this));}.bind(this));this.settings.each(function(element){var attributeId=element.id.replace(/[a-z]*/,"");if(attributeId&&this.config.attributes[attributeId]){element.config=this.config.attributes[attributeId];element.attributeId=attributeId;this.state[attributeId]=false;}}.bind(this));var childSettings=[];for(var i=this.settings.length-1;i>=0;i--){var prevSetting=this.settings[i-1]?this.settings[i-1]:false;var nextSetting=this.settings[i+1]?this.settings[i+1]:false;if(i==0){this.fillSelect(this.settings[i]);}else{this.settings[i].disabled=true;}$(this.settings[i]).childSettings=childSettings.clone();$(this.settings[i]).prevSetting=prevSetting;$(this.settings[i]).nextSetting=nextSetting;childSettings.push(this.settings[i]);}var separatorIndex=window.location.href.indexOf("#");if(separatorIndex!=-1){var paramsStr=window.location.href.substr(separatorIndex+1);this.values=paramsStr.toQueryParams();this.settings.each(function(element){var attributeId=element.attributeId;element.value=(typeof(this.values[attributeId])=="undefined")?"":this.values[attributeId];this.configureElement(element);}.bind(this));}},configure:function(event){var element=Event.element(event);this.configureElement(element);},configureElement:function(element){this.reloadOptionLabels(element);if(element.value){this.state[element.config.id]=element.value;if(element.nextSetting){element.nextSetting.disabled=false;this.fillSelect(element.nextSetting);this.resetChildren(element.nextSetting);}}else{this.resetChildren(element);}this.reloadPrice();},reloadOptionLabels:function(element){var selectedPrice;if(element.options[element.selectedIndex].config){selectedPrice=parseFloat(element.options[element.selectedIndex].config.price);}else{selectedPrice=0;}for(var i=0;i<element.options.length;i++){if(element.options[i].config){element.options[i].text=this.getOptionLabel(element.options[i].config,element.options[i].config.price-selectedPrice);}}},resetChildren:function(element){if(element.childSettings){for(var i=0;i<element.childSettings.length;i++){element.childSettings[i].selectedIndex=0;element.childSettings[i].disabled=true;if(element.config){this.state[element.config.id]=false;}}}},fillSelect:function(element){var attributeId=element.id.replace(/[a-z]*/,"");var options=this.getAttributeOptions(attributeId);this.clearSelect(element);element.options[0]=new Option(this.config.chooseText,"");var prevConfig=false;if(element.prevSetting){prevConfig=element.prevSetting.options[element.prevSetting.selectedIndex];}if(options){var index=1;for(var i=0;i<options.length;i++){var allowedProducts=[];if(prevConfig){for(var j=0;j<options[i].products.length;j++){if(prevConfig.config.allowedProducts&&prevConfig.config.allowedProducts.indexOf(options[i].products[j])>-1){allowedProducts.push(options[i].products[j]);}}}else{allowedProducts=options[i].products.clone();}if(allowedProducts.size()>0){options[i].allowedProducts=allowedProducts;element.options[index]=new Option(this.getOptionLabel(options[i],options[i].price),options[i].id);element.options[index].config=options[i];index++;}}}},getOptionLabel:function(option,price){var price=parseFloat(price);if(this.taxConfig.includeTax){var tax=price/(100+this.taxConfig.defaultTax)*this.taxConfig.defaultTax;var excl=price-tax;var incl=excl*(1+(this.taxConfig.currentTax/100));}else{var tax=price*(this.taxConfig.currentTax/100);var excl=price;var incl=excl+tax;}if(this.taxConfig.showIncludeTax||this.taxConfig.showBothPrices){price=incl;}else{price=excl;}var str=option.label;if(price){if(this.taxConfig.showBothPrices){str+=" "+this.formatPrice(excl,true)+" ("+this.formatPrice(price,true)+" "+this.taxConfig.inclTaxTitle+")";}else{str+=" "+this.formatPrice(price,true);}}return str;},formatPrice:function(price,showSign){var str="";price=parseFloat(price);if(showSign){if(price<0){str+="-";price=-price;}else{str+="+";}}var roundedPrice=(Math.round(price*100)/100).toString();if(this.prices&&this.prices[roundedPrice]){str+=this.prices[roundedPrice];}else{str+=this.priceTemplate.evaluate({price:price.toFixed(2)});}return str;},clearSelect:function(element){for(var i=element.options.length-1;i>=0;i--){element.remove(i);}},getAttributeOptions:function(attributeId){if(this.config.attributes[attributeId]){return this.config.attributes[attributeId].options;}},reloadPrice:function(){var price=0;var oldPrice=0;for(var i=this.settings.length-1;i>=0;i--){var selected=this.settings[i].options[this.settings[i].selectedIndex];if(selected.config){price+=parseFloat(selected.config.price);oldPrice+=parseFloat(selected.config.oldPrice);}}optionsPrice.changePrice("config",{"price":price,"oldPrice":oldPrice});optionsPrice.reload();return price;if($("product-price-"+this.config.productId)){$("product-price-"+this.config.productId).innerHTML=price;}this.reloadOldPrice();},reloadOldPrice:function(){if($("old-price-"+this.config.productId)){var price=parseFloat(this.config.oldPrice);for(var i=this.settings.length-1;i>=0;i--){var selected=this.settings[i].options[this.settings[i].selectedIndex];if(selected.config){price+=parseFloat(selected.config.price);}}if(price<0){price=0;}price=this.formatPrice(price);if($("old-price-"+this.config.productId)){$("old-price-"+this.config.productId).innerHTML=price;}}}};Product.Super={};Product.Super.Configurable=Class.create();Product.Super.Configurable.prototype={initialize:function(container,observeCss,updateUrl,updatePriceUrl,priceContainerId){this.container=$(container);this.observeCss=observeCss;this.updateUrl=updateUrl;this.updatePriceUrl=updatePriceUrl;this.priceContainerId=priceContainerId;this.registerObservers();},registerObservers:function(){var elements=this.container.getElementsByClassName(this.observeCss);elements.each(function(element){Event.observe(element,"change",this.update.bindAsEventListener(this));}.bind(this));return this;},update:function(event){var elements=this.container.getElementsByClassName(this.observeCss);var parameters=Form.serializeElements(elements,true);new Ajax.Updater(this.container,this.updateUrl+"?ajax=1",{parameters:parameters,onComplete:this.registerObservers.bind(this)});var priceContainer=$(this.priceContainerId);if(priceContainer){new Ajax.Updater(priceContainer,this.updatePriceUrl+"?ajax=1",{parameters:parameters});}}};Product.OptionsPrice=Class.create();Product.OptionsPrice.prototype={initialize:function(config){this.productId=config.productId;this.priceFormat=config.priceFormat;this.includeTax=config.includeTax;this.defaultTax=config.defaultTax;this.currentTax=config.currentTax;this.productPrice=config.productPrice;this.showIncludeTax=config.showIncludeTax;this.showBothPrices=config.showBothPrices;this.productPrice=config.productPrice;this.productOldPrice=config.productOldPrice;this.skipCalculate=config.skipCalculate;this.duplicateIdSuffix=config.idSuffix;this.oldPlusDisposition=config.oldPlusDisposition;this.plusDisposition=config.plusDisposition;this.oldMinusDisposition=config.oldMinusDisposition;this.minusDisposition=config.minusDisposition;this.optionPrices={};this.containers={};this.displayZeroPrice=true;this.initPrices();},setDuplicateIdSuffix:function(idSuffix){this.duplicateIdSuffix=idSuffix;},initPrices:function(){this.containers[0]="product-price-"+this.productId;this.containers[1]="bundle-price-"+this.productId;this.containers[2]="price-including-tax-"+this.productId;this.containers[3]="price-excluding-tax-"+this.productId;this.containers[4]="old-price-"+this.productId;},changePrice:function(key,price){this.optionPrices[key]=price;},getOptionPrices:function(){var price=0;var nonTaxable=0;var oldPrice=0;$H(this.optionPrices).each(function(pair){if("undefined"!=typeof(pair.value.price)&&"undefined"!=typeof(pair.value.oldPrice)){price+=parseFloat(pair.value.price);oldPrice+=parseFloat(pair.value.oldPrice);}else{if(pair.key=="nontaxable"){nonTaxable=pair.value;}else{price+=parseFloat(pair.value);oldPrice+=parseFloat(pair.value);}}});var result=[price,nonTaxable,oldPrice];return result;},reload:function(){var price;var formattedPrice;var optionPrices=this.getOptionPrices();var nonTaxable=optionPrices[1];var optionOldPrice=optionPrices[2];optionPrices=optionPrices[0];$H(this.containers).each(function(pair){var _productPrice;var _plusDisposition;var _minusDisposition;if($(pair.value)){if(pair.value=="old-price-"+this.productId&&this.productOldPrice!=this.productPrice){_productPrice=this.productOldPrice;_plusDisposition=this.oldPlusDisposition;_minusDisposition=this.oldMinusDisposition;}else{_productPrice=this.productPrice;_plusDisposition=this.plusDisposition;_minusDisposition=this.minusDisposition;}var price=0;if(pair.value=="old-price-"+this.productId&&optionOldPrice!==undefined){price=optionOldPrice+parseFloat(_productPrice);}else{price=optionPrices+parseFloat(_productPrice);}if(this.includeTax=="true"){var tax=price/(100+this.defaultTax)*this.defaultTax;var excl=price-tax;var incl=excl*(1+(this.currentTax/100));}else{var tax=price*(this.currentTax/100);var excl=price;var incl=excl+tax;}excl+=parseFloat(_plusDisposition);incl+=parseFloat(_plusDisposition);excl-=parseFloat(_minusDisposition);incl-=parseFloat(_minusDisposition);excl+=parseFloat(nonTaxable);incl+=parseFloat(nonTaxable);if(pair.value=="price-including-tax-"+this.productId){price=incl;}else{if(pair.value=="old-price-"+this.productId){if(this.showIncludeTax||this.showBothPrices){price=incl;}else{price=excl;}}else{if(this.showIncludeTax){price=incl;}else{if(!this.skipCalculate||_productPrice==0){price=excl;}else{price=optionPrices+parseFloat(_productPrice);}}}}if(price<0){price=0;}if(price>0||this.displayZeroPrice){formattedPrice=this.formatPrice(price);}else{formattedPrice="";}if($(pair.value).select(".price")[0]){$(pair.value).select(".price")[0].innerHTML=formattedPrice;if($(pair.value+this.duplicateIdSuffix)&&$(pair.value+this.duplicateIdSuffix).select(".price")[0]){$(pair.value+this.duplicateIdSuffix).select(".price")[0].innerHTML=formattedPrice;}}else{$(pair.value).innerHTML=formattedPrice;if($(pair.value+this.duplicateIdSuffix)){$(pair.value+this.duplicateIdSuffix).innerHTML=formattedPrice;}}}}.bind(this));},formatPrice:function(price){return formatCurrency(price,this.priceFormat);}};

// FROM: http://live.coffeeforless.com/skin/frontend/enterprise/coffeeforless/js/enterprise/catalogevent.js
/**
 * Magento Enterprise Edition
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Magento Enterprise Edition License
 * that is bundled with this package in the file LICENSE_EE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.magentocommerce.com/license/enterprise-edition
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     enterprise_default
 * @copyright   Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license     http://www.magentocommerce.com/license/enterprise-edition
 */
 
if (!window.Enterprise) {
    window.Enterprise = {};
}

if (!Enterprise.CatalogEvent) {
    Enterprise.CatalogEvent = {};
}

Enterprise.CatalogEvent.Ticker = Class.create();

Object.extend(Enterprise.CatalogEvent.Ticker.prototype, {
    initialize: function (container, seconds) {
        this.container = $(container);
        this.seconds   = seconds;
        this.start     = new Date();
        this.interval = setInterval(this.applyTimer.bind(this), 1000);
        this.applyTimer();
    },
    getEstimate: function () {
        var now = new Date();
        
        var result = this.seconds - (now.getTime() - this.start.getTime())/1000;
        
        if (result < 0) {
            return 0;
        }
        
        return Math.round(result);
    },
    applyTimer: function () {
        var seconds = this.getEstimate();
        var daySec = Math.floor(seconds / (3600*24)) * (3600*24);
        var hourSec = Math.floor(seconds / 3600) * 3600;
        var minuteSec =  Math.floor(seconds / 60) * 60;
        var secondSec = seconds;
        this.container.down('.days').update(this.formatNumber(Math.floor(daySec/(3600*24))));
        this.container.down('.hour').update(this.formatNumber(Math.floor((hourSec - daySec)/3600)));
        this.container.down('.minute').update(this.formatNumber(Math.floor((minuteSec - hourSec)/60)));
        this.container.down('.second').update(this.formatNumber(seconds - minuteSec));
        if (daySec > 0) {
            this.container.down('.second').previous('.delimiter').hide();
            this.container.down('.second').hide();
            this.container.down('.days').show();
            this.container.down('.days').next('.delimiter').show();
        } else {
            this.container.down('.days').hide();
            this.container.down('.days').next('.delimiter').hide();
            this.container.down('.second').previous('.delimiter').show();
            this.container.down('.second').show();
        }
    },
    formatNumber: function (number) {
        if (number < 10) {
            return '0' + number.toString();
        }

        return number.toString();
    }
});

// FROM: http://live.coffeeforless.com/js/cfl-gpo-promo-min.js

function cfl_gpo_promo(d){if(jQuery.cookie('cfl_gpo_promo')=='liked')return false;if(jQuery('#___plusone_0').length!=0){if(d.state=='on')jQuery.cookie('cfl_gpo_promo','liked',{expires:365});else if(d.state=='off')jQuery.cookie('cfl_gpo_promo',null);var gph='<div id="gpo_promo_overlay"></div><div id="gpo_promo_code"><a href="#" id="gpo_promo_close">Close [X]</a><p>Thank you for supporting CoffeeForLess.com!</p><p>As a token of our gratitude, please accept this <em>one-time use</em> 10% off coupon for your next purchase!</p><p style="margin-top: 1em">Your Google +1 Promo Code Is:</p><strong style="color: #01357C;">GOOGLECFL</strong></div>';jQuery('body').append(gph);var ph = jQuery('body').height();jQuery('#gpo_promo_overlay').css({'background-color':'#000','display':'block','height':ph,'opacity':'0.5','position':'absolute','top':'0','width':'100%','z-index':'10000000'});jQuery('#gpo_promo_code').css({'background-color':'#FFF','display':'block','position':'absolute','top':'50%','left':'50%','z-index':'10000001','margin-left':'-150px','margin-top':'-75px','width':'270px','height':'100px','padding':'50px 20px 20px','border-radius':'10px','border-style':'solid','border-color':'#014FB3 #01357C #01357C #014FB3','border-width':'4px','box-shadow':'-1px 2px 3px #999999','-moz-border-radius':'10px','-moz-box-shadow':'-1px 2px 3px #999999'});jQuery('#gpo_promo_close').css({'position':'absolute','top':'4px','color':'#01357C','text-decoration':'none','right':'8px'});jQuery(document).keyup(function(e){if(e.keyCode==27){jQuery('#gpo_promo_code').remove();jQuery('#gpo_promo_overlay').remove()}});jQuery('#gpo_promo_close').click(function(e){e.preventDefault();jQuery('#gpo_promo_code').remove();jQuery('#gpo_promo_overlay').remove()})}};
