/*
 *
 * jquery.browser.js
 *
 */
(function($){$.browserTest=function(a,z){var u='unknown',x='X',m=function(r,h){for(var i=0;i<h.length;i=i+1){r=r.replace(h[i][0],h[i][1]);}return r;},c=function(i,a,b,c){var r={name:m((a.exec(i)||[u,u])[1],b)};r[r.name]=true;r.version=(c.exec(i)||[x,x,x,x])[3];if(r.name.match(/safari/)&&r.version>400){r.version='2.0';}if(r.name==='presto'){r.version=($.browser.version>9.27)?'futhark':'linear_b';}r.versionNumber=parseFloat(r.version,10)||0;r.versionX=(r.version!==x)?(r.version+'').substr(0,1):x;r.className=r.name+r.versionX;return r;};a=(a.match(/Opera|Navigator|Minefield|KHTML|Chrome/)?m(a,[[/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/,''],['Chrome Safari','Chrome'],['KHTML','Konqueror'],['Minefield','Firefox'],['Navigator','Netscape']]):a).toLowerCase();$.browser=$.extend((!z)?$.browser:{},c(a,/(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari)/,[],/(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\/|\s)([a-z0-9\.\+]*?)(\;|dev|rel|\s|$)/));$.layout=c(a,/(gecko|konqueror|msie|opera|webkit)/,[['konqueror','khtml'],['msie','trident'],['opera','presto']],/(applewebkit|rv|konqueror|msie)(\:|\/|\s)([a-z0-9\.]*?)(\;|\)|\s)/);$.os={name:(/(win|mac|linux|sunos|solaris|iphone)/.exec(navigator.platform.toLowerCase())||[u])[0].replace('sunos','solaris')};if(!z){$('html').addClass([$.os.name,$.browser.name,$.browser.className,$.layout.name,$.layout.className].join(' '));}};$.browserTest(navigator.userAgent);})(jQuery);
/*
 * jQuery Form Plugin
 * version: 2.33 (22-SEP-2009)
 * @requires jQuery v1.2.6 or later
 *
 * Examples and documentation at: http://malsup.com/jquery/form/
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
 ;(function($){$.fn.ajaxSubmit=function(w){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this}if(typeof w=='function')w={success:w};var x=$.trim(this.attr('action'));if(x){x=(x.match(/^([^#]+)/)||[])[1]}x=x||window.location.href||'';w=$.extend({url:x,type:this.attr('method')||'GET'},w||{});var y={};this.trigger('form-pre-serialize',[this,w,y]);if(y.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this}if(w.beforeSerialize&&w.beforeSerialize(this,w)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this}var a=this.formToArray(w.semantic);if(w.data){w.extraData=w.data;for(var n in w.data){if(w.data[n]instanceof Array){for(var k in w.data[n])a.push({name:n,value:w.data[n][k]})}else a.push({name:n,value:w.data[n]})}}if(w.beforeSubmit&&w.beforeSubmit(a,this,w)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this}this.trigger('form-submit-validate',[a,this,w,y]);if(y.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this}var q=$.param(a);if(w.type.toUpperCase()=='GET'){w.url+=(w.url.indexOf('?')>=0?'&':'?')+q;w.data=null}else w.data=q;var z=this,callbacks=[];if(w.resetForm)callbacks.push(function(){z.resetForm()});if(w.clearForm)callbacks.push(function(){z.clearForm()});if(!w.dataType&&w.target){var A=w.success||function(){};callbacks.push(function(a){$(w.target).html(a).each(A,arguments)})}else if(w.success)callbacks.push(w.success);w.success=function(a,b){for(var i=0,max=callbacks.length;i<max;i++)callbacks[i].apply(w,[a,b,z])};var B=$('input:file',this).fieldValue();var C=false;for(var j=0;j<B.length;j++)if(B[j])C=true;var D=false;if(w.iframe||C||D){if(w.closeKeepAlive)$.get(w.closeKeepAlive,fileUpload);else fileUpload()}else $.ajax(w);this.trigger('form-submit-notify',[this,w]);return this;function fileUpload(){var j=z[0];if($(':input[name=submit]',j).length){alert('Error: Form elements must not be named "submit".');return}var k=$.extend({},$.ajaxSettings,w);var s=$.extend(true,{},$.extend(true,{},$.ajaxSettings),k);var l='jqFormIO'+(new Date().getTime());var m=$('<iframe id="'+l+'" name="'+l+'" src="about:blank" />');var o=m[0];m.css({position:'absolute',top:'-1000px',left:'-1000px'});var p={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;m.attr('src','about:blank')}};var g=k.global;if(g&&!$.active++)$.event.trigger("ajaxStart");if(g)$.event.trigger("ajaxSend",[p,k]);if(s.beforeSend&&s.beforeSend(p,s)===false){s.global&&$.active--;return}if(p.aborted)return;var q=0;var r=0;var u=j.clk;if(u){var n=u.name;if(n&&!u.disabled){w.extraData=w.extraData||{};w.extraData[n]=u.value;if(u.type=="image"){w.extraData[name+'.x']=j.clk_x;w.extraData[name+'.y']=j.clk_y}}}setTimeout(function(){var t=z.attr('target'),a=z.attr('action');j.setAttribute('target',l);if(j.getAttribute('method')!='POST')j.setAttribute('method','POST');if(j.getAttribute('action')!=k.url)j.setAttribute('action',k.url);if(!w.skipEncodingOverride){z.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'})}if(k.timeout)setTimeout(function(){r=true;cb()},k.timeout);var b=[];try{if(w.extraData)for(var n in w.extraData)b.push($('<input type="hidden" name="'+n+'" value="'+w.extraData[n]+'" />').appendTo(j)[0]);m.appendTo('body');o.attachEvent?o.attachEvent('onload',cb):o.addEventListener('load',cb,false);j.submit()}finally{j.setAttribute('action',a);t?j.setAttribute('target',t):z.removeAttr('target');$(b).remove()}},10);var v=50;function cb(){if(q++)return;o.detachEvent?o.detachEvent('onload',cb):o.removeEventListener('load',cb,false);var c=true;try{if(r)throw'timeout';var d,doc;doc=o.contentWindow?o.contentWindow.document:o.contentDocument?o.contentDocument:o.document;var f=k.dataType=='xml'||doc.XMLDocument||$.isXMLDoc(doc);log('isXml='+f);if(!f&&(doc.body==null||doc.body.innerHTML=='')){if(--v){q=0;setTimeout(cb,100);return}log('Could not access iframe DOM after 50 tries.');return}p.responseText=doc.body?doc.body.innerHTML:null;p.responseXML=doc.XMLDocument?doc.XMLDocument:doc;p.getResponseHeader=function(a){var b={'content-type':k.dataType};return b[a]};if(k.dataType=='json'||k.dataType=='script'){var h=doc.getElementsByTagName('textarea')[0];if(h)p.responseText=h.value;else{var i=doc.getElementsByTagName('pre')[0];if(i)p.responseText=i.innerHTML}}else if(k.dataType=='xml'&&!p.responseXML&&p.responseText!=null){p.responseXML=toXml(p.responseText)}d=$.httpData(p,k.dataType)}catch(e){c=false;$.handleError(k,p,'error',e)}if(c){k.success(d,'success');if(g)$.event.trigger("ajaxSuccess",[p,k])}if(g)$.event.trigger("ajaxComplete",[p,k]);if(g&&!--$.active)$.event.trigger("ajaxStop");if(k.complete)k.complete(p,c?'success':'error');setTimeout(function(){m.remove();p.responseXML=null},100)};function toXml(s,a){if(window.ActiveXObject){a=new ActiveXObject('Microsoft.XMLDOM');a.async='false';a.loadXML(s)}else a=(new DOMParser()).parseFromString(s,'text/xml');return(a&&a.documentElement&&a.documentElement.tagName!='parsererror')?a:null}}};$.fn.ajaxForm=function(d){return this.ajaxFormUnbind().bind('submit.form-plugin',function(){$(this).ajaxSubmit(d);return false}).bind('click.form-plugin',function(e){var a=$(e.target);if(!(a.is(":submit,input:image"))){return}var b=this;b.clk=e.target;if(e.target.type=='image'){if(e.offsetX!=undefined){b.clk_x=e.offsetX;b.clk_y=e.offsetY}else if(typeof $.fn.offset=='function'){var c=a.offset();b.clk_x=e.pageX-c.left;b.clk_y=e.pageY-c.top}else{b.clk_x=e.pageX-e.target.offsetLeft;b.clk_y=e.pageY-e.target.offsetTop}}setTimeout(function(){b.clk=b.clk_x=b.clk_y=null},10)})};$.fn.ajaxFormUnbind=function(){return this.unbind('submit.form-plugin click.form-plugin')};$.fn.formToArray=function(b){var a=[];if(this.length==0)return a;var c=this[0];var d=b?c.getElementsByTagName('*'):c.elements;if(!d)return a;for(var i=0,max=d.length;i<max;i++){var e=d[i];var n=e.name;if(!n)continue;if(b&&c.clk&&e.type=="image"){if(!e.disabled&&c.clk==e){a.push({name:n,value:$(e).val()});a.push({name:n+'.x',value:c.clk_x},{name:n+'.y',value:c.clk_y})}continue}var v=$.fieldValue(e,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++)a.push({name:n,value:v[j]})}else if(v!==null&&typeof v!='undefined')a.push({name:n,value:v})}if(!b&&c.clk){var f=$(c.clk),input=f[0],n=input.name;if(n&&!input.disabled&&input.type=='image'){a.push({name:n,value:f.val()});a.push({name:n+'.x',value:c.clk_x},{name:n+'.y',value:c.clk_y})}}return a};$.fn.formSerialize=function(a){return $.param(this.formToArray(a))};$.fn.fieldSerialize=function(b){var a=[];this.each(function(){var n=this.name;if(!n)return;var v=$.fieldValue(this,b);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++)a.push({name:n,value:v[i]})}else if(v!==null&&typeof v!='undefined')a.push({name:this.name,value:v})});return $.param(a)};$.fn.fieldValue=function(a){for(var b=[],i=0,max=this.length;i<max;i++){var c=this[i];var v=$.fieldValue(c,a);if(v===null||typeof v=='undefined'||(v.constructor==Array&&!v.length))continue;v.constructor==Array?$.merge(b,v):b.push(v)}return b};$.fieldValue=function(b,c){var n=b.name,t=b.type,tag=b.tagName.toLowerCase();if(typeof c=='undefined')c=true;if(c&&(!n||b.disabled||t=='reset'||t=='button'||(t=='checkbox'||t=='radio')&&!b.checked||(t=='submit'||t=='image')&&b.form&&b.form.clk!=b||tag=='select'&&b.selectedIndex==-1))return null;if(tag=='select'){var d=b.selectedIndex;if(d<0)return null;var a=[],ops=b.options;var e=(t=='select-one');var f=(e?d+1:ops.length);for(var i=(e?d:0);i<f;i++){var g=ops[i];if(g.selected){var v=g.value;if(!v)v=(g.attributes&&g.attributes['value']&&!(g.attributes['value'].specified))?g.text:g.value;if(e)return v;a.push(v)}}return a}return b.value};$.fn.clearForm=function(){return this.each(function(){$('input,select,textarea',this).clearFields()})};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=='text'||t=='password'||tag=='textarea')this.value='';else if(t=='checkbox'||t=='radio')this.checked=false;else if(tag=='select')this.selectedIndex=-1})};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=='function'||(typeof this.reset=='object'&&!this.reset.nodeType))this.reset()})};$.fn.enable=function(b){if(b==undefined)b=true;return this.each(function(){this.disabled=!b})};$.fn.selected=function(b){if(b==undefined)b=true;return this.each(function(){var t=this.type;if(t=='checkbox'||t=='radio')this.checked=b;else if(this.tagName.toLowerCase()=='option'){var a=$(this).parent('select');if(b&&a[0]&&a[0].type=='select-one'){a.find('option').selected(false)}this.selected=b}})};function log(){if($.fn.ajaxSubmit.debug&&window.console&&window.console.log)window.console.log('[jquery.form] '+Array.prototype.join.call(arguments,''))}})(jQuery);
/*
 * jQuery Tooltip plugin 1.3
 *
 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
 * http://docs.jquery.com/Plugins/Tooltip
 *
 * Copyright (c) 2006 - 2008 J?rn Zaefferer
 *
 * $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $
 * 
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
 ;(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked;}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')$(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)return;helper.parent=$('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)helper.parent.bgiframe();helper.title=$('h3',helper.parent);helper.body=$('div.body',helper.parent);helper.url=$('div.url',helper.parent);}function settings(element){return $.data(element,"tooltip");}function handle(event){if(settings(this).delay)tID=setTimeout(show,settings(this).delay);else
show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event);}function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)helper.body.append("<br/>");helper.body.append(part);}helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}if(settings(this).showURL&&$(this).url())helper.url.html($(this).url().replace('http://','')).show();else
helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)helper.parent.fixPNG();handle.apply(this,arguments);}function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else
helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}update();}function update(event){if($.tooltip.blocked)return;if(event&&event.target.tagName=="OPTION"){return;}if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}if(current==null){$(document.body).unbind('mousemove',update);return;}helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}helper.parent.css({left:left,right:right,top:top});}var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}function hide(event){if($.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))helper.parent.stop().fadeTo(tsettings.fade,0,complete);else
helper.parent.stop().fadeOut(tsettings.fade,complete);}else
complete();if(settings(this).fixPNG)helper.parent.unfixPNG();}})(jQuery);
/*
 *
 * mediaFlicker.js
 *
 */
