(function(a){a.fn.FWSButton=function(b){var c=this;var d={ajax:false,eventListener:"click",ajaxOptions:{queryString:null,url:(typeof scriptPath!="undefined")?scriptPath:"/",method:"POST",timeout:120000,cache:false,loading_html:'<div class="loading"><h4>Loading...</h4></div>',showLoading:true,onError:function(){alert("Server Failure!")},onSuccess:function(e){a(c).html(e)}},title:false};b=a.extend(d,b);a(c).addClass("ui-widget").addClass("ui-button").addClass("ui-state-default").addClass("ui-corner-all");if(b.title){a(c).val(b.title)}if(b.ajax){a(c).live(b.eventListener,(function(){a(c).FWSAjax({queryString:b.ajaxOptions.queryString,url:b.ajaxOptions.url,method:b.ajaxOptions.method,timeout:b.ajaxOptions.timeout,cache:b.ajaxOptions.cache,loading_html:b.ajaxOptions.loading_html,showLoading:b.ajaxOptions.showLoading,onError:b.ajaxOptions.onError,onSuccess:b.ajaxOptions.onSuccess})}))}return c.each(function(){})}})(jQuery);(function(a){a.fn.FWSAjax=function(b){var c=this;var d={queryString:null,url:(typeof scriptPath!="undefined")?scriptPath:"/",method:"POST",timeout:120000,cache:false,loading_html:'<div class="loading"><h4>Loading...</h4></div>',showLoading:true,onError:function(e,f){alert("Operation Timedout Please Try Again.")},onSuccess:function(e){a(c).html(e)}};b=a.extend(d,b);if(a(c).hasClass("antiClick_in_progress")){return false}a.ajax({data:b.queryString,type:b.method,url:b.url,timeout:b.timeout,cache:b.cache,error:function(e,f){b.onError.call(this,e,f);a(c).removeClass("antiClick_in_progress")},beforeSend:function(e){a(c).addClass("antiClick_in_progress");if(b.showLoading){c.each(function(){a(c).html(b.loading_html)})}},success:function(e){c.each(function(){b.onSuccess.call(this,e)});a(c).removeClass("antiClick_in_progress")}});return c.each(function(){})}})(jQuery);(function(a){a.fn.FWSSortable=function(b){var c=this;a(c).children().css("cursor","move");var d={placeholder:"ui-state-highlight",axis:"y",cursor:"move",dragImage:(typeof globalFiles!="undefined")?globalFiles+"/loading.gif":"/fws/loading.gif",dragSpinner:false,originalImage:true,start:function(e,f){},over:function(e,f){},stop:function(e,f){},ajax:false,ajaxOptions:{queryString:null,url:(typeof scriptPath!="undefined")?scriptPath:"/",method:"POST",timeout:120000,cache:false,loading_html:'<div class="loading"><h4>Loading...</h4></div>',showLoading:true,onError:function(){alert("Server Failure!")},onSuccess:function(e){a(c).html(e)}}};b=a.extend(d,b);a(c).sortable({placeholder:b.placeholder,start:function(e,f){if(b.dragImage&&b.dragSpinner){b.originalImage=a(f.item).find("img").attr("src");a(f.item).find("img").attr("src",b.dragImage)}b.start.call(this,e,f)},over:function(e,f){b.over.call(this,e,f)},stop:function(e,f){b.stop.call(this,e,f);if(b.ajax){a(c).FWSAjax({queryString:b.ajaxOptions.queryString,url:b.ajaxOptions.url,method:b.ajaxOptions.method,timeout:b.ajaxOptions.timeout,cache:b.ajaxOptions.cache,loading_html:b.ajaxOptions.loading_html,showLoading:b.ajaxOptions.showLoading,onError:b.ajaxOptions.onError,onSuccess:b.ajaxOptions.onSuccess})}if(b.originalImage&&b.dragSpinner){a(f.item).find("img").attr("src",b.originalImage)}}});if(b.disableSelection){a(c).disableSelection()}return c.each(function(){})}})(jQuery);(function(a){a.fn.FWSQueryString=function(){var c=[];var b=a(this).find(":input").get();a.each(b,function(){if(this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))){var d=a(this).val();c.push(encodeURIComponent(this.name)+"="+encodeURIComponent(d))}});return c.join("&").replace(/%20/g,"+")}})(jQuery);(function(a){a.FWSAddToCart=function(l){var c={guid:"",shipping:"",url:(typeof scriptPath!="undefined")?scriptPath:"/",redirect:"/viewCart",weight:"",file:"",name:"",price:""};l=a.extend(c,l);var d=document.getElementsByTagName("input");var e=1;var j="";var k=new RegExp("_"+l.guid+"_");for(var f=0;f<d.length;f++){var b=d[f];if(b.name.search(k)!=-1){var h=b.value;h=h.replace("&amp;","and");j+="&amp;"+b.name+"="+h}if(b.name=="add_"+l.guid+""){e=b.value}}var g=document.getElementsByTagName("select");for(var f=0;f<g.length;f++){var b=g[f];if(b.name.search(k)!=-1){var h=b.options[b.selectedIndex].value;h=h.replace("&amp;","and");j+="&amp;"+b.name+"="+h}}location.href=l.url+"&p=viewCart&pageAction=updateCart&add_"+l.guid+"="+e+"&"+j+"&opt_"+l.guid+"_shipping="+l.shipping+"&opt_"+l.guid+"_price="+l.price+"&opt_"+l.guid+"_weight="+l.weight+"&opt_"+l.guid+"_file="+l.file+"&opt_"+l.guid+"_name="+l.name;return{qty:e,queryString:j}}})(jQuery);(function(a){a.fn.FWSPipeList=function(c){var d=this;var b="";var e={pipe:"|",truncate:"orderItem_"};c=a.extend(e,c);a(this).each(function(f){b+=a(this).attr("id").replace(c.truncate,"");b+=c.pipe});return b}})(jQuery);function truncate(b,a){return(b.length>((typeof a!="undefined")?a:a=32))?b.substr(0,a-3)+"...":b};
