var winVidChild;var theLoader=new Image();theLoader.src="../adminimages/loading.gif";var winHelpChild;var blnShowOrNot;var helpContext;var timerID;var intrnlNav=false;function postToPartner(a,b,c){if(document.location.href.indexOf("affiliatescripts")!=-1){alert("Sorry, the form cannot be used from here.\n\nUse the Template button in the Content Editor to enter and review the form in a page.");return false;}if((b!=null)&&(!isValidForm(b,c))){return false;}var d=document.forms[0];var e=d.elements;var f=e.length;for(var x=f-1;x>-1;x--){var g00=e[x];if(g00.type=="hidden"){if((g00.id.substring(0,8)!="__SCROLL")&&((g00.id.substring(0,2)=="__")||(g00.id.substring(0,2)=="ct")||(g00.id.substring(0,2)=="VM"))){g00.parentNode.removeChild(g00);}}}d.encoding="application/x-www-form-urlencoded";if(a=="AWeber"){d.action="http://www.aweber.com/scripts/addlead.pl";}else if(a=="ConstantContact"){d.target="_blank";d.action="http://visitor.constantcontact.com/d.jsp";}else if(a=="GetResponse"){d.target="_blank";d.action="http://www.getresponse.com/cgi-bin/add.cgi";}return true;}function isValidForm(a,b){var c=a.length;for(x=0;x<c;x++){if(gE(a[x]).value==""){if(b!=null){alert(b);}else{alert("One or more of the required values is missing");}return false;}}return true;}function showSubscribedMessage(a,b){if((gE(a).value.indexOf("?sub=1")==-1)&&(gE(a).value.indexOf("&sub=1")==-1)){var c=document.location.href;if(c.indexOf("?")==-1){gE(a).value=c+"?sub=1";}else{gE(a).value=c+"&sub=1";}return;}else{gE(b).style.display="block";}}function setLogin(a,b,c){gE(b).value=a;if(a=="test"){gE(b).value="Test100";gE(c).value="Testing?";return;}var d="?";if(a==""){d="";}gE(c).value=a+d;}function returnFalse(){if((typeof document.all!="undefined")&&(event!=null)){event.returnValue=false;}return false;}function getViewer(a){var b="alwaysRaised=yes,dependent=no,width=1012,height=683,directories=no,hotkeys=yes,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=no";winVidChild=window.open("viewer.aspx?vid="+a,"winVidChild",b);winVidChild.focus();}function showModal(a,b,c,d,e,f,g00,h){var i=$find(getPopElm_vb("mpeOCT"));i._backgroundElement.style.left="0px";i._backgroundElement.style.top="0px";i.show();gE("modalError").innerHTML="";gE("modalError").style.display="none";gE("modalPrompt").style.display="block";gE("modalPrompt").innerHTML=a;if(b){gE("modalName").style.display="block";gE(getPopElm_vb("txtOCTName")).value=c;gE(getPopElm_vb("txtOCTName")).focus();}var j=gE(getPopElm_vb("btnOCTYes"));j.value=g00;j.onclick=e;if(d){var k=gE(getPopElm_vb("btnOCTNo"));k.style.display="inline";k.value=h;k.onclick=f;}return false;}function clearModal(){var a=$find(getPopElm_vb("mpeOCT"));a.hide();}function checkSearch(){if(gE("txtSearch").value==""){alert("please enter a search term...");return false;}return true;}function showSearch(){var a=gE("search_results");if(a.style.display=="none"){a.style.display="block";gE("hidExpand").value="block";}else{a.style.display="none";gE("hidExpand").value="none";}}function showUpdating(){if((typeof Page_IsValid!='undefined')&&(!Page_IsValid)){return false;}if((typeof $find!='undefined')&&(typeof getPopElm_vb!='undefined')){var a=$find(getPopElm_vb("mpeUpdate"));if((a!=null)&&(a._backgroundElement.style.display=="none")){a._backgroundElement.style.left="0px";a._backgroundElement.style.top="0px";a.show();}}return true;}function clearUpdate(){if($find(getPopElm_vb("mpeUpdate"))){var a=$find(getPopElm_vb("mpeUpdate"));if(a._backgroundElement.style.display!="none"){a.hide();}}intrnlNav=false;}function showAdminHelp(a){gE("hidTopID").value=a;gE("btnRenewHelp").click();}function gE(a){return document.getElementById(a);}function getRoot(){var a=document.location.toString();a=a.replace("http://","");var b="";if(a.indexOf("www.")!=-1){a=a.replace("www.","");b="www.";}var c=new Array();c=a.split("/");var d;if(c[0]=="localhost"){d="/"+c[1];}else{d="http://"+b+c[0];}return d;}function posScroll(a,b){var c=a.length;for(var x=0;x<c;x++){if(gE(b[x])){var d=gE(b[x]).value.split("|");var e=gE(a[x]);e.scrollTop=d[0];e.scrollLeft=d[1];}}}function dsbleBtn(a){var b=a.cloneNode(false);b.disabled=true;a.parentNode.appendChild(b);a.style.display="none";return true;}function positionMessageCenter(a,b){if(typeof getMessElm_vb!="undefined"){var c=gE(getMessElm_vb("message_center"));if(c){var d=gE(getMessElm_vb("lblMessage")).innerHTML;gE(getMessElm_vb("lblMessage")).innerHTML=a+d;if((b)||((gE(getMessElm_vb("hidStatus")))&&(gE(getMessElm_vb("hidStatus")).value=="show"))){c.style.left="-2000px";c.style.display="block";var e=gE(getMessView_vb("mess_viewer"));var f=getPosition(e);c.style.top=(f[1]+e.offsetHeight)+"px";c.style.left=((f[0]+e.offsetWidth)-(c.offsetWidth))+"px";}}}}function showMessageCenter(){this.top;this.left;this.showCenter=function(){var a=gE(getMessElm_vb("message_center"));var b=this.top;var c=this.left;a.style.display="block";a.style.top=b.toString()+"px";a.style.left=(c-a.offsetWidth).toString()+"px";};return;}function showHideMessage(a){if(gE(getMessElm_vb("message_center")).style.display!="block"){newMessageCenter=new showMessageCenter();var b=(window.scrollY)? window.scrollY : document.documentElement.scrollTop;var c=(window.scrollX)? window.scrollX : document.documentElement.scrollLeft;newMessageCenter.top=a.clientY+b;newMessageCenter.left=a.clientX+c;newMessageCenter.showCenter();}}function closeMessageCenter(){gE(getMessElm_vb("message_center")).style.display='none';}function getPosition(a){var b=0;var c=0;while(a!=null){b+=a.offsetLeft;c+=a.offsetTop;a=a.offsetParent;}var d=(window.scrollY)? window.scrollY : document.documentElement.scrollTop;var e=(window.scrollX)? window.scrollX : document.documentElement.scrollLeft;return [b+e,c+d];}function getItemPosition(a,b){var c=0;var d=0;if(b){while(a!=null){c+=a.offsetLeft;d+=a.offsetTop;a=a.offsetParent;}}else{while((a!=null)&&(a.id!="div_menu")){c+=a.offsetLeft;d+=a.offsetTop;a=a.offsetParent;}}return [c,d];}function stopFlickr(){try{document.execCommand("BackgroundImageCache",false,true);}catch(err){}}function addPageLoadFunction(a){if(typeof window.addEventListener!='undefined'){window.addEventListener('load',a,false);}else if(typeof document.addEventListener!='undefined'){document.addEventListener('load',a,false);}else if(typeof window.attachEvent!='undefined'){window.attachEvent('onload',a);}else{var b=window.onload;if(typeof window.onload!='function'){window.onload=anyFunction;}else{window.onload=function(){b();a();};}}}function attachEventListener(a,b,c,d){if(typeof a.addEventListener!="undefined"){a.addEventListener(b,c,d);}else if(typeof a.attachEvent!="undefined"){a.attachEvent("on"+b,c);}else{b="on"+b;if(typeof a[b]=="function"){var e=a[b];a[b]=function(){e();return c();};}else{a[b]=c;}}return true;}function detachEventListener(a,b,c,d){if(typeof a.removeEventListener!="undefined"){a.removeEventListener(b,c,d);}else if(typeof a.detachEvent!="undefined"){a.detachEvent("on"+b,c);}else{a["on"+b]=null;}return true;}function getEventTarget(a){var b=null;if(typeof a.target!="undefined"){b=a.target;}else{b=a.srcElement;}while((b.nodeType==3)&&(b.parentNode!=null)){b=b.parentNode;}return b;}function stopDefaultAction(a){a.returnValue=false;if(typeof a.preventDefault!="undefined"){a.preventDefault();}return true;}function getScrollingPosition(){var a=[0,0];if(typeof window.pageYOffset!='undefined'){a=[window.pageXOffset,window.pageYOffset];}if((typeof document.documentElement.scrollTop!='undefined')&&(document.documentElement.scrollTop>0)){a=[document.documentElement.scrollLeft,document.documentElement.scrollTop];}else if(typeof document.body.scrollTop!='undefined'){a=[document.body.scrollLeft,document.body.scrollTop];}return a;}function getHelp(a){var b=getRoot();if(b.indexOf("levelhorizondev")!=-1){b="http://www.help.levelhorizon.co.uk/helpconsole/adminhelp.aspx?topid="+a;}else{var c;if(typeof getMessElm_vb!='undefined'){c=gE(getMessElm_vb("hidParentDomain")).value;}else if(gE("hidParentDomain")){c=gE("hidParentDomain").value;}else{alert("The function 'getHelp' does not have access to the help files URL.");return;}b="http://www.help."+c+"/helpconsole/adminhelp.aspx?topid="+a;}var d="alwaysRaised=yes,dependent=no,width=750,height=600,directories=yes,hotkeys=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes";winHelpChild=window.open(b,"winHelpChild",d);winHelpChild.focus();return returnFalse();}function showContext(){this.top;this.left;this.cat;this.pos;this.prompt;this.getContextHelp=function(){if(blnShowOrNot){var a=this.top;var b=this.left;var c=this.cat;var d=this.pos;var e=this.prompt;switch(d){case "btmcntr":a=a+15;b=b-20;break;case "btmrght":a=a+15;b=b+15;break;case "btmlft":a=a+15;b=b-160;break;case "topcntr":a=a-30;b=b-20;break;case "toprght":a=a-30;b=b+15;break;case "autoShow":a=a-5;b=b+10;break;}if(helpContext==null){return;}helpContext.innerHTML=getContextHelpText(c,e);helpContext.style.top=a.toString()+"px";helpContext.style.left=b.toString()+"px";helpContext.style.display="block";if(typeof helpContext.style.styleFloat!='undefined'){helpContext.style.width="200px";}}};return;}function helpMe(a,b,c,d,e,f){if(helpContext=='undefined'){return;}if(!a){blnShowOrNot=false;helpContext.style.display="none";timerID=0;return;}else{newShowContext=new showContext();var g00;var h;if(f==null){var i=(window.scrollY)? window.scrollY : document.documentElement.scrollTop;var j=(window.scrollX)? window.scrollX : document.documentElement.scrollLeft;g00=b.clientX+j;h=b.clientY+i;;}else{var k=gE(f);var l=getPosition(k);g00=l[0]+k.offsetWidth;h=l[1];}newShowContext.top=h;newShowContext.left=g00;newShowContext.cat=c;newShowContext.pos=d;newShowContext.prompt=e;blnShowOrNot=true;timerID=setTimeout("newShowContext.getContextHelp()",750);}}function getContext(){helpContext=gE("contexthelp");}function identifyBrowser(){var a=navigator.userAgent.toLowerCase();if((typeof navigator.vendor!="undefined")&&(navigator.vendor=="KDE")&&(typeof window.sidebar!="undefined")){return "kde";}else if(typeof window.opera!="undefined"){var b=parseFloat(a.replace(/.*opera[\/ ]([^ $]+).*/,"$1"));if(b>=7){return "opera7";}else if(b>=5){return "opera5";}return false;}else if(typeof document.all!="undefined"){if(typeof document.getElementById!="undefined"){var c=a.replace(/.*ms(ie[\/ ][^ $]+).*/,"$1").replace(/ /,"");if(typeof document.uniqueID!="undefined"){if(c.indexOf("5.5")!=-1){return c.replace(/(.*5\.5).*/,"$1");}else{return c.replace(/(.*)\..*/,"$1");}}else{return "ie5mac";}}return false;}else if(typeof document.getElementById!="undefined"){if(navigator.vendor.indexOf("Apple Computer,Inc.")!=-1){if(typeof window.XMLHttpRequest!="undefined"){return "safari1.2";}return "safari1";}else if(a.indexOf("gecko")!=-1){return "mozilla";}}return false;}function identifyOS(){var a=navigator.userAgent.toLowerCase();if(a.indexOf("win")!=-1){return "win";}else if(a.indexOf("mac")){return "mac";}else{return "unix";}return false;}function checkIfSaved(a){if(!intrnlNav){switch(a){case "design":if(typeof getGlblHidElm_vb!="undefined"){var b=gE(getGlblHidElm_vb("hidChangeMade")).value;if(b=="y"){return designerUnsavedMessage;}}break;case "edit":if(gE("hidChangeMade")){if(gE("hidChangeMade").value=="y"){return editorUnsavedMessage;}}break;case "mobile":if(gE("hidChangeMade")){if(gE("hidChangeMade").value=="y"){return mobileUnsavedMessage;}}break;}}}function cancelMove(){detachEventListener(document,"mousemove",detectMove,false);detachEventListener(document,"mouseup",cancelMove,false);return true;}function showEditUpdating(){gE("pMessage").style.display="none";gE("pUpImage").style.display="block";}function endEditUpdating(){gE("pMessage").style.display="block";gE("pUpImage").style.display="none";}function UpdatePageFile(a){bpw.updatecontent.savecontent(a,SaveContentComplete,SaveContentError,SaveContentTimeOut);}function SaveContentComplete(a){if(a.indexOf("Error:")!=-1){SaveContentError(a);return;}emptyContentFields();window.opener.gE(window.opener.getAdminHidElm_vb('ibUnpublished')).style.display='inline';gE("hidChangeMade").value="n";showResultMessage(a,false);}function SaveContentError(a){showResultMessage("Error",true);alert("Sorry, as error has occurred and the content might not be saved. This can occur when the connection "+"is lost or the session expires. You might need to return to the Admin page before trying again.\n\n"+"If you experience this regularly and you think the issue is NOT due to a lost connection or session, "+"please contact support.");}function SaveContentTimeOut(a){showResultMessage("Timeout",true);alert("Sorry, a timeout has occurred and the content might not be saved. Please try again.\n\nIf you "+"experience this regularly and you think the issue is NOT due to a slow connection, please contact support.");}function showResultMessage(a,b){var c="0000ff";if(b){c="ff0000";}gE("pMessage").innerHTML="<span style='color:#"+c+";'>"+a+"</span>";setTimeout("endEditUpdating()",500);}function emptyContentFields(){var a=window.opener.dragParentDivs.length;var b;for(var x=0;x<a;x++){b=window.opener.dragParentDivs[x].substring(window.opener.dragParentDivs[x].lastIndexOf("_")+1)+"Content";window.opener.window[b]="";}}function saveContentChanges(){var a="";var b=window.opener.dragParentDivs.length;var c;for(var x=0;x<b;x++){c=window.opener.dragParentDivs[x].substring(window.opener.dragParentDivs[x].lastIndexOf("_")+1)+"Content";if(window.opener.window[c]!=""){a+=window.opener.dragParentXml[x]+"|%|"+window.opener.window[c]+"|&|";}}a=a.substring(0,a.length-3);return a;}function arrayContainsValue(a,b){var c=a.length;for(var x=0;x<c;x++){if(a[x]==b){return true;}}return false;}function updateElementVar(a,b){var c=a.substring(a.lastIndexOf("_")+1)+"Content";window.opener.window[c]=b;}function prepareEditedHtml(a){var b=window.opener.document.createElement("div");b.innerHTML=replaceAffiliateLinksWithMarkers(a);var c=[];var d=first_child(b);var e="";if(d!=null){while((d.nodeName!=null)&&(d.nodeName.toLowerCase()!="div")){d=node_after(d);}d.className=d.className.replace(" cd","");c[0]=d;var f=1;while(node_after(d)!=null){d=node_after(d);if((d.nodeName!=null)&&(d.nodeName.toLowerCase()=="div")){d.className=d.className.replace(" cd","");c[f]=d;f+=1;}}var g00=window.opener.document.createElement("div");var h;var i=c.length;for(var x=0;x<i;x++){if(!arrayContainsValue(window.opener.editableClasses,c[x].className)){c[x].innerHTML="";g00.appendChild(c[x]);}else{c[x].removeAttribute("title");c[x].removeAttribute("style");g00.appendChild(c[x]);}h=window.opener.document.createElement("div");h.className="divider";h.innerHTML="&nbsp;";g00.appendChild(h);}e=g00.innerHTML;g00=null;}return e;}function replaceAffiliateLinksWithMarkers(a){var b=window.opener.gE(window.opener.getAdminHidElm_vb("ddlCountryCode"));if((b==null)||(b.value=="---")){return a.innerHTML;}if(a.innerHTML.indexOf(customTemplatePage+"_")==-1){return a.innerHTML;}var c=window.opener.document.createElement("div");c.innerHTML=a.innerHTML;var d=c.getElementsByTagName("span");var e=d.length;for(var x=0;x<e;x++){if((d[x])&&(d[x].id.indexOf(customTemplatePage+"_")!=-1)){var f=createAffiliateLinkMarker(d[x]);if(f!=null){d[x].parentNode.replaceChild(f,d[x]);}}}return c.innerHTML;}function createAffiliateLinkMarker(a){if(!window.opener.scriptMarkerIDs){return null;}var b=window.opener.scriptMarkerIDs.length;for(var x=0;x<b;x++){if(window.opener.scriptMarkerIDs[x]==a.id){var c=window.opener.document.createElement("span");c.id=a.id;c.className="ah";c.style.cssText=a.style.cssText;c.innerHTML="[]<strong class=\"mceNonEditable\">"+window.opener.scriptMarkerDescriptions[x]+"</strong>[]";return c;}}}function replaceAffiliateMarkersWithLinks(a){var b=window.opener.gE(window.opener.getAdminHidElm_vb("ddlCountryCode"));if((b==null)||(b.value=="---")){return a;}if(a.indexOf("<span")==-1){return a;}var c=window.opener.document.createElement("div");c.innerHTML=a;var d=c.getElementsByTagName("span");var e=d.length;var f;var g00;var h;for(var x=0;x<e;x++){if(d[x].id.indexOf(customTemplatePage+"_")!=-1){f=window.opener.gE(d[x].id);if(f!=null){g00=window.opener.document.createElement("span");g00.id=d[x].id;if(f.className=="ah"){g00.className="ah";}g00.style.cssText=d[x].style.cssText;var h=f.getElementsByTagName("style");g00.innerHTML=f.innerHTML;if(h.length>0){firstChildNode=first_child(g00);for(var y=0;y<h.length;y++){g00.insertBefore(h[y],firstChildNode);}}d[x].parentNode.replaceChild(g00,d[x]);}}}d=null;f=null;return c.innerHTML;}function hideEmpties(){if((typeof isIE!="undefined")&&(isIE)){var a=document.getElementsByTagName("div");var b=a.length;for(var x=0;x<b;x++){if((a[x].className.length==0)&&(a[x].innerHTML.length==0)){a[x].className="hide";}else if((a[x].className=="hide")&&(a[x].innerHTML.length>0)){a[x].className="";}}}}function is_all_ws(a){return !(/[^\t\n\r ]/.test(a.data));}function is_ignorable(a){return(a.nodeType==8)||((a.nodeType==3)&&(is_all_ws(a)));}function first_child(a){var b=a.firstChild;while(b){if(!is_ignorable(b))return b;b=b.nextSibling;}return null;}function node_after(a){while((a=a.nextSibling)){if(!is_ignorable(a))return a;}return null;}function startDownload(a){var b=gE("ifrDownload");b.src=a;b.style.display='none';document.body.appendChild(b);}addPageLoadFunction(getContext);addPageLoadFunction(stopFlickr);