$(document).ready(function(){window.mediaFlickerTimers=Array();$("ul.mediaFlicker").each(function(idx){mediaFlicker_init(this)})});function mediaFlicker_init(flicker){var jqFlicker=$(flicker);var flickerId=jqFlicker.attr("id");jqFlicker.children("li").each(function(idx){if((jqFlicker.attr("mediaType")=="image")||(jqFlicker.attr("mediaType")=="imageAndText")){var imgSrc=$(this).children("img").attr("src");if((imgSrc.indexOf(".jpg")<0)&&(imgSrc.indexOf(".gif")<0)&&(imgSrc.indexOf(".png")<0)&&(imgSrc.indexOf("media.nl")<0)){$(this).attr("class","hidden")}}else{if($.trim($(this).children("div.mediaFlickerContent").html()).length==0){$(this).attr("class","hidden")}}});if(jqFlicker.children("li:not(.hidden)").length<=1){jqFlicker.css("display","none");return}jqFlicker.children("li").bind("mouseenter mouseleave",function(evt){$(this).toggleClass("over");if(jqFlicker.attr("rollAction")=="changeTarget"){if(evt.type=="mouseenter"){clearTimeout(window.mfTimer);mediaFlicker_updateTarget(jqFlicker,$(this))}else{window.mfTimer=setTimeout("mediaFlicker_updateTarget($('#"+flickerId+"'), $('#"+flickerId+"').children('li.on'))",500)}}});jqFlicker.children("li").bind("click",function(evt){mediaFlicker_selectItem(jqFlicker,$(this),true)});if(jqFlicker.attr("autoPlay")){mediaFlicker_resetTimer(flickerId,jqFlicker.attr("delay"));jqFlicker.attr("playing","true")}mediaFlicker_selectItem(jqFlicker,jqFlicker.children("li").eq(0),false)}function mediaFlicker_updateTarget(jqFlicker,jqListItem){if(jqFlicker.attr("mediaType")=="image"){mediaFlicker_updateTargetImage(jqFlicker.attr("id"),jqListItem.children("img").attr("src"))}else if(jqFlicker.attr("mediaType")=="imageAndText"){mediaFlicker_updateTargetImageAndText(jqFlicker.attr("id"),jqListItem.children("img").attr("src"),jqListItem.children("h4").html())}else{mediaFlicker_updateTargetFree(jqFlicker.attr("id"),jqListItem.children("div.mediaFlickerContent").html())}}function mediaFlicker_updateTargetFree(flickerId,contentHtml){var jqTarget=$("#"+flickerId+"_target");jqTarget.empty();jqTarget.append(contentHtml)}function mediaFlicker_updateTargetImageAndText(flickerId,imgSrc,captionHtml){mediaFlicker_updateTargetImage(flickerId,imgSrc);$("#"+flickerId+"_targetText").html(captionHtml)}function mediaFlicker_updateTargetImage(flickerId,imgSrc){$("#"+flickerId+"_targetImage").attr("src",imgSrc)}function mediaFlicker_selectItem(jqFlicker,jqListItem,doClickAction){var flickerId=jqFlicker.attr("id");jqFlicker.children("li.on").attr("class","off");jqListItem.attr("class","on");mediaFlicker_updateTarget(jqFlicker,jqListItem);if(jqFlicker.attr("playing")=="true"){mediaFlicker_resetTimer(flickerId,jqFlicker.attr("delay"))}if((doClickAction==null)||(doClickAction==true)){if(jqFlicker.attr("clickAction")=="zoom"){var jqZoomModal=$("#"+jqFlicker.attr("zoomModal"));var labelNum=jqListItem.children("label").text();jqZoomModal.modal();var jqZoomFlicker=jqZoomModal.find("div.modalPanel div.modalPanelContent div.imageViewerControls ul.mediaFlicker");var jqZoomItem=jqZoomFlicker.find("li label:contains('"+labelNum+"')").eq(0).parent();mediaFlicker_selectItem(jqZoomFlicker,jqZoomItem)}}}function mediaFlicker_advance(flickerId){var nextFlicks=$("#"+flickerId+" li.on").next("li:not(.hidden)");var nextFlick;if(nextFlicks.length==0){nextFlick=$("#"+flickerId).children("li").eq(0)}else{nextFlick=nextFlicks.eq(0)}nextFlick.trigger("click")}function mediaFlicker_resetTimer(flickerId,delay){if(window.mediaFlickerTimers[flickerId]!=null){clearInterval(window.mediaFlickerTimers[flickerId])}window.mediaFlickerTimers[flickerId]=setInterval("mediaFlicker_advance('"+flickerId+"')",(delay*1000))}function mediaFlicker_stopTimer(flickerId){if(window.mediaFlickerTimers[flickerId]!=null){clearInterval(window.mediaFlickerTimers[flickerId])}}function mediaFlicker_togglePlay(flickerId,btnElem){if($("#"+flickerId).attr("playing")=="true"){mediaFlicker_stopTimer(flickerId);$("#"+flickerId).attr("playing","false");$(btnElem).attr("src",$(btnElem).attr("playBtnSrc"))}else{mediaFlicker_resetTimer(flickerId,$("#"+flickerId).attr("delay"));$(btnElem).attr("src",$(btnElem).attr("pauseBtnSrc"));$("#"+flickerId).attr("playing","true")}}
/*
 *
 * omniConnect.js
 *
 */
