var gv_Ka_LE="file",gv_CSSPreview=false;if(typeof window.Ka.LE!="object"){window.Ka.LE=function(){return{version:"1.01",show:function(elements,nodeType){var elements=elements.split(".").length>1?Ka.LE.$$(elements.split(".")[1],nodeType):[Ka.LE.$(elements.split("#")[1])];if(elements!=null){for(var x=0,i=elements.length;x<i;x++){elements[x].style.display="block";}}},hide:function(elements,nodeType){elements=elements.split(".").length>1?Ka.LE.$$(elements.split(".")[1],nodeType):[Ka.LE.$(elements.split("#")[1])];if(elements!=null){for(var x=0,i=elements.length;x<i;x++){elements[x].style.display="none";}}},LEtrim:function(value){if(typeof value!="undefined"){var temp=value,obj=/^(\s*)([\W\w]*)(\b\s*$)/;if(obj.test(temp)){temp=temp.replace(obj,"$2");}var obj=/  /g;while(temp.match(obj)){temp=temp.replace(obj," ");}return temp;}else{return"";}},$:function(id){return document.getElementById(id);},$$:function(className,nodeType){var elements=Ka.LE.$("ka_le").getElementsByTagName(typeof nodeType!="undefined"?nodeType:"*"),returnEls=[],regEx=new RegExp("\\b"+className+"\\b");for(var x=0,j=elements.length;x<j;x++){if(regEx.test(elements[x].className)){returnEls.push(elements[x]);}}return returnEls.length==0?null:returnEls;},browser:navigator.userAgent.toLowerCase().indexOf("firefox")!=-1?"FF":(navigator.userAgent.toLowerCase().indexOf("msie")!=-1?"IE":"SF"),userThemes:new Array(),css:{filters:{"body":{},"wrapper":{"ind":{"div#ka_contentContainer h2,div#ka_contentContainer h3":{"inherit":["color","font-family"]},"ul#ka_commentList h4 strong":{"inherit":["color"]},"div.ka_createForm h1":{"inherit":["color"]},"ul.ka_sideList li,ul.ka_myHomeList li":{"inherit":["color"]},"legend,label":{"inherit":["color"]}}},"header":{"ind":{"h2#ka_topHeaderName":{"inherit":["color","font-family","padding"],"styles":{"margin-top":"0px !important","display":"block","padding-bottom":"0px !important","padding-right":"0px !important"}},"h2#ka_topHeaderName a":{"inherit":["color"]}},"styles":{"padding":"0px !important","display":"block !important"}},"anchor":{},"pillHea":{"ind":{"div#ka_getActive h3":{"inherit":["color","border","border-color","font-size","font-family","background-color","background-image","background-repeat","background-position"]},"span#ka_since":{"styles":{"border":"none !important","margin-top":"5px"},"inherit":["color","font-family","font-size"]},".ka_bumperTop span":{"inherit":["font-size"]},"body#ka_profilePage div.ka_profileSegHeader h5":{"inherit":["font-family"]},"div#ka_manageSubNav ul li span,div#ka_manageSubNav ul li a":{"inherit":["background-color","background-image","background-repeat","background-position","color","border","border-color"],"styles":{"border-bottom":"none !important"}},"div#ka_manageSubNav span.ka_mkplink a":{"styles":{"background-color":"none !important","background-image":"none !important","border-width":"0px !important"}},"div#ka_manageSubNav":{"inherit":["border","border-color"],"styles":{"border-width":"0px 0px 1px 0px !important"}}}},"pillBod":{"ind":{".ka_allItemsContainer":{"styles":{"border":"none !important"}},"ol#ka_audioList div.ka_null":{"inherit":["font-size"]},"h4 a ":{"inherit":["font-family"]},".ka_contentBody a":{"inherit":["font-family"]},".searchLetterBox":{"styles":{"width":"132px !important"}},".ka_list":{"styles":{"width":"144px !important"}},"div.ka_createForm h1":{"inherit":["color"]},"ul.ka_sideList li,ul.ka_myHomeList li":{"inherit":["color"]}}},"footer":{"styles":{"border-top-width":"0px !important"}},"navBac":{},"navAct":{},"navIna":{},"navHov":{},"subnavBac":{},"subnavAct":{},"subnavIna":{},"subnavHov":{}},nodeType:{"body":"element","wrapper":"id","header":"id","anchor":"elements","pillHea":"id,elements","pillBod":"id,elements","footer":"id","navBac":"id","navHov":"elements","navAct":"elements","navIna":"elements","subnavBac":"id","subnavHov":"elements","subnavAct":"elements","subnavIna":"elements"},create:function(themeObj,override){var themeObj=typeof themeObj=="undefined"?Ka.LE.theme.selected:themeObj,themeCSS="";
for(var node in Ka.LE.css.nodeType){if(typeof themeObj[node]!="undefined"){if(node!="attributes"){if(typeof gv_appName!="undefined"&&gv_appName=="KS"&&override!==true){elementHolder="#ka_ks_tabs_preview "+Ka.LE.flow.tb.style.isOpenCors[node].replace(",",",#ka_ks_tabs_preview ");}else{elementHolder=Ka.LE.flow.tb.style.isOpenCors[node];}themeCSS+=elementHolder+" {\n";for(var style in themeObj[node].styles){if(themeObj[node].styles[style]!=""){themeCSS+="\t"+style+": "+Ka.LE.css.sCheck(style,themeObj[node].styles[style])+";\n";}}themeCSS+=Ka.LE.css.mutate(node,themeObj);}}}return themeCSS+Ka.LE.css.adFix(themeObj);},adFix:function(themeObj){var tempCSS="";if(typeof themeObj.header!="undefined"&&typeof themeObj.header.styles["background-image"]!="undefined"&&(themeObj.header.styles["background-image"].indexOf("/templateimages/")!=-1||themeObj.header.styles["background-image"].indexOf("http://localhost/")!=-1)){tempCSS+="div.ka_adWide #ka_le_headercont {\n"+"\tbackground-image: "+themeObj.header.styles["background-image"].replace("/templateimages/","/templateimages/w_")+" !important;\n}\n";}if(typeof themeObj.wrapper!="undefined"&&typeof themeObj.wrapper.styles["background-image"]!="undefined"&&(themeObj.wrapper.styles["background-image"].indexOf("/templateimages/")!=-1||themeObj.wrapper.styles["background-image"].indexOf("http://localhost/")!=-1)){tempCSS+="div#ka_mainContainer {\n"+"\tbackground-image: "+themeObj.wrapper.styles["background-image"].replace("/templateimages/","/templateimages/w_")+" !important;\n}\n";}if(typeof themeObj.navBac!="undefined"&&typeof themeObj.navBac.styles["background-image"]!="undefined"&&(themeObj.navBac.styles["background-image"].indexOf("/templateimages/")!=-1||themeObj.navBac.styles["background-image"].indexOf("http://localhost/")!=-1)){tempCSS+="div.ka_adWide #ka_headerTopNav {\n"+"\tbackground-image: "+themeObj.navBac.styles["background-image"].replace("/templateimages/","/templateimages/w_")+" !important;\n}\n";}if(typeof themeObj.subnavBac!="undefined"&&typeof themeObj.subnavBac.styles["background-image"]!="undefined"&&(themeObj.subnavBac.styles["background-image"].indexOf("/templateimages/")!=-1||themeObj.subnavBac.styles["background-image"].indexOf("http://localhost/")!=-1)){tempCSS+="div.ka_adWide #ka_headerSubNav {\n"+"\tbackground-image: "+themeObj.subnavBac.styles["background-image"].replace("/templateimages/","/templateimages/w_")+" !important;\n}\n";}if(typeof themeObj.body!="undefined"&&typeof themeObj.body.styles["background-image"]!="undefined"&&(themeObj.body.styles["background-image"].indexOf("/templateimages/")!=-1||themeObj.body.styles["background-image"].indexOf("http://localhost/")!=-1)){tempCSS+="body.ka_bodyAdWide {\n"+"\tbackground-image: "+themeObj.body.styles["background-image"].replace("/templateimages/","/templateimages/w_")+" !important;\n}\n";}if(typeof themeObj.footer!="undefined"&&typeof themeObj.footer.styles["background-image"]!="undefined"&&(themeObj.footer.styles["background-image"].indexOf("/templateimages/")!=-1||themeObj.footer.styles["background-image"].indexOf("http://localhost/")!=-1)){tempCSS+="div#ka_footer {\n"+"\tbackground-image: "+themeObj.footer.styles["background-image"].replace("/templateimages/","/templateimages/w_")+" !important;\n}\n";
}return tempCSS;},sCheck:function(attribute,value){if(attribute=="background-image"){if(value=="url()"){value="none";}}else{if(attribute=="border-color"||attribute=="background-color"||attribute=="color"){if(Ka.LE.LEtrim(value)=="!important"||value=="undefined"||typeof value=="undefined"){value="auto !important";}}else{if(attribute=="width"||attribute=="height"||attribute=="margin"||attribute=="padding"){if(Ka.LE.LEtrim(value)=="px"){value="auto";}}else{if(attribute=="font-family"){if(value=="undefined"||typeof value=="undefined"){value="inherit";}}}}}return value;},mutate:function(node,themeObj){var css="",filters=Ka.LE.css.filters[node];if(typeof filters!="undefined"&&typeof filters.styles!="undefined"){for(var style in filters.styles){css+="\t"+style+": "+Ka.LE.css.sCheck(style,filters.styles[style])+";\n";}}css+="}\n";if(typeof filters.ind!="undefined"){for(var indNode in filters.ind){if(typeof filters.ind[indNode].inherit!="undefined"){css+=indNode+" {\n";for(var q=0;q<filters.ind[indNode].inherit.length;q++){if(themeObj[node].styles[filters.ind[indNode].inherit[q]]!=""){css+="\t"+filters.ind[indNode].inherit[q]+": "+Ka.LE.css.sCheck(filters.ind[indNode].inherit[q],themeObj[node].styles[filters.ind[indNode].inherit[q]])+";\n";}}css+="}\n";}if(typeof filters.ind[indNode].styles!="undefined"){css+=indNode+" {\n";for(var style in filters.ind[indNode].styles){css+="\t"+style+": "+Ka.LE.css.sCheck(style,filters.ind[indNode].styles[style])+";\n";}css+="}\n";}}}return css;},edit:function(node,property,value,apply){if(property.indexOf("color")!=-1&&Ka.LE.LEtrim(value)=="!important"){value="auto !important";}else{if(property.indexOf("background-image")!=-1&&value=="url()"){value="none";}}if(!Ka.LE.theme.selected[node]){Ka.LE.theme.selected[node]={attributes:{type:Ka.LE.css.nodeType[node]},styles:{}};}Ka.LE.theme.selected[node].styles[property]=value;if(apply){Ka.LE.theme.apply();}}},core:{note:function(message){alert(message);},ask:function(message){return confirm(message);},answer:function(question,defaultValue){return prompt(question,defaultValue);}},init:function(type){var lb_found=false,la_styleTags=document.getElementsByTagName("style"),whitelistedLinks=["fbcdn","tiny_mce","addthis","rss+xml"];var has3rdPartyStyles=$j("link, style").filter(function(i,el){var $el=$j(el);if(!$el.hasClass("ka_style")){for(link in whitelistedLinks){if($el.hasClass(whitelistedLinks[link])){return false;}return true;}}return false;}).length>0;if(has3rdPartyStyles){var x='<h2>Warning:</h2> 	            		<p>We have detected the presence of custom CSS code that could affect the appearance of your pages if you also try to style them with the Site Styler.</p> 	            		<p>This CSS code might be coming from a browser plug-in, or you may have added CSS styling rules to your Global Page Template.</p> 	            		<p><a target="_blank" href="/affiliate/displaySiteIncludes.kickAction?as='+Ka.Info.AFFILIATESITEID+'">Click here to view your Global Page Template</a></p> 	            		<p><a href="#" onclick="Ka.popup(); return false;">Click here to proceed at your own risk</a></p>';
Ka.popup(x,function(){$j("#ka_le").css({"z-index":"999"});});}if((Ka.LE.browser!="FF"&&Ka.LE.browser!="SF"&&Ka.LE.browser!="IE")||(Ka.LE.browser=="SF"&&navigator.userAgent.toLowerCase().match(/version\/3./)==null)){Ka.LE.flow.disable("browser");Ka.LE.$("ka_le").style.display="block";}else{if(lb_found||type=="disabled"){Ka.LE.flow.disable("style");Ka.LE.$("ka_le").style.display="block";}else{Ka.LE.flow.tm.tg.setup();KickAppsBizComponent.getAllVisibleThemesByAS(Ka.Info.AFFILIATESITEID,Ka.Info.USERID,function(themes,a,b,c,d){if(themes!=null){if(themes.length==1){if(eval("("+themes[0].themeCode+")").attributes.id=="idspacer"){var themeId=themes[0].themeId,JSONString=themes[0].themeCode,themeCSS=themes[0].themeCSS;JSONString=JSONString.replace("idspacer",themeId);KickAppsBizComponent.updateTheme(themeId,JSONString,themeCSS,Ka.Info.AFFILIATESITEID,Ka.Info.USERID,function(){var lo_theme=eval("("+themes[0].themeCode+")");var themeActive=lo_theme.attributes.active;lo_theme.attributes.id=themeId;Ka.LE.flow.openA(lo_theme,themeActive);Ka.LE.showLE();});}else{var themeActive=themes[0].isSelected;Ka.LE.flow.openA(eval("("+themes[0].themeCode+")"),themeActive);Ka.LE.showLE();}}else{for(var x=0;x<themes.length;x++){if(eval("("+themes[x].themeCode+")").attributes.id!="idspacer"){var themeActive=themes[x].isSelected;Ka.LE.flow.openA(eval("("+themes[x].themeCode+")"),themeActive);}}Ka.LE.showLE();}}else{Ka.LE.showLE();}});}}},showLE:function(){loadSV();$S("SVslide").top=(80/100*170-7)+"px";Ka.LE.$("ka_le").style.display="block";Ka.LE.isInit=true;document.getElementById("ka_le_themelist").getElementsByTagName("tr")[0].style.width="100%";Ka.LE.flow.tm.tg.show();},theme:{selected:new Object(),apply:function(themeObj){if(gv_appName!="KS"){if(typeof Ka.LE.theme.selected.header!="undefined"&&Ka.LE.theme.selected.header.styles.display!="none"){value="block";Ka.LE.css.filters["header"]["ind"]["h2#ka_topHeaderName"]["styles"].display="block";}else{if(typeof Ka.LE.theme.selected.header!="undefined"){Ka.LE.css.filters["header"]["ind"]["h2#ka_topHeaderName"]["styles"].display="none";}}}var themeObj=typeof themeObj=="undefined"?Ka.LE.theme.selected:themeObj,themeCSS=Ka.LE.css.create(themeObj);if(!document.getElementById("LE_dynamicCSS")){var styleElement=document.createElement("style");styleElement.type="text/css";styleElement.id="LE_dynamicCSS";styleElement.className="ka_style";document.getElementsByTagName("head")[0].appendChild(styleElement);}if(document.getElementById("LE_setCSS")!=null){document.getElementById("LE_setCSS").href="http://www.google.com";}if(Ka.LE.browser=="FF"){document.getElementById("LE_dynamicCSS").innerHTML=themeCSS;}else{if(Ka.LE.browser=="IE"){for(var x=0;x<document.styleSheets.length;x++){if(document.styleSheets[x].id=="LE_dynamicCSS"){document.styleSheets[x].cssText=themeCSS;break;}}}else{if(Ka.LE.browser=="SF"){for(var x=0;x<document.styleSheets.length;x++){if(document.styleSheets[x].href!=null&&document.styleSheets[x].href.indexOf("LE_safarifix")!=-1){var i=document.styleSheets[x].cssRules.length;
for(var y=0;y<i;y++){document.styleSheets[x].deleteRule(0);}break;}}var counter=0;for(var z=0;z<(themeCSS.split("}").length-1);z++){document.styleSheets[x].insertRule(themeCSS.split("}")[z]+"}",z);}}}}},get:function(themeId,type){for(var lv_x=0;lv_x<Ka.LE.userThemes.length;lv_x++){if(Ka.LE.userThemes[lv_x].attributes.id==themeId){return type=="object"?Ka.LE.userThemes[lv_x]:lv_x;}}},preview:function(previewPage){var themeCSS=Ka.LE.css.create(Ka.LE.theme.selected),cssArray=themeCSS.split("\n");themeCSS="";for(var x=0;x<cssArray.length;x++){themeCSS+=cssArray[x].replace(";","SC");}Ka.Cookie.create("LE_themePreview",themeCSS,1);},save:function(affiliateSiteId){},update:function(themeObj,attribute){var lo_date=new Date();themeObj.attributes[attribute]=lo_date.getFullYear()+"-"+((lo_date.getMonth()+1)<10?("0"+(lo_date.getMonth()+1)):(lo_date.getMonth()+1))+"-"+(lo_date.getDate()<10?("0"+lo_date.getDate()):lo_date.getDate())+" "+(lo_date.getHours()<10?("0"+lo_date.getHours()):lo_date.getHours())+":"+(lo_date.getMinutes()<10?("0"+lo_date.getMinutes()):lo_date.getMinutes())+":"+(lo_date.getSeconds()<10?("0"+lo_date.getSeconds()):lo_date.getSeconds())+":"+(lo_date.getMilliseconds()<10?("0"+lo_date.getMilliseconds()):lo_date.getMilliseconds());}}};}();}if(typeof gv_appName!="undefined"&&gv_appName=="LE"){Ka.addDOMLoadEvent(function(){var anchors=Ka.LE.$("ka_le").getElementsByTagName("a");for(var x=0;x<anchors.length;x++){Ka.addEvent(anchors[x],"click",function(e){if(this.className.indexOf("exempt")==-1){e.cancelBubble=true;e.returnValue=false;if(e.stopPropagation){e.stopPropagation();e.preventDefault();}}});}if(document.location.href.indexOf("LE=launch")!=-1){}});window.onbeforeunload=function(e){if(Ka.LE.$("ka_le_manage_seg").getElementsByTagName("img")[0].src.match(/saveButtonLarge.gif/)){return"You have unsaved changes. If you leave, you'll lose them.";}};}
