function runOnLoad(a){if(runOnLoad.loaded){a()}else{runOnLoad.funcs.push(a)}}runOnLoad.funcs=[];runOnLoad.loaded=false;runOnLoad.run=function(){if(runOnLoad.loaded){return}for(var a=0;a<runOnLoad.funcs.length;a++){try{runOnLoad.funcs[a]()}catch(b){}}runOnLoad.loaded=true;delete runOnLoad.funcs;delete runOnLoad.run};if(window.addEventListener){window.addEventListener("load",runOnLoad.run,false)}else{if(window.attachEvent){window.attachEvent("onload",runOnLoad.run)}else{window.onload=runOnLoad.run}}String.empty="";String.format=function(){if(arguments.length==0){return String.empty}var a=arguments[0];var c=[];if(typeof(arguments[1])=="object"){c=arguments[1]}else{for(var b=1;b<arguments.length;b++){c[c.length]=arguments[b]}}for(var b=0;b<c.length;b++){a=a.replaceAll("\\{"+(b)+"}",c[b])}return a};String.prototype.format=function(){return String.format(this,arguments)};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.contains=function(a){return this.indexOf(a)>-1};String.prototype.replaceAll=function(searchTerm,replacementText,isCaseSensitive){var regex="/"+searchTerm+"/g";if(!isCaseSensitive){regex+="i"}return this.replace(eval(regex),replacementText)};var DEBUG_LEVEL_TYPE={NONE:0,CRITICAL:1,WARNING:2,LOG:3,ENTERING:5,LEAVING:6,INFO:9,FULL:15};var debug={level:DEBUG_LEVEL_TYPE.NONE,logAllObjects:true,loggedObjects:[],logMessagesFromAnonymousObjects:false,isLoggingEnabledFor:function(a){if(debug.logAllObjects){return true}var c=false;if(debug.loggedObjects.length>0){var d=(a.className)?a.className:debug.getVarName(a);if(undefined==d){c=debug.logMessagesFromAnonymousObjects}for(var b in debug.loggedObjects){if(d==debug.loggedObjects[b]){c=true;break}}}return c},setLevel:function(a){debug.level=a},enableLoggingForObjectsNamed:function(a){debug.loggedObjects[debug.loggedObjects.length]=a},log:function(c,b,a){if(c<=debug.level&&debug.isLoggingEnabledFor(a)){if(undefined!=console){debug.logToFireBug(c,b)}else{alert(b)}}},logToFireBug:function(b,a){switch(b){case DEBUG_LEVEL_TYPE.CRITICAL:console.error(a);break;case DEBUG_LEVEL_TYPE.WARNING:console.warn(a);break;default:console.log(a)}},getVarName:function(a){return debug.obSub(window).map(function(b){if(window[b]===a){return b}}).sort()[0]},obSub:function(a){var c=[];var b=0;for(var d in a){if(a.hasOwnProperty(d)){c[b++]=d}}return c}};function SET_DEBUG_CRITICAL(){debug.setLevel(DEBUG_LEVEL_TYPE.CRITICAL)}function SET_DEBUG_WARN(){debug.setLevel(DEBUG_LEVEL_TYPE.WARNING)}function SET_DEBUG_LOG(){debug.setLevel(DEBUG_LEVEL_TYPE.LOG)}function SET_DEBUG_INFO(){debug.setLevel(DEBUG_LEVEL_TYPE.INFO)}function SET_DEBUG_ENTERING(){debug.setLevel(DEBUG_LEVEL_TYPE.ENTERING)}function SET_DEBUG_LEAVING(){debug.setLevel(DEBUG_LEVEL_TYPE.LEAVING)}function SET_DEBUG_FULL(){debug.setLevel(DEBUG_LEVEL_TYPE.FULL)}function ADD_DEBUG_OBJECT(a){debug.enableLoggingForObjectsNamed(a)}function DEBUG_CRITICAL(b,a){debug.log(DEBUG_LEVEL_TYPE.CRITICAL,b,a)}function DEBUG_WARNING(b,a){debug.log(DEBUG_LEVEL_TYPE.WARNING,b,a)}function DEBUG_LOG(b,a){debug.log(DEBUG_LEVEL_TYPE.LOG,"  "+b,a)}function DEBUG_INFO(b,a){debug.log(DEBUG_LEVEL_TYPE.INFO,"  "+b,a)}function DEBUG_ENTERING(b,a){debug.log(DEBUG_LEVEL_TYPE.ENTERING,"Entering: "+b,a)}function DEBUG_LEAVING(b,a){debug.log(DEBUG_LEVEL_TYPE.LEAVING,"Leaving: "+b,a)}function ClassEvent(){this.className="ClassEvent";DEBUG_ENTERING("ClassEvent::ClassEvent()",this);this.handlers=new Array();this.firedCount=0;this.handlersCount=0;DEBUG_LEAVING("ClassEvent::ClassEvent()",this)}ClassEvent.prototype.add=function(a){DEBUG_ENTERING("ClassEvent::add()",this);this.handlers[this.handlers.length]=a;this.handlersCount++;DEBUG_LEAVING("ClassEvent::add()",this)};ClassEvent.prototype.fire=function(){DEBUG_ENTERING("ClassEvent::fire()",this);this.firedCount++;for(var i=0;i<this.handlers.length;i++){var handler=this.handlers[i];var handlerType=typeof(handler);DEBUG_LOG("handlerType",this);switch(handlerType){case"string":eval(handler);break;case"function":handler();break}}DEBUG_LEAVING("ClassEvent::fire()",this)};ClassEvent.prototype.hasFired=function(){DEBUG_ENTERING("ClassEvent::hasFired()",this);DEBUG_INFO("Has Fired: "+(this.firedCount>0)+"; firedCount: "+this.firedCount);DEBUG_LEAVING("ClassEvent::hasFired()",this);return this.firedCount>0};SET_DEBUG_CRITICAL();var SiteEngine={isSecureHost:function(){return window.location.hostname.indexOf("https://")>-1},isHostKingCart:function(){return window.location.hostname.indexOf("king")>-1},getCommonImageRoot:function(){return(SiteEngine.isHostKingCart())?"/store/USCFSales/":"/Common/Images/Layout"},getCommonIncludeRoot:function(){return(SiteEngine.isHostKingCart())?"/store/USCFSales/":"/Common/Include"},getCommonDataRoot:function(){return(SiteEngine.isHostKingCart())?"/store/USCFSales/":"/Common/Data"},registeredComponents:{list:[],onAllItemsComplete:new ClassEvent(),add:function(a){this.list[a]=false},markItemComplete:function(a){this.list[a]=true;this.checkAllItemsComplete()},checkAllItemsComplete:function(){var a=true;for(var b in this.list){if(!this.list[b]){a=false;break}}if(a){this.onAllItemsComplete.fire()}}}};SiteEngine.registeredComponents.add("allImagesLoaded");runOnLoad(function(){SiteEngine.registeredComponents.markItemComplete("allImagesLoaded")});var lpMTagConfig={lpServer:"server.iad.liveperson.net",lpNumber:"72199819",lpProtocol:"https"};function lpAddMonitorTag(b){if(typeof(b)=="undefined"||typeof(b)=="object"){b=(lpMTagConfig.lpMTagSrc)?lpMTagConfig.lpMTagSrc:"/hcp/html/mTag.js"}if(b.indexOf("http")!=0){b=lpMTagConfig.lpProtocol+"://"+lpMTagConfig.lpServer+b+"?site="+lpMTagConfig.lpNumber}else{if(b.indexOf("site=")<0){if(b.indexOf("?")<0){b=b+"?"}else{b=b+"&"}b=b+"site="+lpMTagConfig.lpNumber}}var a=document.createElement("script");a.setAttribute("type","text/javascript");a.setAttribute("charset","iso-8859-1");a.setAttribute("src",b);document.getElementsByTagName("head").item(0).appendChild(a)}if(window.attachEvent){window.attachEvent("onload",lpAddMonitorTag)}else{window.addEventListener("load",lpAddMonitorTag,false)}(function($){$(function(){jQuery.expr[":"].regex=function(elem,index,match){var matchParams=match[3].split(","),validLabels=/^(data|css):/,attr={method:(matchParams[0].match(validLabels))?matchParams[0].split(":")[0]:"attr",property:matchParams.shift().replace(validLabels,"")},regexFlags="ig",regex=new RegExp(matchParams.join("").replace(/^\s+|\s+$/g,""),regexFlags);return regex.test(jQuery(elem)[attr.method](attr.property))};var inbox="sales";var domain="uscfsales";var world="com";$(".emailGoesHere").each(function(){$(this).html(inbox+"@"+domain+"."+world)});$("input:radio").each(function(){$(this).css({background:"transparent",border:"none",padding:"0",margin:"0"})});var searchFunction={defaultText:"Search USCF Sales",keywordsBox:false,focus:function(){var currentText=$(this).attr("value");if(currentText===searchFunction.defaultText){$(this).attr("value","")}},blur:function(){var currentText=$(this).attr("value");if(currentText===""){$(this).attr("value",searchFunction.defaultText)}},keydown:function(event){if(event.keyCode==13){return searchFunction.doSearch()}return true},doSearch:function(){var keywords=searchFunction.keywordsBox.attr("value");var searchMode=searchFunction.searchMode();if(!keywords||keywords==""||keywords==searchFunction.defaultText){alert("Search is empty! Please enter some search terms");searchFunction.keywordsBox.focus();return false}searchFunction.updateDatabase(keywords,searchMode);if(searchMode=="Standard"){}else{var searchUrl="http://www.kingcart.com/USCFSales/product_name=searchUrl/exact_match=exact";$.get(SiteEngine.getCommonDataRoot()+"/ProductCatelogId.xml",function(xml){var name;$(xml).find("item").each(function(){if($(this).attr("id")==keywords){name=$("name",this).text();searchUrl=searchUrl.replace("searchUrl",name);searchUrl=$.trim(searchUrl);return false}});if(name){window.location=searchUrl}else{alert("Catalog item not found. Please try again or use the product name")}})}},updateDatabase:function(keywords,searchMode){if(searchMode=="Standard"){var searchUrl="http://uscfsales.com/Search/add.php?keywords=KEYWORDS_GO_HERE&searchMode=SEARCHMODE_GOES_HERE&referrer=REFERRER_GOES_HERE";var referrer=escape(window.location);keywords=escape(keywords);searchUrl=searchUrl.replace(/KEYWORDS_GO_HERE/g,keywords);searchUrl=searchUrl.replace(/SEARCHMODE_GOES_HERE/g,searchMode);searchUrl=searchUrl.replace(/REFERRER_GOES_HERE/g,referrer);window.location=searchUrl}else{if(!SiteEngine.isHostKingCart()){$.get(searchUrl,{keywords:keywords,searchMode:searchMode})}}},searchMode:function(){if($("#btnSearchAllText").attr("checked")){return"Standard"}else{return"Catalog"}},initialize:function(keywordsBoxId,searchButtonId){searchFunction.keywordsBox=$(keywordsBoxId).attr("value",searchFunction.defaultText).focus(searchFunction.focus).blur(searchFunction.blur).keydown(searchFunction.keydown);$(searchButtonId).click(searchFunction.doSearch)}};searchFunction.initialize("#tbSearch","#btnKingCartSearch");$("#icpsignupForm").validate();var HtmlIncluder={pendingRequests:0,completionHandlers:[],getIncludePath:function(){return SiteEngine.getCommonIncludeRoot()},Start:function(){var $includes=$(".include");if(SiteEngine.isSecureHost()||$includes.length==0){HtmlIncluder.PendingRequestsComplete();return}$includes.each(function(i){$(this).html("");var ds=$(this).attr("class").replace("include ","");var oThis=this;$.ajax({url:HtmlIncluder.getIncludePath()+ds,beforeSend:function(){HtmlIncluder.pendingRequests++},success:function(data){$(oThis).append(data);HtmlIncluder.PendingRequestsComplete()}})})},RegisterCompletionHandler:function(handler){HtmlIncluder.completionHandlers[HtmlIncluder.completionHandlers.length]=handler},PendingRequestsComplete:function(){HtmlIncluder.pendingRequests--;if(HtmlIncluder.pendingRequests==0){$(HtmlIncluder.completionHandlers).each(function(index,value){if(typeof(value)=="string"){eval(value)}else{if(typeof(value)=="function"){value()}}})}}};HtmlIncluder.Start();function setHeight(){var divHeight,minHeight=900;div=document.getElementById("sidebar1");if(div){divHeight=minHeight;if(div.offsetHeight){divHeight=div.offsetHeight}else{if(div.style.pixelHeight){divHeight=div.style.pixelHeight}}if(minHeight<divHeight){minHeight=divHeight}}div=document.getElementById("sidebar2");if(div){divHeight=minHeight;if(div.offsetHeight){divHeight=div.offsetHeight}else{if(div.style.pixelHeight){divHeight=div.style.pixelHeight}}if(minHeight<divHeight){minHeight=divHeight}}div=document.getElementById("content");if(div){divHeight=0;if(div.offsetHeight){divHeight=div.offsetHeight}else{if(div.style.pixelHeight){divHeight=div.style.pixelHeight}}if(divHeight<minHeight){div.style.height=minHeight+"px"}}}runOnLoad(setHeight);$(window).resize(setHeight);$("#sidebar1").resize(setHeight);$("#sidebar2").resize(setHeight);$("#content").resize(setHeight);$.fn.MakeSideMenu=function(options){options=$.extend({speed:250,fadeInEffect:"fast",fadeOutEffect:false},options||{});this.each(function(){function getSubMenu(el){return $("ul:first",el)}function hideItem(el){getSubMenu(el).css("z-index","9").hide(options.fadeOutEffect).end()}function hideLevel(el){var level=($(el).hasClass("L1"))?".L1":".L2";$(level).each(function(){if(this!=el){hideItem(this)}})}function hoverOver(){var $this=$(this);if($this.hasClass("submenu")){$this.css({cursor:"pointer",background:"#2f7b8f url("+SiteEngine.getCommonImageRoot()+"/sidemenu_right_arrow_over.gif) no-repeat right"})}else{$this.css({cursor:"pointer",background:"#2f7b8f"})}}function hoverOut(){var $this=$(this);if($this.hasClass("submenu")){$this.css("background","transparent url("+SiteEngine.getCommonImageRoot()+"/sidemenu_right_arrow.gif) no-repeat right")}else{$this.css("background","transparent")}}function dynamicallyLocateAndTagAllSubMenus(el){$("li>ul",el).each(function(){$(this).parent().addClass("submenu").addClass("L1").end()});$("li.submenu li.submenu",el).each(function(){$(this).removeClass("L1").addClass("L2").end()})}function attachSubmenuAction(el){$(".submenu",el).each(function(){$(this).click(function(){hideLevel(this);getSubMenu(this).toggle(options.fadeInEffect,function(){$(this).css("z-index","10")});return false})});$("li",el).each(function(){$(this).click(function(){var href=$("a:first",this).attr("href");if(undefined!=href&&href!=""&&href!=window.location){window.location=href}})});$("body").click(function(){$(".submenu",el).each(function(){hideItem(this)})})}function correctDisplayIssuesInIe(el){if(!$.browser.msie){return}if($.browser.version>=7){$("li ul>li",el).each(function(){$(this).width("auto");$("a",this).width("auto")})}else{$("li ul>li",el).each(function(){var $this=$(this);var width=$this.parent().width();$this.width(width);$("a",this).width("auto")});$("ul>li",el).each(function(){$(this).hover(hoverOver,hoverOut)})}}function initialize(el){dynamicallyLocateAndTagAllSubMenus(el);attachSubmenuAction(el);correctDisplayIssuesInIe(el)}initialize(this)})};if(SiteEngine.isHostKingCart()){HtmlIncluder.RegisterCompletionHandler('$("#leftNav").MakeSideMenu()')}else{$("#leftNav").MakeSideMenu()}$("#emailer").validate();if(typeof(undefined)!=typeof(fpssinit)){runOnLoad(fpssinit)}})})(jQuery);