if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1)}if(id){this.setAttribute("id",id)}if(w){this.setAttribute("width",w)}if(h){this.setAttribute("height",h)}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(c){this.addParam("bgcolor",c)}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9)}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true)},setAttribute:function(_e,_f){this.attributes[_e]=_f},getAttribute:function(_10){return this.attributes[_10]},addParam:function(_11,_12){this.params[_11]=_12},getParams:function(){return this.params},addVariable:function(_13,_14){this.variables[_13]=_14},getVariable:function(_15){return this.variables[_15]},getVariables:function(){return this.variables},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key]}return _16},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" "}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\""}_19+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />"}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />"}_19+="</object>"}return _19},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0])}catch(e){axo=null}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always"}catch(e){if(_23.major==6){return _23}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","))}}}return _23};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false}if(this.major>fv.major){return true}if(this.minor<fv.minor){return false}if(this.minor>fv.minor){return true}if(this.rev<fv.rev){return false}return true};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var nc_panel=null;nc_panel=function(){YAHOO.namespace("nc.container");var cfg=new YAHOO.util.Config(this);var BaseDiv,isDialog_set,loadingImage,maskEl,maskOpacity;var containerManager;var btnsEvent=new YAHOO.util.CustomEvent("btnsEvent");var onShowEvent=new YAHOO.util.CustomEvent("ShowEvent");var onHideEvent=new YAHOO.util.CustomEvent("HideEvent");var onAddPanelCompleteEvent=new YAHOO.util.CustomEvent("onAddPanelCompleteEvent");var curOpacity;var dialogIcon,OKBtn,CancelBtn;var currEl='';var self=this;return{initDefaultConfig:function(){cfg.addProperty("baseDiv",{value:null,handler:this.setBaseDiv});cfg.addProperty("loadingImage",{value:null,handler:this.setLoadingImage});cfg.addProperty("isDialogSet",{value:false,handler:this.setDialog});cfg.addProperty("ActivePanel",{value:null,handler:this.SetActiveVar});cfg.addProperty("defaultOpacity",{value:0.65});cfg.addProperty("defaultColor",{value:""});cfg.fireQueue()},SetActiveVar:function(type,args,obj){currEl=args[0]},setDialog:function(type,args,obj){isDialog_set=args[0]},setDialog:function(type,args,obj){isDialog_set=args[0]},setBaseDiv:function(type,args,obj){BaseDiv=args[0]},setLoadingImage:function(type,args,obj){loadingImage=args[0]},setProperties:function(properties,setAsInitCfg){cfg.applyConfig(properties,setAsInitCfg);cfg.fireQueue()},setProperty:function(PropertyName,PropertyValue,isEventFired){cfg.setProperty(PropertyName,PropertyValue,isEventFired)},subscribeShowEvent:function(func){onShowEvent.subscribe(func)},subscribeHideEvent:function(func){onHideEvent.subscribe(func)},subscribeAddPanelCompleteEvent:function(func){onAddPanelCompleteEvent.subscribe(func)},subscribeBtnEvents:function(func){btnsEvent.subscribe(func)},init:function(settings){this.initDefaultConfig();containerManager=new YAHOO.widget.OverlayManager()},addPanel:function(cfg){var ID=cfg.id;var P_content=cfg.content;var PanelSettings=cfg.attributes;var dialogSettings=cfg.dialogSettings;YUE.onContentReady(ID,function(){for(var i=0;i<containerManager.overlays.length;i++){if(containerManager.overlays[i].id==ID){throw("ID already Exist.")}}if(typeof dialogSettings!="undefined"){dialogIcon=(dialogSettings.dialogIcon!==undefined)?"<span class="+dialogIcon+" style='height:50px;position:absolute;width:60px;right:0pt;'></span>":"";OKBtn=dialogSettings.okCaption;CancelBtn=dialogSettings.cancelCaption;if(dialogSettings.buttonType&&dialogSettings.buttonType=="hyperLink"){if(OKBtn&&CancelBtn){P_content=dialogIcon+"<span>"+P_content+"</span>"+"<div class=\"clearfix\"><a href='javascript:void(0);' class='"+ID+"_btnOK'>"+OKBtn+"</a><a href='javascript:void(0);' class='"+ID+"_btnCancel'>"+CancelBtn+"</a></div>"}else if(OKBtn){P_content=dialogIcon+"<span>"+P_content+"</span>"+"<div><a href='javascript:void(0);' class='"+ID+"_btnOK'>"+OKBtn+"</a></div>"}}else{if(OKBtn&&CancelBtn){P_content=dialogIcon+"<span>"+P_content+"</span>"+"<div><input type='button' class='"+ID+"_btnOK' value='"+OKBtn+"'>&nbsp;&nbsp;&nbsp;<input type='button' class='"+ID+"_btnCancel' value='"+CancelBtn+"'></div>"}else if(OKBtn){P_content=dialogIcon+"<span>"+P_content+"</span>"+"<div><input type='button' class='"+ID+"_btnOK' value='"+OKBtn+"'></div>"}}PanelSettings.constraintoviewport=true;PanelSettings.close=false;PanelSettings.fixedcenter=true}var P_title;if((PanelSettings.draggable===true||PanelSettings.draggable===null)||!PanelSettings.title){P_title="&nbsp;"}else{P_title=PanelSettings.title}if(!PanelSettings.footer){P_footer="&nbsp;"}else{P_footer=PanelSettings.footer}PanelSettings.iframe=false;PanelSettings.monitorresize=false;YAHOO.nc.container=new YAHOO.widget.Panel(ID,PanelSettings);YAHOO.nc.container.setHeader(P_title);if(typeof P_content!="undefined"){YAHOO.nc.container.setBody(P_content)}YAHOO.nc.container.setFooter(P_footer);if(PanelSettings.shadowOn){}else{YAHOO.nc.container.underlay="matte"}YAHOO.nc.container.render(BaseDiv);YAHOO.nc.container.hide();var overlayWrapper=YAHOO.util.Dom.get(ID).parentNode;YAHOO.util.Dom.setStyle(overlayWrapper,"display","none");containerManager.register(YAHOO.nc.container);containerManager.focus(YAHOO.nc.container);if(currEl==""){this.setProperty("ActivePanel",YAHOO.nc.container,false)}YAHOO.util.Dom.setStyle(ID,"display","block");currEl=containerManager.getActive();if(PanelSettings.offsetFromTop){var overlayWrapper=YAHOO.util.Dom.get(currEl.id).parentNode;overlayWrapper.setAttribute("rel",PanelSettings.offsetFromTop)}if(loadingImage){YAHOO.util.Dom.setStyle(currEl.body,"background-image","url("+loadingImage+")");YAHOO.util.Dom.setStyle(currEl.body,"background-repeat","no-repeat");YAHOO.util.Dom.setStyle(currEl.body,"background-position","center center")}function changeDefault(){if(PanelSettings){if(PanelSettings.dir){var directionEl=YAHOO.util.Dom.get(ID);YAHOO.util.Dom.setStyle(directionEl,"direction",PanelSettings.dir)}if(PanelSettings.titleBackgroundColor){YAHOO.util.Dom.setStyle(currEl.header,"background",PanelSettings.titleBackgroundColor);YAHOO.util.Dom.setStyle(currEl.header,"letter-spacing","1px");if(PanelSettings.titleColor){YAHOO.util.Dom.setStyle(currEl.header,"color",PanelSettings.titleColor)}}if(!PanelSettings.footer){YAHOO.util.Dom.setStyle(currEl.footer,"display","none")}}}if(PanelSettings.modal&&PanelSettings.effectOn){YUE.onAvailable(ID+"_mask",changeDefault)}else{changeDefault()}if(typeof dialogSettings!="undefined"&&(dialogSettings.dialogIcon!==undefined)){YAHOO.util.Dom.addClass(currEl.body,"icon_padding")}else if(dialogSettings){if(OKBtn){var okBtnEl=YAHOO.util.Dom.getElementsByClassName(ID+"_btnOK",'',ID);YUE.addListener(okBtnEl,"click",NC_PanelManager.BtnsCallback,{obj:NC_PanelManager,value:true})}if(CancelBtn){var cancelBtnEl=YAHOO.util.Dom.getElementsByClassName(ID+"_btnCancel",'',ID);YUE.addListener(cancelBtnEl,"click",NC_PanelManager.BtnsCallback,{obj:NC_PanelManager,value:false})}}if(!dialogSettings){var AlertBtnEl=YAHOO.util.Dom.getElementsByClassName(ID+"_btnOK");YUE.addListener(AlertBtnEl,"click",function(){NC_PanelManager.HideActivePanel()})}onAddPanelCompleteEvent.fire(ID);return containerManager.overlays})},BtnsCallback:function(e,objvalue){btnsEvent.fire(objvalue.value);objvalue.obj.hide()},setActive:function(panelID){for(var i=0;i<containerManager.overlays.length;i++){if(containerManager.overlays[i].id==panelID){containerManager.focus(containerManager.overlays[i].id);currEl=containerManager.getActive();this.setProperty("ActivePanel",currEl,false);return currEl}}},GetActivePanel:function(){return currEl},ShowActivePanel:function(autohidetime,hideAll,setOffsetFromTop,MaskSettings){this.show(autohidetime,hideAll,setOffsetFromTop,MaskSettings)},ShowPanelByID:function(PanelID,autohidetime,hideAll,setOffsetFromTop,MaskSettings){this.setActive(PanelID);this.show(autohidetime,hideAll,setOffsetFromTop,MaskSettings)},RemovePanelByID:function(PanelID){this.setActive(PanelID);currEl.destroy();containerManager.remove(PanelID)},HideActivePanel:function(){this.hide()},HidePanelByID:function(PanelID){this.setActive(PanelID);this.hide()},HideAllPanels:function(){this.hideAll()},GetVisibleId:function(){return containerManager.getActive().id},IsVisible:function(){if(containerManager.getActive()==null){return false}else{return true}},ChangePanelContentByAjax:function(ControlName,PanelID,AutoShow,setOffsetFromTop,isEmptyKbPostID,MaskSettings){try{var premiumInwinMaster=false;if(ControlName=='premiumInwinMaster'){ControlName='premiumInwin';premiumInwinMaster=true}if(ControlName=="premiumInwin"){trackerEvent.fire("loadingPanel: "+ControlName)}KbApp1.setProperty("ControlName",ControlName);KbApp1.setProperty("KbPlaceholderID",ControlName+"Region");if(isEmptyKbPostID){KbApp1.setProperty("KbPostID",const_EmptyGuid)}var InwinContent=Netcraft.KeePaBoo.Web.AjaxMethods.GetHtml(KbApp1.GetRefreshContext());if(PanelID){this.setActive(PanelID)}currEl.setBody(InwinContent.value);if(ControlName=='premiumInwin'&&!premiumInwinMaster){YUD.get('premiumIntro').innerHTML="<strong>You have selected a premium feature. Upgrade to Premium to enjoy this and other exclusive features and benefits </strong>"}if(AutoShow){this.ShowActivePanel(null,null,setOffsetFromTop,MaskSettings)}}catch(e){}},ChangePanelContentByDivHtml:function(DivId,PanelID,AutoShow,setOffsetFromTop,MaskSettings){try{if(PanelID){this.setActive(PanelID)}if(currEl.id!=PanelID){return}currEl.setBody(YUD.get(DivId).innerHTML);if(AutoShow){this.ShowActivePanel(null,null,setOffsetFromTop,MaskSettings)}}catch(e){}},ChangePanelContentByIframe:function(IframeSrc,width,height,PanelID,AutoShow,setOffsetFromTop,MaskSettings){try{if(PanelID){this.setActive(PanelID)}currEl.setBody("<iframe src='"+IframeSrc+"' width='"+width+"' height='"+height+"' id='iframe_"+currEl.id+"' frameborder=\"0\" allowtransparency=\"true\" scrolling=\"no\"></iframe>");if(AutoShow){this.ShowActivePanel(null,null,setOffsetFromTop,MaskSettings)}}catch(e){}},ChangePanelContent:function(newContent,PanelID,AutoShow,setOffsetFromTop,MaskSettings){try{if(PanelID){this.setActive(PanelID)}currEl.setBody(newContent);if(AutoShow){this.ShowActivePanel(null,null,setOffsetFromTop,MaskSettings)}}catch(e){}},SyncPositionByID:function(PanelID){this.setActive(PanelID);currEl.syncPosition()},show:function(autohidetime,hideAll,setOffsetFromTop,MaskSettings){currEl.syncPosition();var overlayWrapper=YAHOO.util.Dom.get(currEl.id).parentNode;YAHOO.util.Dom.setStyle(overlayWrapper,"display","block");YAHOO.util.Dom.setStyle(currEl.mask,"display","block");if(YAHOO.env.ua.ie>0){if(currEl.body){try{if(YUD.getStyle(currEl.body.getElementsByTagName("div")[0],"width")!="auto"){YUD.setStyle(currEl.id,"width",YUD.getStyle(currEl.body.getElementsByTagName("div")[0],"width"))}if(YUD.getStyle(currEl.body.getElementsByTagName("div")[0],"height")!="auto"){YUD.setStyle(currEl.id,"height",YUD.getStyle(currEl.body.getElementsByTagName("div")[0],"height"))}}catch(e){}}}currEl.mask.style.backgroundColor="";if(setOffsetFromTop==null){currEl.cfg.setProperty("fixedcenter",true)}else{currEl.cfg.setProperty("fixedcenter",true);currEl.cfg.setProperty("fixedcenter",false);if(YAHOO.env.ua.ie!=0){var scrollTop=document.documentElement.scrollTop}else{var scrollTop=window.pageYOffset}}if(typeof MaskSettings!="undefined"&&MaskSettings!=null){this.MaskColor=MaskSettings.color;this.MaskOpacity=MaskSettings.opacity;if(this.MaskColor!=null){YUD.setStyle(currEl.mask,"background-color",this.MaskColor)}YUD.setStyle(currEl.mask,"opacity",this.MaskOpacity)}else{YUD.setStyle(currEl.mask,"background-color",cfg.getProperty("defaultColor"));YUD.setStyle(currEl.mask,"opacity",cfg.getProperty("defaultOpacity"))}if(hideAll){this.hideAll()}if(YAHOO.env.ua.ie==0){if(typeof MaskSettings!="undefined"&&MaskSettings!=null){YUD.setStyle(currEl.mask,"background-color",MaskSettings.color)}else{}}else{if(typeof MaskSettings!="undefined"&&MaskSettings!=null){if(this.MaskColor!=null){YUD.setStyle(currEl.mask,"background-color",MaskSettings.color)}YUD.setStyle(currEl.mask,"opacity",MaskSettings.opacity)}else{YUD.setStyle(currEl.mask,"background-color",cfg.getProperty("defaultColor"));YUD.setStyle(currEl.mask,"opacity",cfg.getProperty("defaultOpacity"))}}var okBtn=YUD.getElementsByClassName(currEl.id+'_btnOK')[0];if(typeof okBtn!=="undefined"){okBtn.style.display="none"}onShowEvent.fire();currEl.syncPosition();currEl.show();if(setOffsetFromTop!=null){YAHOO.util.Dom.setStyle(currEl.element,"top",scrollTop+setOffsetFromTop+"px");}if(typeof setOffsetFromTop!="undefined"&&setOffsetFromTop!=null){var overlayWrapper=YAHOO.util.Dom.get(currEl.id).parentNode;overlayWrapper.setAttribute("rel",setOffsetFromTop)}if(autohidetime){function autoHide(curEl,scope){scope.setActive(curEl);curEl.hide()}var scope=this;var curEl=currEl;setTimeout(function(){autoHide(curEl,scope)},autohidetime)}},getDimensions:function(){currEl=containerManager.getActive();},setPosition:function(position){currEl=containerManager.getActive()},focus:function(){containerManager.overlays[0].focus()},ToTop:function(){},hide:function(e,objvalue){currEl=containerManager.getActive();if(currEl==null){return}var HideEl=currEl.id;currEl.hide();var overlayWrapper=YAHOO.util.Dom.get(currEl.id).parentNode;containerManager.blurAll();YAHOO.util.Dom.setStyle(overlayWrapper,"display","none");YAHOO.util.Dom.setStyle(currEl.mask,"display","none");bookId=KbApp1.getProperty('bookId');onHideEvent.fire(HideEl);KbApp1.setProperty('bookId',bookId)},setContent:function(content){currEl=containerManager.getActive();currEl.setBody(content)},hideAll:function(){if(YAHOO.env.ua.ie===0){containerManager.hideAll()}containerManager.blurAll();for(var i=0;i<containerManager.overlays.length;i++){var overlayWrapper=YUD.get(containerManager.overlays[i].id).parentNode;YAHOO.util.Dom.setStyle(overlayWrapper,"display","none");var overlayWrapperMask=containerManager.overlays[i].mask;YAHOO.util.Dom.setStyle(overlayWrapperMask,"display","none")}}}};function initARC(formId,onClassRadio,offClassRadio,onClassCheckbox,offClassCheckbox){var agt=navigator.userAgent.toLowerCase();this.major=parseInt(navigator.appVersion);this.ie=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1));this.ie3=(this.ie&&(this.major<4));this.ie4=(this.ie&&(this.major==4)&&(agt.indexOf("msie 4")!=-1));this.iemac=(this.ie&&(agt.indexOf("mac")!=-1));if(!(this.iemac||ie3||ie4)){customiseInputs(formId,onClassRadio,offClassRadio,onClassCheckbox,offClassCheckbox)}}function addLabelProperties(f){if(typeof f.getElementsByTagName=='undefined'){return}var labels=f.getElementsByTagName("label"),label,elem,i=j=0;while(label=labels[i++]){if(typeof label.htmlFor=='undefined'){return}elem=document.getElementById(label.htmlFor);if(typeof elem=='undefined'){var inputs=label.getElementsByTagName("input");if(inputs.length==0){continue}else{elem=inputs[0]}}else if(typeof elem.label!='undefined'){continue}else if(typeof elem.length!='undefined'&&elem.length>1&&elem.nodeName!='SELECT'){for(j=0;j<elem.length;j++){elem.item(j).label=label}}elem.label=label}}function toggleLabelStyle(formId,label,onClass,offClass){if(!document.getElementById||!label){return}var form=document.getElementById(formId);if(!form){return}if(label.htmlFor){var e=document.getElementById(label.htmlFor);if(e.type=="checkbox"){e.label.className=(e.label.className==onClass)?offClass:onClass;e.checked=(e.label.className==onClass)}else if(e.type=="radio"){var wrapper=document.getElementById(formId);var radioGroup=wrapper.getElementsByTagName('input');if(!radioGroup){return}for(var i=0;i<radioGroup.length;i++){if(radioGroup[i].label){radioGroup[i].label.className=((radioGroup[i].checked=(radioGroup[i].id==e.id))&&radioGroup[i].label)?onClass:offClass}}}}};function customiseInputs(formId,onClassRadio,offClassRadio,onClassCheckbox,offClassCheckbox){if(!document.getElementById){return}var prettyForm=document.getElementById(formId);if(!prettyForm){return}prettyForm.onreset=function(){customiseInputs(formId,onClassRadio,offClassRadio,onClassCheckbox,offClassCheckbox)};addLabelProperties(prettyForm);var inputs=prettyForm.getElementsByTagName('input');for(var i=0;i<inputs.length;i++){if((inputs[i].type=="radio")&&inputs[i].label&&onClassRadio&&offClassRadio){inputs[i].style.position="absolute";inputs[i].style.left="-1000px";inputs[i].label.className=offClassRadio;inputs[i].label.onclick=function(){toggleLabelStyle(formId,this,onClassRadio,offClassRadio);return false};inputs[i].onclick=function(){toggleLabelStyle(formId,this.label,onClassRadio,offClassRadio)};if(inputs[i].defaultChecked||inputs[i].checked){toggleLabelStyle(formId,inputs[i].label,onClassRadio,offClassRadio)}}if((inputs[i].type=="checkbox")&&inputs[i].label&&onClassCheckbox&&offClassCheckbox){inputs[i].style.position="absolute";inputs[i].style.left="-1000px";inputs[i].label.className=offClassCheckbox;inputs[i].checked=false;inputs[i].label.onclick=function(){toggleLabelStyle(formId,this,onClassCheckbox,offClassCheckbox);return false};inputs[i].onclick=function(){toggleLabelStyle(formId,this.label,onClassCheckbox,offClassCheckbox)};if(inputs[i].defaultChecked||inputs[i].checked){toggleLabelStyle(formId,inputs[i].label,onClassCheckbox,offClassCheckbox)}}if((inputs[i].type=="checkbox")||(inputs[i].type=="radio")&&inputs[i].label){if(!this.ie){inputs[i].label.style.margin="1px";inputs[i].onfocus=function(){this.label.style.border="1px dotted #333";this.label.style.margin="0px";return false};inputs[i].onblur=function(){this.label.style.border="none";this.label.style.margin="1px";return false}}}}};Object.extend=function(A,C,B){for(var D in C){if(B==false&&A[D]!=null){continue}A[D]=C[D]}return A};Object.extend(Function.prototype,{apply:function(o,a){var r,x="__fapply";if(typeof o!="object"){o={}}o[x]=this;var s="r = o."+x+"(";for(var i=0;i<a.length;i++){if(i>0){s+=","}s+="a["+i+"]"}s+=");";eval(s);delete o[x];return r},bind:function(D){if(!Function.__objs){Function.__objs=[];Function.__funcs=[]}var A=D.__oid;if(!A){Function.__objs[A=D.__oid=Function.__objs.length]=D}var B=this;var C=B.__fid;if(!C){Function.__funcs[C=B.__fid=Function.__funcs.length]=B}if(!D.__closures){D.__closures=[]}var E=D.__closures[C];if(E){return E}D=null;B=null;return Function.__objs[A].__closures[C]=function(){return Function.__funcs[C].apply(Function.__objs[A],arguments)}}},false);Object.extend(Array.prototype,{push:function(A){this[this.length]=A},addRange:function(A){if(A.length>0){for(var B=0;B<A.length;B++){this.push(A[B])}}},clear:function(){this.length=0;return this},shift:function(){if(this.length==0){return null}var B=this[0];for(var A=0;A<this.length-1;A++){this[A]=this[A+1]}this.length--;return B}},false);Object.extend(String.prototype,{trimLeft:function(){return this.replace(/^\s*/,"")},trimRight:function(){return this.replace(/\s*$/,"")},trim:function(){return this.trimRight().trimLeft()},endsWith:function(A){if(this.length==0||this.length<A.length){return false}return(this.substr(this.length-A.length)==A)},startsWith:function(A){if(this.length==0||this.length<A.length){return false}return(this.substr(0,A.length)==A)},split:function(D){var A=[];if(this.length==0){return A}var C=0;for(var B=0;B<this.length;B++){if(this.charAt(B)==D){A.push(this.substring(C,B));C=++B}}A.push(s.substr(C));return A}},false);Object.extend(String,{format:function(B){for(var A=1;A<arguments.length;A++){B=B.replace("{"+(A-1)+"}",arguments[A])}return B},isNullOrEmpty:function(A){if(A==null||A.length==0){return true}return false}},false);if(typeof addEvent=="undefined"){addEvent=function(F,C,D,A){if(F==null){return false}if(F.addEventListener){F.addEventListener(C,D,A);return true}else{if(F.attachEvent){var B=F.attachEvent("on"+C,D);return B}else{try{F["on"+C]=D}catch(E){}}}}}if(typeof removeEvent=="undefined"){removeEvent=function(E,B,C,A){if(E==null){return false}if(E.removeEventListener){E.removeEventListener(B,C,A);return true}else{if(E.detachEvent){E.detachEvent("on"+B,C)}else{try{E["on"+B]=function(){}}catch(D){}}}}}Object.extend(Function.prototype,{getArguments:function(){var A=[];for(var B=0;B<this.arguments.length;B++){A.push(this.arguments[B])}return A}},false);var MS={Browser:{}};Object.extend(MS.Browser,{isIE:navigator.userAgent.indexOf("MSIE")!=-1,isFirefox:navigator.userAgent.indexOf("Firefox")!=-1,isOpera:window.opera!=null},false);var AjaxPro={};AjaxPro.IFrameXmlHttp=function(){};AjaxPro.IFrameXmlHttp.prototype={onreadystatechange:null,headers:[],method:"POST",url:null,async:true,iframe:null,status:0,readyState:0,responseText:null,abort:function(){},readystatechanged:function(){var A=this.iframe.contentDocument||this.iframe.document;if(A!=null&&A.readyState=="complete"&&A.body!=null&&A.body.res!=null){this.status=200;this.statusText="OK";this.readyState=4;this.responseText=A.body.res;this.onreadystatechange();return}setTimeout(this.readystatechanged.bind(this),10)},open:function(E,A,B){if(B==false){alert("Synchronous call using IFrameXMLHttp is not supported.");return}if(this.iframe==null){var C="hans";if(document.createElement&&document.documentElement&&(window.opera||navigator.userAgent.indexOf("MSIE 5.0")==-1)){var D=document.createElement("iframe");D.setAttribute("id",C);D.style.visibility="hidden";D.style.position="absolute";D.style.width=D.style.height=D.borderWidth="0px";this.iframe=document.getElementsByTagName("body")[0].appendChild(D)}else{if(document.body&&document.body.insertAdjacentHTML){document.body.insertAdjacentHTML("beforeEnd",'<iframe name="'+C+'" id="'+C+'" style="border:1px solid black;display:none"></iframe>')}}if(window.frames&&window.frames[C]){this.iframe=window.frames[C]}this.iframe.name=C;this.iframe.document.open();this.iframe.document.write("<html><body></body></html>");this.iframe.document.close()}this.method=E;this.url=A;this.async=B},setRequestHeader:function(A,C){for(var B=0;B<this.headers.length;B++){if(this.headers[B].name==A){this.headers[B].value=C;return}}this.headers.push({name:A,value:C})},getResponseHeader:function(A,B){return null},addInput:function(F,C,B,E){var D;var A="input";if(E.indexOf("\n")>=0){A="textarea"}if(F.all){D=F.createElement("<"+A+' name="'+B+'" />')}else{D=F.createElement(A);D.setAttribute("name",B)}D.setAttribute("value",E);C.appendChild(D);D=null},send:function(C){if(this.iframe==null){return}var D=this.iframe.contentDocument||this.iframe.document;var B=D.createElement("form");D.body.appendChild(B);B.setAttribute("action",this.url);B.setAttribute("method",this.method);B.setAttribute("enctype","application/x-www-form-urlencoded");for(var A=0;A<this.headers.length;A++){switch(this.headers[A].name.toLowerCase()){case"content-length":case"accept-encoding":case"content-type":break;default:this.addInput(D,B,this.headers[A].name,this.headers[A].value)}}this.addInput(D,B,"data",C);B.submit();setTimeout(this.readystatechanged.bind(this),0)}};var progids=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];var progid=null;if(typeof ActiveXObject!="undefined"){var ie7xmlhttp=false;if(typeof XMLHttpRequest=="object"){try{var o=new XMLHttpRequest();ie7xmlhttp=true}catch(e){}}if(typeof XMLHttpRequest=="undefined"||!ie7xmlhttp){XMLHttpRequest=function(){var A=null;if(!AjaxPro.noActiveX){if(progid!=null){return new ActiveXObject(progid)}for(var B=0;B<progids.length&&A==null;B++){try{A=new ActiveXObject(progids[B]);progid=progids[B]}catch(C){}}}if(A==null&&MS.Browser.isIE){return new AjaxPro.IFrameXmlHttp()}return A}}}Object.extend(AjaxPro,{noOperation:function(){},onLoading:function(){},onError:function(){},onTimeout:function(){},onStateChanged:function(){},cryptProvider:null,queue:null,token:"",version:"6.9.29.2",ID:"AjaxPro",noActiveX:false,timeoutPeriod:10*1000,queue:null,noUtcTime:false,toJSON:function(E){if(E==null){return"null"}var B=[];var C;var F=E.constructor;if(F==Number){return isFinite(E)?E.toString():AjaxPro.toJSON(null)}else{if(F==Boolean){return E.toString()}else{if(F==String){for(C=0;C<E.length;C++){var F=E.charAt(C);if(F>=" "){if(F=="\\"||F=='"'){B.push("\\")}B.push(F)}else{switch(F){case"\n":B.push("\\n");break;case"\r":B.push("\\r");break;case"\b":B.push("\\b");break;case"\f":B.push("\\f");break;case"\t":B.push("\\t");break;default:B.push("\\u00");B.push(F.charCodeAt().toString(16))}}}return'"'+B.join("")+'"'}else{if(F==Array){for(C=0;C<E.length;C++){B.push(AjaxPro.toJSON(E[C]))}return"["+B.join(",")+"]"}else{if(F==Date){var D={};D.__type="System.DateTime";if(AjaxPro.noUtcTime==true){D.Year=E.getFullYear();D.Month=E.getMonth()+1;D.Day=E.getDate();D.Hour=E.getHours();D.Minute=E.getMinutes();D.Second=E.getSeconds();D.Millisecond=E.getMilliseconds()}else{D.Year=E.getUTCFullYear();D.Month=E.getUTCMonth()+1;D.Day=E.getUTCDate();D.Hour=E.getUTCHours();D.Minute=E.getUTCMinutes();D.Second=E.getUTCSeconds();D.Millisecond=E.getUTCMilliseconds()}return AjaxPro.toJSON(D)}}}}}if(typeof E.toJSON=="function"){return E.toJSON()}if(typeof E=="object"){for(var A in E){if(typeof E[A]!="function"){B.push('"'+A+'":'+AjaxPro.toJSON(E[A]))}}if(B.length>0){return"{"+B.join(",")+"}"}return"{}"}return E.toString()},dispose:function(){if(AjaxPro.queue!=null){AjaxPro.queue.dispose()}}},false);addEvent(window,"unload",AjaxPro.dispose);AjaxPro.Request=function(A){this.url=A;this.xmlHttp=null};AjaxPro.Request.prototype={url:null,callback:null,onLoading:AjaxPro.noOperation,onError:AjaxPro.noOperation,onTimeout:AjaxPro.noOperation,onStateChanged:AjaxPro.noOperation,args:null,context:null,isRunning:false,abort:function(){if(this.timeoutTimer!=null){clearTimeout(this.timeoutTimer)}if(this.xmlHttp){this.xmlHttp.onreadystatechange=AjaxPro.noOperation;this.xmlHttp.abort()}if(this.isRunning){this.isRunning=false;this.onLoading(false)}},dispose:function(){this.abort()},getEmptyRes:function(){return{error:null,value:null,request:{method:this.method,args:this.args},context:this.context,duration:this.duration}},endRequest:function(A){this.abort();if(A.error!=null){this.onError(A.error,this)}if(typeof this.callback=="function"){this.callback(A,this)}},mozerror:function(){if(this.timeoutTimer!=null){clearTimeout(this.timeoutTimer)}var A=this.getEmptyRes();A.error={Message:"Unknown",Type:"ConnectFailure",Status:0};this.endRequest(A)},doStateChange:function(){this.onStateChanged(this.xmlHttp.readyState,this);if(this.xmlHttp.readyState!=4||!this.isRunning){return}this.duration=new Date().getTime()-this.__start;if(this.timeoutTimer!=null){clearTimeout(this.timeoutTimer)}var A=this.getEmptyRes();if(this.xmlHttp.status==200&&this.xmlHttp.statusText=="OK"){A=this.createResponse(A)}else{A=this.createResponse(A,true);A.error={Message:this.xmlHttp.statusText,Type:"ConnectFailure",Status:this.xmlHttp.status}}this.endRequest(A)},createResponse:function(r,noContent){if(!noContent){var responseText=""+this.xmlHttp.responseText;if(AjaxPro.cryptProvider!=null&&typeof AjaxPro.cryptProvider=="function"){responseText=AjaxPro.cryptProvider.decrypt(responseText)}if(this.xmlHttp.getResponseHeader("Content-Type")=="text/xml"){r.value=this.xmlHttp.responseXML}else{if(responseText!=null&&responseText.trim().length>0){r.json=responseText;eval("r.value = "+responseText+"*/")}}}return r},timeout:function(){this.duration=new Date().getTime()-this.__start;var A=this.onTimeout(this.duration,this);if(typeof A=="undefined"||A!=false){this.abort()}else{this.timeoutTimer=setTimeout(this.timeout.bind(this),AjaxPro.timeoutPeriod)}},invoke:function(G,A,F,C){this.__start=new Date().getTime();if(this.xmlHttp==null){this.xmlHttp=new XMLHttpRequest()}this.isRunning=true;this.method=G;this.args=A;this.callback=F;this.context=C;var D=typeof(F)=="function"&&F!=AjaxPro.noOperation;if(D){if(MS.Browser.isIE){this.xmlHttp.onreadystatechange=this.doStateChange.bind(this)}else{this.xmlHttp.onload=this.doStateChange.bind(this);this.xmlHttp.onerror=this.mozerror.bind(this)}this.onLoading(true)}var B=AjaxPro.toJSON(A)+"";if(AjaxPro.cryptProvider!=null){B=AjaxPro.cryptProvider.encrypt(B)}this.xmlHttp.open("POST",this.url,D);this.xmlHttp.setRequestHeader("Content-Type","text/plain; charset=utf-8");this.xmlHttp.setRequestHeader("X-"+AjaxPro.ID+"-Method",G);if(AjaxPro.token!=null&&AjaxPro.token.length>0){this.xmlHttp.setRequestHeader("X-"+AjaxPro.ID+"-Token",AjaxPro.token)}if(!MS.Browser.isIE){this.xmlHttp.setRequestHeader("Connection","close")}this.timeoutTimer=setTimeout(this.timeout.bind(this),AjaxPro.timeoutPeriod);try{this.xmlHttp.send(B)}catch(E){}if(!D){return this.createResponse({error:null,value:null})}return true}};AjaxPro.RequestQueue=function(B){this.queue=[];this.requests=[];this.timer=null;if(isNaN(B)){B=2}for(var A=0;A<B;A++){this.requests[A]=new AjaxPro.Request();this.requests[A].callback=function(C){var D=C.context;C.context=D[3][1];D[3][0](C,this)};this.requests[A].callbackHandle=this.requests[A].callback.bind(this.requests[A])}};AjaxPro.RequestQueue.prototype={process:function(){this.timer=null;if(this.queue.length==0){return}for(var A=0;A<this.requests.length&&this.queue.length>0;A++){if(this.requests[A].isRunning==false){var B=this.queue.shift();this.requests[A].url=B[0];this.requests[A].onLoading=B[3].length>2&&B[3][2]!=null&&typeof B[3][2]=="function"?B[3][2]:AjaxPro.onLoading;this.requests[A].onError=B[3].length>3&&B[3][3]!=null&&typeof B[3][3]=="function"?B[3][3]:AjaxPro.onError;this.requests[A].onTimeout=B[3].length>4&&B[3][4]!=null&&typeof B[3][4]=="function"?B[3][4]:AjaxPro.onTimeout;this.requests[A].onStateChanged=B[3].length>5&&B[3][5]!=null&&typeof B[3][5]=="function"?B[3][5]:AjaxPro.onStateChanged;this.requests[A].invoke(B[1],B[2],this.requests[A].callbackHandle,B);B=null}}if(this.queue.length>0&&this.timer==null){this.timer=setTimeout(this.process.bind(this),0)}},add:function(B,D,A,C){this.queue.push([B,D,A,C]);this.process()},abort:function(){this.queue.length=0;if(this.timer!=null){clearTimeout(this.timer)}this.timer=null;for(var A=0;A<this.requests.length;A++){if(this.requests[A].isRunning==true){this.requests[A].abort()}}},dispose:function(){for(var A=0;A<this.requests.length;A++){var B=this.requests[A];B.dispose()}this.requests.clear()}};AjaxPro.queue=new AjaxPro.RequestQueue(2);AjaxPro.AjaxClass=function(A){this.url=A};AjaxPro.AjaxClass.prototype={invoke:function(D,A,C){if(C!=null){if(C.length!=6){for(;C.length<6;){C.push(null)}}if(C[0]!=null&&typeof(C[0])=="function"){return AjaxPro.queue.add(this.url,D,A,C)}}var B=new AjaxPro.Request();B.url=this.url;return B.invoke(D,A)}};if(typeof Ajax=="undefined"){Ajax={}}if(typeof Ajax.Web=="undefined"){Ajax.Web={}}Ajax.Web.NameValueCollection=function(A){this.__type="System.Collections.Specialized.NameValueCollection";this.keys=[];this.values=[];if(A!=null&&!isNaN(A.length)){for(var B=0;B<A.length;B++){this.add(A[B][0],A[B][1])}}};Object.extend(Ajax.Web.NameValueCollection.prototype,{add:function(B,A){if(B==null||B.constructor!=String||A==null||A.constructor!=String){return-1}this.keys.push(B);this.values.push(A);return this.values.length-1},containsKey:function(B){for(var A=0;A<this.keys.length;A++){if(this.keys[A]==B){return true}}return false},getKeys:function(){return this.keys},getValue:function(A){for(var B=0;B<this.keys.length&&B<this.values.length;B++){if(this.keys[B]==A){return this.values[B]}}return null},setValue:function(B,A){if(B==null||B.constructor!=String||A==null||A.constructor!=String){return-1}for(var C=0;C<this.keys.length&&C<this.values.length;C++){if(this.keys[C]==B){this.values[C]=A}return C}return this.add(B,A)},toJSON:function(){return AjaxPro.toJSON({__type:this.__type,keys:this.keys,values:this.values})}},true);if(typeof Ajax=="undefined"){Ajax={}}if(typeof Ajax.Web=="undefined"){Ajax.Web={}}Ajax.Web.DataSet=function(B){this.__type="System.Data.DataSet,System.Data";this.Tables=[];this.addTable=function(C){this.Tables.push(C)};if(B!=null){for(var A=0;A<B.length;A++){this.addTable(B[A])}}};if(typeof Ajax=="undefined"){Ajax={}}if(typeof Ajax.Web=="undefined"){Ajax.Web={}}Ajax.Web.DataTable=function(F,B){this.__type="System.Data.DataTable,System.Data";this.Columns=[];this.Rows=[];this.addColumn=function(G,H){this.Columns.push({Name:G,__type:H})};this.toJSON=function(){var I={};var H;I.Columns=[];for(H=0;H<this.Columns.length;H++){I.Columns.push([this.Columns[H].Name,this.Columns[H].__type])}I.Rows=[];for(H=0;H<this.Rows.length;H++){var J=[];for(var G=0;G<this.Columns.length;G++){J.push(this.Rows[H][this.Columns[G].Name])}I.Rows.push(J)}return AjaxPro.toJSON(I)};this.addRow=function(G){this.Rows.push(G)};if(F!=null){for(var A=0;A<F.length;A++){this.addColumn(F[A][0],F[A][1])}}if(B!=null){for(var E=0;E<B.length;E++){var D={};for(var C=0;C<this.Columns.length&&C<B[E].length;C++){D[this.Columns[C].Name]=B[E][C]}this.addRow(D)}}};if(typeof Ajax=="undefined"){Ajax={}}if(typeof Ajax.Web=="undefined"){Ajax.Web={}}Ajax.Web.Profile=function(){this.toJSON=function(){throw"Ajax.Web.Profile cannot be converted to JSON format."};this.setProperty_callback=function(A){};this.setProperty=function(B,A){this[B]=A;AjaxPro.Services.Profile.SetProfile({name:o},this.setProperty_callback.bind(this))}};if(typeof Ajax=="undefined"){Ajax={}}if(typeof Ajax.Web=="undefined"){Ajax.Web={}}Ajax.Web.Dictionary=function(C,A){this.__type=C;this.keys=[];this.values=[];if(A!=null&&!isNaN(A.length)){for(var B=0;B<A.length;B++){this.add(A[B][0],A[B][1])}}};Object.extend(Ajax.Web.Dictionary.prototype,{add:function(B,A){this.keys.push(B);this.values.push(A);return this.values.length-1},containsKey:function(B){for(var A=0;A<this.keys.length;A++){if(this.keys[A]==B){return true}}return false},getKeys:function(){return this.keys},getValue:function(B){for(var A=0;A<this.keys.length&&A<this.values.length;A++){if(this.keys[A]==B){return this.values[A]}}return null},setValue:function(B,A){for(var C=0;C<this.keys.length&&C<this.values.length;C++){if(this.keys[C]==B){this.values[C]=A}return C}return this.add(B,A)},toJSON:function(){return AjaxPro.toJSON({__type:this.__type,keys:this.keys,values:this.values})}},true);function onConnected(){}function onNotConnected(){}function logInWithFB(){var loggedInUser=getFbUser();var panel=document.getElementById("loggedInPanel");var allTags=panel.getElementsByTagName('*');var img='';var fbName='';for(i=0;i<allTags.length;i++){if(allTags[i].tagName=='IMG'){img=allTags[i].src}else if(allTags[i].tagName=='A'){fbName=allTags[i].innerHTML}}__doKBPostBack("__fbReg",loggedInUser+'|'+img+'|'+fbName)}function logOut(){FB.Connect.logout()}function getFbUser(){return FB.Connect.get_loggedInUser()}function facebook_onlogin(){YUD.get("Loading_Indicator").style.display='block';setTimeout(function(){YUD.get("Loading_Indicator").style.display='none'},10000);setTimeout(function(){logInWithFB()},3000);}var DebugMode=false;var EnableHistory=true;var IsAppFullyLoaded=false;var MonthsArray=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var textColorByBookCover=["white","#e2863b","#059b92","#2e9f1b","#d7626a","#e3853b","#d85d7c","#27a5cd","white"];var isAddPanelOpen=false;var KbApp;var On_KbLoad1;var _textResizer;var ItemsArrayList=null;var Post_selected_index=0;var PostsPageCount=0;var KbPostsPages=0;var userLoggedIn;var postsArray;var publicStartTimelineElID=null;var SaveFlag=0;var TimeLineScrollPositionFlag=true;var isNewBackgroundFromAddnewPanel=false;var BackgroundsParentNode=null;var const_EmptyGuid='00000000-0000-0000-0000-000000000000';var trackerEvent=new YAHOO.util.CustomEvent("trackerEvent");var AttachClicked=new YAHOO.util.CustomEvent("AttachClicked");var saveAlertPrompt=new YAHOO.util.CustomEvent("saveAlertPrompt");var saveAlertPromptBook=new YAHOO.util.CustomEvent("saveAlertPromptBook");var onPostEditorChanged=new YAHOO.util.CustomEvent("onPostEditorChanged");var DelChildAlertPrompt=new YAHOO.util.CustomEvent("DelChildAlertPrompt");var onCallBackFinish=new YAHOO.util.CustomEvent("onCallBackFinish");var PostSaved=new YAHOO.util.CustomEvent("PostSaved");var showSavedAlert=true;var KbpostFixerReLoadFlag=true;var isFirstTime;var GrowthFirstVisit=true;var currentGalleryData;var TalkImageManagerType=null;var TabLock=false;var Timeline1=null;var TempKbContext=null;var TinyMceCaretPostion=null;var ScriptLoaded=null;var defualtTitle=document.title;var sidePage=false;var TimelineSelectedDelay=800;var loadFromContext=null;var SaveErr=null;var TempKbPostType=null;var isHistoryStepLoaded=false;var isSavedDateChanged=false;var SSLoadedImagesCounter=0;var SSImagesAreLoaded=false;var SSbookShowStarted=false;if(window.location.href.indexOf("#")==-1){window.name=""}var windowNameArray=window.name.split('@');var KbContextHistoryArray=(windowNameArray.length>0)?windowNameArray:[];var BlockerOpen=false;var HISTORY_STEP=1;var HistoryIndex=0;var isBackBtn=false;var showTabOpenPanel=false;KbApp=function(){YAHOO.namespace("KbApp");var cfg=new YAHOO.util.Config(this);return{initDefaultConfig:function(){cfg.addProperty("KbCurrentPage",{value:"Home"});cfg.addProperty("ChildGender",{value:"unknown"});cfg.addProperty("KbSkinName",{value:"Skin1"});cfg.addProperty("KbPlaceholderID",{value:"MainRegion"});cfg.addProperty("ControlName",{value:"Layout3Columns"});cfg.addProperty("KbpostItemPageNum",{value:1});cfg.addProperty("KbPostsArray",{value:[],handler:this.setItemsArrayList});cfg.addProperty("KbpostType",{value:"Home"});cfg.addProperty("KbpostID",{value:const_EmptyGuid,handler:this.setCurrentPosition});cfg.addProperty("ChildID",{value:const_EmptyGuid});cfg.addProperty("UserID",{value:const_EmptyGuid});cfg.addProperty("KbPostState",{value:"List"});cfg.addProperty("KbpostContent",{value:""});cfg.addProperty("KbpostDate",{value:"3/3/2009 00:00:00"});cfg.addProperty("KbpostTitle",{value:""});cfg.addProperty("KbBookTitle",{value:""});cfg.addProperty("KbpostBackgroundID",{value:"-1",handler:this.SetNewBackground});cfg.addProperty("KbpostBackgroundPath",{value:""});cfg.addProperty("KbpostAttachmentID",{value:const_EmptyGuid});cfg.addProperty("KbpostAttachmentPath",{value:""});cfg.addProperty("BookID",{value:const_EmptyGuid});cfg.addProperty("ClientBookStateIsSaved",{value:true});cfg.addProperty("ClientPostStateIsSaved",{value:true});cfg.addProperty("PageBreakData",{value:[454,908,1362]});cfg.addProperty("ChildFirstName",{value:""});cfg.addProperty("ChildFirstName_WithS",{value:""});cfg.addProperty("ChildGender",{value:1});cfg.addProperty("ChildAge",{value:1});cfg.addProperty("ChildSkin",{value:""});cfg.addProperty("GalleryAttachmentList",{value:null});cfg.addProperty("GalleryAttachmentPosition",{value:0});cfg.addProperty("BookOfLifeID",{value:const_EmptyGuid});cfg.addProperty("CustomParameters",{value:[]});cfg.fireQueue()},SetUserAndChildID:function(ChildID,UserID,ChildFirstName,ChildGender,childAge,skinName,ChildFirstName_WithS,BookOfLifeID){cfg.setProperty("ChildID",ChildID,false);cfg.setProperty("UserID",UserID,false);cfg.setProperty("ChildFirstName",ChildFirstName,false);cfg.setProperty("ChildFirstName_WithS",ChildFirstName_WithS,false);cfg.setProperty("ChildGender",(ChildGender==1)?"Boy":"Girl",false);cfg.setProperty("ChildAge",childAge,false);cfg.setProperty("BookOfLifeID",BookOfLifeID,false);cfg.setProperty("ChildSkin",skinName,false);YUD.addClass(document.body,skinName);if(sidePage){return}if(userLoggedIn==false){window.name="";trackerEvent.fire("Home-1");}else{trackerEvent.fire(KbApp1.getProperty("KbpostType"));var url=window.location.href.split('#');if(url.length>1&&url[1]!=""){isHistoryStepLoaded=true;if(url[1].indexOf("state")>-1){var state=window.location.href.split('state=');state=state[1].split('&');HISTORY_STEP=state[0];this.LoadByHistoryStep(HISTORY_STEP)}else{BlockerOpen=true;var arrIndex=url[1].split("=");HISTORY_STEP=arrIndex[1];this.LoadByHistoryStep(HISTORY_STEP)}}else{this.GetHtml("MainRegion","Layout2RowsLogedIn");setTimeout(function(){KbApp1.navigateContext()},100)}}},LoadByHistoryStep:function(HISTORY_STEP){if(HISTORY_STEP!="Diary"&&HISTORY_STEP!="Milestone"&&HISTORY_STEP!="Gallery"&&HISTORY_STEP!="Growth"&&HISTORY_STEP!="Talk"&&HISTORY_STEP!="Book"){if(HISTORY_STEP<=KbContextHistoryArray.length){KbApp1.InitByContext()}else{this.GetHtml("MainRegion","Layout2RowsLogedIn");KbApp1.navigateContext()}}else{trackerEvent.fire(HISTORY_STEP);if(HISTORY_STEP=="Growth"){setTimeout(function(){YUE.onDOMReady(function(){KbApp1.ChangeTabEventHandler(['Growth',const_EmptyGuid,'View'])})},100)}else{setTimeout(function(){YUE.onDOMReady(function(){KbApp1.ChangeTabEventHandler([HISTORY_STEP,'',"List"])})},100)}if(KbApp1.getProperty("ChildId")!=const_EmptyGuid){KbApp1.GetHtml("TimelineRegion","Timeline")}setTimeout(function(){KbApp1.navigateContext()},100)}},showTabAddPanelOpen:function(tabName){trackerEvent.fire("Home2-StartWidget");showTabOpenPanel=true;if(tabName!="Growth"){this.ChangeTab(tabName,'','List')}else{this.ChangeTab(tabName,'','View')}},setCurrentPosition:function(type,args,obj){var itemID=args[0];for(i=0;i<cfg.getProperty("KbPostsArray").length;i++){if(cfg.getProperty("KbPostsArray")[i]==itemID){Post_selected_index=i}}},SetNewBackground:function(type,args,obj){},setItemsArrayList:function(type,args,obj){ItemsArrayList=args[0]},setProperties:function(ObjectProperties){cfg.applyConfig(ObjectProperties,true)},setProperty:function(key,value,silent){cfg.setProperty(key,value,silent)},getProperty:function(PropertyName){return cfg.getProperty(PropertyName)},init:function(){this.initDefaultConfig();On_KbLoad1=new On_KbLoad();if(typeof TextResizer!="undefined"){_textResizer=new TextResizer()}if(DebugMode&&typeof YAHOO.tool!="undefined"){if(YUD.get("ProfileBtn")){YUD.get("ProfileBtn").style.display="block";YAHOO.tool.Profiler.registerObject("KbApp1")}}if(YAHOO.env.ua.ie>0){}},onLogin:function(){this.GetHtml("MainRegion","Layout2RowsLogedIn");},ChangeTab:function(newTab,KbpostID,KbPostState,isOnlyTabSwitch){if(!IsAppFullyLoaded){return}saveAlertPrompt.fire(this.ChangeTabEventHandler,[newTab,KbpostID,KbPostState,isOnlyTabSwitch])},ChangeTabEventHandler:function(args){KbApp1.setProperty("KbpostContent","",true);KbApp1.setProperty("KbpostTitle","",true);if(args){var newTab=args[0];var KbpostID=args[1];var KbPostState=args[2];var isOnlyTabSwitch=args[3];var GalleryID=args[4]}else{var newTab=this[0];var KbpostID=this[1];var KbPostState=this[2];var isOnlyTabSwitch=this[3];var GalleryID=this[4]}trackerEvent.fire(newTab);if(newTab=="Growth"){GrowthFirstVisit=true}KbApp1.setProperty("KbpostBackgroundID",-1,true);if(newTab=="GalleryItem"){newTab="Gallery";KbPostState="View";}if(!TabLock){if(YUD.hasClass("Books","Books_selected")||newTab!=KbApp1.getProperty("KbpostType")){TabLock=true}if((newTab!=KbApp1.getProperty("KbpostType"))){if(KbApp1.getProperty("KbPostType")!="Gallery"&&KbApp1.getProperty("KbPostType")!="Talk"&&KbApp1.getProperty("KbPostType")!="Growth"){toggleEditor('editorWrap')}}}YUD.removeClass("Home","home_selected tab");YUD.removeClass("Diary","Diary_selected tab");YUD.removeClass("Milestone","Milestone_selected tab");YUD.removeClass("Images","Images_selected tab");YUD.removeClass("Growth","Growth_selected tab");YUD.removeClass("Talk","Talk_selected tab");YUD.removeClass("Books","Books_selected tab");TempKbPostType=null;switch(newTab){case"Milestone":YUD.addClass("Milestone","Milestone_selected tab");KbApp1.setProperty("KbpostBackgroundID",GlobalSetting.Milestone_Defualt_BackgroundID,true);break;case"Diary":YUD.addClass("Diary","Diary_selected tab");KbApp1.setProperty("KbpostBackgroundID",GlobalSetting.Diary_Defualt_BackgroundID,true);break;case"Gallery":YUD.addClass("Images","Images_selected tab");break;case"Home":YUD.addClass("Home","home_selected tab");KbApp1.setProperty("KbpostType",newTab);KbApp1.GetHtml("MainRegion","Layout2RowsLogedIn");if(Timeline1){Timeline1.removeSelectedMark()}return;break;case"Talk":KbApp1.setProperty("KbpostBackgroundID",GlobalSetting.Talk_Defualt_BackgroundID,true);YUD.addClass(newTab,"Talk_selected tab");break;case"Growth":Post_selected_index=0;YUD.addClass("Growth","Growth_selected tab");break;case"Book":YUD.addClass("Books","Books_selected tab");if(Timeline1){Timeline1.removeSelectedMark()}break;default:YUD.addClass(newTab,newTab+"_selected tab");break}if(typeof isOnlyTabSwitch=='undefined'){if(KbPostState){KbApp1.setProperty("KbPostState",KbPostState)}KbApp1.setProperty("KbpostType",newTab);KbApp1.setProperty("KbCurrentPage",newTab);if(KbpostID){KbApp1.setProperty("KbpostID",KbpostID,false)}if(TabLock){KbApp1.GetTab();TabLock=false}}},Save:function(){var memo=null;this.onAjaxLoading("Show");showContentBlocker(false);if(SaveFlag==1&&KbApp1.getProperty("KbPostState")!="Edit"){return}if(KbApp1.getProperty("KbpostType")=="Milestone"||KbApp1.getProperty("KbpostType")=="Diary"){pageBreaker.update()}if(KbApp1.getProperty("KbpostType")=="Talk"){if(typeof CurrentContent.value=="undefined"){return}var re1=new RegExp("\n","g");memo=CurrentContent.value.replace(re1,"<br>");if(memo=="Insert a quote here"){memo=""}this.KbpostAttachmentID=YUD.getElementsByClassName("ImageFrameTalkEdit")[0].getAttribute("rel");if(this.KbpostAttachmentID===null){this.KbpostAttachmentID=const_EmptyGuid}cfg.setProperty("KbpostAttachmentID",this.KbpostAttachmentID,true)}else if(KbApp1.getProperty("KbpostType")!="Gallery"&&KbApp1.getProperty("KbpostType")!="GalleryItem"){if(tinyMCE.activeEditor==null){return}memo=tinyMCE.activeEditor.getContent({format:'raw'});var element=document.createElement("div");element.innerHTML=memo;var ImagesInHtml=element.getElementsByTagName("img");var totalImagesInHtml=ImagesInHtml.length;if(totalImagesInHtml!=0){do{this.imgEl=ImagesInHtml[totalImagesInHtml-1];if(this.imgEl.getAttribute("rel")!=""&&this.imgEl.getAttribute("rel")!=null){this.newSpan=document.createElement("span");this.imgEl.src=this.imgEl.getAttribute("rel");this.imgEl.setAttribute("mce_src","")}totalImagesInHtml--}while(totalImagesInHtml!=0)}memo=element.innerHTML}else{memo=""}var title=YUD.getElementsByClassName("editTitle2")[0].value;KbpostContent=cfg.setProperty("KbpostContent",memo,false);KbpostContent=cfg.setProperty("KbpostTitle",title,false);if(KbApp1.getProperty("KbpostType")=="Milestone"||KbApp1.getProperty("KbpostType")=="Diary"){cfg.setProperty("PageBreakData",pageBreaker.getData(),true)}SaveFlag=1;KbApp1.setProperty("ClientPostStateIsSaved",true,true);if(KbApp1.getProperty("KbpostAttachmentID")!=const_EmptyGuid&&KbApp1.getProperty("KbpostType")=="GalleryItem"){this.AttachmentTitle=YUD.get("pictureTitleInput").value;tempGalleryTitle=KbApp1.getProperty("KbpostTitle");KbApp1.setProperty("KbpostTitle",this.AttachmentTitle,true);var UpdateImageByExternalIDResponse=Netcraft.KeePaBoo.Web.AjaxMethods.UpdateImageByExternalID(this.GetRefreshContext());this.setProperty("KbPostState","Update",false);KbApp1.setProperty("KbpostTitle",tempGalleryTitle,true)}if(this.getProperty("KbpostID")==const_EmptyGuid){this.setProperty("KbPostState","Add",false);Timeline1=null;Netcraft.KeePaBoo.Web.AjaxMethods.AddKbpost(this.GetRefreshContext(),On_KbLoad1.OnSaved)}else{this.setProperty("KbPostState","Update",false);Netcraft.KeePaBoo.Web.AjaxMethods.UpdateKbpost(this.GetRefreshContext(),On_KbLoad1.OnSaved)}if(BlockerOpen){setTimeout(function(){if(SaveFlag!=0){SaveFlag=0;hideContentBlocker()}},60000)}},AddnewGrowth:function(){this.onAjaxLoading("Show");changeAddPanelState("close");floatHeight=YUD.get("HeightText").value;floatWeight=YUD.get("WeightText").value;WeightFactor=YUD.get("CheWeight");HeightFactor=YUD.get("CheHeight");WeightFactor=(WeightFactor.checked)?"PND":"KG";HeightFactor=(HeightFactor.checked)?"INCH":"CM";PublicSelectedWeightFormat=WeightFactor;PublicSelectedHeightFormat=HeightFactor;this.setProperty("KbPostState","Add",false);showContentBlocker(false);KbApp1.setProperty("KbPostID",const_EmptyGuid);Netcraft.KeePaBoo.Web.AjaxMethods.AddKbGrowthPost(this.GetRefreshContext(),HeightFactor,WeightFactor,floatHeight,floatWeight,On_KbLoad1.OnGrowthSaved)},AddKbPostToBook:function(){if(KbApp1.getProperty("KbPostState")=="AddToNewBook"){KbApp1.setProperty("KbBookTitle",YUD.get("NewBookTitle").value,true);KbApp1.setProperty("BookID",const_EmptyGuid,true);KbApp1.setProperty("KbpostBackgroundID",0,true)}Netcraft.KeePaBoo.Web.AjaxMethods.AddItemToBook(this.GetRefreshContext(),On_KbLoad1.OnAddKbPostToBook)},Delete:function(KbpostID){if(this.getProperty("KbpostID")==const_EmptyGuid){return}this.setProperty("KbPostState","Delete",false);this.onAjaxLoading("Show");Netcraft.KeePaBoo.Web.AjaxMethods.DeleteKbPostByExternalID(this.GetRefreshContext(),On_KbLoad1.OnDeleted);},ShowChangeBackgroundPanel:function(KbpostID){},GetRefreshContext:function(){KbpostType=cfg.getProperty("KbpostType");if(typeof KbpostType!="undefined"){KbpostType=KbpostType.replace(" selected","")}KbpostID=cfg.getProperty("KbpostID");ChildID=cfg.getProperty("ChildID");UserID=cfg.getProperty("UserID");KbPostState=cfg.getProperty("KbPostState");KbpostContent=cfg.getProperty("KbpostContent");KbpostDate=cfg.getProperty("KbpostDate");KbpostTitle=cfg.getProperty("KbpostTitle");KbpostBackgroundID=(cfg.getProperty("KbpostBackgroundID")!=0||cfg.getProperty("KbpostBackgroundID")!="")?cfg.getProperty("KbpostBackgroundID"):-1;ControlName=cfg.getProperty("ControlName");KbPlaceholderID=cfg.getProperty("KbPlaceholderID");KbBookID=cfg.getProperty("BookID");KbAttachmentID=cfg.getProperty("KbpostAttachmentID");KbBookTitle=cfg.getProperty("KbBookTitle");PageBreakData=cfg.getProperty("PageBreakData");CustomParameters=cfg.getProperty("CustomParameters");var kbObject=[KbpostType,KbpostID,ChildID,KbPostState,KbpostDate,KbpostTitle,KbpostContent,KbpostBackgroundID,KbPlaceholderID,ControlName,KbBookID,KbAttachmentID,KbBookTitle,PageBreakData,CustomParameters];var failCount=0;for(var index=0;index<kbObject.length;index++){if(kbObject[index]==null){failCount++}}if(failCount==kbObject.length){document.location.href=SiteRootURL+"index.aspx"}return kbObject},navigateContext:function(){if(EnableHistory==false){return}KbContextHistory="";KbContextHistory=KBS.Serialize();KbContextHistoryArray.push(KbContextHistory);if(!sidePage){dhtmlHistory.add("state="+(KbContextHistoryArray.length).toString(),(KbContextHistoryArray.length).toString())}var windowNameStr="";for(var index=0;index<KbContextHistoryArray.length;index++){windowNameStr+=KbContextHistoryArray[index];if(index!=KbContextHistoryArray.length-1){windowNameStr+="@"}}window.name=windowNameStr;document.title=defualtTitle},InitByContext:function(contextJson){if(NC_PanelManager.IsVisible()){NC_PanelManager.HideAllPanels()}if(typeof contextJson=="undefined"||contextJson==null){if(HISTORY_STEP<=0){HISTORY_STEP=1}contextJson=KbContextHistoryArray[HISTORY_STEP-1];if(contextJson==null||typeof contextJson=="undefined"){KbApp1.GetHtml("MainRegion","Layout2RowsLogedIn");return}}KBS.DeSerialize(contextJson);TabLock=true;StoreHistoryPoint=false;if(KbApp1.getProperty("KbpostType")!="Growth"){publicStartTimelineElID=KbApp1.getProperty("KbPostID")}var CurType=KbApp1.getProperty("KbpostType");var CurState=KbApp1.getProperty("KbpostState");if(CurType=="Home"||CurType=="Book"||CurState=="List"){publicStartTimelineElID=null}if(CurState=="Edit"){setTimeout(function(){publicStartTimelineElID=KbApp1.getProperty("KbPostID");KbApp1.GetHtml("TimelineRegion","Timeline")},100)}this.ChangeTabEventHandler([cfg.getProperty("KbpostType"),cfg.getProperty("KbpostID"),cfg.getProperty("KbPostState")])},ResetContext:function(){cfg.setProperty("KbpostType","Home",true);cfg.setProperty("KbpostID",const_EmptyGuid,false);cfg.setProperty("ChildID",const_EmptyGuid,true);cfg.setProperty("UserID",const_EmptyGuid,true);cfg.setProperty("KbPostState","List",true);cfg.setProperty("KbpostContent","",true);cfg.setProperty("KbpostTitle","",true);cfg.setProperty("KbpostBackgroundID","1",true);cfg.setProperty("KbBookTitle","",true);cfg.setProperty("BookID",const_EmptyGuid,true);cfg.setProperty("KbpostAttachmentID","0",true)},GetTab:function(){this.setProperty("KbPlaceholderID","MainRegion");switch(this.getProperty("KbpostType")){case"Book":this.setProperty("ControlName","LayoutMyBooks");break;default:this.setProperty("ControlName","Layout3Columns");break}this.onAjaxLoading("Show");Netcraft.KeePaBoo.Web.AjaxMethods.GetHtml(this.GetRefreshContext(),this.AjaxCallback)},GetHtml:function(KbPlaceholderID,ControlName,showPrompt){this.setProperty("KbPlaceholderID",KbPlaceholderID);this.setProperty("ControlName",ControlName);if(ControlName!="Layout2RowsAnonymous"&&this.getProperty("ChildID")!=const_EmptyGuid){this.onAjaxLoading("Show")}Netcraft.KeePaBoo.Web.AjaxMethods.GetHtml(this.GetRefreshContext(),this.AjaxCallback);},SelectGallery:function(KbPostID){var preGaleeryCallKbPostID=this.getProperty("KbpostID");if(KbPostID){this.setProperty("KbpostID",KbPostID)}this.GetHtml("ImageManagerRegion","AttachmentList");this.setProperty("KbpostID",preGaleeryCallKbPostID)},GetGalleryList:function(){this.GetHtml("ImageManagerRegion","GalleryList")},SwitchToListMode:function(){saveAlertPrompt.fire(this.SwitchToListModeEventHandler,['']);setTimeout(function(){KbApp1.navigateContext()},100)},SwitchToListModeEventHandler:function(){if(KbApp1.getProperty("KbPostState")=="Edit"){toggleEditor('editorWrap')}if(KbApp1.getProperty("KbpostType")=="Gallery"||KbApp1.getProperty("KbpostType")=="GalleryItem"){YUD.get('flashGalleryKeeper').style.zIndex=-2;KbApp1.setProperty("KbpostType","Gallery")}KbApp1.setProperty("KbPostState","List");KbApp1.GetHtml("ViewRegion","View")},SwitchToViewMode:function(KbPostID){saveAlertPrompt.fire(this.SwitchToViewModeEventHandler,[KbPostID])},SwitchToViewModeEventHandler:function(KbPostID){var KbPostID=this[0];TimeLineScrollPositionFlag=true;if(KbPostID){KbApp1.setProperty("KbpostID",KbPostID,false)}KbApp1.setProperty("KbPostState","View");KbApp1.GetHtml("ViewRegion","View");if(KbApp1.getProperty("KbpostType")=="Gallery"||KbApp1.getProperty("KbpostType")=="GalleryItem"){getGalleryData();YUD.get('flashGalleryKeeper').style.zIndex=2}KbApp1.navigateContext()},SwitchToEditMode:function(KbPostID){TimeLineScrollPositionFlag=true;if(KbPostID){this.setProperty("KbpostID",KbPostID,false)}this.setProperty("KbPostState","Edit");this.GetHtml("ViewRegion","View");setTimeout(function(){KbApp1.navigateContext()},100)},SwitchToNewMode:function(NewTitle){saveAlertPrompt.fire(this.SwitchToNewModeEventHandler,[NewTitle]);setTimeout(function(){KbApp1.navigateContext()},100)},SwitchToNewModeEventHandler:function(NewTitle){if(KbApp1.getProperty("KbPostState")=="Edit"){if(KbApp1.getProperty("KbPostType")!="Gallery"&&KbApp1.getProperty("KbPostType")!="Talk"&&KbApp1.getProperty("KbPostType")!="Growth"){toggleEditor('editorWrap')}}var NewTitle=this[0];NewTitle=(NewTitle)?NewTitle:"";KbApp1.setProperty("KbpostTitle",NewTitle);KbApp1.setProperty("KbpostContent","",true);KbApp1.setProperty("KbpostID",const_EmptyGuid,true);KbApp1.setProperty("KbPostState","Edit",false);if(KbApp1.getProperty("KbpostType")=="Talk"){this.ChildAvatar=YUD.get("ImageFrameAdd");KbApp1.setProperty("KbpostAttachmentID",this.ChildAvatar.getAttribute("rel"),true);KbApp1.setProperty("KbpostAttachmentPath",this.ChildAvatar.getAttribute("style"),false)}KbApp1.GetHtml("ViewRegion","View");resetDateField();},SwitchToNewMilestoneMode:function(NewTitle,NewBackgroundID,NewBackgroundUrl){saveAlertPrompt.fire(this.SwitchToNewMilestoneModeEventHandler,[NewTitle,NewBackgroundID,NewBackgroundUrl]);setTimeout(function(){KbApp1.navigateContext()},100)},SwitchToNewMilestoneModeEventHandler:function(NewTitle,NewBackgroundID,NewBackgroundUrl){var NewTitle=this[0];var NewBackgroundID=this[1];var NewBackgroundUrl=this[2];if(KbApp1.getProperty("KbPostState")=="Edit"){if(KbApp1.getProperty("KbPostType")!="Gallery"&&KbApp1.getProperty("KbPostType")!="Talk"&&KbApp1.getProperty("KbPostType")!="Growth"){toggleEditor('editorWrap')}}if(NewTitle.indexOf("{childName}")>-1){NewTitle=NewTitle.replace("{childName}",KbApp1.getProperty("ChildFirstName"))}var Gender=KbApp1.getProperty("ChildGender");if(Gender=="Girl"){if(NewTitle.indexOf("his")>-1){NewTitle=NewTitle.replace("his","her")}else if(NewTitle.indexOf("His")>-1){NewTitle=NewTitle.replace("His","her")}}KbApp1.setProperty("KbpostTitle",NewTitle);KbApp1.setProperty("KbpostContent","",true);KbApp1.setProperty("KbpostBackgroundID",NewBackgroundID,true);NewBackground=NewBackgroundUrl;KbApp1.setProperty("KbpostBackgroundPath",NewBackground,true);isNewBackgroundFromAddnewPanel=true;KbApp1.setProperty("KbpostID",const_EmptyGuid,true);KbApp1.setProperty("KbPostState","Edit",false);KbApp1.GetHtml("ViewRegion","View")},SwitchToNewMsMode:function(NewTitle,newBakcgroundPath,newBackgroundID){if(newBackgroundID){this.setProperty("KbpostBackgroundID",newBackgroundID,true);this.setProperty("KbpostBackgroundPath",newBakcgroundPath,true);isNewBackgroundFromAddnewPanel=true}else{this.setProperty("KbpostBackgroundID","0",true)}NewTitle=(NewTitle)?NewTitle:"untitled";this.setProperty("KbpostTitle",NewTitle);this.setProperty("KbpostID",const_EmptyGuid,true);this.setProperty("KbPostState","Edit");this.GetHtml("ViewRegion","Edit")},AddtoBook:function(){TempKbContext=[KbApp1.getProperty("KbPostType"),KbApp1.getProperty("KbPostState"),KbApp1.getProperty("KbPostID")];if(KbApp1.getProperty("KbPostState")=="Edit"){showSavedAlert=false;this.Save()}BlockerOpen=false;NC_PanelManager.ChangePanelContentByAjax('AddToBook','KbMainInwin',true,150)},ShareItem:function(){if(KbApp1.getProperty("KbPostState")=="Edit"){showSavedAlert=false;this.Save();BlockerOpen=false;PostSaved.subscribe(function(){NC_PanelManager.ChangePanelContentByAjax('ShareItemInwin','KbBookViewInwin',true,40);PostSaved.unsubscribeAll()})}else{NC_PanelManager.ChangePanelContentByAjax('ShareItemInwin','KbBookViewInwin',true,40)}},EditorImageManagerOnItemClick:function(imageData){var imageData=imageData.split(";");var attachmentID=imageData[0];var imageURL=imageData[1];var pattern=imageData[2];KbApp1.setProperty("KbpostAttachmentID",attachmentID,true);insertImageInEditor(pattern,imageURL);AttachClicked.unsubscribeAll();NC_PanelManager.HideActivePanel()},TalkImageManagerOnItemClick:function(newClickedID){var newClickedID=newClickedID.split(";");KbApp1.setProperty("KbpostAttachmentID",newClickedID[0],true);KbApp1.setProperty("KbpostAttachmentPath",newClickedID[1],true);if(TalkImageManagerType=="Edit"){if(newClickedID[1].indexOf("UserGalleryImage")>-1){if(newClickedID[1].indexOf("_16")>-1){YUD.setStyle(YUD.getElementsByClassName("ImageFrameTalkEdit")[0],"background-image","url("+newClickedID[1].replace("_16.","_14.")+")")}else{YUD.setStyle(YUD.getElementsByClassName("ImageFrameTalkEdit")[0],"background-image","url("+newClickedID[1].replace("_12.","_14.")+")")}}else{YUD.setStyle(YUD.getElementsByClassName("ImageFrameTalkEdit")[0],"background-image","url("+newClickedID[1].replace("_4.","_1.")+")")}}else{var ImagePath=newClickedID[1];if(ImagePath.indexOf("UserGalleryImage")>-1){ImagePath=ImagePath.replace("_12.","_16.");ImagePath=ImagePath.replace("_49X49.","_95X95.")}YUD.setStyle(YUD.getElementsByClassName("ImageFrameAdd")[0],"background-image","url("+ImagePath+")")}TalkImageManagerType=null;for(i=0;i<YUD.getElementsByClassName("ImageFrame").length;i++){YUD.getElementsByClassName("ImageFrame")[i].setAttribute("rel",newClickedID[0])}AttachClicked.unsubscribeAll();NC_PanelManager.HideActivePanel()},BookProcessEdit:function(bookID){KbApp1.onAjaxLoading('Show');setTimeout(function(event){KbApp1.setProperty("BookID",bookID,true);var MaskSettings={color:GetColorBySkinName(),opacity:"1"};NC_PanelManager.ChangePanelContentByAjax('KbBookEditor','KbMainInwin',true,10,true,MaskSettings);if(YUD.get("KbMainInwin").style.top=="-1400px"){YUD.get("KbMainInwin").style.top="0px"}KbApp1.setProperty("ClientBookStateIsSaved",false);trackerEvent.fire("Book-Editor")},100)},BookProcessAdd:function(){if(userPermissionsObj.isAllowed("MaxCustomBook")){KbApp1.BookProcessEdit(const_EmptyGuid)}else{NC_PanelManager.ChangePanelContentByAjax('premiumInwin','KbBookViewInwin',true,40,null)}},BookOfLifeProcessEdit:function(bookID){if(userPermissionsObj.isAllowed("LifeBookEditor")){KbApp1.onAjaxLoading('Show');setTimeout(function(event){KbApp1.setProperty("BookID",bookID,true);var MaskSettings={color:GetColorBySkinName(),opacity:"1"};NC_PanelManager.ChangePanelContentByAjax('KbBookOfLifeEditor','KbMainInwin',true,10,true,MaskSettings);if(YUD.get("KbMainInwin").style.top=="-1400px"){YUD.get("KbMainInwin").style.top="0px"}KbApp1.setProperty("ClientBookStateIsSaved",false);trackerEvent.fire("Book-Editor")},100)}else{NC_PanelManager.ChangePanelContentByAjax('premiumInwin','KbBookViewInwin',true,40,null)}},BookProcessPrint:function(bookID){this.setProperty("BookID",bookID,true)},BookProcessIsReady:function(bookID){this.setProperty("BookID",bookID,true);var isReady=Netcraft.KeePaBoo.Web.AjaxMethods.IsOffLineBookReady(this.GetRefreshContext());},BookProcessShare:function(bookID,maskOpacity){if(bookID||bookID!=null){this.setProperty("BookID",bookID,true)}NC_PanelManager.ChangePanelContentByAjax('ShareItemInwin','KbBookViewInwin',true,40,null);NC_PanelManager.HidePanelByID("BookEditorFinish");KbApp1.setProperty("KbPostType","Book")},BookProcessDownload:function(bookID,maskOpacity){trackerEvent.fire("Download-book-button");if(userPermissionsObj.isAllowed("OffLineBook")){NC_PanelManager.ChangePanelContentByAjax('DownloadInwin','KbBookViewInwin',true,40,null);this.setProperty("BookID",bookID,true);Netcraft.KeePaBoo.Web.AjaxMethods.GenerateOffLineBook(this.GetRefreshContext());PollingCounter=0;setTimeout(activateDownloadBookPolling,5000)}else{NC_PanelManager.ChangePanelContentByAjax('premiumInwin','KbBookViewInwin',true,40,null)}},GalleryBookProcessDownload:function(){trackerEvent.fire("Download-gallery-button");if(userPermissionsObj.isAllowed("OffLineBook")){NC_PanelManager.ChangePanelContentByAjax('DownloadInwin','KbBookViewInwin',true,40,null);Netcraft.KeePaBoo.Web.AjaxMethods.GenerateOffLineBook(this.GetRefreshContext());PollingCounter=0;setTimeout(activateDownloadBookPolling,5000)}else{NC_PanelManager.ChangePanelContentByAjax('premiumInwin','KbBookViewInwin',true,40,null)}},DownloadGalleryBook:function(){if(KbApp1.getProperty("KbpostType")==="Gallery"){this.GalleryBookProcessDownload()}},OpenInviteFriendsInWin:function(){NC_PanelManager.ChangePanelContentByAjax('InviteFriendsInWin','KbMainInwin',true,40,null)},OpenFaceBookFriendsInviterInWin:function(){NC_PanelManager.ChangePanelContentByAjax('FacebookInvite','KbMainInwin',true,null,null)},BookProcessDelete:function(bookID){KbApp1.setProperty("ClientPostStateIsSaved","false");PromptDialog("DeleteBook('"+bookID+"')")},DeleteBook:function(bookID){this.setProperty("BookID",bookID,true);this.setProperty("KbPostState","DeleteBook",false);Netcraft.KeePaBoo.Web.AjaxMethods.DeleteCustomBook(this.GetRefreshContext(),On_KbLoad1.OnBookDeleted)},ViewBookOfLife:function(){this.BookProcessView(cfg.getProperty("BookOfLifeID"))},BookProcessView:function(bookID){if(bookID){this.setProperty("BookID",bookID,true)}this.MaskSettings={color:GetColorBySkinName(),opacity:"1"};NC_PanelManager.ChangePanelContentByAjax('KbBookViewer','KbMainInwin',true,1,false,this.MaskSettings);trackerEvent.fire("Book-View")},BookEditorViewBook:function(bookID){if(!KbApp1.getProperty("ClientBookStateIsSaved")){customBook.SilentTransfer();return}if(bookID||bookID!=null){this.setProperty("BookID",bookID,true)}if(KbApp1.getProperty("BookID")==const_EmptyGuid){return}YUD.get("KbMainInwin").style.top="-1400px";this.MaskSettings={color:GetColorBySkinName(),opacity:"1"};NC_PanelManager.ChangePanelContentByAjax('KbBookViewer','KbBookViewInwin',true,1,true,this.MaskSettings);NC_PanelManager.HidePanelByID("BookEditorFinish")},BookEditorFinish:function(){UpdateCurrentContextDate();customBook.transfer()},BookOfLifeEditorFinish:function(){UpdateCurrentContextDate();editableBookOfLife.transfer()},KbpostFixerReLoad:function(){if(!KbpostFixerReLoadFlag){return}this.KbpostType=cfg.getProperty("KbpostType");this.KbpostID=cfg.getProperty("KbpostID");this.KbPostState=cfg.getProperty("KbPostState");if(this.KbpostType!="Growth"){return}if(this.KbpostID!=const_EmptyGuid){this.ChangeTab('Growth','00000000-0000-0000-0000-000000000000','View')}else{TimeLineScrollPositionFlag=true;KbApp1.GetHtml("ViewRegion","View")}KbpostFixerReLoadFlag=false},onGoogleSearch:function(){var searchQuery=encodeURIComponent(YUD.get('googleSearchBox').value);var queryUrl="http://www.google.com/search?hl=en&q="+searchQuery;window.open(queryUrl)},onAjaxLoading:function(state){if(state!="Hide"){setTimeout(function(){if(YUD.get("Loading_Indicator").style.display!='none'){KbApp1.onAjaxLoading("Hide")}},10000)}state=(state=="Hide")?"none":"block";YUD.get("Loading_Indicator").style.display=state},ActivateScripts:function(container){var scripts=container.getElementsByTagName("script");for(var i=0;i<scripts.length;i++){if(scripts[i].getAttribute("src")){var script=document.createElement('script');script.setAttribute('type','text/javascript');script.setAttribute('src',scripts[i].getAttribute("src"));var callback=scripts[i].getAttribute("onload");if(callback){script.onload=function(){eval(callback)};script.onreadystatechange=function(){eval(callback)};}document.getElementsByTagName("HEAD")[0].appendChild(script)}else{eval(scripts[i].innerHTML)}}},OnApplicationError:function(){},AjaxCallback:function(resArray){isHistoryStepLoaded=false;if(resArray.value==null||resArray.value.indexOf("GetHTMLFailed")>-1||resArray.value.indexOf("Object reference not")>-1){return}IsAppFullyLoaded=true;KbPlaceholderID=resArray.request.args.KbContextfromClient[8];KbPostState=resArray.request.args.KbContextfromClient[3];var KbPlaceholder=YUD.get(KbPlaceholderID);if(KbPlaceholder!=null){KbPlaceholder.innerHTML=resArray.value}if(KbApp1.getProperty("KbpostType")!="Book"&&KbApp1.getProperty("KbpostType")!="Home"&&KbPlaceholderID=="MainRegion"){showContentBlocker(false)}if(DebugMode&&typeof YAHOO.tool!="undefined"){YAHOO.tool.Profiler.registerObject("On_KbLoad1")}if(!isBackBtn&&KbPlaceholderID=="MainRegion"&&userLoggedIn==true){setTimeout(function(){KbApp1.navigateContext()},100)}isBackBtn=false;if(fixr){fixr.update()}try{setTimeout(function(){On_KbLoad1.init(KbPlaceholderID,KbPostState)},10)}catch(e){}}}};var On_KbLoad=function(){setupLogo();YAHOO.namespace("onLoad");var self=this;return{init:function(KbPlaceholderID,KbPostState){if(KbApp1.getProperty("KbpostType")==="Home"){startBookshow()}if(KbApp1.getProperty("KbpostType")==="Home"&&KbPlaceholderID==="MainRegion"&&navigator.userAgent.toString().indexOf("MSIE")>-1){YUD.setStyle('makeHomepageBtn','display','block')}if(KbPostState=="Edit"&&KbPlaceholderID!="ImageManagerRegion"&&KbApp1.getProperty("KbpostType")!="Home"){KbPlaceholderID="ViewEditRegion"}switch(KbPlaceholderID){case"MainRegion":if(KbApp1.getProperty("ControlName")=="Layout2RowsAnonymous"){this.Layout2RowsAnonymous_onLoad()}else{this.ViewRegion_onLoad();inviteItem=YUD.get('inviteSideItems');galleryBookDownloadBtn=YUD.get('downloadGalleryBookBtn');if(KbApp1.getProperty("KbpostType")=="Gallery"){if(inviteItem){inviteItem.style.display='none'}if(galleryBookDownloadBtn){galleryBookDownloadBtn.style.display='block'}loadGalleryMovie();if(KbApp1.getProperty("KbPostState")=="View"){onFlashReady.subscribe(function(){setTimeout(function(){if(KbApp1.getProperty("KbpostType")!="Gallery"){return}getGalleryData()},1000);onFlashReady.unsubscribeAll()})}}else{if(inviteItem){inviteItem.style.display='block'}if(galleryBookDownloadBtn){galleryBookDownloadBtn.style.display='none'}}if(KbApp1.getProperty("KbpostType")=="Growth"){this.GrowthViewMode_onLoad()}if(KbApp1.getProperty("KbpostType")=="Home"||KbApp1.getProperty("KbpostType")=="Book"){KbApp1.onAjaxLoading("Hide")}else{this.AddnewRegion_onLoad()}}if((KbApp1.getProperty("ControlName")!="Layout2RowsAnonymous")&&KbApp1.getProperty("ChildId")!=const_EmptyGuid){if(Timeline1!=null){if(!TimeLineScrollPositionFlag){if(KbApp1.getProperty("KbpostType")=="Growth"){setTimeout(function(){Timeline1.moveByClassName(publicStartTimelineElID)},TimelineSelectedDelay)}else{Timeline1.removeSelectedMark()}initFixr()}}else{KbApp1.GetHtml("TimelineRegion","Timeline")}}break;case"bolife_count":break;case"AddnewRegion":this.AddnewRegion_onLoad();break;case"ViewRegion":if(KbApp1.getProperty("KbpostType")=="Growth"){this.ViewRegion_onLoad();this.GrowthViewMode_onLoad()}else{this.ViewRegion_onLoad()}break;case"ViewEditRegion":this.ViewEditRegion_onLoad();hideContentBlocker();break;case"RightbuttonsRegion":this.RightbuttonsRegion_onLoad();break;case"TipsRegion":break;case"TimelineRegion":this.TimelineRegion_onLoad();break;case"ItemPreviewRegion":this.ItemPreviewRegion_onLoad();break;default:break}if(Timeline1!=null&&(KbApp1.getProperty("KbPostType")=="Home"||KbApp1.getProperty("KbPostType")=="Book"||KbApp1.getProperty("KbPostState")=="List")){Timeline1.removeSelectedMark();return}KbApp1.onAjaxLoading("Hide")},AddnewRegion_onLoad:function(){if(KbApp1.getProperty("KbPostType")=="Diary"){newItemsCurrentPage=0}YUE.addListener("addNewBar","mousedown",function(){YUD.removeClass(this,"side_bar_left_close_over");YUE.removeListener(this,"mouseout");YUE.removeListener(this,"mouseover");YUE.removeListener(this,"mouseout");if(YAHOO.env.ua.ie!=0){isAddPanelOpen=false;changeAddPanelState()}YUE.removeListener(this,"mousedown")});YUE.addListener("addNewBar","mouseout",function(){YUD.removeClass(this,"side_bar_left_close_over")});YUE.addListener("addNewBar","mouseover",function(){YUD.addClass(this,"side_bar_left_close_over")});if(KbApp1.getProperty("KbPostType")=="Diary"||KbApp1.getProperty("KbPostType")=="Talk"){var SelectedBackground=YUD.getElementsByClassName("selected","LI",YUD.get("changeBgListAddNew"));SelectedBackground=YUD.getFirstChild(SelectedBackground[0]);SelectedBackground=YUD.getFirstChild(SelectedBackground);if(SelectedBackground!=null&&SelectedBackground.getAttribute("rel")!=null&&KbApp1.getProperty("KbpostType")!="Milestone"&&KbApp1.getProperty("KbpostType")!="Growth"&&KbApp1.getProperty("KbpostType")!="Gallery"){SelectedBackground=SelectedBackground.getAttribute("rel").split(",");KbApp1.setProperty("KbpostBackgroundPath",SelectedBackground[1],true);isNewBackgroundFromAddnewPanel=true}var BackgroundsParentNode=YUD.getElementsByClassName('sidebar_content');BackgroundsParentNode=BackgroundsParentNode[0];select_bg_links_Panel=new Array();var changeBgListAddNewArr=YUD.getElementsByClassName("changeBgListAddNew");for(var i=0;i<changeBgListAddNewArr.length;i++){select_bg_links_Panel.push(changeBgListAddNewArr[i].getElementsByTagName('a'));YUE.addListener(select_bg_links_Panel,'click',function(event){selectBgAddNew(this);YUE.preventDefault(event)})}}newItemListCount=YUD.getElementsByClassName("newPageList");if(typeof newItemListCount!="undefined"){var pagelist=YUD.get("page_list");for(i=0;i<newItemListCount.length;i++){var li=document.createElement("li");var a=document.createElement("a");a.href='javascript:gotoPageX('+i+');';newtext=document.createTextNode(i+1);a.appendChild(newtext);li.appendChild(a);pagelist.appendChild(li)}}BackgroundsParentNode=YUD.getElementsByClassName('sidebar_content','div','AddNewRegion')[0];YUD.addClass(BackgroundsParentNode,KbApp1.getProperty("ChildGender"));if(KbApp1.getProperty("KbpostType")=="Milestone"){this.NewListPages=YUD.getElementsByClassName("newPageList","div","addNewBar");var childAge=KbApp1.getProperty("ChildAge");for(var i=0;i<this.NewListPages.length;i++){PageAgeLimit=this.NewListPages[i].getAttribute("rel").split(',');if(childAge>=PageAgeLimit[0]&&childAge<PageAgeLimit[1]){gotoPageX(i);break}}}if(KbApp1.getProperty("KbpostType")=="Growth"){toggleGrowthUnits()}else if(KbApp1.getProperty("KbpostType")=="Gallery"){fileListObj=new FileListObj();fileListObj.init({"SWFURL":SiteRootURL+"Swf/KBooUploader.swf","browseSettings":{"allowMultiple":true,"description":"Images","extensions":"*.jpg;*.gif;*.jpeg;*.png;*.bmp"},"fileListElId":"fileListEl","totalFileWeightElId":"totalFileWeight","uploadURL":SiteRootURL+"SiteAPI/Uploader.ashx?childId="+KbApp1.getProperty("ChildID")+"&jsOnError=quickInstance.showError();&jsOnComplete=quickInstance.showComplete()","uploadStatusElId":"uploadStatus"});initARC('addToGallery','radio_on','radio_off','checkbox_on','checkbox_off');if(YAHOO.env.ua.ie==6){YUE.on(['gallery_select_label_newgallery','gallery_select_label_togallery'],"click",function(){YUD.setStyle(YUD.get('totalFileWeight').parentNode,'zoom','100%');YUD.setStyle(YUD.get('totalFileWeight').parentNode,'zoom','')});var btn_add_img_El=YUD.getElementsByClassName("btn_add_img")[0];YUE.on(btn_add_img_El,"click",function(){var zoom=(YUD.get("addNewBar").style.zoom==1)?0:1;YUD.get("addNewBar").style.zoom=zoom});YUE.on("fileListEl","click",function(){var zoom=(YUD.get("addNewBar").style.zoom==1)?0:1;YUD.get("addNewBar").style.zoom=zoom})}}this.SelectedBackground=YUD.getElementsByClassName("selected","LI",YUD.get("changeBgListAddNew"));var type=KbApp1.getProperty("KbpostType");if(type!="Home"&&type!="Book"){var GalleryCalender=null;settings={type:GalleryCalender,btn:"date_pickr",calWrap:"DivCalendarHolder",textField:"newDateField"};setTimeout(function(){loadAddCalender(settings);},10)}setTimeout(function(){if(showTabOpenPanel){changeAddPanelState("open");showTabOpenPanel=false}else{changeAddPanelState("close")}},10)},GrowthViewMode_onLoad:function(){if(Timeline1==null){KbApp1.GetHtml("TimelineRegion","Timeline")}YUD.get("noGrowthContent").style.display="block";var curGrowthID=KbApp1.getProperty("KbpostID");postsArray=KbApp1.getProperty("KbPostsArray");if(typeof postsArray[0]=="undefined"||postsArray[0]==""){YUD.get("RightbuttonsRegion").style.display="none";KbApp1.setProperty("KbPostsArray","",false);YUD.get("PagesWrapper").style.display="none";YUD.get("growthContentWrapper").style.display="none";YUD.setStyle(YUD.getElementsByClassName("delBtn","a","ViewRegion")[0],"visibility","hidden");KbApp1.setProperty("KbpostID",const_EmptyGuid);publicStartTimelineElID=null;if(Timeline1){Timeline1.removeSelectedMark()}return}YUD.get("noGrowthContent").style.display="none";if(curGrowthID==const_EmptyGuid){curGrowthID=postsArray[0];KbApp1.setProperty("KbpostID",curGrowthID);setTimeout(function(){if(Timeline1!=null){Timeline1.moveByClassName(KbApp1.getProperty("KbpostID"))}},TimelineSelectedDelay)}var curpPge=Math.abs(Post_selected_index-ItemsArrayList.length);YUD.get("curPage").innerHTML=(curpPge==0)?1:curpPge;YUD.get("pagesNumberLbl").innerHTML=postsArray.length;YUD.get("RightbuttonsRegion").style.display="block";YUD.setStyle(YUD.getElementsByClassName("delBtn","a","ViewRegion")[0],"visibility","visible");if(KbApp1.getProperty("KbpostID")!=const_EmptyGuid){publicStartTimelineElID=KbApp1.getProperty("KbpostID");YUD.setStyle(YUD.getElementsByClassName("delBtn","a","ViewRegion")[0],"visibility","visible")}else{if(ItemsArrayList.length>0&&ItemsArrayList[0]!=""){publicStartTimelineElID=ItemsArrayList[Post_selected_index];this.KbpostID=ItemsArrayList[Post_selected_index];KbApp1.setProperty("KbpostID",this.KbpostID,false);YUD.setStyle(YUD.getElementsByClassName("delBtn","a","ViewRegion")[0],"visibility","visible")}else{YUD.setStyle(YUD.getElementsByClassName("delBtn","a","ViewRegion")[0],"visibility","hidden")}}var GrowthData=Netcraft.KeePaBoo.Web.AjaxMethods.GetGrowthDataSource(KbApp1.GetRefreshContext());initCharts(GrowthData.value)},ViewRegion_onLoad:function(){if(KbApp1.getProperty("KbpostType")=="Home"||KbApp1.getProperty("KbpostType")=="Book"){return}if(KbApp1.getProperty("KbpostType")=="Gallery"&&KbPostState=="View"){YUD.get('flashGalleryKeeper').style.left='305px'}if(KbPostState=="List"){if(Timeline1==null){KbApp1.GetHtml("TimelineRegion","Timeline")}else{Timeline1.moveByClassName(publicStartTimelineElID)}YUD.setStyle("RightbuttonsRegion","display","none");YUE.addListener("leftArrow","mousedown",function(){YUD.addClass(this,"btn_down")});YUE.addListener("rightArrow","mousedown",function(){YUD.addClass(this,"btn_down")});YUE.addListener("leftArrow","click",function(){YUD.removeClass(this,"btn_down")});YUE.addListener("rightArrow","click",function(){YUD.removeClass(this,"btn_down")});var curpageEl=YUD.get("curPage");if(curpageEl){curpageEl.innerHTML=1}var listNodes=YUD.getElementsByClassName('listItem',"div","KbListWrap");YUE.on(listNodes,'mouseover',function(){YUD.addClass(this,"itemList_over")});YUE.on(listNodes,'mouseout',function(){YUD.removeClass(this,"itemList_over")});KbPostMode="List";var postsArray=YUD.getElementsByClassName("postsArray");if(typeof postsArray[0]!="undefined"||postsArray[0]!=null){postsArray=postsArray[0].value.split(",")}var PostsPageCount=YUD.getElementsByClassName("PostsPageCount");if(PostsPageCount[0]!=null||typeof PostsPageCount[0]!="undefined"){PostsPageCount=PostsPageCount[0].value}KbApp1.setProperty("KbPostsArray",postsArray,false);KbApp1.setProperty("KbPages",PostsPageCount,false);if(PostsPageCount==0){YUD.setStyle(YUD.get("PagesWrapper"),"display","none")}else{YUD.setStyle(YUD.get("PagesWrapper"),"display","block")}if(PostsPageCount>1){YUD.removeClass("leftArrow","btn_lock")}KbApp1.setProperty("KbpostItemPageNum",1);KbPostsPages=YUD.getElementsByClassName("KbpostPage");setTimeout(function(){YUD.get("pagesNumberLbl").innerHTML=PostsPageCount},10)}else{changeAddPanelState("close");if(KbApp1.getProperty("KbpostType")!="Growth"){YUD.setStyle("RightbuttonsRegion","display","block")}if(KbApp1.getProperty("KbpostType")=="Milestone"||KbApp1.getProperty("KbpostType")=="Diary"){var pageBrakesData=YUD.get("pageBrakesHidden").value;KbApp1.setProperty("PageBreakData",eval(pageBrakesData),true)}postsArray=YUD.getElementsByClassName("HiddenPostsArray","input","ViewRegion");if(typeof postsArray=="undefined"){return}postsArray=postsArray[0].value.split(",");KbApp1.setProperty("KbPostsArray",postsArray,false);KbApp1.setProperty("KbPostID",KbApp1.getProperty("KbPostID"),false);publicStartTimelineElID=KbApp1.getProperty("KbPostID");if(postsArray.length==1){YUD.addClass("A1","btn_lock");YUD.addClass("A2","btn_lock")}if(Post_selected_index==0&&postsArray.length!=1){YUD.removeClass("A1","btn_lock");YUD.addClass("A2","btn_lock")}if(Post_selected_index+1==postsArray.length&&postsArray.length!=1){YUD.removeClass("A2","btn_lock");YUD.addClass("A1","btn_lock")}KbPostMode="Saved";if(KbApp1.getProperty("KbpostType")=="Talk"){YUE.onContentReady("TalkHiddenContent",function(){var HiddenTalkContent=YUD.get("TalkHiddenContent").innerHTML;KbApp1.setProperty("KbpostContent",HiddenTalkContent,true);var newBackgroundProp=YUD.get("KbpostBackgroundPath").value.split(",");KbApp1.setProperty("KbpostBackgroundID",newBackgroundProp[0],true);RenderResizeTextCanvas(false)})}if(publicStartTimelineElID!=null){if(Timeline1==null){KbApp1.GetHtml("TimelineRegion","Timeline")}else{Timeline1.moveByClassName(publicStartTimelineElID)}}}if(KbApp1.getProperty("KbpostType")=="Gallery"||KbApp1.getProperty("KbpostType")=="GalleryItem"){JS2flashCommander("updateImageTitle","")}onCallBackFinish.fire()},ViewEditRegion_onLoad:function(){this.kbpostTitle=YUD.getElementsByClassName("editTitle2","textarea","ViewRegion");if(typeof this.kbpostTitle=="undefined"){this.ViewEditRegion_onLoad();return}if(Timeline1==null){this.TimelineRegion_onLoad()}if(KbApp1.getProperty("KbpostID")==const_EmptyGuid){if(Timeline1!=null){Timeline1.removeSelectedMark()}}else{if(Timeline1!=null){Timeline1.moveByClassName(KbApp1.getProperty("KbpostID"))}}isFirstTime=true;changeAddPanelState("close");YUD.setStyle("RightbuttonsRegion","display","block");if(KbApp1.getProperty("KbpostType")=="Talk"&&KbApp1.getProperty("KbpostID")==const_EmptyGuid){this.KbpostAttachmentID=KbApp1.getProperty("KbpostAttachmentID");if(YAHOO.env.ua.ie!=0){this.KbpostAttachmentPath=KbApp1.getProperty("KbpostAttachmentPath").cssText}else{this.KbpostAttachmentPath=KbApp1.getProperty("KbpostAttachmentPath")}if(this.KbpostAttachmentPath!=null){if(this.KbpostAttachmentPath.indexOf("UserGalleryImage")>-1){if(this.KbpostAttachmentPath.indexOf("_16")>-1){this.KbpostAttachmentPath=this.KbpostAttachmentPath.replace("_16.","_14.")}else{this.KbpostAttachmentPath=this.KbpostAttachmentPath.replace("_12.","_14.")}}else{this.KbpostAttachmentPath=this.KbpostAttachmentPath.replace("_4.","_1.");this.KbpostAttachmentPath=this.KbpostAttachmentPath.replace("_49X49.","_95X95.")}if(YAHOO.env.ua.ie!=0){YUD.getElementsByClassName("ImageFrameTalkEdit","div","ViewRegion")[0].style.cssText=this.KbpostAttachmentPath}else{YUD.getElementsByClassName("ImageFrameTalkEdit","div","ViewRegion")[0].setAttribute("style",this.KbpostAttachmentPath)}YUD.getElementsByClassName("ImageFrameTalkEdit","div","ViewRegion")[0].setAttribute("rel",this.KbpostAttachmentID)}}else{if(KbApp1.getProperty("KbpostType")=="Talk"){var HiddenTalkContent=YUD.get("TalkHiddenContent").innerHTML;KbApp1.setProperty("KbpostContent",HiddenTalkContent,true)}}this.KbpostID=YUD.getElementsByClassName("KbPostID_hidden")[0];this.KbpostID=this.KbpostID.value;KbApp1.setProperty("KbpostID",this.KbpostID,true);if(this.KbpostID!=const_EmptyGuid){YUD.setStyle(YUD.getElementsByClassName("delBtn","a","ViewRegion")[0],"visibility","visible");YUD.setStyle(YUD.getElementsByClassName("viewBtn","a","ViewRegion")[0],"visibility","visible")}this.kbpostTitle=YUD.getElementsByClassName("editTitle2","textarea","ViewRegion")[0].value;KbApp1.setProperty("KbpostTitle",this.kbpostTitle,true);this.kbpostDate=YUD.getElementsByClassName("Date_hidden","input","ViewRegion")[0].value;KbApp1.setProperty("KbpostDate",this.kbpostDate,true);if(KbApp1.getProperty("KbpostType")=="Milestone"||KbApp1.getProperty("KbpostType")=="Diary"){toggleEditor('editorWrap','visible');loadFromContext=true;pageBreaker=new PageBreaker({width:425,margin:"0px 8px 0",pageHeight:357});}loadEditUtils();YUE.onContentReady("changeBgList",function(){BackgroundsParentNode=YUD.getElementsByClassName('bottom_foot','div','ViewRegion')[0];select_bg_links=YUD.getElementsBy(testParent,'a','changeBgList');YUE.addListener(select_bg_links,'click',function(event){selectBg(this);YUE.preventDefault(event)});});var selectedBackground=YUD.getElementsByClassName("selected","li","ViewRegion");if(isNewBackgroundFromAddnewPanel&&this.KbpostID==const_EmptyGuid){YUD.removeClass(selectedBackground,"selected");if(KbApp1.getProperty("KbpostBackgroundPath")==""){var SelectedBackground=YUD.getElementsByClassName("icon_"+KbApp1.getProperty("KbpostBackgroundID"))[0].firstChild.firstChild;var SelectedBackground=SelectedBackground.getAttribute("rel").split(",")[1];ChangeKbpostBackground(SelectedBackground)}else{ChangeKbpostBackground(KbApp1.getProperty("KbpostBackgroundPath"));isNewBackgroundFromAddnewPanel=false}YUD.addClass(YUD.getElementsByClassName("icon_"+KbApp1.getProperty("KbpostBackgroundID"),"li","ViewRegion"),"selected")}else{if(KbApp1.getProperty("KbpostID")!=const_EmptyGuid){var newBackgroundProp=YUD.get("KbpostBackgroundPath").value.split(",");newBackgroundPath=newBackgroundProp[1];if(newBackgroundProp[0]<1000){var newBackgroundPath=null;if(newBackgroundProp[1].indexOf("Boy")>-1){newBackgroundPath=newBackgroundProp[1].replace("_Boy","")}else{newBackgroundPath=newBackgroundProp[1].replace("_Girl","")}}KbApp1.setProperty("KbpostBackgroundID",newBackgroundProp[0],true);ChangeKbpostBackground(newBackgroundPath);YUD.removeClass(selectedBackground,"selected");YUD.addClass(YUD.getElementsByClassName("icon_"+newBackgroundProp[0],"li","ViewRegion"),"selected")}}if(YUD.get("editorWrap_ifr")){YUD.get("editorWrap_ifr").allowTransparency=true}if(KbApp1.getProperty("KbpostType")=="Gallery"||KbApp1.getProperty("KbpostType")=="GalleryItem"){JS2flashCommander("updateImageTitle","")}if(KbApp1.getProperty("KbpostType")=="Milestone"){injectMilesoneBackgrounds()}},RightbuttonsRegion_onLoad:function(){},OnDeleted:function(res){publicStartTimelineElID=null;Timeline1=null;KbApp1.setProperty("KbpostID",const_EmptyGuid,false);YUD.get("AlertMsg_AlertContent").innerHTML=res.value;NC_PanelManager.ShowPanelByID("AlertMsg",1500);if(KbApp1.getProperty("KbpostType")=="Growth"){KbApp1.onAjaxLoading("Hide");KbApp1.setProperty("KbPostState","View");KbApp1.SwitchToViewMode();}else{KbApp1.setProperty("KbPostState","List");KbApp1.SwitchToListMode();KbApp1.onAjaxLoading("Hide")}if(KbApp1.getProperty("KbpostType")=="Gallery"){var GalleryOptions=YUD.get("galleryListParent").getElementsByTagName("select")[0].getElementsByTagName("option");var DeletedGalleryPostID=res.request.args.KbContextfromClient[1];for(var index=0;index<GalleryOptions.length;index++){if(YUD.get("galleryListParent").getElementsByTagName("select")[0].getElementsByTagName("option")[index].value==DeletedGalleryPostID){YUD.get("galleryListParent").getElementsByTagName("select")[0].removeChild(YUD.get("galleryListParent").getElementsByTagName("select")[0].getElementsByTagName("option")[index])}}}},OnBookDeleted:function(res){if(res.value.indexOf(";")<0){YUD.get("AlertMsg_AlertContent").innerHTML=res.value;YUD.getElementsByClassName("KbMainDialog_btnOK","a","AlertMsg")[0].style.display="none";NC_PanelManager.ShowPanelByID("AlertMsg",1500);KbApp1.setProperty("ClientPostStateIsSaved",false,true);return}var res=res.value.split(";");KbApp1.setProperty("BookID",const_EmptyGuid,false);YUD.get("AlertMsg_AlertContent").innerHTML=res[1];NC_PanelManager.ShowPanelByID("AlertMsg",1500);KbApp1.setProperty("KbPostState","View");KbApp1.GetHtml("bookListRegion","CustomBookList");KbApp1.setProperty("ClientPostStateIsSaved","true")},OnSaved:function(res){if(res.value.indexOf(";")<0){YUD.get("AlertMsg_AlertContent").innerHTML=res.value;YUD.getElementsByClassName("KbMainDialog_btnOK","a","AlertMsg")[0].style.display="none";NC_PanelManager.ShowPanelByID("AlertMsg",1500);KbApp1.setProperty("ClientPostStateIsSaved",false,true);SaveFlag=0;SaveErr=true;return}if(KbApp1.getProperty("KbPostType")!="Gallery"&&KbApp1.getProperty("KbPostType")!="GalleryItem"&&KbApp1.getProperty("KbPostType")!="Talk"){toggleEditor('editorWrap')}if(!YUD.isAncestor("KbMainInwin","AddToBook_FormPanel")&&!YUD.isAncestor("KbMainInwin","divSend")){NC_PanelManager.hideAll()}var add2book=true;if(KbApp1.getProperty("KbpostID")==const_EmptyGuid){res=res.value.split(";");if(res[3]==="itemNotAdded"){add2book=false}if(res[0]!=""||res.value!=""){KbApp1.setProperty("KbpostID",res[0],true)}else{return}if(KbApp1.getProperty("KbPostsArray")!=res[1]){this.postArray=res[1].split(",");KbApp1.setProperty("KbPostsArray",this.postArray,true);ItemsArrayList=this.postArray}KbApp1.setProperty("ClientPostStateIsSaved",true,true)}if(KbApp1.getProperty("KbpostID")!=const_EmptyGuid){if(res.length==="undefined"&&res.value.split(";")[3]==="itemNotAdded"){add2book=false}else if(res[3]==="itemNotAdded"){add2book=false}YUD.setStyle(YUD.getElementsByClassName("delBtn","a","ViewRegion")[0],"visibility","visible");YUD.setStyle(YUD.getElementsByClassName("viewBtn","a","ViewRegion")[0],"visibility","visible")}var kbPostTypeLabel="";if(KbApp1.getProperty("KbpostType")=="Talk"){kbPostTypeLabel="Quote"}else{kbPostTypeLabel=KbApp1.getProperty("KbpostType");if(kbPostTypeLabel=="GalleryItem"){kbPostTypeLabel="Gallery Item"}}var savedCaption;if(!add2book){savedCaption="The "+kbPostTypeLabel+" <br/> "+"<div class='msg_title'>"+YUD.getElementsByClassName("editTitle2","textarea","ViewRegion")[0].value+"</div> was successfully saved.  <br/><span style=\"font-size:15px;color:red;padding:4px;line-height:20px;\">Please note: you have reached the free version 12 book pages limitation. <a href=\"\" onclick=\"NC_PanelManager.HideActivePanel();NC_PanelManager.ChangePanelContentByAjax('premiumInwinMaster', 'KbBookViewInwin', true, 40, null); return false;\">Upgrade to Keepaboo Pro</a> to enjoy unlimited number of book pages</span>"}else{savedCaption="The "+kbPostTypeLabel+" <br/> "+"<div class='msg_title'>"+YUD.getElementsByClassName("editTitle2","textarea","ViewRegion")[0].value+"</div> was successfully saved. "}var PostButtons="<div class='SavedBtnWrapper clearfix'><a href='' class='facebook_save' id='FacebookBookLink' onclick='NC_PanelManager.HideActivePanel();shareOnFacebook_click();return false;' target='_blank' rel='nofollow'>Share on Facebook</a><a href='' class='share_save' onclick='NC_PanelManager.HideActivePanel();KbApp1.ShareItem();return false;'>Share It</a><a href='' class='book_save' onclick='NC_PanelManager.HideActivePanel();KbApp1.ViewBookOfLife();return false;' style='margin:0'>View Lifebook</a></div>";savedCaption=savedCaption+PostButtons;YUD.get("AlertMsg_AlertContent").innerHTML=savedCaption;var closeButton=document.createElement("div");closeButton.innerHTML="<a onclick='NC_PanelManager.HideActivePanel();return false;' class='onSaveMsgCloseBtn' href=''>close</a>";var closeLink=document.createElement("div");closeLink.innerHTML="<a onclick='NC_PanelManager.HideActivePanel();return false;' class='onSaveMsgCloseLink' href=''>close</a>";YUD.get("AlertMsg").appendChild(closeButton);YUD.get("AlertMsg").appendChild(closeLink);YUD.getElementsByClassName("KbMainDialog_btnOK","a","AlertMsg")[0].style.display="none";if(showSavedAlert==true){NC_PanelManager.ShowPanelByID("AlertMsg");YUD.setStyle("AlertMsg","width","390px")}if(isSavedDateChanged){Timeline1=null;isSavedDateChanged=false}KbApp1.setProperty("KbPostState","Edit");KbApp1.onAjaxLoading("Hide");SaveFlag=0;KbApp1.setProperty("ClientPostStateIsSaved",true,true);showSavedAlert=true;publicStartTimelineElID=KbApp1.getProperty("KbpostID");changeAddPanelState("close");KbApp1.SwitchToViewMode();PostSaved.fire()},OnGrowthSaved:function(res){if(res.value.indexOf(";")<0){YUD.get("AlertMsg_AlertContent").innerHTML=res.value;YUD.getElementsByClassName("KbMainDialog_btnOK","a","AlertMsg")[0].style.display="none";NC_PanelManager.ShowPanelByID("AlertMsg",1500);KbApp1.setProperty("ClientPostStateIsSaved",false,true);SaveFlag=0;var GalleryCalender=null;var settings={type:GalleryCalender,btn:"date_pickr",calWrap:"DivCalendarHolder",textField:"newDateField"};setTimeout(function(){loadAddCalender(settings)},10);return}if(res.value.split(";")[2]==="itemNotAdded"){savedCaption="The "+KbApp1.getProperty("KbpostType")+" data was successfully <br/>saved.  <br/><span style=\"font-size:15px;color:red;padding:4px;line-height:20px;\">Please note: you have reached the free version 12 book pages limitation. <a href=\"\" onclick=\"NC_PanelManager.HideActivePanel();NC_PanelManager.ChangePanelContentByAjax('premiumInwinMaster', 'KbBookViewInwin', true, 40, null); return false;\">Upgrade to Keepaboo Pro</a> to enjoy unlimited number of book pages</span>"}else{savedCaption="The "+KbApp1.getProperty("KbpostType")+" data was successfully <br/>saved. "}var PostButtons="<div class='SavedBtnWrapper clearfix'><a href='' class='facebook_save' id='FacebookBookLink' onclick='NC_PanelManager.HideActivePanel();shareOnFacebook_click();return false;' target='_blank' rel='nofollow'>Share on Facebook</a><a href='' class='share_save' onclick='NC_PanelManager.HideActivePanel();KbApp1.ShareItem();return false;'>Share It</a><a href='' class='book_save' onclick='NC_PanelManager.HideActivePanel();KbApp1.ViewBookOfLife();return false;' style='margin:0'>View Lifebook</a></div>";savedCaption=savedCaption+PostButtons;YUD.get("AlertMsg_AlertContent").innerHTML=savedCaption;var closeButton=document.createElement("div");closeButton.innerHTML="<a onclick='NC_PanelManager.HideActivePanel();return false;' class='onSaveMsgCloseBtn' href=''>close</a>";var closeLink=document.createElement("div");closeLink.innerHTML="<a onclick='NC_PanelManager.HideActivePanel();return false;' class='onSaveMsgCloseLink' href=''>close</a>";YUD.get("AlertMsg").appendChild(closeButton);YUD.get("AlertMsg").appendChild(closeLink);YUD.setStyle("AlertMsg","width","390px");NC_PanelManager.ShowPanelByID("AlertMsg");var growth_ID=res.value.split(";")[0];KbApp1.setProperty("KbPostID",growth_ID);publicStartTimelineElID=growth_ID;Timeline1=null;KbApp1.SwitchToViewMode();showTabOpenPanel=false;changeAddPanelState("close");resetDateField();hideContentBlocker()},OnAddKbPostToBook:function(res){if(res.value==null){return}var ResponseParts=res.value.split(';');var Succeed=ResponseParts[0];var Message=ResponseParts[1];var BookID=ResponseParts[2];YUD.setStyle("AddToBook_FeedbackMessagePanel","display","block");YUD.setStyle("AddToBook_FormPanel","display","none");YUD.get("AddToBook_Message").innerHTML=Message;if(Succeed=="true"){YUD.getElementsByClassName("btn_view_book","a","AddToBook_FeedbackMessagePanel")[0].style.display="block"}else{LoadTempContext();YUD.getElementsByClassName("btn_view_book","a","AddToBook_FeedbackMessagePanel")[0].style.display="none";return}KbApp1.setProperty("KbPostType","Book",true);KbApp1.setProperty("KbPostState","View",true);KbApp1.setProperty("BookID",BookID,true)},TimelineRegion_onLoad:function(){var Timeline_settings={element:"timelineBody",wrapper:"timeline_bd",animationPixelMovement:200,animationSpeed:0.5,leftButton:"leftBtn",rightButton:"rightBtn",startElId:null,startByElPosition:0};YUE.onContentReady(Timeline_settings.wrapper,function(){Timeline1=new Timeline();Timeline1.init(Timeline_settings);if(publicStartTimelineElID!=null&&KbApp1.getProperty("KbPostState")!="List"){Timeline1.moveByClassName(publicStartTimelineElID)}else{Timeline1.moveToLastItem_unSelect()}});initFixr();KbApp1.setProperty("KbPostState","View",true);KbApp1.GetHtml("bolife_count","BookOfLifeSummary")},ItemPreviewRegion_onLoad:function(){if(KbApp1.getProperty("KbpostType")=="Growth"){this.GrowthData=Netcraft.KeePaBoo.Web.AjaxMethods.GetGrowthDataSource(KbApp1.GetRefreshContext());initCharts(this.GrowthData.value)}if(KbApp1.getProperty("KbpostType")=="Gallery"){YUD.setStyle(YUD.getElementsByClassName("bottom_bd","div","ItemPreviewRegion")[0],"overflow-y","hidden");var GalleryJSonObject=null;YUD.getElementsByClassName("age")[0].innerHTML="";YUD.setStyle(YUD.getElementsByClassName("bottom_bd","DIV","ItemPreviewRegion")[0],"text-align","center");GalleryJSonObject=Netcraft.KeePaBoo.Web.AjaxMethods.GetGalleryJSon(KbApp1.GetRefreshContext());for(var i=0;i<GalleryJSonObject.value.length;i++){GalleryJSonObject[i]=eval("("+GalleryJSonObject.value[i]+")")}KbApp1.setProperty("GalleryAttachmentList",GalleryJSonObject,true);var curAttachmentPosition=0;if(KbApp1.getProperty("KbpostAttachmentID")!=const_EmptyGuid){for(var temp=0;temp<GalleryJSonObject.value.length;temp++){if(GalleryJSonObject[temp].id==KbApp1.getProperty("KbpostAttachmentID")){curAttachmentPosition=temp;break}}}KbApp1.setProperty("GalleryAttachmentPosition",curAttachmentPosition,true);GetGalleryAttachmentPreview(GalleryJSonObject[KbApp1.getProperty("GalleryAttachmentPosition")])}if(KbApp1.getProperty("KbpostType")=="Talk"){KbApp1.setProperty('KbpostBackgroundID',YUD.getElementsByClassName('HiddenBackgroundID')[0].value,true);KbApp1.setProperty('KbpostContent',YUD.get('TalkHTMLContentWrapper').innerHTML,true);RenderResizeTextCanvas(false)}if(KbApp1.getProperty("KbpostType")=="Diary"||KbApp1.getProperty("KbpostType")=="Milestone"){YUD.setStyle(YUD.getElementsByClassName("bottom_bd"),"overflow-y","auto")}},Layout2RowsAnonymous_onLoad:function(){}}};function ShowEl(elid){YUD.get(elid).style.display="block"}function HideEl(elid){YUD.get(elid).style.display="none"}function fnAddNewCallback(e){changeAddPanelState()}function changeAddPanelState(Mstate){var addnewEl=YUD.get("addNewBar");if(Mstate=="close"){YUD.addClass(addnewEl,"side_bar_left_close");YUE.addListener(addnewEl,"click",fnAddNewCallback);isAddPanelOpen=false}else{UpdateCurrentContextDate();if(KbApp1.getProperty("KbpostType")=="Growth"){toggleGrowthUnits()}YUD.removeClass(addnewEl,"side_bar_left_close");YUE.removeListener(addnewEl,"click");isAddPanelOpen=true;if(KbApp1.getProperty("KbpostType")=="Talk"){this.MainChildAvatar=YUD.getElementsByClassName("ChildAvatarAttachID")[0].value;YUD.setStyle("ImageFrameAdd","background-image","url("+this.MainChildAvatar+")");YUD.get("ImageFrameAdd").setAttribute("rel",const_EmptyGuid)}UpdateAddNewPanelSelectedBG();YAHOO.util.Event.onContentReady('addNewBar',function(){YUE.removeListener("addNewBar","mouseover");YUE.removeListener("addNewBar","mouseout")})}addnewEl=null}function UpdateAddNewPanelSelectedBG(){if(KbApp1.getProperty("KbpostType")!="Milestone"&&KbApp1.getProperty("KbpostType")!="Growth"&&KbApp1.getProperty("KbpostType")!="Gallery"){if(YUD.get("changeBgListAddNew")==null){return}var SelectedBackground=null;var new_backgroundID=parseInt(KbApp1.getProperty("KbpostBackgroundID"),10);if(new_backgroundID>1&&new_backgroundID!=null){YUD.removeClass(YUD.get("changeBgListAddNew").getElementsByTagName("li"),"selected");SelectedBackground=YUD.get("changeBgListAddNew").getElementsByTagName("li")[new_backgroundID-1];YUD.addClass(SelectedBackground,"selected")}SelectedBackground=YUD.getElementsByClassName("selected","LI",YUD.get("changeBgListAddNew"));SelectedBackground=YUD.getFirstChild(SelectedBackground[0]);SelectedBackground=YUD.getFirstChild(SelectedBackground);if(SelectedBackground!=null&&SelectedBackground.getAttribute("rel")!=null){SelectedBackground=SelectedBackground.getAttribute("rel").split(",");KbApp1.setProperty("KbpostBackgroundPath",SelectedBackground[1],true);isNewBackgroundFromAddnewPanel=true}}SelectedBackground=null;new_backgroundID=null}function tinyEventHandler(e){if(isFirstTime){isFirstTime=false}else{onPostEditorChanged.fire()}return true;}onPostEditorChanged.subscribe(function(){KbApp1.setProperty("ClientPostStateIsSaved",false,true)});var newItemsCurrentPage=0;var newItemListCount=0;function gotoPageX(pageNumber){if((pageNumber==newItemsCurrentPage)){return}var prePage="newPageList_"+newItemsCurrentPage;var newPage="newPageList_"+pageNumber;var ActiveDivs=YUD.getElementsByClassName("newPageList_active");YUD.removeClass(ActiveDivs,"newPageList_active");YUD.addClass(newPage,"newPageList_active");YUD.removeClass(prePage,"newPageList_active");newItemsCurrentPage=pageNumber;var pageList=YUD.get("page_list").getElementsByTagName("a");for(var index=0;index<pageList.length;index++){YUD.setStyle(YUD.get("page_list").getElementsByTagName("a")[index],"text-decoration","none")}YUD.setStyle(YUD.get("page_list").getElementsByTagName("li")[newItemsCurrentPage].getElementsByTagName("a")[0],"text-decoration","underline");prePage=null;newPage=null;ActiveDivs=null}function newItemsPaging(direction){var ActiveDivs=YUD.getElementsByClassName("newPageList_active");if(typeof(ActiveDivs)=="undefined"){return}if(direction==1&&newItemsCurrentPage!=newItemListCount.length-1){YUD.removeClass(ActiveDivs,"newPageList_active");var prePage="newPageList_"+newItemsCurrentPage;newItemsCurrentPage++;var newPage="newPageList_"+newItemsCurrentPage;YUD.addClass(newPage,"newPageList_active");YUD.removeClass(prePage,"newPageList_active")}if(direction==-1&&newItemsCurrentPage>0){if(typeof(ActiveDivs)=="undefined")return;YUD.removeClass(ActiveDivs,"newPageList_active");var prePage="newPageList_"+newItemsCurrentPage;newItemsCurrentPage--;var newPage="newPageList_"+newItemsCurrentPage;YUD.addClass(newPage,"newPageList_active");YUD.removeClass(prePage,"newPageList_active")}var pageList=YUD.get("page_list").getElementsByTagName("a");for(var index=0;index<pageList.length;index++){YUD.setStyle(YUD.get("page_list").getElementsByTagName("a")[index],"text-decoration","none")}if(typeof(YUD.get("page_list").getElementsByTagName("li")[newItemsCurrentPage])!="undefined"){YUD.setStyle(YUD.get("page_list").getElementsByTagName("li")[newItemsCurrentPage].getElementsByTagName("a")[0],"text-decoration","underline")}}var GlobalCalenderSettings=null;function onGenericCalenderBtn(){if(YUD.getStyle(GlobalCalenderSettings.calWrap,"display")!="block"){YUD.get(GlobalCalenderSettings.calWrap).style.display="block"}else{YUD.get(GlobalCalenderSettings.calWrap).style.display="none"}}function loadAddCalender(cfg){if(typeof cfg=="undefined"||cfg==null){return}GlobalCalenderSettings=cfg;YAHOO.util.Event.purgeElement(cfg.btn);YAHOO.util.Event.addListener(cfg.btn,'click',onGenericCalenderBtn);if(YUD.get(cfg.textField)==null){return}YUD.get(cfg.textField).disabled=true;YUD.addClass(cfg.textField,"inputDisabled");cfg.type=new Calendar();var calWrapper=YUD.get(cfg.calWrap);if(calWrapper==null){return}var type=KbApp1.getProperty("KbpostType");if(type=="Home"||type=="Book"){return}cfg.type.setup(cfg.calWrap,OnDateChanged);YUD.setStyle(cfg.calWrap,"position","absolute");YUD.setStyle(cfg.calWrap,"z-index","3000");YUD.setStyle(cfg.calWrap,"display","none");resetDateField();cfg.type=null}function resetDateField(){var today=new Date();var h=today.getHours();var m=today.getMinutes();var s=today.getSeconds();var mo=today.getMonth();var d=today.getUTCDate();var y=today.getFullYear();var newDate=(mo+1)+"/"+d+"/"+y+" "+h+":"+m+":"+s;KbApp1.setProperty("KbpostDate",newDate,false);YUD.get(GlobalCalenderSettings.textField).value=MonthsArray[mo]+" "+d+", "+y;var Calender=GlobalCalenderSettings.type;if(Calender!=null){Calender.Get_kboo_calendar().clear()}today=null;h=null;m=null;s=null;mo=null;d=null;y=null}function OnDateChanged(date){var y=null;var mo=null;var d=null;if(date){y=String(date[0]);mo=String(date[1]);d=String(date[2])}var today=new Date();var h=today.getHours();var m=today.getMinutes();var s=today.getSeconds();var newDate=mo+"/"+d+"/"+y+" "+h+":"+m+":"+s;KbApp1.setProperty("KbpostDate",newDate,false);YUD.get(GlobalCalenderSettings.textField).value=MonthsArray[mo-1]+" "+d+", "+y;YUD.get(GlobalCalenderSettings.calWrap).style.display="none";}function loadEditUtils(){if(YUD.get('divCalendar')!=null){var Calendar1=new Calendar();var type=KbApp1.getProperty("KbpostType");if(type=="Home"||type=="Book"){return}selectedDate=YUD.getElementsByClassName("Date_hidden")[0].value;Calendar1.setup('divCalendar',OnMsDateChanged,selectedDate)}}function OnMsDateChanged(date){if(date){var y=String(date[0]);var mo=String(date[1]);var d=String(date[2])}isSavedDateChanged=true;var today=new Date();var h=today.getHours();var m=today.getMinutes();var s=today.getSeconds();var newDate=mo+"/"+d+"/"+y+" "+h+":"+m+":"+s;KbApp1.setProperty("KbpostDate",newDate,false);this.newDateLabel=MonthsArray[mo-1]+"<br/>"+d+"<br/>"+y;YUD.getElementsByClassName("DateLabel")[0].innerHTML=newDateLabel;YUD.get('divCalendar').style.display="none";onPostEditorChanged.fire()}function OnGrowthDateChanged(date){if(date){var y=String(date[0]);var mo=String(date[1]);var d=String(date[2])}var today=new Date();var h=today.getHours();var m=today.getMinutes();var s=today.getSeconds();var newDate=mo+"/"+d+"/"+y+" "+h+":"+m+":"+s;KbApp1.setProperty("KbpostDate",newDate,false);YUD.get('GrowthdivCalendar').style.display="none";YUD.get('GrowthDateInput').value=mo+"/"+d+"/"+y}function onCalenderBtn(){YUD.get('divCalendar').style.display="block"}function onGrowthCalenderBtn(){YUD.get('GrowthdivCalendar').style.display="block"}var KbPostMode="List";function ControlsOnArrow(direction){TimeLineScrollPositionFlag=true;switch(KbPostMode){case'List':showItemsPage(direction);break;case'Saved':if(KbApp1.getProperty("KbpostType").indexOf("Gallery")==0){if((direction==1&&Post_selected_index+1<ItemsArrayList.length)||(direction==-1&&Post_selected_index>0)){JS2flashCommander('ControlsOnArrow',direction)}else{JS2flashCommander('ControlsOnArrow',direction+"0")}}else{showItem(direction)}break;case'New':break}}function showItem(direction){if(direction==1&&(Post_selected_index+1<ItemsArrayList.length)){Post_selected_index=Post_selected_index+1;KbApp1.setProperty("KbpostID",ItemsArrayList[Post_selected_index],false);KbApp1.GetHtml("ViewRegion","View")}else if(direction==-1&&Post_selected_index-1>=0){Post_selected_index=Post_selected_index-1;KbApp1.setProperty("KbpostID",ItemsArrayList[Post_selected_index],false);KbApp1.GetHtml("ViewRegion","View")}}function showItemsPage(direction){var currentKbPage=KbApp1.getProperty("KbpostItemPageNum");if(direction==1&&KbPostsPages.length!=1&&currentKbPage<KbPostsPages.length){var pageEl=KbPostsPages[currentKbPage-1];HideEl(pageEl);currentKbPage=currentKbPage+1;var pageEl=KbPostsPages[currentKbPage-1];ShowEl(pageEl);YUD.get("curPage").innerHTML=currentKbPage;YUD.removeClass("rightArrow","btn_lock");KbApp1.setProperty("KbpostItemPageNum",currentKbPage,false)}if(direction==-1&&currentKbPage!=1){var pageEl=KbPostsPages[currentKbPage-1];HideEl(pageEl);currentKbPage=currentKbPage-1;var pageEl=KbPostsPages[currentKbPage-1];ShowEl(pageEl);YUD.get("curPage").innerHTML=currentKbPage;YUD.removeClass("leftArrow","btn_lock");KbApp1.setProperty("KbpostItemPageNum",currentKbPage,false)}if((currentKbPage)==KbPostsPages.length){YUD.addClass("leftArrow","btn_lock")}else{if(currentKbPage==1){YUD.addClass("rightArrow","btn_lock")}}}function SendNewPassword(email){Netcraft.KeePaBoo.Web.AjaxMethods.SendPassword(YUD.get(email).value,SendNewPassword_callback);slidePanel.setForgotPassFeedback("true","Sending...")}function SendNewPassword_callback(res){var isSuccessful=res.value.split(";")[0];var message=res.value.split(";")[1];slidePanel.setForgotPassFeedback(isSuccessful,message)}function toggleClass(oldClass,newClass,elementId){if(elementId==="changeBgInwin"){trackerEvent.fire("Change_background")}YUD.replaceClass(elementId,oldClass,newClass)}var select_bg_links;var select_bg_links_Panel;var userPermissionsObj=new UserPermissionsObj();function selectBg(clickedLink){CLickedEl=YUD.getFirstChild(clickedLink);var newBackgroundProp=CLickedEl.getAttribute("rel").split(",");newBackgroundProp[0]=parseInt(newBackgroundProp[0],10);if(userPermissionsObj.isAllowed("SpecialIconsAllowed",newBackgroundProp[0])){for(i in select_bg_links){YUD.removeClass(select_bg_links[i].parentNode,'selected')}YUD.addClass(clickedLink.parentNode,'selected');KbApp1.setProperty("KbpostBackgroundID",newBackgroundProp[0]);ChangeKbpostBackground(newBackgroundProp[1]);toggleClass('inwin_open','inwin_closed','changeBgInwin');onPostEditorChanged.fire()}else{NC_PanelManager.ChangePanelContentByAjax('premiumInwin','KbBookViewInwin',true,40,null)}}function selectBgAddNew(clickedLink){CLickedEl=YUD.getFirstChild(clickedLink);var newBackgroundProp=CLickedEl.getAttribute("rel").split(",");newBackgroundProp[0]=parseInt(newBackgroundProp[0],10);if(userPermissionsObj.isAllowed("SpecialIconsAllowed",newBackgroundProp[0])){for(i in select_bg_links_Panel){for(j in select_bg_links_Panel[i]){YUD.removeClass(select_bg_links_Panel[i][j].parentNode,'selected')}}YUD.addClass(clickedLink.parentNode,'selected');KbApp1.setProperty("KbpostBackgroundID",newBackgroundProp[0]);KbApp1.setProperty("KbpostBackgroundPath",newBackgroundProp[1]);isNewBackgroundFromAddnewPanel=true}else{NC_PanelManager.ChangePanelContentByAjax('premiumInwin','KbBookViewInwin',true,40,null)}}function ChangeKbpostBackground(newBackgroundPath){var WrapperEl=YUD.get("bottom_bd");YUD.setStyle(WrapperEl,"background-image","url("+newBackgroundPath+")");if(KbApp1.getProperty("KbPostState")=="Edit"&&KbApp1.getProperty("KbPostType")!="Talk"){YUD.setStyle(WrapperEl,"background-position","0px 28px")}UpdateAddNewPanelSelectedBG();if(KbApp1.getProperty("KbpostType")=="Talk"){RenderResizeTextCanvas(true)}}function PromptDialog(FuncWhenTrue){onDialogSelected.unsubscribeAll();if(KbApp1.getProperty("ClientPostStateIsSaved")==true&&FuncWhenTrue!="Delete()"){eval("KbApp1."+FuncWhenTrue)}else{YUD.get("KbMainDialog").getElementsByTagName("span")[0].innerHTML="Are you sure?";NC_PanelManager.ShowPanelByID("KbMainDialog")}onDialogSelected.subscribe(function(e,obj){if(obj[0]==true){eval("KbApp1."+FuncWhenTrue)}else{return}})}function ShowImageManager(AttachClickedFunc){AttachClicked.unsubscribeAll();try{this.MaskSettings={color:null,opacity:"0.65"};NC_PanelManager.ChangePanelContentByAjax("ImageManagerInwin","ImageManagerInwin",true,null,null,this.MaskSettings)}catch(e){onApplicationError.fire(e)}AttachClicked.subscribe(function(e,obj){try{AttachClickedFunc=AttachClickedFunc+"('"+obj[0]+"')";eval("KbApp1."+AttachClickedFunc)}catch(e){onApplicationError.fire(e)}})}function insertImageInEditor(pattern,URL){NC_PanelManager.HideActivePanel();var Image1=new Image();Image1.src=URL;var ImageSize=null;var SizeSpace=null;if(YAHOO.env.ua.ie>0){ImageSize=Image1.width}else{ImageSize=Image1.naturalWidth}if(ImageSize>380){SizeSpace=380+"px"}else{SizeSpace="auto"}var HTML="<img border=\"0\" src=\""+URL+"\" style=\"width:"+SizeSpace+";\" title=\"User image\" rel=\""+pattern+"\" />";var inst=tinyMCE.activeEditor;inst.selection.moveToBookmark(TinyMceCaretPostion);tinyMCE.activeEditor.execCommand("mceInsertContent",false,HTML);}function openAddChildPanel(){NC_PanelManager.ShowPanelByID('RegistrationChildInwin',null,null,24)}function testParent(el){return YUD.isAncestor(BackgroundsParentNode,el)}function testEl(el){return true}var max_fields=99;var count=0;function editShareSenderEmail(clickedLink,which){if(YUD.hasClass(clickedLink.parentNode.parentNode.parentNode,'email_set')){YUD.replaceClass(clickedLink.parentNode.parentNode.parentNode,'email_set','email_edit')}else{if(which==='invite'){var fromEmail=YUD.getElementsByClassName('inviteInwinFromLabel')[0];var fromInput=YUD.getElementsByClassName('inviteInwinFromInput')[0]}else if(which==='share'){var fromEmail=YUD.getElementsByClassName('shareInwinFromLabel')[0];var fromInput=YUD.getElementsByClassName('shareInwinFromInput')[0]}if(isEmail(fromInput.value)){fromEmail.innerHTML=fromInput.value;YUD.setStyle('invalidSender','display','none');YUD.replaceClass(clickedLink.parentNode.parentNode.parentNode,'email_edit','email_set');setImportRegion(fromInput.value,which)}else{YUD.setStyle('invalidSender','display','block')}}}function SplitInviteValues(which){var numOfMails=0;var inputValues='';var wrap;switch(which){case("share"):wrap=YUD.get('InviteInputWrapperOnShare');break;case("invite"):wrap=YUD.get('InviteInputWrapperOnInvite');break;case("reg"):wrap=YUD.get('InviteInputWrapperOnRegChild');break}var inputs=wrap.getElementsByTagName('input');for(var i=0;i<inputs.length;i++){if(inputs[i].type=='text'&&inputs[i].id.indexOf('send_to_')>-1&&inputs[i].value!=''){inputValues+=inputs[i].value;numOfMails++;if(i+1<inputs.length&&inputs[i+1].value!==""){inputValues+=","}}}if(YUD.getElementsByClassName('contactlist').length===1){var list=YUD.getElementsByClassName('contactlist')[0];var emails=list.getElementsByTagName('span');var inputs=list.getElementsByTagName('input');for(var i=1;i<inputs.length;i++){if(inputs[i].checked===true){if(inputValues!==''&&inputValues.substring(inputValues.length-1)!==','){inputValues+=","}inputValues+=emails[i].innerHTML;numOfMails++}}}return inputValues}function toggleImportRegion(which){var elem,_importRegion;switch(which){case("share"):elem=YUD.get('InviteInputWrapperOnShare');_importRegion=YUD.get('importRegionOnShare');break;case("invite"):elem=YUD.get('InviteInputWrapperOnInvite');_importRegion=YUD.get('importRegionOnInvite');break;case("reg"):elem=YUD.get('InviteInputWrapperOnRegChild');_importRegion=YUD.get('importRegionOnChildReg');break}if(elem.style.display==='none'){elem.style.display='block';_importRegion.style.display='none'}else{elem.style.display='none';YUD.get('from').style.display='block';YUD.setStyle(['invalidSender','invalidReceipent','invalidReceipents','emptyReceipents'],'display','none');var importRegionContent="<span id=\"importSpan1\"><span>Your mail account password:&nbsp;</span><input type=\"password\" style=\"width: 80px;\" id=\"mailpw\"/><a onclick=\"importContacts('"+which+"');return false;\" id=\"importLink2\" href=\"\">Import</a><div style=\"font-size: 12px; width: auto;float:none\">We won't store your password or contacts</div></span>";if(which=='reg'){importRegionContent+="<a id=\"importLink4\" >Importing contacts...</a>"}else{importRegionContent+="<a id=\"importLink3\" >Importing contacts...</a>"}_importRegion.innerHTML=importRegionContent;_importRegion.style.display='block'}YUD.get('from').style.display='block';YUD.get('regChildInviteToggler2').style.display='none'}function setImportRegion(mailAddress,which){idx=mailAddress.indexOf("@")+1;mailAddress=mailAddress.substring(idx);var linkWrapper;switch(which){case("share"):linkWrapper=YUD.get('importLinkWrapperOnShare');break;case("invite"):linkWrapper=YUD.get('importLinkWrapperOnInvite');break;case("reg"):linkWrapper=YUD.get('importLinkWrapperOnChildReg');break}if(mailAddress==="gmail.com"){linkWrapper.innerHTML="<a onclick=\"toggleImportRegion('"+which+"');return false;\" class='import_gmailLogo' >Import your Gmail contacts</a>";linkWrapper.style.display='block'}else if(mailAddress==="yahoo.com"){linkWrapper.innerHTML="<a onclick=\"toggleImportRegion('"+which+"');return false;\" class='import_yahoomailLogo' >Import your Yahoo Mail contacts</a>";linkWrapper.style.display='block'}else{linkWrapper.innerHTML=""}}function importContacts(which){var mailpw=YUD.get('mailpw').value;if(mailpw===''){return}YUD.get('importSpan1').style.display='none';if(which==="reg"){YUD.get('importLink4').style.display='block'}else{YUD.get('importLink3').style.display='block'}var mailAddress;switch(which){case("share"):mailAddress=YUD.getElementsByClassName('shareInwinFromInput')[0].value;break;case("invite"):mailAddress=YUD.getElementsByClassName('inviteInwinFromInput')[0].value;break;case("reg"):mailAddress=YUD.getElementsByClassName('from_input regChildFrom_input')[0].value;break}Netcraft.KeePaBoo.Web.AjaxMethods.ImportContacts(KbApp1.GetRefreshContext(),mailAddress,mailpw,which,importContacts_callback)}function selectAllContacts(){var list=YUD.getElementsByClassName('contactlist')[0];var items=list.getElementsByTagName('input');if(YUD.get('importContactsSelectAll').checked){for(i=1;i<items.length;i++){items[i].checked=true}}else{for(i=1;i<items.length;i++){items[i].checked=false}}}function selectContact(item){if(item.checked===false){YUD.get('importContactsSelectAll').checked=false}}function countImportedContacts(){var list=YUD.getElementsByClassName('contactlist');if(list.length===0){return 0}else{list=list[0]}var items=list.getElementsByTagName('input');if(items.length===1){return 0}for(i=1;i<items.length;i++){if(items[i].checked===true){return 1}}return 0}function importContacts_callback(res){var _importRegion;switch(res.request.args['fromWhich']){case("share"):_importRegion=YUD.get('importRegionOnShare');break;case("invite"):_importRegion=YUD.get('importRegionOnInvite');break;case("reg"):_importRegion=YUD.get('importRegionOnChildReg');break}_importRegion.innerHTML=res.value;YUD.get('from').style.display='none';YUD.get('regChildInviteToggler2').style.display='block'}function SendShareEmail(){var invalidReceipents=0;var emptyReceipents=0;var wrapInputs=YUD.get('toFields');var inputs=wrapInputs.getElementsByTagName('input');var fromInput=YUD.getElementsByClassName('shareInwinFromInput')[0];YUD.setStyle(['invalidSender','invalidReceipent','invalidReceipents','emptyReceipents'],'display','none');for(var i=0;i<inputs.length;i++){YUD.removeClass(inputs[i],'invalid')}if(!isEmail(fromInput.value)){YUD.setStyle('invalidSender','display','block')}else{for(var i=0;i<inputs.length;i++){if(inputs[i].value==''){emptyReceipents+=1}}for(var i=0;i<inputs.length;i++){if(inputs[i].value!=''){if(!isEmail(inputs[i].value)){invalidReceipents+=1;YUD.addClass(inputs[i],'invalid')}}}if((invalidReceipents==0&&emptyReceipents<inputs.length)||countImportedContacts()>0){count=0;var EmailTo=SplitInviteValues('share');var Message="";Message=YUD.getElementsByClassName("ShareMessageField")[0].value;var ShareType=-1;switch(KbApp1.getProperty("KbPostType")){case"Book":case"Home":ShareType=3;break;case"GalleryItem":ShareType=1;break;case"Diary":case"Talk":case"Milestone":case"Gallery":case"Growth":ShareType=0;break}if(ShareType!=-1){Netcraft.KeePaBoo.Web.AjaxMethods.SendShareEmail(KbApp1.GetRefreshContext(),EmailTo,fromInput.value,Message,ShareType,SendShareEmail_callback);while(YUD.getElementsByClassName('contactlist')[0]){YUD.getElementsByClassName('contactlist')[0].parentNode.innerHTML=''}}}else{if(emptyReceipents==inputs.length&&countImportedContacts()===0){YUD.setStyle('emptyReceipents','display','block')}else{if(invalidReceipents==1){YUD.setStyle('invalidReceipent','display','block')}else{YUD.setStyle('invalidReceipents','display','block')}}}}}function SendShareEmail_callback(res){var EmailsTo=res.request.args.EmailTo;YUD.get("EmailToLabel").innerHTML="";var ResponseParts=res.value.split(';');var Succeed=ResponseParts[0];var Message=ResponseParts[1];if(Succeed=='true'){YUD.get("divShareMessage").style.display="block";YUD.get("divSend").style.display="none";while(EmailsTo.indexOf(",")>-1){EmailsTo=EmailsTo.replace(",","<br />")}YUD.get("EmailToLabel").innerHTML=EmailsTo}else{YUD.get("divShareMessage").style.display="block";YUD.get("divSend").style.display="none";YUD.get("ShareItemUserMessage").innerText=Message}}var fbWindow=null;var fb_bookID=null;function shareOnFacebook_click(bookID){fb_bookID=bookID;var ShareType=-1;switch(KbApp1.getProperty("KbPostType")){case"Book":case"Home":ShareType=3;break;case"GalleryItem":ShareType=1;break;case"Diary":case"Talk":case"Milestone":case"Gallery":case"Growth":ShareType=0;break}if(ShareType==-1){return false}if(bookID||bookID!=null){KbApp1.setProperty("BookID",bookID,true)}fbWindow=window.open("fbshare.html",'sharer','toolbar=0,status=0,width=626,height=436');if(window.focus){fbWindow.focus()}if(KbApp1.getProperty("KbPostState")=="Edit"){showSavedAlert=false;KbApp1.Save();BlockerOpen=false;PostSaved.subscribe(function(){Netcraft.KeePaBoo.Web.AjaxMethods.ShareOnFacebook(KbApp1.GetRefreshContext(),ShareType,ShareOnFacebook_callback);PostSaved.unsubscribeAll()})}else{Netcraft.KeePaBoo.Web.AjaxMethods.ShareOnFacebook(KbApp1.GetRefreshContext(),ShareType,ShareOnFacebook_callback)}trackerEvent.fire("Facebook-Share: "+KbApp1.getProperty("KbPostType"));return false}function ShareOnFacebook_callback(res){tokenId=res.value;t="Keepaboo. It's All About Your Child.";u=SiteRootURL+"siteAPI/Share.aspx?TokenID="+tokenId+'&fb=true';var fbUrl='http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t);if(!fbWindow){shareOnFacebook_click(fb_bookID);return}if(fbWindow.document.getElementById('fbsharediv')){fbWindow.location.href=fbUrl}else{fbWindow.onload=function(){fbWindow.open(fbUrl)}}fbWindow=null;fb_bookID=null}function SendInviteEmail(){var invalidReceipents=0;var emptyReceipents=0;var wrapInputs=YUD.get('toFields');var inputs=wrapInputs.getElementsByTagName('input');var fromInput=YUD.getElementsByClassName('inviteInwinFromInput')[0];YUD.setStyle(['invalidSender','invalidReceipent','invalidReceipents','emptyReceipents'],'display','none');for(var i=0;i<inputs.length;i++){YUD.removeClass(inputs[i],'invalid')}if(!isEmail(fromInput.value)){YUD.setStyle('invalidSender','display','block')}else{for(var i=0;i<inputs.length;i++){if(inputs[i].value==''){emptyReceipents+=1}}for(var i=0;i<inputs.length;i++){if(inputs[i].value!=''){if(!isEmail(inputs[i].value)){invalidReceipents+=1;YUD.addClass(inputs[i],'invalid')}}}if((invalidReceipents==0&&emptyReceipents<inputs.length)||countImportedContacts()>0){count=0;var EmailTo=SplitInviteValues('invite');var Message=YUD.getElementsByClassName("ShareMessageField")[0].value;var ShareType=1;Netcraft.KeePaBoo.Web.AjaxMethods.InviteFriends(KbApp1.GetRefreshContext(),EmailTo,fromInput.value,Message,ShareType,SendInviteEmail_callback);while(YUD.getElementsByClassName('contactlist')[0]){YUD.getElementsByClassName('contactlist')[0].parentNode.innerHTML=''}}else{if(emptyReceipents==inputs.length&&countImportedContacts()===0){YUD.setStyle('emptyReceipents','display','block')}else{if(invalidReceipents==1){YUD.setStyle('invalidReceipent','display','block')}else{YUD.setStyle('invalidReceipents','display','block')}}}}}function SendInviteEmail_callback(res){var EmailsTo=res.request.args.EmailTo;YUD.get("EmailToLabel").innerHTML="";var ResponseParts=res.value.split(';');var Succeed=ResponseParts[0];var Message=ResponseParts[1];if(Succeed=='true'){YUD.get("divShareMessage").style.display="block";YUD.get("divSend").style.display="none";while(EmailsTo.indexOf(",")>-1){EmailsTo=EmailsTo.replace(",","<br />")}YUD.get("EmailToLabel").innerHTML=EmailsTo}else{YUD.get("divShareMessage").style.display="block";YUD.get("divSend").style.display="none";YUD.get("ShareItemUserMessage").innerText=Message}}function isEmail(string){var s=new String(string);if(s.trim().search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1){return true}else{return false}}function validateContact(nameID,emailID,subjectID,msgID){YUD.setStyle(['emptyName','emptyEmail','invalidEmail','emptySubject','emptyMessage'],'display','none');var error=false;var senderName=YUD.get(nameID).value;var senderEmail=YUD.get(emailID).value;var msgSubject=YUD.get(subjectID).value;var msgText=YUD.get(msgID).value;if(senderName==''){YUD.setStyle('emptyName','display','block');error=true}if(senderEmail==''){YUD.setStyle('emptyEmail','display','block');error=true}else{if(!isEmail(senderEmail)){YUD.setStyle('invalidEmail','display','block');error=true}}if(msgSubject==''){YUD.setStyle('emptySubject','display','block');error=true}if(msgText==''){YUD.setStyle('emptyMessage','display','block');error=true}if(error==false){ContactUs(nameID,emailID,subjectID,msgID)}}var valid=0;function ValidateGrowthForm(){var _weight=YUD.get("WeightText").value;var _height=YUD.get("HeightText").value;var _kbGrowthPostDate=KbApp1.getProperty("KbpostDate");if(_weight!=""&&_height!=""&&_kbGrowthPostDate!=""){valid=1;if(isFloat(_weight)&&_weight.indexOf("-")<0){YUD.setStyle(YUD.get("ValidErrDate"),"display","none");YUD.setStyle(YUD.get("ValidErrWeight"),"display","none");YUD.setStyle(YUD.get("ValidErrAll"),"display","none");valid++}else{YUD.setStyle(YUD.get("ValidErrWeight"),"display","block");valid--}if(isFloat(_height)&&_height.indexOf("-")<0){YUD.setStyle(YUD.get("ValidErrDate"),"display","none");YUD.setStyle(YUD.get("ValidErrHeight"),"display","none");YUD.setStyle(YUD.get("ValidErrAll"),"display","none");valid++}else{YUD.setStyle(YUD.get("ValidErrHeight"),"display","block");valid--}if(valid==3){KbApp1.AddnewGrowth();YUD.get("WeightText").value="";YUD.get("HeightText").value="";YUD.get("newDateField").value=""}else{valid=0;return false}}else{if(YUD.get("WeightText").value==""&&YUD.get("HeightText").value==""&&YUD.get("newDateField").value==""){YUD.setStyle(YUD.get("ValidErrAll"),"display","block");valid=0;return false}if(YUD.get("newDateField").value==""){YUD.setStyle(YUD.get("ValidErrDate"),"display","block");valid++}else{YUD.setStyle(YUD.get("ValidErrDate"),"display","none");valid++}if(YUD.get("WeightText").value==""){YUD.setStyle(YUD.get("ValidErrWeight"),"display","block");valid--}else{YUD.setStyle(YUD.get("ValidErrWeight"),"display","none");valid++}if(YUD.get("HeightText").value==""){YUD.setStyle(YUD.get("ValidErrHeight"),"display","block");valid--}else{YUD.setStyle(YUD.get("ValidErrHeight"),"display","none");valid++}}function isFloat(s){var RegularExpression=new RegExp("^([-][0-9]*[.][0-9]+|[.][0-9]+|[-.][0-9]+|[0-9]*[.][0-9]+|[-][0-9]+|[0-9]+)$");if(RegularExpression.test(s)){return true}else{return false}}}function RenderResizeTextCanvas(isEnabled){if(KbApp1.getProperty("KbpostType")=="Talk"){if(DebugMode&&typeof YAHOO.tool!="undefined"){YAHOO.tool.Profiler.registerObject("_textResizer")}if(KbApp1.getProperty("KbpostBackgroundID")<1){return}switch(KbApp1.getProperty("KbpostBackgroundID").toString()){case"1":canvasSettings={width:"316px",height:"100px",top:"70px",left:"65px",fontColor:"#FFFFFF",fontFamily:"comic Sans MS"};break;case"2":canvasSettings={width:"217px",height:"133px",top:"57px",left:"114px",fontColor:"#FFFFFF",fontFamily:"comic Sans MS"};break;case"3":canvasSettings={width:"340px",height:"101px",top:"58px",left:"50px",fontColor:"#FFFFFF",fontFamily:"comic Sans MS"};break;case"4":canvasSettings={width:"298px",height:"134px",top:"55px",left:"70px",fontColor:"#9849C9",fontFamily:"comic Sans MS"};break;case"5":canvasSettings={width:"161px",height:"133px",top:"59px",left:"139px",fontColor:"#F66700",fontFamily:"comic Sans MS"};break;case"6":canvasSettings={width:"220px",height:"120px",top:"38px",left:"108px",fontColor:"#436d04",fontFamily:"comic Sans MS"};break;case"7":canvasSettings={width:"220px",height:"136px",top:"42px",left:"108px",fontColor:"#ffffff",fontFamily:"comic Sans MS"};break;case"8":canvasSettings={width:"220px",height:"119px",top:"45px",left:"123px",fontColor:"#0175c0",fontFamily:"comic Sans MS"};break;case"9":canvasSettings={width:"220px",height:"119px",top:"35px",left:"107px",fontColor:"#ffffff",fontFamily:"comic Sans MS"};break;default:return}function initTextResizer(){_textResizer.init("TalkContainer",[45,40,36,32,28,24,20,16,14,12,10,9],KbApp1.getProperty("KbpostContent"),canvasSettings,isEnabled)}YUD.setStyle(YUD.get("TalkContainer"),"visibility","hidden");YUE.onContentReady("TalkContainer",function(){setTimeout(function(){initTextResizer()},500)})}}function AddToBook_onIwinLoad(){YAHOO.util.Event.onContentReady('radios_add_to_book',function(){initARC('radios_add_to_book','radio_on','radio_off','checkbox_on','checkbox_off');var radio_labels=YAHOO.util.Dom.get('radios_add_to_book').getElementsByTagName('label');var submit_button=YAHOO.util.Dom.get('inwin_submit');YAHOO.util.Event.addListener(radio_labels[0],'click',function(){if(YAHOO.util.Dom.hasClass(submit_button,'btn_add_to_new')){YAHOO.util.Dom.replaceClass(submit_button,'btn_add_to_new','btn_add')}KbApp1.setProperty("KbPostState","AddToBook",true)});YAHOO.util.Event.addListener(radio_labels[1],'click',function(){if(YAHOO.util.Dom.hasClass(submit_button,'btn_add')){YAHOO.util.Dom.replaceClass(submit_button,'btn_add','btn_add_to_new')}KbApp1.setProperty("KbPostState","AddToNewBook",true);KbApp1.setProperty("BookID",const_EmptyGuid,true)})});YAHOO.util.Event.onContentReady('scroll_list',function(){list_links=YUD.get('scroll_list').getElementsByTagName('a');YAHOO.util.Event.addListener(list_links,'click',function(event){for(i in list_links){YUD.removeClass(list_links[i].parentNode,'selected')}KbApp1.setProperty("BookID",this.getAttribute("rel"),true);KbApp1.setProperty("KbBookTitle",this.innerHTML,true);KbApp1.setProperty("KbPostState","AddToBook",true);YUD.addClass(this.parentNode,'selected');swapRadioButtons(1);YAHOO.util.Event.preventDefault(event)});YAHOO.util.Event.addListener('NewBookTitle','click',function(){swapRadioButtons(2)})})}function CustomBookEditor_onIwinLoad(){YAHOO.util.Dom.addClass('KbMainInwin_mask','mask_cover');try{initBooks()}catch(e){onApplicationError.fire(e)}}function BookOfLifeEditor_onIwinLoad(){YAHOO.util.Dom.addClass('KbMainInwin_mask','mask_cover');try{initBookOfLifeEditor()}catch(e){onApplicationError.fire(e)}}function BookEditor_onIwinUnLoad(){YAHOO.util.Dom.removeClass('KbMainInwin_mask','mask_cover')}function KbBookViewer_onIwinLoad(){var randomnumber=Math.floor(Math.random()*9999999);YAHOO.util.Dom.addClass('KbMainInwin_mask','mask_cover');var pageURL=window.location.href;var externaMode="";if(pageURL.toLowerCase().indexOf("siteapi")>-1){externaMode="1"}else{if(GlobalSetting.SampleBookId==KbApp1.getProperty("BookID")){externaMode=2}else{externaMode="0"}}var sourcesrc=GlobalSetting.SiteRootURL+"SiteAPI/BookHandler.ashx?bi="+KbApp1.getProperty("BookID")+"&ext="+externaMode+"&rnd="+randomnumber+"&MZ=1";var swf=GlobalSetting.SiteRootURL+"swf/book3.swf";var so=new SWFObject(swf,"book","980","680","9","#E4F8FF");so.addParam("wmode","transparent");so.addParam("allowScriptAccess","sameDomain");so.addParam("swLiveConnect","true");so.addParam("allowFullscreen","true");so.addVariable("xmlFile",sourcesrc);skin=KbApp1.getProperty("ChildSkin").substring(4);so.addVariable("bookSkin",skin);YUE.onContentReady("flashcontent_Book",function(){setTimeout(function(){so.write(YUD.get("flashcontent_Book"));var noFlashContent=YUD.get("noflash_book_wrapper");if(noFlashContent){YUD.setStyle(noFlashContent,"display","block")}},250)})}function CloseBookFromFlash(){setTimeout(function(){NC_PanelManager.HideActivePanel()},1)}function GalleryKbBookViewer_onIwinLoad(){var pageURL=window.location.href;var externaMode="";if(pageURL.toLowerCase().indexOf("siteapi")>-1){externaMode="1"}else{externaMode="0"}var randomnumber=Math.floor(Math.random()*9999999);var sourcesrc=SiteRootURL+"SiteAPI/BookHandler.ashx?gi="+KbApp1.getProperty("KbPostID")+"&ext="+externaMode+"&rnd="+randomnumber+"&MZ=1";var swf=GlobalSetting.SiteRootURL+"swf/book3.swf";var so=new SWFObject(swf,"book","980","680","9","#E4F8FF");so.addParam("wmode","transparent");so.addParam("allowScriptAccess","sameDomain");so.addParam("swLiveConnect","true");so.addParam("allowFullscreen","true");so.addVariable("xmlFile",sourcesrc);skin=KbApp1.getProperty("ChildSkin").substring(4);so.addVariable("bookSkin",skin);YUE.onContentReady("flashcontent_Book",function(){setTimeout(function(){so.write(YUD.get("flashcontent_Book"));var noFlashContent=YUD.get("noflash_book_wrapper");if(noFlashContent){YUD.setStyle(noFlashContent,"display","block")}},250)});}function KbBookViewer_onIwinUnLoad(){YAHOO.util.Dom.removeClass('KbMainInwin_mask','mask_cover')}function LoadTempContext(){if(TempKbContext!=null){KbApp1.setProperty("KbPostType",TempKbContext[0]);KbApp1.setProperty("KbPostState",TempKbContext[1]);KbApp1.setProperty("KbPostID",TempKbContext[2]);}}saveAlertPrompt.unsubscribeAll();saveAlertPrompt.subscribe(function(type,args,scope){var func=args[0];var arg=args[1];if(arg==null||typeof arg=="undefined"){return}if(SaveErr){func.call(arg);SaveErr=null;toggleEditor('editorWrap');return}if(KbApp1.getProperty("ClientPostStateIsSaved")==true){func.call(arg)}else{if(KbApp1.getProperty("KbPostState")=="Edit"){YUD.get("KbMainDialog").getElementsByTagName("span")[0].innerHTML="Do you want to save?";KbApp1.setProperty("KbPostState","View");NC_PanelManager.ShowPanelByID("KbMainDialog")}else{KbApp1.setProperty("ClientPostStateIsSaved",true,true)}}onDialogSelected.unsubscribeAll();onDialogSelected.subscribe(function(e,obj){if(obj[0]==true){PostSaved.subscribe(function(){func.call(arg);PostSaved.unsubscribeAll()});KbApp1.Save();KbApp1.setProperty("ClientPostStateIsSaved",true,true)}else{toggleEditor('editorWrap');func.call(arg);KbApp1.setProperty("ClientPostStateIsSaved",true,true)}})});saveAlertPromptBook.unsubscribeAll();saveAlertPromptBook.subscribe(function(type,args,scope){var func=args[0];var arg=args[1];if(KbApp1.getProperty("ClientBookStateIsSaved")==true){func.call(arg)}else{YUD.get("KbMainDialog").getElementsByTagName("span")[0].innerHTML="Do you want to save?";NC_PanelManager.ShowPanelByID("KbMainDialog")}onDialogSelected.unsubscribeAll();onDialogSelected.subscribe(function(e,obj){if(obj[0]==true){PostSaved.subscribe(function(){func.call(arg);PostSaved.unsubscribeAll()});KbApp1.BookEditorFinish();KbApp1.setProperty("ClientBookStateIsSaved",true)}else{func.call(arg);KbApp1.setProperty("ClientBookStateIsSaved",true)}})});DelChildAlertPrompt.unsubscribeAll();DelChildAlertPrompt.subscribe(function(type,args,scope){var func=args[0];var arg=args[1];NC_PanelManager.ShowPanelByID("KbMainDialog");onDialogSelected.unsubscribeAll();onDialogSelected.subscribe(function(e,obj){if(obj[0]==true){func=func.replace("javascript:","");setTimeout(function(){func=eval(func)},10);FixIe6SelectBug('show')}else{FixIe6SelectBug('show');return}})});function validateAddToBook(){var radioAddToExistingBook=YUD.get('radio_add');var radioAddToNewBoook=YUD.get('radio_new');YUD.setStyle(['noOptionSelected','noBookSelected','noBookTitle'],'display','none');if(!radioAddToExistingBook.checked&&!radioAddToNewBoook.checked){YUD.setStyle('noOptionSelected','display','block');return false}else{YUD.setStyle('noOptionSelected','display','none')}var selectedBook=YUD.getElementsByClassName('selected','li','scroll_list');if(radioAddToExistingBook.checked&&selectedBook==''){YUD.setStyle('noBookSelected','display','block');return false}else{YUD.setStyle('noBookSelected','display','none')}var newBookName=YUD.get('NewBookTitle').value;if(radioAddToNewBoook.checked&&newBookName==''){YUD.setStyle('noBookTitle','display','block');return false}else{YUD.setStyle('noBookTitle','display','none')}KbApp1.AddKbPostToBook()}function swapRadioButtons(activeButton){var radioAddToExistingBook=YUD.get('radio_add');var radioAddToNewBoook=YUD.get('radio_new');var labelAddToExistingBook=YUD.get('AddToBook_FormPanel').getElementsByTagName('label')[0];var labelAddToNewBook=YUD.get('AddToBook_FormPanel').getElementsByTagName('label')[1];switch(activeButton){case 1:radioAddToExistingBook.checked=true;YUD.replaceClass(labelAddToExistingBook,'radio_off','radio_on');radioAddToNewBoook.checked=false;YUD.replaceClass(labelAddToNewBook,'radio_on','radio_off');break;case 2:radioAddToExistingBook.checked=false;YUD.replaceClass(labelAddToExistingBook,'radio_on','radio_off');radioAddToNewBoook.checked=true;YUD.replaceClass(labelAddToNewBook,'radio_off','radio_on');break}}function initQuickUpload(){var settings={form_id:"blabla",label_id:"u_label",target:"u_iframe",action:SiteRootURL+"/SiteAPI/Uploader.ashx",button_id:"upload_button",instance:quickUpload,child_id:KbApp1.getProperty("ChildID")};quickUpload.init(settings);try{SI.Files.htmlClass='image_manager';SI.Files.fileClass='file';SI.Files.wrapClass='btn_upload';SI.Files.stylizeAll()}catch(e){onApplicationError.fire(e)}}function GetGalleryAttachmentPreview(cfgIndexed){if(!cfgIndexed){return}this.AttachArray=KbApp1.getProperty("GalleryAttachmentList");this.Attach_selected_index=KbApp1.getProperty("GalleryAttachmentPosition");YUD.get("GalleryItemTitle").innerHTML=cfgIndexed.title;var GalleryAttachment=YUD.get("GalleryAttachment");GalleryAttachment.src=cfgIndexed.url;YUD.setStyle(YUD.getElementsByClassName("title","DIV","ItemPreviewRegion")[0],"width","285px");if(KbApp1.getProperty("KbpostAttachmentID")==const_EmptyGuid){YUD.getElementsByClassName("leftArrow","DIV","ItemPreviewRegion")[0].style.visibility="visible";YUD.getElementsByClassName("rightArrow","DIV","ItemPreviewRegion")[0].style.visibility="visible";YUD.getElementsByClassName("age")[0].innerHTML="Page "+(this.Attach_selected_index+1)+" of "+this.AttachArray.value.length;if(this.AttachArray.value.length==1||this.AttachArray.value.length==0){YUD.addClass("A1","btn_lock");YUD.addClass("A2","btn_lock");return}if(this.Attach_selected_index==0&&this.AttachArray.value.length!=1){YUD.removeClass("A1","btn_lock");YUD.addClass("A2","btn_lock")}if(this.Attach_selected_index==(this.AttachArray.value.length-1)){YUD.removeClass("A2","btn_lock");YUD.addClass("A1","btn_lock")}if(this.Attach_selected_index<this.AttachArray.value.length-1&&this.Attach_selected_index>0){YUD.removeClass("A1","btn_lock");YUD.removeClass("A2","btn_lock")}}}function ReadNextAttachmentGallery(direction){this.Attach_selected_index=KbApp1.getProperty("GalleryAttachmentPosition");this.AttachArray=KbApp1.getProperty("GalleryAttachmentList");if(direction==-1&&(this.Attach_selected_index>0)){this.Attach_selected_index--;KbApp1.setProperty("GalleryAttachmentPosition",this.Attach_selected_index,true);GetGalleryAttachmentPreview(this.AttachArray[this.Attach_selected_index])}if(direction==1&&(this.Attach_selected_index<this.AttachArray.value.length-1)){this.Attach_selected_index++;KbApp1.setProperty("GalleryAttachmentPosition",this.Attach_selected_index,true);GetGalleryAttachmentPreview(this.AttachArray[this.Attach_selected_index])}}function getAttachmentProperties(){this.AttachArray=KbApp1.getProperty("GalleryAttachmentList");this.Attach_selected_index=KbApp1.getProperty("GalleryAttachmentPosition");var Properties={id:this.AttachArray[this.Attach_selected_index].id,type:"GalleryItem",title:this.AttachArray[this.Attach_selected_index].title,date:bookOfLife.getSelecedItemProperties().date,parentId:bookOfLife.getSelecedItemProperties().id,thumbUrl:this.AttachArray[this.Attach_selected_index].thumbUrl,pageCount:"1"};return Properties}function AddGalleryAttachmentsToCustomBook(){var AttachArray=KbApp1.getProperty("GalleryAttachmentList");if(AttachArray==null){return}AttachArray=AttachArray.value;for(var index=0;index<AttachArray.length;index++){var curItem=eval("("+AttachArray[index]+")");var Properties={id:curItem.id,type:"GalleryItem",title:curItem.title,thumbUrl:curItem.thumbUrl,date:bookOfLife.getSelecedItemProperties().date,parentId:bookOfLife.getSelecedItemProperties().id,pageCount:"1"};customBook.addItem(Properties)}}function injectMilesoneBackgrounds(){var changeBgList=YUD.getElementsByClassName("changeBgList","UL",YUD.getElementsByClassName("IconPicker_Milestone")[0])[0];var picMilestone=YUD.getElementsByClassName("pic","SPAN","addNewBar");this.TempLIs=changeBgList.innerHTML;changeBgList.innerHTML='';for(var i=0;i<picMilestone.length;i++){picMilestoneData=picMilestone[i].getAttribute("rel").split(',');var newLI=document.createElement("li");newLI.id=picMilestoneData[0];if(picMilestoneData[0]==KbApp1.getProperty("KbpostBackgroundID")){newLI.className="selected"}var newLink=document.createElement("a");newLink.href="javascript:return false;";var newImg=document.createElement("img");newImg.style.cssText="border-width: 0px;";newImg.src=(picMilestoneData[1].replace("453X454","73X62"));newImg.setAttribute("rel",picMilestoneData[0]+","+newImg.src.replace("73X62","453X454"));newLink.appendChild(newImg);newLI.appendChild(newLink);changeBgList.appendChild(newLI)}changeBgList.innerHTML=changeBgList.innerHTML+this.TempLIs;msBckgHelper(changeBgList,31,1);msBckgHelper(changeBgList,25,2);msBckgHelper(changeBgList,30,4);msBckgHelper(changeBgList,43,5);msBckgHelper(changeBgList,27,7);msBckgHelper(changeBgList,33,8);msBckgHelper(changeBgList,38,10);msBckgHelper(changeBgList,43,11);msBckgHelper(changeBgList,34,13);msBckgHelper(changeBgList,41,14);msBckgHelper(changeBgList,38,16);msBckgHelper(changeBgList,41,17);msBckgHelper(changeBgList,36,19);msBckgHelper(changeBgList,39,20);msBckgHelper(changeBgList,37,22);msBckgHelper(changeBgList,41,23);msBckgHelper(changeBgList,38,25);msBckgHelper(changeBgList,41,26);msBckgHelper(changeBgList,40,29);msBckgHelper(changeBgList,41,32);msBckgHelper(changeBgList,45,35);msBckgHelper(changeBgList,45,38);msBckgHelper(changeBgList,45,41);msBckgHelper(changeBgList,45,44)}function msBckgHelper(list,idx1,idx2){list.insertBefore(list.getElementsByTagName('LI')[idx1],list.getElementsByTagName('LI')[idx2])}function changeSkinForChild(SkinName){var result=Netcraft.KeePaBoo.Web.AjaxMethods.ChangeChildSkin(KbApp1.GetRefreshContext(),SkinName);eval(result.value)}function UpdateCurrentContextDate(){var today=new Date();var h=today.getHours();var m=today.getMinutes();var s=today.getSeconds();var mo=today.getMonth();var d=today.getUTCDate();var y=today.getFullYear();var newDate=(mo+1)+"/"+d+"/"+y+" "+h+":"+m+":"+s;KbApp1.setProperty("KbpostDate",newDate,false)}function ContactUs_CallBack(res){var EmailsTo=res.request.args.EmailTo;var ResponseParts=res.value.split(';');var Succeed=ResponseParts[0];var Message=ResponseParts[1];if(Succeed=='true'){NC_PanelManager.HidePanelByID("AlertMsg");YUD.get("AlertMsg_AlertContent").innerHTML=Message;NC_PanelManager.ShowPanelByID("AlertMsg",3000)}}function ContactUs(ContactNameID,ContactMailId,SubjectId,MessageId){var ContactName=YUD.get(ContactNameID);var ContactMail=YUD.get(ContactMailId);var Subject=YUD.get(SubjectId);var Message=YUD.get(MessageId);NC_PanelManager.ShowPanelByID("AlertMsg");YUD.get("AlertMsg_AlertContent").innerHTML="Sending...";Netcraft.KeePaBoo.Web.AjaxMethods.ContactUs(KbApp1.GetRefreshContext(),ContactName.value,ContactMail.value,Subject.value,Message.value,ContactUs_CallBack)}function GetColorBySkinName(){var childSkin=KbApp1.getProperty("ChildSkin");switch(childSkin){case"Skin1":return"#E4F8FF";case"Skin2":return"#FFECF6";default:return"#E4F8FF"}}onCallBackFinish.subscribe(function(){if((KbPlaceholderID=="MainRegion"||KbPlaceholderID=="TimelineRegion")&&(KbApp1.getProperty("KbPostState")=="List"||(KbApp1.getProperty("KbPostState")=="View"&&KbApp1.getProperty("KbPostID")!=const_EmptyGuid)||KbApp1.getProperty("KbPostType")=="Growth"||KbApp1.getProperty("KbPostType")=="Gallery")){setTimeout(function(){hideContentBlocker()},100)}});function showContentBlocker(showLoading){if(BlockerOpen){return}if(!showLoading){YUD.get("ContentBlocker").getElementsByTagName("img")[0].style.display="none"}NC_PanelManager.ChangePanelContentByDivHtml("ContentBlocker","KbMainInwin",true,350,{color:"transparent",opacity:"0"});BlockerOpen=true;setTimeout(function(){hideContentBlocker()},800)}function showImageuploadLoaderOnStep2(func,callback,linkUrl){validateMailInvitations();if(numberOfInvitedFriendsOnAddChild===0){YUD.get('noMailsMessageOnSendInvitation').style.display='block'}else{numberOfInvitedFriendsOnAddChild=0;showImageuploadLoader(func,callback,linkUrl)}}function showImageuploadLoader(func,callback,linkUrl){var dropDownTest=func.call();if(!dropDownTest){return}var panel;if(YUD.get("RegistrationChildInwin").parentNode.style.display=="block"){if(numberOfInvitedFriendsOnAddChild>2){numberOfInvitedFriendsOnAddChild=0}else{if(!validateMailInvitations()){return}if(numberOfInvitedFriendsOnAddChild>2){regChildOnToStep3();return}}panel="RegistrationChildInwin"}else{panel="EditChildInwin"}var divs=YUD.getElementsByClassName("registr","",panel);var formEl=divs[0];var loadingEl=divs[1];formEl.style.display="none";loadingEl.style.display="block";var loaderSpin=YUD.getElementsByClassName("ajaxLoaderBig","div",loadingEl)[0];setTimeout(function(){linkUrl=(unescape(linkUrl)).replace("javascript:","");if(callback!=""){eval(callback)}else{eval(linkUrl)}},1000)}function toggleRegChildInviteArea(imported){if(YUD.get('regChildInviteToggler').innerHTML.indexOf("Add")>-1){YUD.get('regChildInviteToggler2').style.display='none';YUD.get('regChildtoFields').style.display='none';YUD.get('regChildInviteMessage').style.display='block';YUD.get('insertLabel').style.visibility='hidden';if(imported){YUD.get('regChildInviteToggler').innerHTML="<span></span>"}else{YUD.get('regChildInviteToggler').innerHTML="<span>View emails</span>"}}else{YUD.get('regChildtoFields').style.display='block';YUD.get('regChildInviteMessage').style.display='none';YUD.get('insertLabel').style.visibility='visible';YUD.get('regChildInviteToggler').innerHTML="Add message"}return false}function toggleRegChildInviteArea2(){toggleImportRegion('reg');var imported=YUD.getElementsByClassName('contactlist').length===1?true:false;toggleRegChildInviteArea(imported)}var numberOfInvitedFriendsOnAddChild=0;function validateMailInvitations(){numberOfInvitedFriendsOnAddChild=0;var invalidReceipents=0;var validReceipents=0;var numOfMails=0;var wrapInputs=YUD.get('regChildtoFields');var inputs=wrapInputs.getElementsByTagName('input');var fromInput=YUD.getElementsByClassName('regChildFrom_input')[0];var fromLabel=YUD.getElementsByClassName('regChildFromMailLabel')[0];if(fromInput.value==""){fromInput.value=fromLabel.innerHTML}YUD.setStyle(['invalidSender','invalidReceipent','invalidReceipents','emptyReceipents'],'display','none');for(var i=0;i<inputs.length;i++){YUD.removeClass(inputs[i],'invalid')}if(fromLabel.innerHTML!=='Please enter Email'&&!isEmail(fromLabel.innerHTML)){YUD.setStyle('invalidSender','display','block')}else{for(var i=0;i<inputs.length;i++){if(inputs[i].value!=''){if(!isEmail(inputs[i].value)){invalidReceipents+=1;YUD.addClass(inputs[i],'invalid')}else{validReceipents+=1}}}if(invalidReceipents==0){if(countImportedContacts()>0){var inputValues='';var list=YUD.getElementsByClassName('contactlist')[0];var emails=list.getElementsByTagName('span');var inputs=list.getElementsByTagName('input');for(var i=1;i<inputs.length;i++){if(inputs[i].checked===true){if(inputValues!==''){inputValues+=","}inputValues+=emails[i].innerHTML;numOfMails++}}YUD.getElementsByClassName('hiddenImportedContactsList')[0].value=inputValues;validReceipents=numOfMails;}msg="Invite friends ["+validReceipents+"]";trackerEvent.fire(msg,true);numberOfInvitedFriendsOnAddChild=validReceipents;return true}else{return false}}}function regChildeditFromSenderEmail(clickedLink){var fromLabel=YUD.getElementsByClassName('regChildFromMailLabel')[0];var fromInput=YUD.getElementsByClassName('regChildFrom_input')[0];if(YUD.hasClass(clickedLink.parentNode.parentNode.parentNode,'email_set')){fromInput.value=fromLabel.innerHTML;YUD.replaceClass(clickedLink.parentNode.parentNode.parentNode,'email_set','email_edit')}else{if(isEmail(fromInput.value)){fromLabel.innerHTML=fromInput.value;YUD.setStyle('invalidSender','display','none');YUD.replaceClass(clickedLink.parentNode.parentNode.parentNode,'email_edit','email_set');setImportRegion(fromInput.value,'reg')}else{YUD.setStyle('invalidSender','display','block')}}}function hideContentBlocker(){if(!BlockerOpen){return}NC_PanelManager.HidePanelByID("KbMainInwin");YUD.get("ContentBlocker").getElementsByTagName("img")[0].style.display="block";BlockerOpen=false}function UpdateImageFromAjax(res){if(KbApp1.getProperty("KbPostType")!="Home"){return}var el=YUD.get(res.request.args["ImageClientID"]);var newImageSrc=res.value;if(typeof el!="undefined"&&el!=null&&newImageSrc!=null){if(newImageSrc.toLowerCase()!=el.src.toLowerCase()){el.src=newImageSrc;el.onload=function(){}}else{el.onload.call()}}}function LoadDaysByMonth(monthDDLId){var yearDDLId=monthDDLId.replace('drpMonth','drpYear');LoadDays(monthDDLId,yearDDLId)}function LoadDaysByYear(yearDDLId){var monthDDLId=yearDDLId.replace('drpYear','drpMonth');var month=YUD.get(monthDDLId).selectedIndex;if(month==2){LoadDays(monthDDLId,yearDDLId)}}function LoadDays(monthDDLId,yearDDLId){var month=YUD.get(monthDDLId).selectedIndex;var year=YUD.get(yearDDLId).selectedIndex;var dayDDLId=monthDDLId.replace('drpMonth','drpDay');var dayDDL=YUD.get(dayDDLId);var day=YUD.get(dayDDLId).selectedIndex;var dayArray=Netcraft.KeePaBoo.Web.AjaxMethods.InitDayDateDDL(KbApp1.GetRefreshContext(),month,year);if(dayArray==null||dayArray=='undefined'){return}dayDDL.innerHTML="";if(dayDDL.options.length>0){dayDDL.options.length=0}for(i=0;i<dayArray.value.length;i++){var option=document.createElement("OPTION");option.innerHTML=dayArray.value[i];dayDDL.appendChild(option)}if(dayArray.value.length>=day){dayDDL.selectedIndex=day}}function LoadHistoryPoint(pointIndex,historyObject){var Index=parseInt(historyObject,10);isBackBtn=true;HISTORY_STEP=Index;if(!isHistoryStepLoaded){KbApp1.InitByContext()}}var showTempImage=function(imageNode,tempImageURL){imageNode.onerror=function(){};if(YUD.get(imageNode.id)!==null){var snapshotURL=imageNode.src;imageNode.src=tempImageURL;setTimeout(function(){retryGettingSnapshotImage(imageNode,tempImageURL,snapshotURL)},3000)}};var retryGettingSnapshotImage=function(imageNode,tempImageURL,snapshotURL){if(YUD.get(imageNode.id)!==null&&snapshotURL!==null&&snapshotURL!==""){imageSrc=addRandomQueryString(snapshotURL);imageNode.src=imageSrc;imageNode.onerror=function(){showTempImage(imageNode,tempImageURL)}}};function addRandomQueryString(URL){var addition="r="+Math.random()*1000;var alreadyHasQueryString=URL.indexOf("?");if(alreadyHasQueryString){return URL+"&"+addition}else{return URL+"?"+addition}}function getProfile(){var points=YAHOO.tool.Profiler.getFullReport()}function toggleEditor(id,state){var editorVisible=null;var ed=tinyMCE.get(id);if(typeof ed=="undefined"){if(KbApp1.getProperty("KbPostState")=="Edit"){tinyMCE.execCommand('mceAddControl',false,id);editorVisible=true}else{editorVisible=false}}else{ed.remove();editorVisible=false}if(state=="visible"&&editorVisible==false){tinyMCE.execCommand('mceAddControl',false,id)}if(state=="visible"){setTimeout(function(){tinyMCE.execCommand('mceFocus',false,id)},100)}}function toggleGrowthUnits(){YUE.onContentReady('weight_option',function(){initARC('weight_option','radio_on','radio_off','weight_pound','weight_kg');var inputEl=YUD.getElementsBy(testEl,'input',"weight_option")[0];var labelEl=YUD.getElementsBy(testEl,'label','weight_option')[0];if(PublicSelectedWeightFormat=="KG"){inputEl.checked=false;YUD.replaceClass(labelEl,labelEl.className,"weight_kg")}else{inputEl.checked=true;YUD.replaceClass(labelEl,labelEl.className,"weight_pound")}});YUE.onContentReady('height_option',function(){initARC('height_option','radio_on','radio_off','height_inch','height_cm');var inputEl=YUD.getElementsBy(testEl,'input',"height_option")[0];var labelEl=YUD.getElementsBy(testEl,'label','height_option')[0];if(PublicSelectedHeightFormat=="CM"){inputEl.checked=false;YUD.replaceClass(labelEl,labelEl.className,"height_cm")}else{inputEl.checked=true;YUD.replaceClass(labelEl,labelEl.className,"height_inch")}})}function FixIe6SelectBug(state){if(YAHOO.env.ua.ie!=6){return}var SelectEl=YUD.getElementsByClassName("form_row","div","EditChildInwin")[3];var Operation=(state=="hide")?"hidden":"visible";YUD.setStyle(SelectEl,"visibility",Operation)}var fixr;function initFixr(){if(typeof ScrollToTimeline!=="undefined"){fixr=new ScrollToTimeline();fixr.init()}}function onSubmitItem(bookId){Netcraft.KeePaBoo.Web.AjaxMethods.submitToShowcase(KbApp1.GetRefreshContext(),bookId,On_SubmitCallback)}function On_SubmitCallback(res){YUD.get('showcaseBoxWrapper').innerHTML=res.value}function fb_openInvite(){trackerEvent.fire("Invite_Facebook_Friends");window.open('fb_invite.aspx','','width=980,height=700,toolbar=no,scrollbars=no,menubar=no,right=100,top=100')}function onRegister(){try{NC_PanelManager.ShowPanelByID('RegistrationInwin');if(navigator.userAgent.indexOf('NT 6.0')>-1){setTimeout(function(){YUD.get('registerVistaNote').style.display="block"},3000)}return false}catch(x){if(x.message==='currEl is null'){setTimeout(onRegister,1000)}}}function onGetWidget(_return){if(_return){YUD.get('bookWidgetBox').innerHTML=YUD.get('bookWidgetKeeper').innerHTML}else{YUD.get('bookWidgetKeeper').innerHTML=YUD.get('bookWidgetBox').innerHTML;YUD.get('bookWidgetBox').innerHTML="<img style=\"padding-left:168px;padding-top:43px;\" src=\"http://www.keepaboo.com/images/widgetLoading.gif\"  />";var bookId=YUD.get('lifeBookId').value;KbApp1.setProperty("BookID",bookId,true);var shareType=3;Netcraft.KeePaBoo.Web.AjaxMethods.ShareOnFacebook(KbApp1.GetRefreshContext(),shareType,getTokenForWidget_callback)}}function getTokenForWidget_callback(res){tokenId=res.value;var widgetScript=YUD.get('bookWidgetHtmlText').innerHTML;while(widgetScript.indexOf('???widgetTokenId???')>0){widgetScript=widgetScript.replace('???widgetTokenId???',tokenId)}YUD.get('bookWidgetBox').innerHTML=widgetScript;YUD.get('widgetHtmlTextArea').focus();YUD.get('widgetHtmlTextArea').select()}function UserPermissionsObj(){this.isAllowed=function(type,value){var isAllowed;switch(type){case"SpecialIconsAllowed":var previousBg=KbApp1.getProperty("KbpostBackgroundID");KbApp1.setProperty("KbpostBackgroundID",value,true);isAllowed=Netcraft.KeePaBoo.Web.AjaxMethods.IsFeatureAllowed(KbApp1.GetRefreshContext(),3).value;if(!isAllowed){KbApp1.setProperty("KbpostBackgroundID",previousBg,true)}break;case"OffLineBook":isAllowed=Netcraft.KeePaBoo.Web.AjaxMethods.IsFeatureAllowed(KbApp1.GetRefreshContext(),2).value;break;case"LifeBookEditor":isAllowed=Netcraft.KeePaBoo.Web.AjaxMethods.IsFeatureAllowed(KbApp1.GetRefreshContext(),5).value;break;case"MaxCustomBook":isAllowed=Netcraft.KeePaBoo.Web.AjaxMethods.IsFeatureAllowed(KbApp1.GetRefreshContext(),4).value}return isAllowed}}var DownloadBookPollingTimeout;var MaxDownloadPollingTimeOut=50000;var PollingCounter=0;function activateDownloadBookPolling(){clearTimeout(DownloadBookPollingTimeout);var offLineBookURL=Netcraft.KeePaBoo.Web.AjaxMethods.IsOffLineBookReady(KbApp1.GetRefreshContext()).value;PollingCounter++;if(PollingCounter<(MaxDownloadPollingTimeOut/2000)){if(KbApp1.getProperty("KbpostType")==="Gallery"){if(offLineBookURL!=""){YUD.get("DownloadOfflineBook").href="SiteAPI/OfflineBookHandler.ashx?postId="+KbApp1.getProperty("KbPostID");YUD.removeClass("inwin_download","hide_download_button")}else{DownloadBookPollingTimeout=setTimeout(activateDownloadBookPolling,2000)}}else{if(offLineBookURL!=""){YUD.get("DownloadOfflineBook").href="SiteAPI/OfflineBookHandler.ashx?bookId="+KbApp1.getProperty("BookID");YUD.removeClass("inwin_download","hide_download_button")}else{DownloadBookPollingTimeout=setTimeout(activateDownloadBookPolling,2000)}}}else{var inwin_download=YUD.get("DownloadOfflineBook");var downloadWrap=inwin_download.parentNode;YUD.addClass(downloadWrap,"inwin_ft_err");downloadWrap.innerHTML="<span style=\"color:red\">Oops, problem has occured while processing your book. Please retry later</span>"}}function RefreshPrintData(){var orderDetailsArray=getOrderData();Netcraft.KeePaBoo.Web.AjaxMethods.GetPriceDetails(KbApp1.GetRefreshContext(),orderDetailsArray,RefreshPrintData_CallBack)}function getOrderData(){var quantity=YUD.get("select_quantity").value;var coupon="";if(YUD.get("couponBox")!==null){coupon=YUD.get("couponBox").value}var ShippingInputArr=YUD.get("deliveryType").getElementsByTagName("INPUT");var ShippingId;for(var i=0;i<ShippingInputArr.length;i++){if(ShippingInputArr[i].checked===true){ShippingId=ShippingInputArr[i].value;break}}return[1,quantity,ShippingId,coupon]}function RefreshPrintData_CallBack(args){var quantity=YUD.get("select_quantity").value;YUD.get("quantity_price").innerHTML=quantity+" X $ "+args.value[0];YUD.get("shipping_price").innerHTML="$ "+args.value[1];YUD.get("total_price").innerHTML="$ "+args.value[3];var bookPrice=YUD.getElementsByClassName('bookPrice')[3].innerHTML;if(bookPrice=='-1'){YUD.get('bookTitleRegion').innerHTML="<div style=\"font-size:14px;line-height:20px;margin-top:60px;margin:10px;color:red\"><b>Please note:</b> Your book contains more than 100 pages. Currently, we print books with up to 100 pages. You can easily reduce the number of pages by either editing this book using the book editor, or creating a new custom book based on it. Both options are available on the 'My Books' page. If you need any help with that, please <a href=\""+SiteRootURL+"contact.aspx\">contact us</a>, and we'll be glad to assist you.</div>"}}function SubmitToPayPal(){KbApp1.setProperty("KbPlaceholderID","payPalFormRegion");KbApp1.setProperty("ControlName","PayPalForm");KbApp1.setProperty("CustomParameters",getOrderData());var previousState=KbApp1.getProperty("KbPostState");KbApp1.setProperty("KbPostState","CreatePPFToken",false);Netcraft.KeePaBoo.Web.AjaxMethods.GetHtml(KbApp1.GetRefreshContext(),SubmitToPayPalCallBack);KbApp1.setProperty("CustomParameters",null);KbApp1.setProperty("KbPostState",previousState,false)}function SubmitToPayPalCallBack(resArray){var region=YUD.get("payPalFormRegion");region.innerHTML=resArray.value;var form=region.getElementsByTagName("FORM")[0];form.submit()}function SubmitToPayPalForRolePackage(){KbApp1.setProperty("KbPlaceholderID","payPalFormRegion");KbApp1.setProperty("ControlName","PayPalForm");KbApp1.setProperty("CustomParameters",[2,1]);var tempContext=KbApp1.GetRefreshContext();tempContext[3]="CreatePPFToken";Netcraft.KeePaBoo.Web.AjaxMethods.GetHtml(tempContext,SubmitToPayPalRoleCallBack);KbApp1.setProperty("CustomParameters",null)}function SubmitToPayPalRoleCallBack(resArray){var region=YUD.get("payPalFormRegion");region.innerHTML=resArray.value;var form=region.getElementsByTagName("FORM")[0];form.submit()}function setupLogo(){var masterlogo=YUD.get("masterlogo");if(!masterlogo||typeof masterlogo==="undefined"){return}if(window.location.href.indexOf('newmominc')>0||getCookie("kboologo")==="newmominc"){YUD.addClass("masterlogo","newmominc");YUD.get("masterlogo").href="http://www.newmominc.com";YUD.addClass("poweredbylogo","poweredbylogo");YUD.get("poweredbylogo").style.display="inline";document.cookie="kboologo=newmominc;expires=Fri, 31-Dec-2010 23:59:59 GMT"}else{YUD.addClass("masterlogo","logo");document.cookie="kboologo=keepaboo;expires=Fri, 31-Dec-2010 23:59:59 GMT"}YUD.get("masterlogo").style.display="inline"}function getCookie(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length}return unescape(document.cookie.substring(c_start,c_end))}}return""}function regChildFormOnNextTo2(toStep2){YUD.get('noMailsMessageOnSendInvitation').style.display='none';if(toStep2){if(CheckDropDowns()){YUD.get('regChildStep1').style.display='none';YUD.get('regChildStep2').style.display='block'}}else{YUD.get('regChildStep1').style.display='block';YUD.get('regChildStep2').style.display='none'}}function regChildOnToStep3(){YUD.get('regChildStep1').style.display='none';YUD.get('regChildStep2').style.display='none';YUD.get('regChildStep3').style.display='block'}function closeRegChildForm(){regChildFormOnNextTo2(false);NC_PanelManager.HideActivePanel()}var SStimer;var SSindex=1;var isFirstTimePlay=true;var SSinterval=9000;var SSmode='play';function SSimageLoaded(){if(SSLoadedImagesCounter<2){SSLoadedImagesCounter++;return}else{SSImagesAreLoaded=true}}function startBookshow(){if(SSbookShowStarted){return}SSbookShowStarted=true;var comboSSimg1=new Image();comboSSimg1.onLoad=SSimageLoaded();comboSSimg1.src=SiteRootURL+"images/bookshow/1.jpg";var comboSSimg2=new Image();comboSSimg2.onLoad=SSimageLoaded();comboSSimg2.src=SiteRootURL+"images/bookshow/2.jpg";var comboSSimg3=new Image();comboSSimg3.onLoad=SSimageLoaded();comboSSimg3.src=SiteRootURL+"images/bookshow/3.jpg";var comboSSimg4=new Image();comboSSimg4.onLoad=SSimageLoaded();comboSSimg4.src=SiteRootURL+"images/bookshow/4.jpg";SSmode='play';SStimer=setTimeout(SSanimate,SSinterval)}function SSanimate(){if(SSmode=='paused'){return}switch(SSindex){case 1:if(isFirstTimePlay){animateSShow('homeSS1','homeSS2');isFirstTimePlay=false}break;case 2:animateSShow('homeSS2','homeSS3');break;case 3:animateSShow('homeSS3','homeSS4');break;case 4:animateSShow('homeSS4','homeSS1');break}if(SSindex==4){SSindex=1}else{SSindex++}}function animateSShow(imgOldId,imgNewId){if(SSImagesAreLoaded){slideshow=new Animator({transition:Animator.linear,duration:800});slideshow.addSubject(new NumericalStyleSubject(document.getElementById(imgNewId),'opacity',0,1)).addSubject(new NumericalStyleSubject(document.getElementById(imgOldId),'opacity',1,0));slideshow.play()}setTimeout(SSanimate,SSinterval)}if(typeof(AjaxPro)!='undefined'){AjaxPro.timeoutPeriod=30*1000}SlidePanel=function(){var self=this,closedObj,openObj,forgotPassEl,loginClientErrorEl,submitFunction,isHidden=true,hasError=false;function ClosedObj(closedElementId){var self=this,element=YUD.get(closedElementId),showAnim=new YAHOO.util.Anim(element,{height:{to:62}},0.25,YAHOO.util.Easing.easeOut),hideAnim=new YAHOO.util.Anim(element,{height:{to:0}},0.25,YAHOO.util.Easing.easeOut);this.show=function(){showAnim.animate()};this.hide=function(){hideAnim.animate()}}function OpenObj(openElementId,openElementHeight,forgotPassHeight,errorHeight){var self=this,element=YUD.get(openElementId),hideAnim=new YAHOO.util.Anim(element,{height:{to:0}},0.25,YAHOO.util.Easing.easeOut),showForgotAnim=new YAHOO.util.Anim(element,{height:{by:forgotPassHeight}},0.25,YAHOO.util.Easing.easeOut),hideForgotAnim=new YAHOO.util.Anim(element,{height:{by:-forgotPassHeight}},0.25,YAHOO.util.Easing.easeOut),isForgotHidden=true;this.show=function(){var height=(hasError)?openElementHeight+errorHeight:openElementHeight;showAnim=new YAHOO.util.Anim(element,{height:{to:height}},0.25,YAHOO.util.Easing.easeOut);showAnim.animate()};this.hide=function(){hideAnim.animate();isForgotHidden=true};this.toggleForgotEl=function(){if(isForgotHidden){showForgotAnim.animate();isForgotHidden=false}else{hideForgotAnim.animate();isForgotHidden=true}};this.addHeight=function(addedHeight){var currentHeight=YUD.getStyle(element,"height");var newHeight=parseInt(currentHeight,10)+addedHeight;YUD.setStyle(element,"height",newHeight+"px")};this.subtractHeight=function(addedHeight){var currentHeight=YUD.getStyle(element,"height");var newHeight=parseInt(currentHeight,10)-addedHeight;YUD.setStyle(element,"height",newHeight+"px")}}this.init=function(cfg){closedObj=new ClosedObj(cfg.closedElId);openObj=new OpenObj(cfg.openElId,cfg.openElHeight,cfg.forgotElHeight,cfg.loginPostbackErrorElHeight);forgotPassEl=YUD.get(cfg.forgotElId);loginClientErrorEl=YUD.get(cfg.loginClientErrorElId);};this.toggle=function(){if(isHidden){this.show()}else{this.hide()}};this.toggleForgotEl=function(){openObj.toggleForgotEl()};this.hide=function(){closedObj.show();openObj.hide();self.removeForgotPassFeedback();isHidden=true};this.show=function(){closedObj.hide();openObj.show();isHidden=false};this.onLoginErrorHandler=function(){hasError=true;self.show()};this.setForgotPassFeedback=function(isSuccessful,message){forgotPassEl.className=(isSuccessful=="true")?"success":"error";forgotPassEl.innerHTML=message};this.removeForgotPassFeedback=function(){forgotPassEl.innerHTML=""};this.onLogin=function(){hideLoginClientError();var timeout=setTimeout(function(){showLoginClientError()},50)};this.login=function(){submitFunction.call()};var showLoginClientError=function(){var display=YUD.getStyle(loginClientErrorEl,"display");if(display=="block"){var addedHeight=loginClientErrorEl.offsetHeight;openObj.addHeight(addedHeight)}};var hideLoginClientError=function(){var display=YUD.getStyle(loginClientErrorEl,"display");if(display=="block"){var addedHeight=loginClientErrorEl.offsetHeight;openObj.subtractHeight(addedHeight)}YUD.setStyle(loginClientErrorEl,"display","none")}};var slideMenu=function(){var sp,st,t,m,sa,l,w,sw,ot;return{build:function(sm,sw,mt,s,sl,h){sp=s;st=sw;t=mt;m=document.getElementById(sm);sa=m.getElementsByTagName('li');l=sa.length;w=m.offsetWidth;sw=w/l;ot=Math.floor((w-st)/(l-1));var i=0;for(i;i<l;i++){s=sa[i];s.style.width=sw+'px';this.timer(s)}if(sl!=null){m.timer=setInterval(function(){slideMenu.slide(sa[sl-1])},t)}},timer:function(s){s.onclick=function(){clearInterval(m.timer);m.timer=setInterval(function(){slideMenu.slide(s)},t)}},slide:function(s){var cw=parseInt(s.style.width,'10');if(cw<st){var owt=0;var i=0;for(i;i<l;i++){if(sa[i]!=s){var o,ow;var oi=0;o=sa[i];ow=parseInt(o.style.width,'10');if(ow>ot){oi=Math.floor((ow-ot)/sp);oi=(oi>0)?oi:1;o.style.width=(ow-oi)+'px'}owt=owt+(ow-oi)}}s.style.width=(w-owt)+'px'}else{clearInterval(m.timer)}}}}();ot_d=document;ot_b="http"+(ot_d.URL.indexOf('https:')==0?'s://':'://')+'s14.opentracker.net';ot_t2=escape(ot_d.title);ot_ti=ot_t2;if(ot_t2.indexOf('%u')!=-1){ot_ti=escape(ot_t2)}ot_cd=(new Date("December 31, 2023")).toGMTString();ot_cld=new Date();ot_fv=false;ot_ac=false;try{if(typeof(top.document)=="object"){ot_r=top.document}else{ot_r=ot_d}}catch(ex){ot_r=ot_d}if(ot_d.referrer.indexOf(ot_r.location.hostname)==-1){ot_r=ot_d}if(ot_d.cookie.indexOf('machine-id')!=-1){ot_ac=true}else{if(ot_d.cookie.indexOf('machine-id')==-1){f_sc("machine-id",guid(),ot_cd,"/")}if(ot_d.cookie.indexOf('machine-id')!=-1){ot_ac=true}}ot_rc=f_rc("machine-id");ot_lc=escape(ot_d.location);function S4(){return(((1+Math.random())*0x10000)|0).toString(16).substring(1)}function guid(){n=new Date();et=n.getTime();return(et+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4())}function f_log(pageId){ot_im=new Image(1,1);ot_im.src=ot_b+'/collect.jsp?p=1&mid='+ot_rc+'&fv='+ot_fv+'&cld='+escape(ot_cld)+'&sh='+screen.height+'&sw='+screen.width+'&sc='+screen.colorDepth+'&lc='+ot_lc+'&ref='+escape(ot_r.referrer)+'&t0='+ot_t0+'&ti='+pageId+'&si=keepaboo.com'}function f_sc(n,v,h,p,d,s){ot_fv=true;ot_d.cookie=n+'='+escape(v)+((h)?(';expires='+h):'')+((p)?';path='+p:'')+((d)?';domain='+d:'')+((s&&(s==true))?'; secure':'')}function f_rc(n){if(ot_d.cookie==''){return false}else{var fc,ot_lc;var tbc=ot_d.cookie;fc=tbc.indexOf(n);var NN2Hack=fc+n.length;if((fc!=-1)&&(tbc.charAt(NN2Hack)=='=')){fc+=n.length+1;ot_lc=tbc.indexOf(';',fc);if(ot_lc==-1){ot_lc=tbc.length}return unescape(tbc.substring(fc,ot_lc))}else{return false}}}function ot_f(){e=event.srcElement;ep=e.parentElement;if(ep==null){return}if(ep.tagName=="A"||ep.tagName=="AREA"){e=ep}else{if(ep.parentElement){epp=ep.parentElement;if(epp.tagName=="A"||epp.tagName=="AREA"){e=epp}}}isA=(e.tagName=="A"||e.tagName=="AREA")?1:0;isL=(isA&&e.href)?1:0;if(!isL){return}ot_i=e.href.indexOf(ot_d.domain);if((ot_i<9&&ot_i!=-1)||e.href.indexOf("/")==1){return}ot_im=new Image(1,1);ot_im.src=ot_b+'/collect_.jsp?p=3&mid='+ot_rc+'&t0='+ot_t0+'&ms='+escape(e.href)+'&lc='+ot_lc+'&ti='+ot_ti+'&si=keepaboo.com'}function _j(ms){n=new Date();et=n.getTime()+ms;while(true){n=new Date();if(n.getTime()>et){return}}}function _bye(){if(navigator.userAgent.toLowerCase().indexOf('safari')!=-1){return}ot_im=new Image(1,1);ot_im.src=ot_b+'/collect_.jsp?p=2&mid='+ot_rc+'&t0='+ot_t0+'&ms=gone&lc='+ot_lc+'&ti='+ot_ti+'&si=keepaboo.com';_j(250)}function ot_e(ot_m,ot_u,ot_n){return true}if(ot_d.getElementById&&ot_d.createElement){if(window.attachEvent){window.attachEvent("onunload",_bye);ot_d.attachEvent("onclick",ot_f)}}trackerEvent.subscribe(function(event,vars){if(ot_lc.toLowerCase().indexOf('siteapi')==-1){ot_lc="http://www.keepaboo.com/"+vars[0]}if(ot_lc.indexOf('refisfacebook')>-1){ot_ti="facebook-user-visit";ot_lc=encodeURIComponent(ot_d.referrer)}else{ot_ti=vars[0]}n=new Date();et=n.getTime();ot_t0=et;delay=5000;if(vars[1]){delay=0}var pageId=ot_ti;setTimeout(function(){f_log(pageId)},delay)});function Animator(options){this.setOptions(options);var _this=this;this.timerDelegate=function(){_this.onTimerEvent()};this.subjects=[];this.target=0;this.state=0;this.lastTime=null}Animator.prototype={setOptions:function(options){this.options=Animator.applyDefaults({interval:20,duration:400,onComplete:function(){},onStep:function(){},transition:Animator.tx.easeInOut},options)},seekTo:function(to){this.seekFromTo(this.state,to)},seekFromTo:function(from,to){this.target=Math.max(0,Math.min(1,to));this.state=Math.max(0,Math.min(1,from));this.lastTime=new Date().getTime();if(!this.intervalId){this.intervalId=window.setInterval(this.timerDelegate,this.options.interval)}},jumpTo:function(to){this.target=this.state=Math.max(0,Math.min(1,to));this.propagate()},toggle:function(){this.seekTo(1-this.target)},addSubject:function(subject){this.subjects[this.subjects.length]=subject;return this},clearSubjects:function(){this.subjects=[]},propagate:function(){var value=this.options.transition(this.state);for(var i=0;i<this.subjects.length;i++){if(this.subjects[i].setState){this.subjects[i].setState(value)}else{this.subjects[i](value)}}},onTimerEvent:function(){var now=new Date().getTime();var timePassed=now-this.lastTime;this.lastTime=now;var movement=(timePassed/this.options.duration)*(this.state<this.target?1:-1);if(Math.abs(movement)>=Math.abs(this.state-this.target)){this.state=this.target}else{this.state+=movement}try{this.propagate()}finally{this.options.onStep.call(this);if(this.target==this.state){window.clearInterval(this.intervalId);this.intervalId=null;this.options.onComplete.call(this)}}},play:function(){this.seekFromTo(0,1)},reverse:function(){this.seekFromTo(1,0)},inspect:function(){var str="#<Animator:\n";for(var i=0;i<this.subjects.length;i++){str+=this.subjects[i].inspect()}str+=">";return str}};Animator.applyDefaults=function(defaults,prefs){prefs=prefs||{};var prop,result={};for(prop in defaults){result[prop]=prefs[prop]!==undefined?prefs[prop]:defaults[prop]}return result};Animator.makeArray=function(o){if(o===null){return[]}if(!o.length){return[o]}var result=[];for(var i=0;i<o.length;i++){result[i]=o[i]}return result};Animator.camelize=function(string){var oStringList=string.split('-');if(oStringList.length===1){return oStringList[0]}var camelizedString=string.indexOf('-')===0?oStringList[0].charAt(0).toUpperCase()+oStringList[0].substring(1):oStringList[0];for(var i=1,len=oStringList.length;i<len;i++){var s=oStringList[i];camelizedString+=s.charAt(0).toUpperCase()+s.substring(1)}return camelizedString};Animator.apply=function(el,style,options){if(style instanceof Array){return new Animator(options).addSubject(new CSSStyleSubject(el,style[0],style[1]))}return new Animator(options).addSubject(new CSSStyleSubject(el,style))};Animator.makeEaseIn=function(a){return function(state){return Math.pow(state,a*2)}};Animator.makeEaseOut=function(a){return function(state){return 1-Math.pow(1-state,a*2)}};Animator.makeElastic=function(bounces){return function(state){state=Animator.tx.easeInOut(state);return((1-Math.cos(state*Math.PI*bounces))*(1-state))+state}};Animator.makeADSR=function(attackEnd,decayEnd,sustainEnd,sustainLevel){if(sustainLevel===null){sustainLevel=0.5}return function(state){if(state<attackEnd){return state/attackEnd}if(state<decayEnd){return 1-((state-attackEnd)/(decayEnd-attackEnd)*(1-sustainLevel))}if(state<sustainEnd){return sustainLevel}return sustainLevel*(1-((state-sustainEnd)/(1-sustainEnd)))}};Animator.makeBounce=function(bounces){var fn=Animator.makeElastic(bounces);return function(state){state=fn(state);return state<=1?state:2-state}};Animator.tx={easeInOut:function(pos){return((-Math.cos(pos*Math.PI)/2)+0.5)},linear:function(x){return x},easeIn:Animator.makeEaseIn(1.5),easeOut:Animator.makeEaseOut(1.5),strongEaseIn:Animator.makeEaseIn(2.5),strongEaseOut:Animator.makeEaseOut(2.5),elastic:Animator.makeElastic(1),veryElastic:Animator.makeElastic(3),bouncy:Animator.makeBounce(1),veryBouncy:Animator.makeBounce(3)};function NumericalStyleSubject(els,property,from,to,units){this.els=Animator.makeArray(els);if(property=='opacity'&&window.ActiveXObject){this.property='filter'}else{this.property=Animator.camelize(property)}this.from=parseFloat(from);this.to=parseFloat(to);this.units=units!==null?units:'px'}NumericalStyleSubject.prototype={setState:function(state){var style=this.getStyle(state);var visibility=(this.property==='opacity'&&state===0)?'hidden':'';var j=0;for(var i=0;i<this.els.length;i++){try{this.els[i].style[this.property]=style}catch(e){if(this.property!='fontWeight'){throw e}}if(j++>20){return}}},getStyle:function(state){state=this.from+((this.to-this.from)*state);if(this.property=='filter'){return"alpha(opacity="+Math.round(state*100)+")"}if(this.property=='opacity'){return state}return Math.round(state)+this.units},inspect:function(){return"\t"+this.property+"("+this.from+this.units+" to "+this.to+this.units+")\n"}};function ColorStyleSubject(els,property,from,to){this.els=Animator.makeArray(els);this.property=Animator.camelize(property);this.to=this.expandColor(to);this.from=this.expandColor(from);this.origFrom=from;this.origTo=to}ColorStyleSubject.prototype={expandColor:function(color){var hexColor,red,green,blue;hexColor=ColorStyleSubject.parseColor(color);if(hexColor){red=parseInt(hexColor.slice(1,3),16);green=parseInt(hexColor.slice(3,5),16);blue=parseInt(hexColor.slice(5,7),16);return[red,green,blue]}if(window.DEBUG){alert("Invalid colour: '"+color+"'")}},getValueForState:function(color,state){return Math.round(this.from[color]+((this.to[color]-this.from[color])*state))},setState:function(state){var color='#'+ColorStyleSubject.toColorPart(this.getValueForState(0,state))+ColorStyleSubject.toColorPart(this.getValueForState(1,state))+ColorStyleSubject.toColorPart(this.getValueForState(2,state));for(var i=0;i<this.els.length;i++){this.els[i].style[this.property]=color}},inspect:function(){return"\t"+this.property+"("+this.origFrom+" to "+this.origTo+")\n"}};ColorStyleSubject.parseColor=function(string){var color='#',match;if(match===ColorStyleSubject.parseColor.rgbRe.exec(string)){var part;for(var i=1;i<=3;i++){part=Math.max(0,Math.min(255,parseInt(match[i])));color+=ColorStyleSubject.toColorPart(part)}return color}if(match===ColorStyleSubject.parseColor.hexRe.exec(string)){if(match[1].length==3){for(i=0;i<3;i++){color+=match[1].charAt(i)+match[1].charAt(i)}return color}return'#'+match[1]}return false};ColorStyleSubject.toColorPart=function(number){if(number>255){number=255}var digits=number.toString(16);if(number<16){return'0'+digits}return digits};ColorStyleSubject.parseColor.rgbRe=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i;ColorStyleSubject.parseColor.hexRe=/^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function DiscreteStyleSubject(els,property,from,to,threshold){this.els=Animator.makeArray(els);this.property=Animator.camelize(property);this.from=from;this.to=to;this.threshold=threshold||0.5}DiscreteStyleSubject.prototype={setState:function(state){var j=0;for(var i=0;i<this.els.length;i++){this.els[i].style[this.property]=state<=this.threshold?this.from:this.to}},inspect:function(){return"\t"+this.property+"("+this.from+" to "+this.to+" @ "+this.threshold+")\n"}};function CSSStyleSubject(els,style1,style2){els=Animator.makeArray(els);this.subjects=[];if(els.length===0){return}var prop,toStyle,fromStyle;if(style2){fromStyle=this.parseStyle(style1,els[0]);toStyle=this.parseStyle(style2,els[0])}else{toStyle=this.parseStyle(style1,els[0]);fromStyle={};for(prop in toStyle){fromStyle[prop]=CSSStyleSubject.getStyle(els[0],prop)}}for(prop in fromStyle){if(fromStyle[prop]==toStyle[prop]){delete fromStyle[prop];delete toStyle[prop]}}var units,match,type,from,to;for(prop in fromStyle){var fromProp=String(fromStyle[prop]);var toProp=String(toStyle[prop]);if(toStyle[prop]===null){if(window.DEBUG){alert("No to style provided for '"+prop+'"')}continue}if(from===ColorStyleSubject.parseColor(fromProp)){to=ColorStyleSubject.parseColor(toProp);type=ColorStyleSubject}else if(fromProp.match(CSSStyleSubject.numericalRe)&&toProp.match(CSSStyleSubject.numericalRe)){from=parseFloat(fromProp);to=parseFloat(toProp);type=NumericalStyleSubject;match=CSSStyleSubject.numericalRe.exec(fromProp);var reResult=CSSStyleSubject.numericalRe.exec(toProp);if(match[1]!==null){units=match[1]}else if(reResult[1]!==null){units=reResult[1]}else{units=reResult}}else if(fromProp.match(CSSStyleSubject.discreteRe)&&toProp.match(CSSStyleSubject.discreteRe)){from=fromProp;to=toProp;type=DiscreteStyleSubject;units=0;}else{if(window.DEBUG){alert("Unrecognised format for value of "+prop+": '"+fromStyle[prop]+"'")}continue}this.subjects[this.subjects.length]=new type(els,prop,from,to,units)}}CSSStyleSubject.prototype={parseStyle:function(style,el){var rtn={};if(style.indexOf(":")!=-1){var styles=style.split(";");for(var i=0;i<styles.length;i++){var parts=CSSStyleSubject.ruleRe.exec(styles[i]);if(parts){rtn[parts[1]]=parts[2]}}}else{var prop,value,oldClass;oldClass=el.className;el.className=style;for(i=0;i<CSSStyleSubject.cssProperties.length;i++){prop=CSSStyleSubject.cssProperties[i];value=CSSStyleSubject.getStyle(el,prop);if(value!==null){rtn[prop]=value}}el.className=oldClass}return rtn},setState:function(state){for(var i=0;i<this.subjects.length;i++){this.subjects[i].setState(state)}},inspect:function(){var str="";for(var i=0;i<this.subjects.length;i++){str+=this.subjects[i].inspect()}return str}};CSSStyleSubject.getStyle=function(el,property){var style;if(document.defaultView&&document.defaultView.getComputedStyle){style=document.defaultView.getComputedStyle(el,"").getPropertyValue(property);if(style){return style}}property=Animator.camelize(property);if(el.currentStyle){style=el.currentStyle[property]}return style||el.style[property]};CSSStyleSubject.ruleRe=/^\s*([a-zA-Z\-]+)\s*:\s*(\S(.+\S)?)\s*$/;CSSStyleSubject.numericalRe=/^-?\d+(?:\.\d+)?(%|[a-zA-Z]{2})?$/;CSSStyleSubject.discreteRe=/^\w+$/;CSSStyleSubject.cssProperties=['azimuth','background','background-attachment','background-color','background-image','background-position','background-repeat','border-collapse','border-color','border-spacing','border-style','border-top','border-top-color','border-right-color','border-bottom-color','border-left-color','border-top-style','border-right-style','border-bottom-style','border-left-style','border-top-width','border-right-width','border-bottom-width','border-left-width','border-width','bottom','clear','clip','color','content','cursor','direction','display','elevation','empty-cells','css-float','font','font-family','font-size','font-size-adjust','font-stretch','font-style','font-variant','font-weight','height','left','letter-spacing','line-height','list-style','list-style-image','list-style-position','list-style-type','margin','margin-top','margin-right','margin-bottom','margin-left','max-height','max-width','min-height','min-width','orphans','outline','outline-color','outline-style','outline-width','overflow','padding','padding-top','padding-right','padding-bottom','padding-left','pause','position','right','size','table-layout','text-align','text-decoration','text-indent','text-shadow','text-transform','top','vertical-align','visibility','white-space','width','word-spacing','z-index','opacity','outline-offset','overflow-x','overflow-y'];function AnimatorChain(animators,options){this.animators=animators;this.setOptions(options);for(var i=0;i<this.animators.length;i++){this.listenTo(this.animators[i])}this.forwards=false;this.current=0}AnimatorChain.prototype={setOptions:function(options){this.options=Animator.applyDefaults({resetOnPlay:true},options)},play:function(){this.forwards=true;this.current=-1;if(this.options.resetOnPlay){for(var i=0;i<this.animators.length;i++){this.animators[i].jumpTo(0)}}this.advance()},reverse:function(){this.forwards=false;this.current=this.animators.length;if(this.options.resetOnPlay){for(var i=0;i<this.animators.length;i++){this.animators[i].jumpTo(1)}}this.advance()},toggle:function(){if(this.forwards){this.seekTo(0)}else{this.seekTo(1)}},listenTo:function(animator){var oldOnComplete=animator.options.onComplete;var _this=this;animator.options.onComplete=function(){if(oldOnComplete){oldOnComplete.call(animator)}_this.advance()}},advance:function(){if(this.forwards){if(this.animators[this.current+1]===null){return}this.current++;this.animators[this.current].play()}else{if(this.animators[this.current-1]===null){return}this.current--;this.animators[this.current].reverse()}},seekTo:function(target){if(target<=0){this.forwards=false;this.animators[this.current].seekTo(0)}else{this.forwards=true;this.animators[this.current].seekTo(1)}}};function Accordion(options){this.setOptions(options);var selected=this.options.initialSection,current;if(this.options.rememberance){current=document.location.hash.substring(1)}this.rememberanceTexts=[];this.ans=[];var _this=this;for(var i=0;i<this.options.sections.length;i++){var el=this.options.sections[i];var an=new Animator(this.options.animatorOptions);var from=this.options.from+(this.options.shift*i);var to=this.options.to+(this.options.shift*i);an.addSubject(new NumericalStyleSubject(el,this.options.property,from,to,this.options.units));an.jumpTo(0);var activator=this.options.getActivator(el);activator.index=i;activator.onclick=function(){_this.show(this.index)};this.ans[this.ans.length]=an;this.rememberanceTexts[i]=activator.innerHTML.replace(/\s/g,"");if(this.rememberanceTexts[i]===current){selected=i}}this.show(selected)}Accordion.prototype={setOptions:function(options){this.options=Object.extend({sections:null,getActivator:function(el){return document.getElementById(el.getAttribute("activator"))},shift:0,initialSection:0,rememberance:true,animatorOptions:{}},options||{})},show:function(section){for(var i=0;i<this.ans.length;i++){this.ans[i].seekTo(i>section?1:0)}if(this.options.rememberance){document.location.hash=this.rememberanceTexts[section]}}};