(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}function GNFTreeUpdate(c,a,g,f,e){var d=GNFTreeUpdate.arguments[5];var b=GNFTreeUpdate.arguments[6];if(typeof d=="undefined"){d=0}if(typeof b=="undefined"){b=0}if(document.getElementById("cat"+c).innerHTML==""||e==1){if(b){GNFAjax(a,g+"&amp;parentId="+c+"&amp;depth="+f,"cat"+c)}else{GNFAjax(a,g+"&amp;parentId="+c+"&amp;depth="+f,"cat"+c,"$.modal.setContainerDimensions();")}if(c!=0){if(document.getElementById("tree"+c)!=null){document.getElementById("tree"+c).src=globalFiles+"/minus.gif"}}document.getElementById("cat"+c).style.display="none"}if((document.getElementById("cat"+c).style.display!="none")){document.getElementById("cat"+c).style.display="none";if(d){if(document.getElementById("tree"+c)!=null){document.getElementById("tree"+c).src=globalFiles+"/plus.gif"}}else{if(document.getElementById("tree"+c)!=null){document.getElementById("tree"+c).src=globalFiles+"/plusbottom.gif"}}}else{document.getElementById("cat"+c).style.display="block";if(d){if(document.getElementById("tree"+c)!=null){document.getElementById("tree"+c).src=globalFiles+"/minus.gif"}}else{if(document.getElementById("tree"+c)!=null){document.getElementById("tree"+c).src=globalFiles+"/minusbottom.gif"}}}if(!b){$.modal.setContainerDimensions()}}function handleEnter(d,b){var c=b.keyCode?b.keyCode:b.which?b.which:b.charCode;if(c==13){var a;for(a=0;a<d.form.elements.length;a++){if(d==d.form.elements[a]){break}}a=(a+1)%d.form.elements.length;d.form.elements[a].focus();return false}else{return true}}function FWSAjax(){GNFAjax(FWSAjax.arguments[0],FWSAjax.arguments[1],FWSAjax.arguments[2],FWSAjax.arguments[3])}function GNFAjax(){var spanId=GNFAjax.arguments[2];var execWhenFinished=GNFAjax.arguments[3];var randomnumber=Math.floor(Math.random()*11111);var url=GNFAjax.arguments[0];var parameters="&"+GNFAjax.arguments[1]+"&cache="+randomnumber;parameters=parameters.replace(/\?/g,"");var http;var browser=navigator.appName;if(browser=="Microsoft Internet Explorer"){http=new ActiveXObject("Microsoft.XMLHTTP")}else{http=new XMLHttpRequest()}http.onreadystatechange=function(){if(http.readyState==4||http.readyState=="complete"){if(typeof documentChanged!="undefined"){documentChanged=false}document.body.style.cursor="";var elems=document.getElementsByTagName("a");for(var i=0;i<elems.length;i++){elems[i].style.cursor=""}var response=http.responseText;if(typeof spanId!="undefined"){if(spanId!=""){document.getElementById(spanId).innerHTML=response}}if(typeof execWhenFinished!="undefined"){eval(execWhenFinished)}}};http.open("POST",url,true);http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");http.send(parameters)};