function MakeOmnitureCookie(itemsInCart,cartTotal,isLoggedIn,priceLevel,custName){var cookieVal="itemsInCart="+itemsInCart
+"&cartTotal="+cartTotal.replace("$","")
+"&customerIsLoggedIn="+isLoggedIn
+"&storeDirectoryName=";switch(priceLevel){case"default":cookieVal+="StoreRetail1";break;case"Wholesale":cookieVal+="StoreWholesale2";break;case"Retail":cookieVal+="StoreRetail1";break;}
if(custName!=null){cookieVal+="&customerName="+custName.replace('&','');}
$.cookie("sailriteStoreStats",cookieVal,{path:'/',domain:'.sailrite.com'});}
/*
 * addToCartForm.js
 *
 */
var relatedforms=new Array();$(document).ready(function(){if(!(($.browser.name=="msie")&&($.browser.versionNumber=="6"))){$("form[action*='additemtocart.nl']").each(function()
{this.setAttribute("oldonsubmit",this.getAttribute("onsubmit"));this.setAttribute("onsubmit","");});$("form[action*='additemtocart.nl']").ajaxForm({beforeSubmit:function(formData,jqForm,options){var onSubmitFn=jqForm.attr("oldonsubmit");jqForm.unbind('click');jqForm.unbind('submit');jqForm.attr("onsubmit","");if(typeof onSubmitFn=='string'&&(onSubmitFn.length>0)){var result=new Function(onSubmitFn);return result();}
else if(typeof onSubmitFn=='function'){return onSubmitFn();}
else{return true;}},success:function(data){if(!($.browser.name=="msie")){$("#pageHeadMastTopCartInfo").replaceWith($("#pageHeadMastTopCartInfo",data));updateOmniCookie();}
else{$("#pageHeadMastTopCartInfo").load("/s.nl/sc.38/.f #pageHeadMastTopCartInfo > *",updateOmniCookie);}
if($("#shoppingCartHead").length>0){$("#addToCartModal").modal({onClose:function(dialog){window.location.reload();}});}
else{$("#addToCartModal").modal();}}});}
while(relatedforms.length>0)
{$("#"+relatedforms.pop()).parent().find("select").each(function(){var selectlabel=$(this).parent().parent().prev().prev().find("a");selectlabel.parent().parent().remove();$(this).parent().parent().prev().remove();$(this).find("option").eq(0).html("- "+selectlabel.text()+" -");});}
$("div.pageGuidedNavPanel textarea").parent().parent().parent().hide();});function updateOmniCookie(){var cartData=$.trim($("a.cartInfo").text()).split(/ /);MakeOmnitureCookie(cartData[1].replace('(',''),cartData[0].replace('$',''),customerIsLoggedIn,custPriceLevel,custName);}
function generatePriceDisplay(isWholesale,wholesalePrice,retailPrice,nsPriceHtml,customerPriceClass,retailPriceClass,centerQuantityTable){var priceHtml="";nsPriceHtml=nsPriceHtml.replace("<br>","");if(retailPrice=="$0.00"){retailPrice="FREE";}
if(wholesalePrice=="$0.00"){wholesalePrice="FREE";}
var hasQuantityPrice=(nsPriceHtml.indexOf("<table")>=0);var quantityPriceTable=nsPriceHtml;if(hasQuantityPrice){quantityPriceTable=quantityPriceTable.replace(/.+<table/,"<table");if(centerQuantityTable){quantityPriceTable=quantityPriceTable.replace("<table","<table align='center'");}}
var hasPriceRange=(nsPriceHtml.indexOf("itemprice")>=0);var priceRange=nsPriceHtml;if(hasPriceRange){priceRange=priceRange.replace(/<\/span>.+/,"</span>");}
if(!isWholesale&&!hasPriceRange){priceHtml+="<div class='"+customerPriceClass+"'>"+retailPrice+"</div>";}else
if(!isWholesale&&hasPriceRange){priceHtml+="<div class='"+customerPriceClass+"'>"+priceRange+"</div>";}else
if(isWholesale&&!hasPriceRange){if(retailPrice!=wholesalePrice){priceHtml+="<div class='"+retailPriceClass+"'>Retail Price "+retailPrice+"</div>";priceHtml+="<div class='"+customerPriceClass+"'>Your Price: "+wholesalePrice+"</div>";}else{priceHtml+="<div class='"+customerPriceClass+"'>"+wholesalePrice+"</div>";}}else
if(isWholesale&&hasPriceRange){if(retailPrice!=wholesalePrice){priceHtml+="<div class='"+retailPriceClass+"'>Retail Price "+retailPrice+"</div>";priceHtml+="<div class='"+customerPriceClass+"'>Your Price: "+priceRange+"</div>";}else{priceHtml+="<div class='"+customerPriceClass+"'>"+priceRange+"</div>";}}
if(hasQuantityPrice){priceHtml+=quantityPriceTable;}
return priceHtml;}
/*
 * checkout fix
 *
 */
