var canPostBack=true;var activeZeroClip=null;var mailCaptureCountDown;var mailCaptureTimerID=null;var mailCaptureTimerRunning=false;function getRootUser(a){var b=document.location.href;b=b.replace("http://", "");var c="";if(b.indexOf("www.")!=-1){b=b.replace("www.", "");c="www.";}var d;var e=new Array();e=b.split("/");if(e[0]=="localhost"){d="/"+e[1];if((a)&&(b.indexOf("/users/")!=-1)){d+=getCommunityPath(b, "trial");}else{d+="/";}}else{d="http://"+c+e[0];if((a)&&((b.indexOf("www.trial.")!=-1)||(b.indexOf("www.examples.")!=-1))){var f="trial";if(b.indexOf("www.examples.")!=-1){f="examples";}d+=getCommunityPath(b, f);}else{d+="/";}}return d;}function getCommunityPath(a, b){var c;if(b=="trial"){c=/\/users\/.+?\//;}else{c=/\/examples\/.+?\//;}var d=new RegExp(c);return d.exec(a);}function getRelativeRoot(a){var b=document.location.href;if((b.indexOf("www.trial.")==-1)&&(b.indexOf("www.examples.")==-1)){return a+"/";}var c;if(b.indexOf("www.trial.")!=-1){c=/users\/.+?\//;}else{c=/examples\/.+?\//;}var d=new RegExp(c);return d.exec(b)+a+"/";}function testPriceCompVals(a, b, c){if((gE(a).selectedIndex<1)||(gE(b).selectedIndex<1)){alert(c);return false;}return true;}function postToPartner(a,b,c){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(canBeRemoved(g00.id)){g00.parentNode.removeChild(g00);}else if(g00.id.substring(0,2)=="ct"){g00.value="";}}}d.encoding="application/x-www-form-urlencoded";if(a=="AWeber"){d.action="http://www.aweber.com/scripts/addlead.pl";}else if(a=="ConstantContact"){d.action="http://visitor.constantcontact.com/d.jsp";}else if(a=="GetResponse"){d.action="http://www.getresponse.com/cgi-bin/add.cgi";}return true;}function canBeRemoved(a){switch(a){case "DesignMode":case "ImageSearch":case "MasterPage":case "PageType":case "UcReload":case "VM":case "__EVENTTARGET":case "__EVENTARGUMENT":case "__VIEWSTATE":case "__VIEWSTATE_INFO":case "__EVENTVALIDATION":case "__LASTFOCUS":return true;break;}return false;}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 dsbleBtn(a){if((typeof Page_Validators!='undefined')&&(Page_Validators.length>0)){Page_ClientValidate(null);if(!Page_IsValid){return false;}}showUpdating();var b=a.cloneNode(false);b.disabled=true;a.parentNode.appendChild(b);a.style.display="none";return true;}function setScrollPos(){var a=(document.documentElement)? document.documentElement.scrollTop : document.body.scrollTop;gE(getSlideCtrls_vb("hidScrollTop")).value=a;window.scrollTo(0,0);}function resetScrollPos(){var a=(document.documentElement)? document.documentElement : document.body;var b=parseInt(gE(getSlideCtrls_vb("hidScrollTop")).value);setTimeout("scrollToPos('"+b+"')",0);}function scrollToPos(a){a=parseInt(a);window.scrollTo(0,a);}function gE(a){return document.getElementById(a);}function setAtt(a,b,c){gE(a).b=c;return;}function returnFalse(){if(typeof document.all!="undefined"){event.returnValue=false;}return false;}function overImage(a){gE(a).src=window[a+"_over"].src;return true;}function offImage(a){gE(a).src=window[a+"_up"].src;return true;}function downImage(a){gE(a).src=window[a+"_down"].src;return true;}function upImage(a){overImage(a);return true;}function checkEmail(a){var b=new RegExp(/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/i);if(b.test(a)){gE(errSpanID).style.display="none";}else{gE(errSpanID).style.display="inline";}return true;}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 showUpdating(){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((typeof $find!='undefined')&&(typeof getPopElm_vb!='undefined')){if($find(getPopElm_vb("mpeUpdate"))){var a=$find(getPopElm_vb("mpeUpdate"));if(a._backgroundElement.style.display!="none"){a.hide();}}}}function stopFlickr(){try{document.execCommand("BackgroundImageCache",false,true);}catch(err){}}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 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 getPostBackPermission(){if(canPostBack){canPostBack=false;return true;}return false;}function upAlbum(){if(!canPostBack){return false;}if(typeof SLIDES!='undefined'){navigateAway(SLIDES);}if(typeof killImages!='undefined'){killImages();}return true;}function getAlbumNameFromPath(a){var b=a.substring(0,a.lastIndexOf("/"));b=b.substring(b.lastIndexOf("/")+1);var c=new RegExp("_",'g');b=b.replace(c," ");if(b.substring(0,3)=="LH "){b=getExampleHeaderFromDirectoryName(b);}return b;}function getExampleHeaderFromDirectoryName(a){var b=a.replace("LH ", "");b=b.substring(0, b.lastIndexOf(" "));return b;}function confirmDeleteGen(a){if(confirm(a+" The action cannot be undone.\n\nClick OK to delete the item.")){showUpdating();return true;}return false;}function expandThis(a, b){if(b=="open"){a.style.display="none";gE(a.id.replace("trunc", "full")).style.display="block";}else{a.style.display="none";gE(a.id.replace("full", "trunc")).style.display="block";}}function createZClip(a, b, c, d){destroyZClip();activeZeroClip=new ZeroClipboard.Client();if(ZeroClipboard.moviePath=="ZeroClipboard.swf"){ZeroClipboard.setMoviePath(getRootUser(false)+"javascript/swf/ZeroClipboard.swf");}activeZeroClip.glue(gE("clip"+a), gE("clipp"+a));activeZeroClip.setText(gE("clipc"+a).innerHTML.replace("&amp;","&"));activeZeroClip.setHandCursor(true);activeZeroClip.addEventListener('onMouseOver', function(client){revealCouponPrompt(a, "block");});activeZeroClip.addEventListener('onMouseOut', function(client){revealCouponPrompt(a, "none");});activeZeroClip.addEventListener('onComplete', function(client){textCopied(a, b, c, d);});}function destroyZClip(){if(activeZeroClip!=null){activeZeroClip.destroy();showPromptElms("none");}}function showPromptElms(a){var b=document.getElementsByTagName("div");var c=b.length;for(var x=0;x<c;x++){if((b[x].className)&&(b[x].className.indexOf("coup_prmpt")!=-1)){b[x].style.display=a;}}}function textCopied(a, b, c, d){if(isInDesignMode()){if(window.location.href.indexOf("localhost")!=-1){alert(b);}else{alert("The code "+activeZeroClip.clipText+" has been copied to your clipboard. To avoid distorting statistics, affiliate links are not followed when in design mode.");}revealCoupon(b, a, false);}else if(b!=null){incrementClicksCoupon(c, d);alert("The code "+activeZeroClip.clipText+" has been copied to your clipboard. You will now be taken to the Merchant's Website where you can paste the code.");revealCoupon(b, a, true);}}function goToNonCoupon(a, b, c){if(isInDesignMode()){if(window.location.href.indexOf("localhost")!=-1){alert(a);}else{alert("To avoid distorting statistics, affiliate links are not followed when in design mode.");}}else if(a!=null){incrementClicksCoupon(b, c);winCoupon=window.open(a);focusCouponWin();}}function revealCoupon(a, b, c){gE("clipcp"+b).style.display="block";if(c){winCoupon=window.open(a);focusCouponWin();}}function isInDesignMode(){if((gE("ctl00_mde"))&&(gE("ctl00_mde").value=="true")){return true;}return false;}function goToMerchant(a, b, c){if(isInDesignMode()){if(window.location.href.indexOf("localhost")!=-1){alert(a+"\n\n"+b+"\n\n"+c);}else{alert("To avoid distorting statistics, affiliate links are not followed when in design mode.");}return false;}else if(a!=null){window.open(a);incrementClicksProduct(b, c);return true;}}function focusCouponWin(){if((!winCoupon)||(!winCoupon.top)){alert("Your browser has blocked the new window.");}else if(window.focus){winCoupon.focus();}}function revealCouponPrompt(a, b){if(gE("cliph"+a)){gE("cliph"+a).style.display=b;}}function loadZeroClip(){if(!gE("zClipScript")){var a=document.getElementsByTagName('head')[0];var b=document.createElement("script");var c=getRootUser(false);b.setAttribute('id', 'zClipScript');b.setAttribute('type', 'text/javascript');b.setAttribute('src', c+'javascript/ZeroClipboard.js');a.appendChild(b);attachEventListener(window, "unload", destroyZClip, false);}}function clearSearchPrompt(a){if(gE(a).value.indexOf("keywords(optional)")!=-1){gE(a).value="";}}function getCouponsForSearch(a, b, c, d){if(gE(a).value==""){alert("please select a merchant");return;}addLoadingImage(b);var e=gE(a).value;var f=gE(c).value;if(f.indexOf("keywords(optional)")!=-1){f="";}var g00="0";if(isInDesignMode()){g00="1";}populateCouponSearchWidget(b, e, f, g00, d);}function displayResultPane(a, b, c){gE(c).innerHTML="";if(b=="change"){gE(c).style.display="none";}else{if(gE(a).value==""){gE(c).style.display="none";}else{gE(c).style.display="block";}}}function enableSearchButton(a, b, c){if(b){if(gE(c).value!=""){gE(a).disabled=false;}}else{gE(a).disabled=true;}}function addPageScript(a, b, c, d){if(a.substring(0,1)!="g"){if((c==null)||(c=="")){c=gE("ctl00_rcc").value;}var e=gE("ctl00_dcc").value;var f="0";if(isInDesignMode()){f="1";}var g00=gE("ctl00_hsh").value;if(a=="cS"){addCouponSearchWidget(b, c, e, f, g00);}else{if((d==null)||(d=="")){d=gE("ctl00_ani").value;}addAffiliateScript(a, b, c, e, f, d, '', g00);}}}function addAffiliateScript(a, b, c, d, e, f, g00, h){if(a.substring(0,1)=="c"){loadZeroClip();}a=a.substring(1);if(f){addLoadingImage(b);}if(g00==null){g00="";}bpw.renderaffiliatelinks.RenderAffiliateWidget(a, b, document.location.href, c, "", d, e, g00, h, RenderAffiliateWidgetComplete, RenderAffiliateWidgetError, RenderAffiliateWidgetTimeOut);}function addCouponSearchWidget(a, b, c, d, e){loadZeroClip();bpw.renderaffiliatelinks.RenderCouponSearchWidget(a, document.location.href, b, c, d, e, RenderAffiliateWidgetComplete, RenderAffiliateWidgetError, RenderAffiliateWidgetTimeOut);}function populateCouponSearchWidget(a, b, c, d, e){bpw.renderaffiliatelinks.PopulateCouponSearchWidget(a, document.location.href, b, c, d, e, RenderAffiliateWidgetComplete, RenderAffiliateWidgetError, RenderAffiliateWidgetTimeOut);}function addLoadingImage(a){if(typeof(a)=='string'){a=gE(a);}var b=document.createElement("img");b.id=a.id+"_img";b.src=getRootUser(true)+"files/images/LH_Aff_Spinner.gif";b.alt="";b.className="coup_img";a.appendChild(b);}function removeLoadingImage(a){if(typeof(a)=='string'){a=gE(a);}if(gE(a.id+"_img")){a.removeChild(gE(a.id+"_img"));return true;}return false;}function showAllLoadingImages(){var a=/ud_[elc|elg|pcn|blg]+/;var b=new RegExp(a);var c=document.getElementsByTagName("div");var d=c.length;for(var x=0;x<d;x++){if((c[x].id)&&(b.test(c[x].id))){if(!removeLoadingImage(c[x])){addLoadingImage(c[x]);}}}return false;}function updateNewMarker(a){a.removeAttribute("class");var b=first_child(a).cloneNode(true);a.innerHTML="";if((b)&&(b.className=="cmark")){a.appendChild(b);}}function isNewMarker(a){if(a.className=="ah"){return true;}var b=a.getElementsByTagName("div");if((b.length>0)&&(b[0].className)&&(b[0].className=="ah")){return true;}return false;}function RenderAffiliateWidgetComplete(a){var b=a.split("<|>");var c=document.getElementById(b[0]);if(isNewMarker(c)){updateNewMarker(c);}if((b[2])&&(b[2]!="")){addWidgetStyle(b[2]);}if((b[1])||(b[1]=="")){addWidgetHTML(b[1], c);}if((b[3])&&(b[3]!="")){addWidgetScript(b[3], c);}removeLoadingImage(c);}function addWidgetScript(a, b){var c=b.getElementsByTagName("script");for(var x=c.length - 1;x>-1;x--){if(c[x].text.indexOf("addPageScript")==-1){b.removeChild(c[x]);}}var d=a.split("@|@");for(var y=0;y<d.length;y++){var e;if(d[y].substring(0, 3)=="fb:"){e=getFaceBookElement(d[y]);}else{e=document.createElement('script');e.setAttribute('type', 'text/javascript');if(d[y].substring(0, 4)=="http"){e.setAttribute('src', d[y]);}else{e.text=d[y];}}b.appendChild(e);}}function addWidgetHTML(a, b){var c="div";if((a!="")&&(a.substring(0, 13)=='<a class="ral')){c="a";}else{if(typeof removePcPrompt!='undefined'){removePcPrompt(b, a);}}var d=b.getElementsByTagName(c);var e=getRal(d);if(e!=null){if(e.outerHTML){e.outerHTML=a;}else{var f=document.createElement('div');f.innerHTML=a;e.parentNode.replaceChild(f.firstChild, e);f=null;}}else{b.innerHTML+=a;}}function getRal(a){var b=null;var c=a.length;for(var x=0;x<c;x++){if(a[x].className=="ral"){b=a[x];break;}}return b;}function removePcPrompt(a, b){if(a.id.indexOf("ud_pcn")==-1){return;}if(gE("pcn_msg")){var c=gE("pcn_msg");if(b==""){c.innerHTML="no prices found";}else{c.parentNode.removeChild(c);}}}function addWidgetStyle(a){var b=document.createElement('style');b.setAttribute('type', 'text/css');var c=document.createTextNode(a);var d=document.getElementsByTagName('head')[0];if(b.styleSheet){b.styleSheet.cssText=c.nodeValue;}else{b.appendChild(c);}d.appendChild(b);}function RenderAffiliateWidgetTimeOut(a){}function RenderAffiliateWidgetError(a){}function getFaceBookElement(a){var b=a.split("~");var c=document.createElement(b[0]);var d=[];for(x=1;x<b.length;x++){d=b[x].split("=");c.setAttribute(d[0], d[1]);}return c;}function incrementClicksProduct(a, b, c){bpw.renderaffiliatelinks.ProductLinkClick(a+"|"+document.location.href+"|"+b, c, ProductLinkClickComplete, ProductLinkClickError, ProductLinkClickTimeOut);}function ProductLinkClickComplete(){}function ProductLinkClickError(){}function ProductLinkClickTimeOut(){}function incrementClicksCoupon(a, b){bpw.renderaffiliatelinks.CouponWidgetClick(document.location.href, a, b, CouponWidgetClickComplete, CouponWidgetClickError, CouponWidgetClickTimeOut);}function CouponWidgetClickComplete(){}function CouponWidgetClickError(){}function CouponWidgetClickTimeOut(){}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 displayMerchantImage(a, b, c){var d=gE(a);if(checkForMerchantLogo(c)){d.src=c;}else{var e=node_after(d.parentNode);if((e!=null)&&(e.className.indexOf("_name_")==-1)){var f=document.createElement('p');f.innerHTML=b;d.parentNode.className=d.parentNode.className.replace("_img_", "_name_");d.parentNode.replaceChild(f, d);}else{d.parentNode.removeChild(d);}}}function checkForMerchantLogo(a){if(a==null){return false;}var b=window.XMLHttpRequest ? new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");b.open("HEAD", a, false);b.send();return(b.status==404)? false : true;}function beginMailCaptureTimer(a){intMailCaptureTimer(a);}function intMailCaptureTimer(a){mailCaptureCountDown=a;stopMailCaptureTimer();startMailCaptureTimer();}function stopMailCaptureTimer(){if(mailCaptureTimerRunning){clearTimeout(mailCaptureTimerID);}mailCaptureTimerRunning=false;}function startMailCaptureTimer(){if(mailCaptureCountDown<=0){stopMailCaptureTimer();gE(getMailCaptureElm_vb("hidMailCaptureStatus")).value="Expired";showMailCapture();}else{self.status=mailCaptureCountDown;mailCaptureCountDown -=2;mailCaptureTimerRunning=true;mailCaptureTimerID=self.setTimeout("startMailCaptureTimer()", 2000);}}function showMailCapture(){if((typeof $find!='undefined')&&(typeof getMailCaptureElm_vb!='undefined')){var a=$find(getMailCaptureElm_vb("mpeMailCapture"));if((a!=null)&&(a._backgroundElement.style.display=="none")){a._backgroundElement.style.left="0px";a._backgroundElement.style.top="0px";a.show();}}return false;}function clearMailCapture(a){if((typeof $find!='undefined')&&(typeof getMailCaptureElm_vb!='undefined')){var b=$find(getMailCaptureElm_vb("mpeMailCapture"));if((b!=null)&&(b._backgroundElement.style.display!="none")){gE(getMailCaptureElm_vb("mailCaptureSpinner")).style.display="none";b.hide();}}if(a){return true;}return false;}function testMailCaptureInput(a, b, c){showEmailCaptureError(false);if((gE(getMailCaptureElm_vb("txtMailCaptureName")))&&(gE(getMailCaptureElm_vb("txtMailCaptureName")).value=="")){showEmailCaptureError(true);gE(getMailCaptureElm_vb("lblMailCaptureError")).innerHTML=a;return false;}if(gE(getMailCaptureElm_vb("txtMailCaptureEmail")).value==""){showEmailCaptureError(true);gE(getMailCaptureElm_vb("lblMailCaptureError")).innerHTML=b;return false;}if(c!=null){if((!gE(getMailCaptureElm_vb("cbxCouponNew")).checked)&&(!gE(getMailCaptureElm_vb("cbxCouponExpiring")).checked)){showEmailCaptureError(true);gE(getMailCaptureElm_vb("lblMailCaptureError")).innerHTML=c;return false;}}gE(getMailCaptureElm_vb("mailCaptureSpinner")).style.display="block";return true;}function showEmailCaptureError(a){if(a){gE(getMailCaptureElm_vb("mailCaptureError")).style.display="block";}else{gE(getMailCaptureElm_vb("mailCaptureError")).style.display="none";}}function testForSearchParams(a){if(a=="lb"){if(gE(getCoupElm_vb("lbMerchant")).selectedIndex>0){gE(getCoupElm_vb("txtSearch")).value="";}return true;}if((gE(getCoupElm_vb("ddlOption")).value!="all")&&(gE(getCoupElm_vb("lbMerchant")).selectedIndex!=0)){gE(getCoupElm_vb("ddlOption")).value="all";}if(gE(getCoupElm_vb("txtSearch")).value==""){return true;}if((gE(getCoupElm_vb("ddlOption")).value!="all")||(gE(getCoupElm_vb("lbMerchant")).selectedIndex!=0)){gE(getCoupElm_vb("lbMerchant")).selectedIndex=0;gE(getCoupElm_vb("ddlOption")).value="all";}return true;}function showCouponSearchOption(){var a=gE(getCoupElm_vb("div_search"));if(a.style.display=="block"){a.style.display="none";}else{a.style.display="block";}return false;}function hideCouponResultsPane(){gE(getCoupElm_vb("div_results")).style.display="none";}function populateCouponSearchWords(a){bpw.autocomplete.PopulateListsForAutoComplete(a, populateCouponSearchWordsComplete, populateCouponSearchWordsError, populateCouponSearchWordsTimeOut);}function populateCouponSearchWordsComplete(a){}function populateCouponSearchWordsTimeOut(a){}function populateCouponSearchWordsError(a){}addPageLoadFunction(stopFlickr);