$("document").ready(function(){if(($.browser.msie)&&($.browser.version=="8.0")){$("#paymeth table").eq(0).css("width","753px");$("#newcust table").eq(0).css("width","753px");}});
/*
 * My Account fixes
 *
 */
if((typeof(NLDropdown)!="undefined")&&($.browser!="msie")){NLDropdown.prototype.positionDiv=function NLDropdown_positionDiv(triggerObj,popupObj){var x=findPosX(triggerObj);if(x+popupObj.offsetWidth-document.body.scrollLeft<=getDocumentClientWidth())
popupObj.style.left=x+"px";else
popupObj.style.left=getDocumentClientWidth()-popupObj.offsetWidth+document.body.scrollLeft;var y=findPosY(triggerObj);if(y+triggerObj.offsetHeight+popupObj.offsetHeight>getDocumentClientHeight()){popupObj.style.top=Math.max(y-popupObj.offsetHeight,0)+"px";}else{if(isIE)
popupObj.style.top=(y+triggerObj.offsetHeight-1)+"px";else if(isNS)
popupObj.style.top=(y+triggerObj.offsetHeight)+"px";}}}
$("document").ready(function() {
	var jqProfileLink = $("tr[name='edit your profile'] td.smalltext a");
	if( jqProfileLink.length > 0 ) {
		jqProfileLink.attr("href", jqProfileLink.attr("href").replace("sc=4","sc=6"));
	}
});