function previewRatingNew(c){clearRatingsNew();if(document.getElementById){for(var d=1;d<=c;d++){document.getElementById("myRatingStar"+d).src=stars_whole_your}}}function resetRatingsNew(){for(var c=1;c<=5;c++){document.getElementById("myRatingStar"+c).src=defaultStarsNew[c]}}function clearRatingsNew(){for(var c=1;c<=5;c++){document.getElementById("myRatingStar"+c).src=stars_empty}}var __savingRating=false;function saveRatingNew(c){if(!__savingRating){__savingRating=true;for(var d=1;d<=5;d++){defaultStarsNew[d]=document.getElementById("myRatingStar"+d).src}new Ajax.Updater("ratingDiv","/utility/rate_lens/"+theLensName,{asynchronous:true,method:"post",postBody:"rating="+c,onSuccess:function(){__savingRating=false}})}}function openFlagEdit(){document.getElementById("flagEditDiv").style.display="block";if(document.getElementById("comments")){document.getElementById("comments").select();document.getElementById("comments").focus()}}function closeFlagEdit(){document.getElementById("flagEditDiv").style.display="none";document.getElementById("default_onion").style.display="none"}function saveFlag(){if(!flagged){var g=document.getElementById("flag_form");pass=$("reason").value==""?false:true;if(pass){var f=g.getElementsByTagName("select");var c=g.getElementsByTagName("textarea");var e=saveFields(f);e+=saveFields(c);var d=function(j){if(j.responseText=="saved"){flagged=true;document.getElementById("flagResultsDiv").innerHTML="<p>You have successfully reported this lens. Thank you.</p>";setTimeout("closeFlagEdit()",3000)}else{var h="<strong>"+j.responseText+"</strong>";document.getElementById("flagResultsDiv").innerHTML=h}};new Ajax.Request("/utility/flag_lens/"+theLensName,{asynchronous:true,method:"post",postBody:e,onSuccess:d})}else{alert("Before continuing, please tell us why you are reporting this lens as inappropriate.");document.getElementById("comments").focus()}}else{document.getElementById("flagResultsDiv").innerHTML="<p>You have successfully reported this lens. Thank you.</p>";setTimeout("closeFlagEdit()",3000)}}function showAllFavorited(){new Ajax.Updater("fanroll","/utility/get_favorited/"+theLensName,{asynchronous:true})}function loadWorkshop(c){Element.show("divWorkshopPreloader");location.href="/lensmaster/workshop/"+c}function plexConfirmation(){if(!$("loginLiteMessage")){setTimeout("plexConfirmation()",1000)}else{$("loginLiteMessage").innerHTML='<strong>Yippeee you voted!</strong> <p>Would you like to go back to <a href="'+plexBack+'">where you came from</a> or stick around and <a href="#" onclick="Element.hide(\'overlay\');Effect.Fade(\'loginLite\');">vote for more stuff</a>?</p>';Element.show("loginLite","overlay")}}plexBack=null;var ajaxRunning=false;function validateAfterAJAX(d,c){checkAvailability($("username"));validate($(d),c);waitForAJAX(d,c);return false}function checkAvailability(c){if(!ajaxRunning){ajaxRunning=true;$("regAjaxErrors").innerHTML="";new Ajax.Request("/utility/usernames/"+escapeForURL(c.value),{asynchronous:true,method:"post",postBody:"first_name=&last_name=",onSuccess:function(d){ajaxRunning=false;if(d.responseText!=null&&d.responseText.replace(/[\r|\n]+/,"")!=""){if($("regErrors").style.display=="none"){$("regErrors").style.display="block"}if($("ajaxErrorText")&&$("ajaxErrorText").innerHTML.length){$("ajaxErrorText").innerHTML="- "+d.responseText}else{$("regErrors").innerHTML+=ajaxSpanStart+"- "+d.responseText+ajaxSpanEnd}$("regAjaxErrors").innerHTML=d.responseText;$("usernameRow").className+=" error";scrollToElement("regErrors")}else{if($("regErrors").style.display=="block"){if($("ajaxErrorText")){$("ajaxErrorText").innerHTML="";var e=new RegExp(ajaxSpanStart+ajaxSpanEnd,"g");$("regErrors").innerHTML=$("regErrors").innerHTML.replace(e,"");if(!$("regErrors").innerHTML.length){$("regErrors").style.display="none"}}}$("regAjaxErrors").innerHTML="";$("usernameRow").className=$("usernameRow").className.replace(/error/gi,"")}ajaxRunning=false}})}}lensLoveInit=false;function initLensLove(){if(window.isWorkshop||lensLoveInit){return false}lensLoveInit=true;loveSaveRating(0);for(var c=5;c>0;c--){$$(".wS"+c).each(function(d){d.src=defaultStarsNew[c];d.title=d.alt})}if(theLensName!=""){$$(".wMail").each(function(d){d.href="/utility/email_page?"+theLensName});$$(".wFave").each(function(d){d.href="/member/add_favorite/"+theLensName});$$(".wRoll").each(function(d){d.href="/lensmaster/lensroll/"+theLensName})}if(!isLoggedIn){$$(".wRating").each(function(d){d.innerHTML="<i>Login to rate this lens</i>"});$$(".wFave").each(function(d){d.href="http://addthis.com/bookmark.php"});$$(".wFave").each(function(d){d.innerHTML="Bookmark it &nbsp;"});$$(".wRoll").each(function(d){d.style.display="none"})}}function loveSaveRating(e){var d="http://cdn.squidoo.com/images/layout/star-sm-0.gif";var c="http://cdn.squidoo.com/images/layout/star-sm-2.gif";if(e>=1){$$(".wS1").each(function(f){f.src=c})}else{$$(".wS1").each(function(f){f.src=d})}if(e>=2){$$(".wS2").each(function(f){f.src=c})}else{$$(".wS2").each(function(f){f.src=d})}if(e>=3){$$(".wS3").each(function(f){f.src=c})}else{$$(".wS3").each(function(f){f.src=d})}if(e>=4){$$(".wS4").each(function(f){f.src=c})}else{$$(".wS4").each(function(f){f.src=d})}if(e>=5){$$(".wS5").each(function(f){f.src=c})}else{$$(".wS5").each(function(f){f.src=d})}if(e>=1){saveRatingNew(e)}}function launchMeebo(c){Meebo=function(){(Meebo._=Meebo._||[]).push(arguments)};(function(j){var g=arguments;if(!document.body){return setTimeout(function(){g.callee.apply(this,g)},100)}var k=document,f=k.body,e=f.insertBefore(k.createElement("div"),f.firstChild),h=k.createElement("script");e.id="meebo";e.style.display="none";e.innerHTML='<iframe id="meebo-iframe"></iframe>';h.src="http"+(j.https?"s":"")+"://"+(j.stage?"stage-":"")+"cim.meebo.com/cim/cim.php?network="+j.network;f.insertBefore(h,f.firstChild);if(c){f.insertBefore(document.createComment("INFOLINKS_OFF"),f.firstChild)}})({network:"squidoo",stage:false});Meebo("addButton",{id:"meebobutton1",type:"menu",icon:"http://the.squidoocdn.com/imgs/modules/meebo/smiley.png",label:"Fun stuff to DO!",items:[{value:"http://blogs.squidoo.com/lensoftheday/",text:"Lens of the Day"},{value:"http://www.squidoo.com/browse/top_lenses",text:"See the Top 100"},{value:"http://www.squidoo.com/build/start",text:"Make a lens"},{value:"http://squidu.com/forum",text:"Say hi in the forum"},{value:"http://www.squidoo.com/squidquiz/hq",text:"P.S. Take a quiz!"},{value:"http://www.squidoo.com/squidwho/hq",text:"P.P.S. Get famous"},],onSelect:function(d){window.open(d,"resizable=1,scrolling=1,scrollbars=1,status=1,toolbar=1")}});Meebo("domReady")}function setClickOutTracking(g){if(typeof g=="string"){var c=$(g).getElementsByTagName("a")}else{var c=document.getElementsByTagName("a")}for(var e=0;e<c.length;e++){var f=c[e];try{if(typeof f.hostname=="unknown"){continue}if(f.href=="javascript:void(0);"){continue}if(f!=""&&f.hostname!=theRequestServerName&&f.hostname!=theServerName){if(f.className.indexOf("googleUrl")!=-1||f.className.indexOf("googleClickout")!=-1){f.onclick=trackAdWordClick;if(!theWindowPref){f.target="_blank"}}else{f.onclick=trackClickWrapper;if(!theWindowPref){f.target="_blank"}}}}catch(d){}}}function trackClickWrapper(){trackClick(this)}function trackClick(d){var c="url="+escape(d.href)+"&lens_id="+theLensId;new Ajax.Request("/utility/track_click",{asynchronous:true,method:"post",postBody:c});if(pageTracker!==undefined){pageTracker._trackEvent("clickout",d.hostname,d.href)}}function trackAdWordClick(){var c=this.href;var d="url="+escape(c)+"&lens_id="+theLensId;new Ajax.Request("/utility/track_ad_click",{asynchronous:true,method:"post",postBody:d})}function trackReferrer(){var c="/utility/track_referrer?random="+Math.random();var d="lens_id="+theLensId;d+="&referrer="+escape(document.referrer);if(window.location.search.substring(1).indexOf("utm_campaign=search-discovery")!==-1||window.location.search.substring(1).indexOf("utm_campaign=lensmaster-discovery")!==-1){d+="&discovery=1"}new Ajax.Request(c,{asynchronous:true,method:"post",postBody:d})}if(window.trackReferrer){trackReferrer()}function fade(c,d){return}function setLoadFunctions(){setTooltips();fade();if(window.setClickOutTracking){setClickOutTracking()}}if(pageLoadActions==undefined){var pageLoadActions=[]}pageLoadActions.push(setLoadFunctions);function setDisplay(c,e){if($(c)){var d=$(c);d.style.display=e}}function toggleDisplay(c){var g=c+"Body";var e=c+"Hdr";if($(g)){var d=$(g);var j=d.style.display;var h="collapse";var f="expanded";if(j=="none"){setDisplay(g,"block");addClass(e,f);desist(c)}else{setDisplay(g,"none");addClass(e,h);persist(c,h)}}else{if($(c)){var d=$(c);var j=d.style.display;var h="collapse";var f="";if(j=="none"){setDisplay(c,"block")}else{setDisplay(c,"none")}}}}function addClass(c,f){if($(c)){var d=$(c);var e=d.className;d.className=f}}function persist(d,e){var c=new Date();c.setFullYear(c.getFullYear()+10);document.cookie=d+"="+e+"; path=/; expires="+c.toGMTString()}function desist(d){var c=new Date();c.setFullYear(c.getFullYear()-10);document.cookie=d+"=test; path=/; expires="+c.toGMTString()}function scheduleShow(){if(this.getElementsByTagName){setTipShow(this.getElementsByTagName("div"));setTipShow(this.getElementsByTagName("span"))}}function setTipShow(d){for(var c=0;c<d.length;c++){if(d[c].className.indexOf("toolTip")!=-1){d[c].mouseover=true;if(d[c].id){window.setTimeout('showTip("'+d[c].id+'")',250)}}}}function scheduleHide(){if(this.getElementsByTagName){setTipHide(this.getElementsByTagName("div"));setTipHide(this.getElementsByTagName("span"))}}var length=1000;function setTipHide(d){for(var c=0;c<d.length;c++){if(d[c].className.indexOf("toolTip")!=-1){d[c].mouseover=false;if(d[c].id){window.setTimeout('clearTip("'+d[c].id+'")',length)}}}}function showTip(d){var c=$(d);if(c.mouseover){c.style.display="block"}}function clearTip(d){var c=$(d);if(!c.mouseover){c.style.display="none"}else{window.setTimeout('clearTip("'+d+'")',1000)}}function recordParentMouseover(){this.parentNode.mouseover=true}function recordParentMouseout(){this.parentNode.mouseover=false}function setTooltips(c,g){if(g){length=g}if(!c){c="span"}if(document.getElementsByTagName){var e=document.getElementsByTagName(c);for(var d=0;d<e.length;d++){var f=e[d];if(f.className.indexOf("moreInfo")!=-1){f.onmouseover=scheduleShow;f.onmouseout=scheduleHide;setEvents(f,"div");setEvents(f,"span")}}}}function setEvents(e,c){var f=e.getElementsByTagName(c);for(var d=0;d<f.length;d++){if(f[d].className.indexOf("toolTip")!=-1){f[d].onmouseover=recordParentMouseover;f[d].onmouseout=recordParentMouseout}}}function swapDescriptions(d){var g=d.parentNode.parentNode;var f=g.getElementsByTagName("p");for(var c=0;c<f.length;c++){var e=f[c];if(e.className.indexOf("productDescriptionExcerpt")>=0){e.style.display="none"}else{if(e.className.indexOf("productDescriptionFullText")>=0){e.style.display="block"}}}}function openLoginLite(c,d){if(jQuery("#loginLiteMessage").length==0){jQuery("#loginLite").load("/utility/loginlite",function(){openLoginLite(c)})}else{if(!c){c="<strong>Hey smarty!</strong>  To make your vote count, <a href=\"#\" onclick=\"jQuery('#login-option').show(); jQuery('#join-option').hide(); return false;\">login</a> or <a href=\"#\" onclick=\"jQuery('#login-option').hide(); jQuery('#join-option').show(); return false;\">join Squidoo</a> for free."}jQuery("#loginLiteMessage").html(c);jQuery("#default_onion").show();jQuery("#loginLite").show();jQuery("#login_redirect").val("/"+theLensName);jQuery("#reg_redirect").val("/"+theLensName);window.scrollTo(0,0);if(d){d()}}}function openPlexSubmit(e,c,d){if(d){if(member_id!=""){Element.show("add-options"+e);Element.show("bulkSurfer"+e);new Ajax.Updater("captcha_"+e,"/utility/load_captcha",{asynchronous:true});return false}else{$("loginLiteMessage").innerHTML="<strong>Hey smarty!</strong>  To make your vote count, <a href=\"#\" onclick=\"Element.show('login-option'); Element.hide('join-option'); return false;\">login</a> or <a href=\"#\" onclick=\"Element.hide('login-option'); Element.show('join-option'); return false;\">join Squidoo</a> for free.";Element.show("loginLite","overlay");$("login_redirect").value="/"+c;$("reg_redirect").value="/"+c;window.scrollTo(0,0);return true}}else{Element.show("bulk"+e)}}function plexSubmit(g,e){var f=null;myform=$("plexoForm"+g);f=validate(myform);if(f){var d=myform.getElementsByTagName("input");var c=myform.getElementsByTagName("textarea");postString=saveFields(d);postString+=saveFields(c);new Ajax.Request("/utility/plexo_submit/"+g,{asynchronous:true,method:"post",postBody:postString,onSuccess:function(h){if(h.responseText=="captcha_error"){alert("The security word you entered is incorrect. Please try again.")}else{if(h.responseText==null||h.responseText==""){if(e=="manual"){$("add-options"+g).innerHTML='<div style="text-align: center; font-weight: bold; width: 80%; padding: 20px;"><img src="/images/btn-submitted.gif" alt="Submitted" style="text-align: center;" /> <br /><br />Thanks! Your item was submitted successfully, and is now pending approval from the lensmaster.</div>'}else{$("add-options"+g).innerHTML='<div style="text-align: center; font-weight: bold; width: 80%; padding: 20px;"><img src="/images/btn-submitted.gif" alt="Submitted" style="text-align: center;" /> <br /><br />Thanks! Your item was submitted successfully and will appear shortly. Don\'t forget to vote for it!</div>'}}else{alert("There was a problem saving your submission:\n\n"+h.responseText)}}}})}return false}function plexVote(lmi,lens_name,item_id,direction){if(member_id&&member_id!=""){new Ajax.Request("/utility/plexo_vote/"+item_id+"/"+direction,{onSuccess:function(response){if(response.responseText.indexOf("|")==0){var curPoints=response.responseText.substr(1);var children=$("plexItem"+item_id).getElementsByTagName("div");for(var i=0;i<children.length;i++){if(direction=="up"){if(children[i].className.indexOf("vote-up")>-1||children[i].className.indexOf("voted-up")>-1){children[i].className="voted-up"}else{if(children[i].className.indexOf("vote-down")>-1||children[i].className.indexOf("voted-down")>-1){children[i].className="vote-down"}}}else{if(direction=="down"){if(children[i].className.indexOf("vote-up")>-1||children[i].className.indexOf("voted-up")>-1){children[i].className="vote-up"}else{if(children[i].className.indexOf("vote-down")>-1||children[i].className.indexOf("voted-down")>-1){children[i].className="voted-down"}}}}}var newDisplay="";if(curPoints==-1||curPoints==1){newDisplay=curPoints+' point - <a href="javascript:window.location.reload();" title="refresh the page">refresh to rerank</a>'}else{newDisplay=curPoints+' points - <a href="javascript:window.location.reload()" title="refresh the page">refresh to rerank</a>'}var voteHistory=eval("voted"+lmi);if(!voteHistory[item_id]||voteHistory[item_id]!=direction){new Effect.Highlight("plexItem"+item_id);window.eval("voted"+lmi+"["+item_id+'] = "'+direction+'"')}$("pointsDisplay"+item_id).innerHTML=newDisplay}else{alert("There was a problem saving your vote. The problem was: \n\n"+response.repsponseText)}},asynchronous:true,method:"post"});return false}else{$("loginLiteMessage").innerHTML="<strong>Hey smarty!</strong>  To make your vote count, <a href=\"#\" onclick=\"Element.show('login-option'); Element.hide('join-option'); return false;\">login</a> or <a href=\"#\" onclick=\"Element.hide('login-option'); Element.show('join-option'); return false;\">join Squidoo</a> for free.";Element.show("loginLite","loginLiteMessage","default_onion");Element.show("default_onion");$("login_record_vote").value=item_id+"/"+direction;$("login_redirect").value="/"+lens_name;if(plexBack){$("login_redirect").value="/"+lens_name+"?plexBack="+escape(plexBack)}$("reg_record_vote").value=item_id+"/"+direction;$("reg_redirect").value="/"+lens_name;if(plexBack){$("reg_redirect").value="/"+lens_name+"?plexBack="+escape(plexBack)}window.scrollTo(0,0);return false}}function plexWidget(g,f,d,c,e){if(e){contents='<div id="plex'+f+'"><a href="'+e+'">Click through to see the plexo</a></div>'}else{contents='<div id="plex'+f+'"></div>'}contents+='<script type="text/javascript" src="http://www.squidoo.com/scripts/plexo/syndicate.php?plex_id='+f+'"><\/script>\n';contents+='<script type="text/javascript">\n';contents+="  openPlexo({\n";contents+='    "container" : "plex'+f+'"';if(d=="sidebar"){contents+=',\n    "size" : "sidebar"\n'}if(c!=undefined){contents+=',\n    "num_results" : "'+c+'"\n'}contents+="  });\n";contents+="<\/script>";$("widget-code-box"+g).value=contents;Element.show("widget-code"+g)}function openHelper(lmi,url){var width=550;var height=420;var _left=((screen.width-width)>>1);var _top=((screen.height-height)>>1);myWin=eval("helperWindow"+lmi);myWin=window.open(url,"modules_id"+lmi+"_helper","status=yes,scrollbars=yes,resizable=yes,width="+width+",height="+height+",left="+_left+",top="+_top);if(myWin.opener==null){myWin.opener=window}myWin.opener.name="opener";myWin.focus()}function showItems(f,c,e){var d="";if(c){d="Surfer"}Element.show("plexSubmission"+d+f);if(!e){Element.hide("bulk"+d+f)}new Effect.Highlight("bulkList"+d+f)}function hideToolbox(){$("toolbox-contents").hide();$("toggle-off").hide();$("toggle-on").show();var d=new Date();d.setTime(d.getTime()+(60*24*60*60*1000));var c=d.toGMTString();document.cookie="hide_toolbox = true; expires="+c+"; path=/";return false}function showToolbox(){$("toolbox-contents").show();$("toggle-off").show();$("toggle-on").hide();var d=new Date();d.setTime(d.getTime()+(-1*24*60*60*1000));var c=d.toGMTString();document.cookie="hide_toolbox = true; expires="+c+"; path=/";return false}function hideSquidUTips(){$("tip-squidu").hide();var d=new Date();d.setTime(d.getTime()+(60*24*60*60*1000));var c=d.toGMTString();document.cookie="hide_squidu_tips = true; expires="+c+"; path=/";return false}var RecaptchaOptions={theme:"white",tabindex:8};if(typeof Effect=="undefined"){var Effect=function(){return{Highlight:function(e,c){try{if(typeof e=="object"){e=e.id}jQuery("#"+e).fadeIn("fast");jQuery("#"+e).fadeOut("fast");jQuery("#"+e).fadeIn("fast")}catch(d){}},Fade:function(f,d){try{var c="slow";if(typeof d=="object"){c=d*1000}if(typeof f=="object"){f=f.id}jQuery("#"+f).fadeOut(c)}catch(e){}},Appear:function(e,c){try{if(typeof e=="object"){e=e.id}jQuery("#"+e).show()}catch(d){}},Pulsate:function(e,c){try{if(typeof e=="object"){e=e.id}jQuery("#"+e).fadeIn("fast");jQuery("#"+e).fadeOut("fast");jQuery("#"+e).fadeIn("fast");jQuery("#"+e).fadeOut("fast");jQuery("#"+e).fadeIn("fast");jQuery("#"+e).fadeOut("fast");jQuery("#"+e).fadeIn("fast");jQuery("#"+e).fadeOut("fast");jQuery("#"+e).fadeIn("fast")}catch(d){}},Grow:function(e,c){try{if(typeof e=="object"){e=e.id}jQuery("#"+e).show()}catch(d){}},BlindUp:function(e,c){try{if(typeof e=="object"){e=e.id}jQuery("#"+e).slideUp("fast")}catch(d){}},BlindDown:function(e,c){try{if(typeof e=="object"){e=e.id}jQuery("#"+e).slideDown("fast")}catch(d){}}}}()}if(pageLoadActions==undefined){var pageLoadActions=[];var loaded=false}onPageLoadHandler=function(){if(!loaded){for(iterator=0;iterator<pageLoadActions.length;iterator++){var c=pageLoadActions[iterator];if(typeof c=="function"){pageLoadActions[iterator]()}else{}}loaded=true}};function hasPageLoaded(){if(typeof(pageBottomLoaded)!="undefined"){onPageLoadHandler()}}jQuery(document).ready(onPageLoadHandler);window.setTimeout(hasPageLoaded,12000);var ajaxSpanStart='<span id="ajaxErrorText">';var ajaxSpanEnd="</span>";function validate(e,d){var c=true;if(typeof(e)=="string"){e=document.getElementById(e)}if(d==null){d="errors"}var f=$(d);f.style.display="none";f.innerHTML="";inputresult=validateFields(e,"input",f);selectresult=validateFields(e,"select",f);textarearesult=validateFields(e,"textarea",f);ajaxresult=true;if($("ajaxErrors")&&$("ajaxErrors").innerHTML.length){ajaxresult=false}if(!ajaxresult){f.innerHTML+=ajaxSpanStart+"- "+$("ajaxErrors").innerHTML+ajaxSpanEnd}c=inputresult&&selectresult&&textarearesult&&ajaxresult;if($("notSubmittable")){c=false;f.innerHTML+=" - Your submission could not be processed. Please check the form for any remaining errors<br />"}if(!c){f.style.display="block";scrollToElement("errors")}else{f.style.display="none"}return c}function scrollToElement(f){var c=0;var e=0;var d=$(f);while(d){c+=d.offsetLeft;e+=d.offsetTop;d=d.offsetParent}window.scrollTo(c,e)}function waitForAJAX(e,d){if(!d){d="errors"}if(ajaxRunning){var c=setTimeout("waitForAJAX('"+e+"', '"+d+"')",500)}else{if(!$(d).innerHTML.length){$(d).style.display="none";$(e).submit()}else{$(d).style.display="block"}}}function validateFields(e,z,k){var n=e.getElementsByTagName(z);var c=true;var l="";var A=new Array();for(var u=0;u<n.length;u++){var D=true;var d=n[u].value;var B=n[u].name;var r=B.replace(/_/g," ");var y="";if(n[u].getAttribute("maxlength")){var t=n[u].getAttribute("maxlength");var q=n[u].value;if(q.length>t){q=q.substr(0,t);n[u].value=q}}var f="";if(n[u].getAttribute("errormessage")){f=" - "+n[u].getAttribute("errormessage")+"<br />"}if((!n[u].getAttribute("ignore")||n[u].getAttribute("ignore")==null)&&n[u].getAttribute("required")){if(z!="select"&&d==""){D=false;if(f==""){y=" - Please enter your "+r+"<br />"}else{y=f}}if(n[u].options){if(n[u].selectedIndex<1){D=false;if(f==""){y=" - Please select a "+r+"<br />"}else{y=f}}}if(n[u].className.indexOf("radio")>=0){var v=document.getElementsByName(B);D=false;for(var s=0;s<v.length;s++){if(v[s].checked){D=true}}if(!D){if(f==""){y=" - Please select a "+r+" value<br />"}else{y=f}}}}else{if(!n[u].getAttribute("ignore")&&n[u].getAttribute("validate")&&n[u].getAttribute("validate").length){var w=n[u].getAttribute("validate");if(w=="email"){w="[\\_\\d\\w\\.'\\-]+@([\\d\\w'\\-]\\.?)+"}else{if(w=="url"){d=d.replace("http://http","http");n[u].value=d;w="^https?://([\\_\\d\\w\\-]+\\.)+[\\_\\d\\w\\-]+(:\\d+)?(/[^\\s]*)*$"}else{if(w=="feed"){w="^((https?://)|(feed:(//)?))([\\_\\d\\w\\-]+\\.)+[\\_\\d\\w\\-]+(:\\d+)?(/[^\\s]*)*$"}else{if(w=="password"){w="[\\S]{4,8}"}else{if(w=="tag"){w="^[^\\\\\\/\\!@#$%\\^\\?<>\\|\\{\\}\\[\\]=+~`&\\*\\(\\)]+$"}}}}}var p=new RegExp(w);if(!p.test(d)){D=false;if(f==""){y=" - Please make sure that you are entering your "+r+" in the correct format<br />"}else{y=f}}}}if(!n[u].getAttribute("ignore")&&n[u].getAttribute("confirms")){var C=n[u].getAttribute("confirms");if($(C).value.toLowerCase()!=d.toLowerCase()){D=false;if(f==""){y=" - Please make sure that your "+C.replace("_"," ")+" is entered correctly in both fields<br />"}else{y=f}}}var x=findParentDiv(n[u]);var g=x.className;if(!x.getAttribute("classPristine")){x.setAttribute("classPristine",g)}if(!D){c=false;x.className=g+" error";n[u].setAttribute("error","true");var h=false;for(var s=0;s<A.length;s++){if(A[s]==y){h=true}}if(!h){A.push(y)}}else{if(n[u].getAttribute("error")){x.className=g.replace(" error","")}}}if(!c&&A.length>0){k.innerHTML+=A.join("\n")}return c}function findParentDiv(c){var d=c.parentNode;while(d.tagName!="DIV"){d=d.parentNode}return d}function saveFields(h,u){var s="";for(var g=0;g<h.length;g++){var l=h[g];var j=l.id;var r=l.name;var f="";if(l.type!="checkbox"&&l.type!="submit"&&l.type!="image"&&l.type!="select-one"&&l.type!="radio"){var n=l.value;var c=j+"_value";if(r.indexOf("[")>-1){c=r.substr(0,r.indexOf("["))+"_value"}if($(c)&&n!=""){if(r.indexOf("[")>-1&&g>0){var k=$(c).innerHTML;if(k!=""){k=k+", "+escapeForDisplay(n,true)}else{k=escapeForDisplay(n)}$(c).innerHTML=k}else{$(c).innerHTML=escapeForDisplay(n,true)}}else{if($(c)&&n==""&&g==0){$(c).innerHTML=""}}if(r.indexOf("[]")>0){var q=r.replace("[]","");if(s.indexOf(q+"=")>=0){var e=s.indexOf(q+"=");var p=s.indexOf("&",e);var t=s.slice(e,p);var d=t+","+escapeForURL(n);s=s.substr(0,e)+d+s.substr(p)}else{s+=q+"="+escapeForURL(n)+"&"}}else{s+=r+"="+escapeForURL(n)+"&"}}else{if(l.type=="checkbox"&&l.checked&&r.indexOf("[]")<0){s+=r+"=1&"}else{if(l.type=="checkbox"&&l.checked&&r.indexOf("[]")>0){var q=r.replace("[]","");var n=l.value;if(s.indexOf(q+"=")>=0){var e=s.indexOf(q+"=");var p=s.indexOf("&",e);var t=s.slice(e,p);var d=t+","+escapeForURL(n);s=s.substr(0,e)+d+s.substr(p)}else{s+=q+"="+escapeForURL(n)+"&"}}else{if(l.type=="select-one"){var n=l.options[l.selectedIndex].value;s+=r+"="+escapeForURL(n)+"&"}else{if(l.type=="radio"){if(l.checked=="1"){s+=r+"="+escapeForURL(l.value)+"&"}}}}}}}return s}function escapeForDisplay(d,e){if(d!=null){var c=new String(d);c=c.replace(/&/g,"&amp;");if(!e){c=c.replace(/</g,"&lt;");c=c.replace(/>/g,"&gt;");c=c.replace(/\"/g,"&quot;")}c=c.replace(/\r/g,"");c=c.replace(/\n/g,"<br />\n");c=c.replace(/&amp;nbsp;/g,"&nbsp;");return c}else{return""}}function escapeForFormField(c){return escapeForDisplay(c)}function escapeForURL(d){if(d!=null){var c=new String(escape(d));c=c.replace(/\+/g,"%2B");return c}else{return""}}function stripTags(d){var c=/<\/?[^>]+>/gi;d=d.replace(c,"");return d}function makeTinyMce(c,g){var f=false;var e=navigator.userAgent.indexOf("Safari")!=-1;if(elements){for(var d=0;d<elements.length;d++){if(elements[d].substr(0,c.length+1)==c+":"){f=true}}if(!e&&(!f||g)){elements.push(c);tinyMCE.execCommand("mceAddControl",false,c)}}}function unMakeTinyMce(c){var f=false;var e=navigator.userAgent.indexOf("Safari")!=-1;if(elements){for(var d=0;d<elements.length;d++){if(elements[d].substr(0,c.length+1)==c+":"){f=true}}if(!e&&f){elements.pop(c);tinyMCE.execCommand("mceRemoveControl",false,c)}}}function checkTinyMceContent(d){var k=d.getElementsByTagName("textarea");for(var h=0;h<k.length;h++){var f="";var e=k[h].id;for(var g=0;g<elements.length;g++){if(k[h].id+":"==elements[g].substr(0,k[h].id.length+1)){f=elements[g].replace(k[h].id+":","")}}var l=null;if(l=tinyMCE.getInstanceById(f)){var n=k[h].value;var c=l.getBody().innerHTML;if(n!=c){k[h].value=c}}}}var Carousel=Class.create();Carousel.prototype={initialize:function(d){this.carouselElemID=d;this.options=Object.extend({numVisible:1,scrollInc:1,animParameters:{},buttonStateHandler:null,animHandler:null,ajaxHandler:null,initDoneHandler:null,queue:"carousel",size:0,prevElementID:"prev-arrow",nextElementID:"next-arrow",ajaxParameters:null,url:null},arguments[1]||{});this.initDone=false;this.animRunning="none";this.requestIsRunning=false;this.animAfterFinish=this.options.animParameters.afterFinish;Object.extend(this.options.animParameters,{afterFinish:this._animDone.bind(this),queue:{position:"end",scope:this.options.queue}});this.prevScroll=this._prevScroll.bindAsEventListener(this);this.nextScroll=this._nextScroll.bindAsEventListener(this);this.onComplete=this._onComplete.bindAsEventListener(this);this.onFailure=this._onFailure.bindAsEventListener(this);Event.observe(this.options.prevElementID,"click",this.prevScroll);Event.observe(this.options.nextElementID,"click",this.nextScroll);var c="carousel-list";this.carouselList=document.getElementsByClassName(c,$(d))[0];this.options.size=$(this.carouselList.getElementsByTagName("li")).length;this._init()},destroy:function(){Event.stopObserving(this.options.prevElementID,"click",this.prevScroll);Event.stopObserving(this.options.nextElementID,"click",this.nextScroll)},scrollTo:function(c){var d=this.options.scrollInc;this.ignoreNoMoreImages=true;if(c>this.currentIndex){this.options.scrollInc=c-this.currentIndex;this._nextScroll(this)}else{this.options.scrollInc=this.currentIndex-c;this._prevScroll(this)}this.options.scrollInc=d},_init:function(){this.currentIndex=0;if(this.options.url){this._request(this.currentIndex,this.options.numVisible)}else{this._getLiElementSize();this._updateButtonStateHandler(this.options.prevElementID,false);this._updateButtonStateHandler(this.options.nextElementID,this.options.size>this.options.numVisible)}},_prevScroll:function(c){if(this.animRunning!="none"||this.currentIndex==0){return}var d=this.options.scrollInc;if(this.currentIndex-d<0){d=this.currentIndex}this._scroll(d);return false},_nextScroll:function(c){if(this.animRunning!="none"){return false}if(this.currentIndex+this.options.numVisible+this.options.scrollInc<=this.options.size){this._scroll(-this.options.scrollInc)}else{this.nbInCache=this.options.size-(this.currentIndex+this.options.numVisible);if(this.options.url&&this.noMoreImages==false){this._request(this.currentIndex+this.options.numVisible+this.nbInCache,this.options.scrollInc-this.nbInCache)}else{if(this.nbInCache>0){this._scroll(-this.nbInCache)}}}return false},_request:function(e,c){if(this.options.url&&!this.requestIsRunning){this.requestIsRunning=true;if(this.options.ajaxHandler){this.options.ajaxHandler(this,"before")}var d="start="+e+"&nb="+c;if(this.options.ajaxParameters!=null){d+="&"+this.options.ajaxParameters}new Ajax.Request(this.options.url,{parameters:d,onComplete:this.onComplete,onFailure:this.onFailure})}},_onComplete:function(c){this.requestIsRunning=false;this.carouselList.innerHTML+=c.responseText;var d=this.options.size;this.options.size=this.carouselList.getElementsByTagName("li").length;var e=this.options.size-d;if(this.initDone==false){this._getLiElementSize();this.currentIndex=0;this.initDone=true;if(this.options.initDoneHandler){this.options.initDoneHandler(this)}this._updateButtonStateHandler(this.options.prevElementID,false);this._updateButtonStateHandler(this.options.nextElementID,this.options.size==this.options.numVisible);this.noMoreImages=this.options.size<this.options.numVisible}else{if(!this.ignoreNoMoreImages){this.noMoreImages=e!=this.options.scrollInc}else{this.ignoreNoMoreImages=false}if(e>0){this._scroll(-e,this.noMoreImages)}else{if(this.nbInCache>0){this._scroll(-this.nbInCache,true)}this._updateButtonStateHandler(this.options.nextElementID,false)}}if(this.options.ajaxHandler){this.options.ajaxHandler(this,"after")}},_onFailure:function(c){this.requestIsRunning=false},_animDone:function(c){if(this.options.animHandler){this.options.animHandler(this.carouselElemID,"after",this.animRunning)}this.animRunning="none";if(this.animAfterFinish){this.animAfterFinish(c)}},_updateButtonStateHandler:function(c,d){if(this.options.buttonStateHandler){this.options.buttonStateHandler(c,d)}},_scroll:function(d,c){this.animRunning=d>0?"prev":"next";if(this.options.animHandler){this.options.animHandler(this.carouselElemID,"before",this.animRunning)}new Effect.MoveBy(this.carouselList,0,d*this.elementSize,this.options.animParameters);this.currentIndex-=d;this._updateButtonStateHandler(this.options.prevElementID,this.currentIndex!=0);if(this.options.url&&this.noMoreImages==false){enable=true}else{enable=(this.currentIndex+this.options.numVisible<this.options.size)}this._updateButtonStateHandler(this.options.nextElementID,(c?false:enable))},_getLiElementSize:function(){var c=$(this.carouselList.getElementsByTagName("li")[0]);this.elementSize=c.getDimensions().width+parseFloat(c.getStyle("margin-left"))+parseFloat(c.getStyle("margin-right"))}};var hs={graphicsDir:"http://cdn.squidoo.com/scripts/highslide/graphics/",restoreCursor:"zoomout.cur",expandSteps:10,expandDuration:250,restoreSteps:10,restoreDuration:250,allowMultipleInstances:true,hideThumbOnExpand:true,captionSlideSpeed:1,outlineWhileAnimating:false,outlineStartOffset:3,marginLeft:10,marginRight:35,marginTop:10,marginBottom:35,numberOfImagesToPreload:5,zIndexCounter:1001,fullExpandIcon:"fullexpand.gif",fullExpandTitle:"Expand to actual size",restoreTitle:"Click to close image, click and drag to move. Use arrow keys for next and previous.",focusTitle:"Click to bring to front",loadingText:"Loading...",loadingTitle:"Click to cancel",loadingOpacity:0.75,showCredits:true,creditsText:"Powered by <i>Highslide JS</i>",creditsHref:"http://vikjavev.no/highslide/",creditsTitle:"Go to the Highslide JS homepage",enableKeyListener:true,anchor:"auto",align:"auto",targetX:null,targetY:null,captionId:null,captionTemplateId:null,slideshowGroup:null,spaceForCaption:30,minWidth:200,minHeight:200,allowSizeReduction:true,outlineType:"drop-shadow",wrapperClassName:null,preloadTheseImages:new Array(),continuePreloading:true,expandedImagesCounter:0,expanders:new Array(),overrides:new Array("anchor","align","targetX","targetY","outlineType","outlineWhileAnimating","spaceForCaption","wrapperClassName","minWidth","minHeight","captionId","captionTemplateId","allowSizeReduction","slideshowGroup"),overlays:new Array(),pendingOutlines:new Array(),origNodes:new Array(),faders:new Array(),ie:(document.all&&!window.opera),safari:navigator.userAgent.indexOf("Safari")!=-1,hasFocused:false,$:function(c){return document.getElementById(c)},push:function(c,d){c[c.length]=d},createElement:function(c,h,g,f,e){var d=document.createElement(c);if(h){hs.setAttribs(d,h)}if(e){hs.setStyles(d,{padding:0,border:"none",margin:0})}if(g){hs.setStyles(d,g)}if(f){f.appendChild(d)}return d},setAttribs:function(d,e){for(var c in e){d[c]=e[c]}},setStyles:function(d,f){for(var c in f){try{if(hs.ie&&c=="opacity"){d.style.filter="alpha(opacity="+(f[c]*100)+")"}else{d.style[c]=f[c]}}catch(g){}}},ieVersion:function(){arr=navigator.appVersion.split("MSIE");return parseFloat(arr[1])},clientInfo:function(){var c=document.compatMode&&document.compatMode!="BackCompat"?document.documentElement:document.body;this.width=hs.ie?c.clientWidth:self.innerWidth;this.height=hs.ie?c.clientHeight:self.innerHeight;this.scrollLeft=hs.ie?c.scrollLeft:pageXOffset;this.scrollTop=hs.ie?c.scrollTop:pageYOffset},position:function(d){var c=d;var e={x:c.offsetLeft,y:c.offsetTop};while(c.offsetParent){c=c.offsetParent;e.x+=c.offsetLeft;e.y+=c.offsetTop;if(c!=document.body&&c!=document.documentElement){e.x-=c.scrollLeft;e.y-=c.scrollTop}}return e},expand:function(c,g,d){try{new HsExpander(c,g,d);return false}catch(f){return true}},focusTopmost:function(){var d=0,c=-1;for(i=0;i<hs.expanders.length;i++){if(hs.expanders[i]){if(hs.expanders[i].wrapper.style.zIndex&&hs.expanders[i].wrapper.style.zIndex>d){d=hs.expanders[i].wrapper.style.zIndex;c=i}}}if(c==-1){hs.focusKey=-1}else{hs.expanders[c].focus()}},closeId:function(c){return hs.close(c)},close:function(c){try{hs.getExpander(c).doClose()}catch(d){}return false},getAdjacentAnchor:function(f,h){var c=document.getElementsByTagName("A"),d=new Array,g=-1,e=0;for(i=0;i<c.length;i++){if(hs.isHsAnchor(c[i])&&((hs.expanders[f].slideshowGroup==hs.getParam(c[i],"slideshowGroup")))){d[e]=c[i];if(hs.expanders[f]&&c[i]==hs.expanders[f].a){g=e}e++}}return d[g+h]},getParam:function(a,param){try{var s=a.onclick.toString().replace(/\s/g," ").split("{")[2].split("}")[0];if(hs.safari){for(var i=0;i<hs.overrides.length;i++){s=s.replace(hs.overrides[i]+":",","+hs.overrides[i]+":").replace(new RegExp("^\\s*?,"),"")}}eval("var arr = {"+s+"};");if(arr[param]){return arr[param]}else{return hs[param]}}catch(e){return hs[param]}},getSrc:function(c){var d=hs.getParam(c,"src");if(d){return d}return c.rel.replace(/_slash_/g,"/")||c.href},cloneNode:function(e){if(!hs.$(e)&&!hs.origNodes[e]){return null}var d,c;if(hs.origNodes[e]){c=hs.origNodes[e];d=c.cloneNode(1);hs.setId(d,/-hsOrig$/,1)}else{c=hs.$(e);d=c.cloneNode(1);if(!e.match(/-hsCache[0-9]+$/)){hs.origNodes[e]=hs.$(e);hs.setId(hs.$(e),"-hsOrig")}}if(hs.ie&&hs.cloneFix){d=hs.cloneFix(c,d)}return d},setId:function(h,f,c){if(h.id){h.id=c?h.id.replace(f,""):h.id+f}if(h.name){h.name=c?h.name.replace(f,""):h.name+f}if(hs.geckoBug&&hs.geckoBug(h)){return}var e=h.childNodes;for(var g=0;g<e.length;g++){if(e[g]){hs.setId(e[g],f,c)}}},purge:function(g){var e=g.attributes,f,c,h;if(e){c=e.length;for(f=0;f<c;f+=1){h=e[f].name;if(typeof g[h]==="function"){g[h]=null}}}if(hs.geckoBug&&hs.geckoBug(g)){return}e=g.childNodes;if(e){c=e.length;for(f=0;f<c;f+=1){hs.purge(g.childNodes[f])}}},previousOrNext:function(c,g){var f=hs.getExpander(c);try{hs.getAdjacentAnchor(f.key,g).onclick()}catch(d){}try{f.doClose()}catch(d){}return false},previous:function(c){return hs.previousOrNext(c,-1)},next:function(c){return hs.previousOrNext(c,1)},keyHandler:function(c){if(!c){c=window.event}if(!c.target){c.target=c.srcElement}if(c.target.form){return}var d=null;switch(c.keyCode){case 34:case 39:case 40:d=1;break;case 33:case 37:case 38:d=-1;break;case 27:case 13:d=0}if(d!==null){hs.removeEventListener(document,"keydown",hs.keyHandler);try{if(!hs.enableKeyListener){return true}}catch(c){}if(c.preventDefault){c.preventDefault()}else{c.returnValue=false}if(d==0){try{hs.getExpander().doClose()}catch(c){}return false}else{return hs.previousOrNext(hs.focusKey,d)}}else{return true}},registerOverlay:function(c){hs.push(hs.overlays,c)},getWrapperKey:function(c){var e,d=/^highslide-wrapper-([0-9]+)$/;e=c;while(e.parentNode){e=e.parentNode;if(e.id&&e.id.match(d)){return e.id.replace(d,"$1")}}e=c;while(e.parentNode){if(e.tagName&&hs.isHsAnchor(e)){for(key=0;key<hs.expanders.length;key++){exp=hs.expanders[key];if(exp&&exp.a==e){return key}}}e=e.parentNode}},getExpander:function(c){try{if(!c){return hs.expanders[hs.focusKey]}if(typeof c=="number"){return hs.expanders[c]}if(typeof c=="string"){c=hs.$(c)}return hs.expanders[hs.getWrapperKey(c)]}catch(d){}},cleanUp:function(){for(i=0;i<hs.expanders.length;i++){if(hs.expanders[i]&&hs.expanders[i].isExpanded){hs.focusTopmost()}}},mouseClickHandler:function(g){if(!g){g=window.event}if(g.button>1){return true}if(!g.target){g.target=g.srcElement}if(g.target.form){return}var j=g.target;while(j.parentNode&&!(j.className&&j.className.match(/highslide-(image|move|html)/))){j=j.parentNode}if(!j.parentNode){return}hs.dragExp=hs.getExpander(j);if(j.className.match(/highslide-(image|move)/)){var f=true;var d=parseInt(hs.dragExp.wrapper.style.left);var h=parseInt(hs.dragExp.wrapper.style.top)}if(g.type=="mousedown"){if(f){if(j.className.match("highslide-image")){hs.dragExp.content.style.cursor="move"}hs.wLeft=d;hs.wTop=h;hs.dragX=g.clientX;hs.dragY=g.clientY;hs.addEventListener(document,"mousemove",hs.mouseMoveHandler);if(g.preventDefault){g.preventDefault()}if(hs.dragExp.content.className.match(/highslide-(image|html)-blur/)){hs.dragExp.focus();hs.hasFocused=true}return false}else{if(j.className.match(/highslide-html/)){hs.dragExp.focus();hs.dragExp.redoShowHide();hs.hasFocused=false}}}else{if(g.type=="mouseup"){hs.removeEventListener(document,"mousemove",hs.mouseMoveHandler);if(f&&hs.dragExp){if(j.className.match("highslide-image")){j.style.cursor=hs.styleRestoreCursor}var c=d!=hs.wLeft||h!=hs.wTop;if(!c&&!hs.hasFocused&&!j.className.match(/highslide-move/)){hs.dragExp.onClick()}else{if(c||(!c&&hs.hasHtmlexpanders)){hs.dragExp.redoShowHide()}}hs.hasFocused=false}else{if(j.className.match("highslide-image-blur")){j.style.cursor=hs.styleRestoreCursor}}}}},mouseMoveHandler:function(d){if(!hs.dragExp||!hs.dragExp.wrapper){return}if(!d){d=window.event}hs.dragExp.x.min=hs.wLeft+d.clientX-hs.dragX;hs.dragExp.y.min=hs.wTop+d.clientY-hs.dragY;var c=hs.dragExp.wrapper;c.style.left=hs.dragExp.x.min+"px";c.style.top=hs.dragExp.y.min+"px";if(hs.dragExp.objOutline){var f=hs.dragExp.objOutline;f.table.style.left=(hs.dragExp.x.min-f.offset)+"px";f.table.style.top=(hs.dragExp.y.min-f.offset)+"px"}return false},addEventListener:function(c,f,d){try{c.addEventListener(f,d,false)}catch(g){try{c.detachEvent("on"+f,d);c.attachEvent("on"+f,d)}catch(g){c["on"+f]=d}}},removeEventListener:function(c,f,d){try{c.removeEventListener(f,d,false)}catch(g){try{c.detachEvent("on"+f,d)}catch(g){c["on"+f]=null}}},isHsAnchor:function(c){return(c.onclick&&c.onclick.toString().replace(/\s/g," ").match(/hs.(htmlE|e)xpand/))},preloadFullImage:function(d){if(hs.continuePreloading&&hs.preloadTheseImages[d]&&hs.preloadTheseImages[d]!="undefined"){var c=document.createElement("img");c.onload=function(){hs.preloadFullImage(d+1)};c.src=hs.preloadTheseImages[d]}},preloadImages:function(e){if(e&&typeof e!="object"){hs.numberOfImagesToPreload=e}var d,c=0;var g=document.getElementsByTagName("A");for(i=0;i<g.length;i++){a=g[i];d=hs.isHsAnchor(a);if(d&&d[0]=="hs.expand"){if(c<hs.numberOfImagesToPreload){hs.preloadTheseImages[c]=hs.getSrc(a);c++}}}new HsOutline(hs.outlineType,function(){hs.preloadFullImage(0)});var f=hs.createElement("img",{src:hs.graphicsDir+hs.restoreCursor})},genContainer:function(){if(!hs.container){hs.container=hs.createElement("div",null,{position:"absolute",left:0,top:0,width:"100%",zIndex:hs.zIndexCounter},document.body,true)}},fade:function(f,g,e,c,d){g=parseFloat(g);if(g<=0){f.style.visibility="hidden"}else{f.style.visibility="visible"}if(c*(g-e)>0){return}if(d==null){d=hs.faders.length}if(typeof(f.i)!="undefined"&&f.i!=d){clearTimeout(hs.faders[f.i]);g=f.tempOpacity}f.i=d;f.tempOpacity=g;f.style.visibility=(g<=0)?"hidden":"visible";hs.setStyles(f,{opacity:g});hs.faders[d]=setTimeout(function(){hs.fade(f,Math.round((g+0.1*c)*100)/100,e,c,d)},25)}};HsOutline=function(h,f){if(!h){if(f){f()}return}this.onLoad=f;this.outlineType=h;var c=hs.ieVersion(),g;hs.genContainer();this.hasAlphaImageLoader=hs.ie&&c>=5.5&&c<7;this.hasPngSupport=!hs.ie||(hs.ie&&c>=7);this.hasOutline=this.outlineType&&(this.hasAlphaImageLoader||this.hasPngSupport);this.table=hs.createElement("table",{cellSpacing:0},{visibility:"hidden",position:"absolute",zIndex:hs.zIndexCounter++,borderCollapse:"collapse"},hs.container,true);this.tbody=hs.createElement("tbody",null,null,this.table);this.td=Array();for(var d=0;d<=8;d++){if(d%3==0){g=hs.createElement("tr",null,null,this.tbody,true)}this.td[d]=hs.createElement("td",null,null,g,true);var e=d!=4?{lineHeight:0,fontSize:0}:{position:"relative"};hs.setStyles(this.td[d],e)}this.td[4].className=h;this.preloadGraphic()};HsOutline.prototype.preloadGraphic=function(){var d=hs.graphicsDir+"outlines/"+this.outlineType+".png";var c=hs.safari?hs.container:null;this.graphic=hs.createElement("img",null,{position:"absolute",left:"-9999px",top:"-9999px"},c,true);var e=this;this.graphic.onload=function(){e.onGraphicLoad()};this.graphic.src=d};HsOutline.prototype.onGraphicLoad=function(){var f=this.offset=this.graphic.width/4;var h=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]];for(var d=0;d<=8;d++){if(h[d]){if(this.hasAlphaImageLoader){var c=(d==1||d==7)?"100%":this.graphic.width+"px";var g=hs.createElement("div",null,{width:"100%",height:"100%",position:"relative",overflow:"hidden"},this.td[d],true);hs.createElement("div",null,{filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+this.graphic.src+"')",position:"absolute",width:c,height:this.graphic.height+"px",left:(h[d][0]*f)+"px",top:(h[d][1]*f)+"px"},g,true)}else{hs.setStyles(this.td[d],{background:"url("+this.graphic.src+") "+(h[d][0]*f)+"px "+(h[d][1]*f)+"px"})}var e=2*f;hs.setStyles(this.td[d],{height:e+"px",width:e+"px"})}}hs.pendingOutlines[this.outlineType]=this;if(this.onLoad){this.onLoad()}};HsOutline.prototype.destroy=function(){hs.purge(this.table);try{this.table.parentNode.removeChild(this.table)}catch(c){}};HsExpander=function(k,g,c,l){hs.continuePreloading=false;this.custom=c;for(i=0;i<hs.overrides.length;i++){var d=hs.overrides[i];if(g&&typeof g[d]!="undefined"){this[d]=g[d]}else{this[d]=hs[d]}}var e;if(g&&g.thumbnailId){e=hs.$(g.thumbnailId)}else{e=k.getElementsByTagName("IMG")[0]}if(!e){e=k}for(i=0;i<hs.expanders.length;i++){if(hs.expanders[i]&&hs.expanders[i].thumb!=e&&!hs.expanders[i].onLoadStarted){hs.expanders[i].cancelLoading()}}for(i=0;i<hs.expanders.length;i++){if(hs.expanders[i]&&hs.expanders[i].thumb==e){hs.expanders[i].focus();return false}}if(!hs.allowMultipleInstances){var f=hs.expandedImagesCounter-1;if(hs.expanders[f]){hs.expanders[f].doClose()}}var n=this.key=hs.expandedImagesCounter++;hs.expanders[this.key]=this;if(l=="html"){this.isHtml=true;this.contentType="html"}else{this.isImage=true;this.contentType="image"}this.a=k;this.thumbsUserSetId=e.id||k.id;this.thumb=e;this.overlays=new Array();var j=hs.position(e);this.wrapper=hs.createElement("div",{id:"highslide-wrapper-"+this.key,className:this.wrapperClassName},{visibility:"hidden",position:"absolute",zIndex:hs.zIndexCounter++},null,true);this.wrapper.onmouseover=function(p){try{hs.expanders[n].onMouseOver()}catch(p){}};this.wrapper.onmouseout=function(p){try{hs.expanders[n].onMouseOut()}catch(p){}};this.thumbWidth=e.width?e.width:e.offsetWidth;this.thumbHeight=e.height?e.height:e.offsetHeight;this.thumbLeft=j.x;this.thumbTop=j.y;this.thumbOffsetBorderW=(this.thumb.offsetWidth-this.thumbWidth)/2;this.thumbOffsetBorderH=(this.thumb.offsetHeight-this.thumbHeight)/2;hs.genContainer();if(hs.pendingOutlines[this.outlineType]){this.connectOutline();this[this.contentType+"Create"]()}else{if(!this.outlineType){this[this.contentType+"Create"]()}else{this.displayLoading();var h=this;new HsOutline(this.outlineType,function(){h.connectOutline();h[h.contentType+"Create"]()})}}};HsExpander.prototype.connectOutline=function(c,e){var d=hs.pendingOutlines[this.outlineType];this.objOutline=d;hs.pendingOutlines[this.outlineType]=null};HsExpander.prototype.displayLoading=function(){if(this.onLoadStarted||this.loading){return}this.originalCursor=this.a.style.cursor;this.a.style.cursor="wait";if(!hs.loading){hs.loading=hs.createElement("a",{className:"highslide-loading",title:hs.loadingTitle,innerHTML:hs.loadingText},{position:"absolute",opacity:hs.loadingOpacity},hs.container)}this.loading=hs.loading;this.loading.href="javascript:hs.expanders["+this.key+"].cancelLoading()";this.loading.visibility="visible";this.loading.style.left=(this.thumbLeft+this.thumbOffsetBorderW+(this.thumbWidth-this.loading.offsetWidth)/2)+"px";this.loading.style.top=(this.thumbTop+(this.thumbHeight-this.loading.offsetHeight)/2)+"px";setTimeout("if (hs.expanders["+this.key+"] && hs.expanders["+this.key+"].loading) hs.expanders["+this.key+"].loading.style.visibility = 'visible';",100)};HsExpander.prototype.imageCreate=function(){var d=this.key;var c=document.createElement("img");this.content=c;c.onload=function(){try{hs.expanders[d].onLoad()}catch(f){}};c.className="highslide-image";c.style.visibility="hidden";c.style.display="block";c.style.position="absolute";c.style.maxWidth="none";c.style.zIndex=3;c.title=hs.restoreTitle;if(hs.safari){hs.container.appendChild(c)}c.src=hs.getSrc(this.a);this.displayLoading()};HsExpander.prototype.onLoad=function(){try{if(!this.content){return}if(this.onLoadStarted){return}else{this.onLoadStarted=true}if(this.loading){this.loading.style.visibility="hidden";this.loading=null;this.a.style.cursor=this.originalCursor||""}if(this.isImage){this.newWidth=this.content.width;this.newHeight=this.content.height;this.fullExpandWidth=this.newWidth;this.fullExpandHeight=this.newHeight;this.content.width=this.thumbWidth;this.content.height=this.thumbHeight}else{if(this.htmlGetSize){this.htmlGetSize()}}this.marginBottom=hs.marginBottom;this.getCaption();this.wrapper.appendChild(this.content);this.content.style.position="relative";if(this.caption){this.wrapper.appendChild(this.caption)}this.wrapper.style.left=this.thumbLeft+"px";this.wrapper.style.top=this.thumbTop+"px";hs.container.appendChild(this.wrapper);this.offsetBorderW=(this.content.offsetWidth-this.thumbWidth)/2;this.offsetBorderH=(this.content.offsetHeight-this.thumbHeight)/2;var g=hs.marginRight+2*this.offsetBorderW;this.marginBottom+=2*this.offsetBorderH;var k=this.newWidth/this.newHeight;var d=this.allowSizeReduction?this.minWidth:this.newWidth;var p=this.allowSizeReduction?this.minHeight:this.newHeight;var h={x:"auto",y:"auto"};if(this.align=="center"){h.x="center";h.y="center"}else{if(this.anchor.match(/^top/)){h.y=null}if(this.anchor.match(/right$/)){h.x="max"}if(this.anchor.match(/^bottom/)){h.y="max"}if(this.anchor.match(/left$/)){h.x=null}}client=new hs.clientInfo();this.x={min:parseInt(this.thumbLeft)-this.offsetBorderW+this.thumbOffsetBorderW,span:this.newWidth,minSpan:this.newWidth<d?this.newWidth:d,justify:h.x,target:this.targetX,marginMin:hs.marginLeft,marginMax:g,scroll:client.scrollLeft,clientSpan:client.width,thumbSpan:this.thumbWidth};var f=this.x.min+parseInt(this.thumbWidth);this.x=this.justify(this.x);this.y={min:parseInt(this.thumbTop)-this.offsetBorderH+this.thumbOffsetBorderH,span:this.newHeight,minSpan:this.newHeight<p?this.newHeight:p,justify:h.y,target:this.targetY,marginMin:hs.marginTop,marginMax:this.marginBottom,scroll:client.scrollTop,clientSpan:client.height,thumbSpan:this.thumbHeight};var c=this.y.min+parseInt(this.thumbHeight);this.y=this.justify(this.y);if(this.isHtml){this.htmlSizeOperations()}if(this.isImage){this.correctRatio(k)}var n=this.x;var l=this.y;this.show()}catch(j){if(hs.expanders[this.key]&&hs.expanders[this.key].a){window.location.href=hs.getSrc(hs.expanders[this.key].a)}}};HsExpander.prototype.show=function(){var d={x:this.x.min-20,y:this.y.min-20,w:this.x.span+40,h:this.y.span+40+this.spaceForCaption};hs.hideSelects=(hs.ie&&hs.ieVersion()<7);if(hs.hideSelects){this.showHideElements("SELECT","hidden",d)}hs.hideIframes=(window.opera||navigator.vendor=="KDE"||(hs.ie&&hs.ieVersion()<5.5));if(hs.hideIframes){this.showHideElements("IFRAME","hidden",d)}if(this.objOutline&&!this.outlineWhileAnimating){this.positionOutline(this.x.min,this.y.min,this.x.span,this.y.span)}var c=this.objOutline?this.objOutline.offset:0;this.changeSize(1,this.thumbLeft+this.thumbOffsetBorderW-this.offsetBorderW,this.thumbTop+this.thumbOffsetBorderH-this.offsetBorderH,this.thumbWidth,this.thumbHeight,this.x.min,this.y.min,this.x.span,this.y.span,hs.expandDuration,hs.expandSteps,hs.outlineStartOffset,c)};HsExpander.prototype.justify=function(f){var g,e=f==this.x?"x":"y";if(f.target&&f.target.match(/ /)){g=f.target.split(" ");f.target=g[0]}if(f.target&&hs.$(f.target)){f.min=hs.position(hs.$(f.target))[e];if(g&&g[1]&&g[1].match(/^[-]?[0-9]+px$/)){f.min+=parseInt(g[1])}}else{if(f.justify=="auto"||f.justify=="center"){var d=false;var c=true;if(f.justify=="center"){f.min=Math.round(f.scroll+(f.clientSpan-f.span-f.marginMax)/2)}else{f.min=Math.round(f.min-((f.span-f.thumbSpan)/2))}if(f.min<f.scroll+f.marginMin){f.min=f.scroll+f.marginMin;d=true}if(f.span<f.minSpan){f.span=f.minSpan;c=false}if(f.min+f.span>f.scroll+f.clientSpan-f.marginMax){if(d&&c){f.span=f.clientSpan-f.marginMin-f.marginMax}else{if(f.span<f.clientSpan-f.marginMin-f.marginMax){f.min=f.scroll+f.clientSpan-f.span-f.marginMin-f.marginMax}else{f.min=f.scroll+f.marginMin;if(c){f.span=f.clientSpan-f.marginMin-f.marginMax}}}}if(f.span<f.minSpan){f.span=f.minSpan;c=false}}else{if(f.justify=="max"){f.min=Math.floor(f.min-f.span+f.thumbSpan)}}}if(f.min<f.marginMin){tmpMin=f.min;f.min=f.marginMin;if(c){f.span=f.span-(f.min-tmpMin)}}return f};HsExpander.prototype.correctRatio=function(e){var d=this.x;var h=this.y;var g=false;if(d.span/h.span>e){var c=d.span;d.span=h.span*e;if(d.span<d.minSpan){d.span=d.minSpan;h.span=d.span/e}g=true}else{if(d.span/h.span<e){var f=h.span;h.span=d.span/e;g=true}}if(g){d.min=parseInt(this.thumbLeft)-this.offsetBorderW+this.thumbOffsetBorderW;d.minSpan=d.span;this.x=this.justify(d);h.min=parseInt(this.thumbTop)-this.offsetBorderH+this.thumbOffsetBorderH;h.minSpan=h.span;this.y=this.justify(h)}};HsExpander.prototype.changeSize=function(w,A,e,q,n,z,c,p,l,x,y,f,d){var j=(p-q)/y,r=(l-n)/y,h=(z-A)/y,g=(c-e)/y,B=(d-f)/y,u,k="hs.expanders["+this.key+"]";for(i=1;i<=y;i++){q+=j;n+=r;A+=h;e+=g;f+=B;u=Math.round(i*(x/y));var v="try {";if(i==1){v+=k+".content.style.visibility = 'visible';if ("+k+".thumb.tagName == 'IMG' && hs.hideThumbOnExpand) "+k+".thumb.style.visibility = 'hidden';"}if(i==y){q=p;n=l;A=z;e=c;f=d}v+=k+"."+this.contentType+"SetSize("+Math.round(q)+", "+Math.round(n)+", "+Math.round(A)+", "+Math.round(e)+", "+Math.round(f);v+=");} catch (e) {}";setTimeout(v,u)}if(w==1){setTimeout("try { "+k+'.objOutline.table.style.visibility = "visible"; } catch (e){}',u);setTimeout("try { "+k+".onExpanded(); } catch(e){}",u+50)}else{setTimeout("try { "+k+".onEndClose(); } catch(e){}",u)}};HsExpander.prototype.imageSetSize=function(d,f,c,l,k){try{this.content.width=d;this.content.height=f;if(this.objOutline&&this.outlineWhileAnimating){var j=this.objOutline.offset-k;this.positionOutline(c+j,l+j,d-2*j,f-2*j,1)}hs.setStyles(this.wrapper,{visibility:"visible",left:c+"px",top:l+"px"})}catch(g){window.location.href=hs.getSrc(this.a)}};HsExpander.prototype.positionOutline=function(c,j,d,e,f){if(!this.objOutline){return}var g=this.objOutline;if(f){g.table.style.visibility="visible"}g.table.style.left=(c-g.offset)+"px";g.table.style.top=(j-g.offset)+"px";g.table.style.width=(d+2*(this.offsetBorderW+g.offset))+"px";d+=2*(this.offsetBorderW-g.offset);e+=+2*(this.offsetBorderH-g.offset);g.td[4].style.width=d>=0?d+"px":0;g.td[4].style.height=e>=0?e+"px":0;if(g.hasAlphaImageLoader){g.td[3].style.height=g.td[5].style.height=g.td[4].style.height}};HsExpander.prototype.onExpanded=function(){this.isExpanded=true;this.focus();if(this.isHtml&&this.objectLoadTime=="after"){this.writeExtendedContent()}this.createCustomOverlays();if(hs.showCredits){this.writeCredits()}if(this.caption){this.writeCaption()}if(this.fullExpandWidth>this.x.span){this.createFullExpand()}if(!this.caption){this.onDisplayFinished()}};HsExpander.prototype.onDisplayFinished=function(){var c=this.key;var d=this.outlineType;new HsOutline(d,function(){try{hs.expanders[c].preloadNext()}catch(f){}})};HsExpander.prototype.preloadNext=function(){var d=hs.getAdjacentAnchor(this.key,1);if(d.onclick.toString().match(/hs\.expand/)){var c=hs.createElement("img",{src:hs.getSrc(d)})}};HsExpander.prototype.cancelLoading=function(){this.a.style.cursor=this.originalCursor;if(this.loading){hs.loading.style.visibility="hidden"}hs.expanders[this.key]=null};HsExpander.prototype.writeCredits=function(){var c=hs.createElement("a",{href:hs.creditsHref,className:"highslide-credits",innerHTML:hs.creditsText,title:hs.creditsTitle});this.createOverlay(c,"top left")};HsExpander.prototype.getCaption=function(){if(!this.captionId&&this.thumbsUserSetId){this.captionId="caption-for-"+this.thumbsUserSetId}if(this.captionId){this.caption=hs.cloneNode(this.captionId)}if(this.captionTemplateId){var c=(this.caption)?this.caption.innerHTML:"";this.caption=hs.cloneNode(this.captionTemplateId);if(this.caption){this.caption.innerHTML=this.caption.innerHTML.replace(/\s/g," ").replace("{caption}",c)}}if(this.caption){this.marginBottom+=this.spaceForCaption}};HsExpander.prototype.writeCaption=function(){try{this.wrapper.style.width=this.wrapper.offsetWidth+"px";this.caption.style.visibility="hidden";this.caption.className+=" highslide-display-block";var height;if(hs.ie&&(hs.ieVersion()<6||document.compatMode=="BackCompat")){height=this.caption.offsetHeight}else{var temp=hs.createElement("div",{innerHTML:this.caption.innerHTML},null,null,true);this.caption.innerHTML="";this.caption.appendChild(temp);height=this.caption.childNodes[0].offsetHeight;this.caption.innerHTML=this.caption.childNodes[0].innerHTML}hs.setStyles(this.caption,{overflow:"hidden",height:0,zIndex:2});if(hs.captionSlideSpeed){step=Math.round(height/50);if(step==0){step=1}step=step*hs.captionSlideSpeed}else{this.placeCaption(height,1);return}var t=0;for(var h=height%step;h<=height;h+=step,t+=10){var end=(h==height)?1:0;var eval="try { hs.expanders["+this.key+"].placeCaption("+h+", "+end+");} catch (e) {}";setTimeout(eval,t)}}catch(e){}};HsExpander.prototype.placeCaption=function(c,d){if(!this.caption){return}this.caption.style.height=c+"px";this.caption.style.visibility="visible";this.y.span=this.wrapper.offsetHeight-2*this.offsetBorderH;var e=this.objOutline;if(e){e.td[4].style.height=(this.wrapper.offsetHeight-2*this.objOutline.offset)+"px";if(e.hasAlphaImageLoader){e.td[3].style.height=e.td[5].style.height=e.td[4].style.height}}if(d){this.onDisplayFinished()}};HsExpander.prototype.showHideElements=function(d,c,g){var f=document.getElementsByTagName(d);if(f){for(i=0;i<f.length;i++){if(f[i].nodeName==d){var j=f[i].getAttribute("hidden-by");if(c=="visible"&&j){j=j.replace("["+this.key+"]","");f[i].setAttribute("hidden-by",j);if(!j){f[i].style.visibility="visible"}}else{if(c=="hidden"){var l=hs.position(f[i]);l.w=f[i].offsetWidth;l.h=f[i].offsetHeight;var k=(l.x+l.w<g.x||l.x>g.x+g.w);var h=(l.y+l.h<g.y||l.y>g.y+g.h);var e=hs.getWrapperKey(f[i]);if(!k&&!h&&e!=this.key){if(!f[i].currentStyle||(f[i].currentStyle&&f[i].currentStyle.visibility!="hidden")){if(!j){f[i].setAttribute("hidden-by","["+this.key+"]")}else{if(!j.match("["+this.key+"]")){f[i].setAttribute("hidden-by",j+"["+this.key+"]")}}f[i].style.visibility="hidden"}}else{if(j=="["+this.key+"]"||hs.focusKey==e){f[i].setAttribute("hidden-by","");f[i].style.visibility="visible"}else{if(j&&j.match("["+this.key+"]")){f[i].setAttribute("hidden-by",j.replace("["+this.key+"]",""))}}}}}}}}};HsExpander.prototype.focus=function(){for(i=0;i<hs.expanders.length;i++){if(hs.expanders[i]&&i==hs.focusKey){var c=hs.expanders[i];c.content.className+=" highslide-"+c.contentType+"-blur";if(c.caption){hs.setId(c.caption,"-hsBlur"+i);c.caption.className+=" highslide-caption-blur"}if(c.isImage){c.content.style.cursor=hs.ie?"hand":"pointer";c.content.title=hs.focusTitle}else{hs.setId(c.innerContent,"-hsBlur"+i)}}}this.wrapper.style.zIndex=hs.zIndexCounter++;if(this.objOutline){this.objOutline.table.style.zIndex=this.wrapper.style.zIndex}this.content.className="highslide-"+this.contentType;if(this.caption){hs.setId(this.caption,"-hsBlur"+this.key,1);this.caption.className=this.caption.className.replace(" highslide-caption-blur","")}if(this.isImage){this.content.title=hs.restoreTitle;hs.styleRestoreCursor=window.opera?"pointer":"url("+hs.graphicsDir+hs.restoreCursor+"), pointer";if(hs.ie&&hs.ieVersion()<6){hs.styleRestoreCursor="hand"}this.content.style.cursor=hs.styleRestoreCursor}else{hs.setId(this.innerContent,"-hsBlur"+this.key,1)}hs.focusKey=this.key;hs.addEventListener(document,"keydown",hs.keyHandler)};HsExpander.prototype.onClick=function(){this.doClose()};HsExpander.prototype.doClose=function(){hs.removeEventListener(document,"keydown",hs.keyHandler);try{this.isClosing=true;var c=parseInt(this.wrapper.style.left);var p=parseInt(this.wrapper.style.top);var d=(this.isImage)?this.content.width:parseInt(this.content.style.width);var f=(this.isImage)?this.content.height:parseInt(this.content.style.height);if(this.objOutline){if(this.outlineWhileAnimating){this.positionOutline(c,p,d,f)}else{if(this.preserveContent){this.objOutline.table.style.visibility="hidden"}else{this.objOutline.destroy()}}}var l=this.wrapper.childNodes.length;for(i=l-1;i>=0;i--){var k=this.wrapper.childNodes[i];if(k!=this.content){hs.purge(this.wrapper.childNodes[i]);this.wrapper.removeChild(this.wrapper.childNodes[i])}}if(this.isHtml){this.htmlOnClose()}this.wrapper.style.width="auto";this.content.style.cursor="default";var g=this.objOutline?this.objOutline.offset:0;this.changeSize(-1,c,p,d,f,this.thumbLeft-this.offsetBorderW+this.thumbOffsetBorderW,this.thumbTop-this.offsetBorderH+this.thumbOffsetBorderH,this.thumbWidth,this.thumbHeight,hs.restoreDuration,hs.restoreSteps,g,hs.outlineStartOffset)}catch(j){this.onEndClose()}};HsExpander.prototype.onEndClose=function(){this.thumb.style.visibility="visible";if(hs.hideSelects){this.showHideElements("SELECT","visible")}if(hs.hideIframes){this.showHideElements("IFRAME","visible")}if(this.preserveContent){this.sleep()}else{if(this.objOutline&&this.outlineWhileAnimating){this.objOutline.destroy()}hs.purge(this.wrapper);this.wrapper.parentNode.removeChild(this.wrapper)}hs.expanders[this.key]=null;hs.cleanUp()};HsExpander.prototype.createOverlay=function(c,f,k,g){if(typeof c=="string"){c=hs.cloneNode(c)}if(!c||typeof c=="string"||!this.isImage){return}var e=hs.createElement("div",null,{left:0,top:0,position:"absolute",zIndex:3,visibility:"hidden"},this.wrapper,true);if(g){hs.setStyles(c,{opacity:g})}c.className+=" highslide-display-block";e.appendChild(c);var d=this.offsetBorderW;var l=this.content.width-e.offsetWidth;var j=this.offsetBorderH;var h=this.content.height-e.offsetHeight;if(!f){f="center center"}if(f.match(/^bottom/)){j+=h}if(f.match(/^center/)){j+=h/2}if(f.match(/right$/)){d+=l}if(f.match(/center$/)){d+=l/2}e.style.left=d+"px";e.style.top=j+"px";if(k){e.setAttribute("hideOnMouseOut",true)}e.setAttribute("opacity",g);hs.fade(e,0,g,1);hs.push(this.overlays,e)};HsExpander.prototype.createCustomOverlays=function(){for(i=0;i<hs.overlays.length;i++){var c=hs.overlays[i];if(c.thumbnailId==null||c.thumbnailId==this.thumbsUserSetId){this.createOverlay(c.overlayId,c.position,c.hideOnMouseOut,c.opacity)}}};HsExpander.prototype.onMouseOver=function(){for(i=0;i<this.overlays.length;i++){hs.fade(this.overlays[i],0,this.overlays[i].getAttribute("opacity"),1)}};HsExpander.prototype.onMouseOut=function(){var c=new Array();var d=0;for(i=0;i<this.overlays.length;i++){if(this.overlays[i].getAttribute("hideOnMouseOut")){c[d]=this.overlays[i];d++}}for(i=0;i<c.length;i++){hs.fade(c[i],c[i].getAttribute("opacity"),0,-1)}};HsExpander.prototype.createFullExpand=function(){var c=hs.createElement("a",{href:"javascript:hs.expanders["+this.key+"].doFullExpand();",title:hs.fullExpandTitle},{background:"url("+hs.graphicsDir+hs.fullExpandIcon+")",display:"block",margin:"0 10px 10px 0",width:"45px",height:"44px"},null,true);this.createOverlay(c,"bottom right",true,0.75);this.fullExpandIcon=c};HsExpander.prototype.doFullExpand=function(){try{hs.purge(this.fullExpandIcon);this.fullExpandIcon.parentNode.removeChild(this.fullExpandIcon);this.focus();this.x.min=parseInt(this.wrapper.style.left)-(this.fullExpandWidth-this.content.width)/2;if(this.x.min<hs.marginLeft){this.x.min=hs.marginLeft}this.wrapper.style.left=this.x.min+"px";var c=this.wrapper.offsetWidth-this.content.width;this.content.width=this.fullExpandWidth;this.content.height=this.fullExpandHeight;this.x.span=this.content.width;this.wrapper.style.width=(this.x.span+c)+"px";this.y.span=this.wrapper.offsetHeight-2*this.offsetBorderH;this.positionOutline(this.x.min,this.y.min,this.x.span,this.y.span);for(var d=0;d<this.overlays.length;d++){hs.purge(this.overlays[d]);this.overlays[d].parentNode.removeChild(this.overlays[d])}if(hs.showCredits){this.writeCredits()}this.createCustomOverlays();this.redoShowHide()}catch(f){window.location.href=this.content.src}};HsExpander.prototype.redoShowHide=function(){var c={x:parseInt(this.wrapper.style.left)-20,y:parseInt(this.wrapper.style.top)-20,w:this.content.offsetWidth+40,h:this.content.offsetHeight+40+this.spaceForCaption};if(hs.hideSelects){this.showHideElements("SELECT","hidden",c)}if(hs.hideIframes){this.showHideElements("IFRAME","hidden",c)}};hs.addEventListener(document,"mousedown",hs.mouseClickHandler);hs.addEventListener(document,"mouseup",hs.mouseClickHandler);hs.addEventListener(window,"load",hs.preloadImages);hs.allowWidthReduction=false;hs.allowHeightReduction=false;hs.objectLoadTime="before";hs.cacheAjax=false;hs.preserveContent=false;hs.push(hs.overrides,"contentId");hs.push(hs.overrides,"allowWidthReduction");hs.push(hs.overrides,"allowHeightReduction");hs.push(hs.overrides,"objectType");hs.push(hs.overrides,"objectWidth");hs.push(hs.overrides,"objectHeight");hs.push(hs.overrides,"objectLoadTime");hs.push(hs.overrides,"swfObject");hs.push(hs.overrides,"cacheAjax");hs.push(hs.overrides,"preserveContent");hs.preloadTheseAjax=new Array;hs.cacheBindings=new Array;hs.sleeping=new Array;hs.cacheCounter=0;hs.clearing=hs.createElement("div",null,{clear:"both",borderTop:"1px solid white"},null,true);hs.htmlExpand=function(c,h,f){if(!hs.$(h.contentId)&&!hs.origNodes[h.contentId]){return true}for(var d=0;d<hs.sleeping.length;d++){if(hs.sleeping[d]&&hs.sleeping[d].a==c){hs.sleeping[d].awake();hs.sleeping[d]=null;return false}}try{hs.hasHtmlexpanders=true;new HsExpander(c,h,f,"html");return false}catch(g){return true}};hs.identifyContainer=function(d,c){for(i=0;i<d.childNodes.length;i++){if(d.childNodes[i].className==c){return d.childNodes[i]}}};hs.geckoBug=function(c){return(!hs.ie&&c.className&&c.className=="highslide-body"&&hs.expanders[hs.getWrapperKey(c)]&&hs.expanders[hs.getWrapperKey(c)].swfObject)};hs.cloneFix=function(f,e){var c=f.getElementsByTagName("SELECT");var d=e.getElementsByTagName("SELECT");for(i=0;i<c.length;i++){d[i].selectedIndex=c[i].selectedIndex}return e};hs.preloadAjax=function(g){var h=document.getElementsByTagName("A");var c,f,d=0;for(i=0;i<h.length;i++){c=h[i];f=hs.isHsAnchor(c);if(f&&f[0]=="hs.htmlExpand"&&hs.getParam(c,"objectType")=="ajax"&&hs.getParam(c,"cacheAjax")){hs.preloadTheseAjax[d]=c;d++}}hs.preloadAjaxElement(0)};hs.preloadAjaxElement=function(e){if(!hs.preloadTheseAjax[e]){return}var c=hs.preloadTheseAjax[e];var d=hs.cloneNode(hs.getParam(c,"contentId"));var f=new HsAjax(c,d);f.onError=function(){};f.onLoad=function(){hs.setId(d,/-hsOrig$/,1);hs.setId(d,"-hsCache"+hs.cacheCounter);hs.genContainer();hs.container.appendChild(d);hs.cacheBindings[d.id]=c;hs.cacheCounter++;hs.preloadAjaxElement(e+1)};f.run()};hs.getCacheBinding=function(d){for(var c in hs.cacheBindings){if(hs.cacheBindings[c]==d){return hs.$(c)}}return false};HsExpander.prototype.htmlCreate=function(){this.tempContainer=hs.createElement("div",null,{padding:"0 "+hs.marginRight+"px 0 "+hs.marginLeft+"px",position:"absolute",left:0,top:0},document.body);this.innerContent=hs.getCacheBinding(this.a);if(this.innerContent){hs.setId(this.innerContent,/-hsCache[0-9]+/,1)}else{this.innerContent=hs.cloneNode(this.contentId)}this.setObjContainerSize(this.innerContent);this.tempContainer.appendChild(this.innerContent);hs.setStyles(this.innerContent,{position:"relative",visibility:"hidden"});this.innerContent.className+=" highslide-display-block";this.content=hs.createElement("div",{className:"highslide-html"},{position:"relative",zIndex:3,overflow:"hidden",width:this.thumbWidth+"px",height:this.thumbHeight+"px"},null);if(this.objectType=="ajax"&&!hs.getCacheBinding(this.a)){var c=new HsAjax(this.a,this.innerContent);var d=this;c.onLoad=function(){d.onLoad()};c.onError=function(){location.href=hs.getSrc(this.a)};c.run()}else{this.onLoad()}};HsExpander.prototype.htmlGetSize=function(){this.innerContent.appendChild(hs.clearing);this.newWidth=this.innerContent.offsetWidth;this.newHeight=this.innerContent.offsetHeight;this.innerContent.removeChild(hs.clearing);if(hs.ie&&this.newHeight>parseInt(this.innerContent.currentStyle.height)){this.newHeight=parseInt(this.innerContent.currentStyle.height)}};HsExpander.prototype.setObjContainerSize=function(d,f){if(this.swfObject||this.objectType=="iframe"){var e=hs.identifyContainer(d,"highslide-body");e.style.width=this.swfObject?this.swfObject.attributes.width+"px":this.objectWidth+"px";e.style.height=this.swfObject?this.swfObject.attributes.height+"px":this.objectHeight+"px"}};HsExpander.prototype.writeExtendedContent=function(){if(this.hasExtendedContent){return}this.objContainer=hs.identifyContainer(this.innerContent,"highslide-body");if(this.objectType=="iframe"){if(hs.ie&&hs.ieVersion()<5.5){window.location.href=hs.getSrc(this.a)}var c=this.key;this.iframe=hs.createElement("iframe",{frameBorder:0},{width:this.objectWidth+"px",height:this.objectHeight+"px"},this.objContainer);if(hs.safari){this.iframe.src=null}this.iframe.src=hs.getSrc(this.a);if(this.objectLoadTime=="after"){this.correctIframeSize()}}else{if(this.swfObject){this.objContainer.id=this.objContainer.id||"hs-flash-id-"+this.key;this.swfObject.write(this.objContainer.id)}}this.hasExtendedContent=true};HsExpander.prototype.correctIframeSize=function(){var d=this.innerContent.offsetWidth-this.objContainer.offsetWidth;if(d<0){d=0}var c=this.innerContent.offsetHeight-this.objContainer.offsetHeight;hs.setStyles(this.iframe,{width:(this.x.span-d)+"px",height:(this.y.span-c)+"px"});hs.setStyles(this.objContainer,{width:this.iframe.style.width,height:this.iframe.style.height});this.scrollingContent=this.iframe;this.scrollerDiv=this.scrollingContent};HsExpander.prototype.htmlSizeOperations=function(){this.setObjContainerSize(this.innerContent);if(this.objectLoadTime=="before"){this.writeExtendedContent()}if(this.x.span<this.newWidth&&!this.allowWidthReduction){this.x.span=this.newWidth}if(this.y.span<this.newHeight&&!this.allowHeightReduction){this.y.span=this.newHeight}this.scrollerDiv=this.innerContent;this.mediumContent=hs.createElement("div",null,{width:this.x.span+"px",position:"relative",left:(this.x.min-this.thumbLeft)+"px",top:(this.y.min-this.thumbTop)+"px"},this.content,true);this.mediumContent.appendChild(this.innerContent);document.body.removeChild(this.tempContainer);hs.setStyles(this.innerContent,{border:"none",width:"auto",height:"auto"});var g=hs.identifyContainer(this.innerContent,"highslide-body");if(g&&!this.swfObject&&this.objectType!="iframe"){var d=g.cloneNode(true);if(hs.ie){d=hs.cloneFix(g,d)}g.innerHTML="";g.id=null;hs.setStyles(g,{margin:0,border:"none",padding:0,overflow:"hidden"});g.appendChild(hs.clearing);g.appendChild(d);var e=this.innerContent.offsetWidth-g.offsetWidth;var c=this.innerContent.offsetHeight-g.offsetHeight;g.removeChild(hs.clearing);var f=hs.safari||navigator.vendor=="KDE"?1:0;hs.setStyles(g,{width:(this.x.span-e-f)+"px",height:(this.y.span-c)+"px",overflow:"auto",position:"relative"});if(f&&d.offsetHeight>g.offsetHeight){g.style.width=(parseInt(g.style.width)+f)+"px"}this.scrollingContent=g;this.scrollerDiv=this.scrollingContent}if(this.iframe&&this.objectLoadTime=="before"){this.correctIframeSize()}if(!this.scrollingContent&&this.y.span<this.mediumContent.offsetHeight){this.scrollerDiv=this.content}if(this.scrollerDiv==this.content&&!this.allowWidthReduction&&this.objectType!="iframe"){this.x.span+=17}if(this.scrollerDiv&&this.scrollerDiv.offsetHeight>this.scrollerDiv.parentNode.offsetHeight){setTimeout("try { hs.expanders["+this.key+"].scrollerDiv.style.overflow = 'auto'; } catch(e) {}",hs.expandDuration)}};HsExpander.prototype.htmlSetSize=function(f,g,c,n,l,d){try{hs.setStyles(this.wrapper,{visibility:"visible",left:c+"px",top:n+"px"});hs.setStyles(this.content,{width:f+"px",height:g+"px"});hs.setStyles(this.mediumContent,{left:(this.x.min-c)+"px",top:(this.y.min-n)+"px"});this.innerContent.style.visibility="visible";if(this.objOutline&&this.outlineWhileAnimating){var k=this.objOutline.offset-l;this.positionOutline(c+k,n+k,f-2*k,g-2*k,1)}}catch(j){window.location.href=hs.getSrc(this.a)}};HsExpander.prototype.reflow=function(){hs.setStyles(this.scrollerDiv,{height:"auto",width:"auto"});this.x.span=this.innerContent.offsetWidth;this.y.span=this.innerContent.offsetHeight;var c={width:this.x.span+"px",height:this.y.span+"px"};hs.setStyles(this.content,c);this.positionOutline(this.x.min,this.y.min,this.x.span,this.y.span)};HsExpander.prototype.htmlOnClose=function(){if(this.objectLoadTime=="after"&&!this.preserveContent){this.destroyObject()}if(this.scrollerDiv&&this.scrollerDiv!=this.scrollingContent){this.scrollerDiv.style.overflow="hidden"}if(this.swfObject){hs.$(this.swfObject.getAttribute("id")).StopPlay()}};HsExpander.prototype.destroyObject=function(){this.objContainer.innerHTML=""};HsExpander.prototype.sleep=function(){if(this.objOutline){this.objOutline.table.className="highslide-display-none"}this.wrapper.className+=" highslide-display-none";hs.setId(this.content,"-hsSleeping"+this.key);hs.push(hs.sleeping,this)};HsExpander.prototype.awake=function(){hs.expanders[this.key]=this;this.wrapper.className=this.wrapper.className.replace(/highslide-display-none/,"");var c=hs.zIndexCounter++;this.wrapper.style.zIndex=c;if(o=this.objOutline){if(!this.outlineWhileAnimating){o.table.style.visibility="hidden"}o.table.className=null;o.table.style.zIndex=c}hs.setId(this.content,"-hsSleeping"+this.key,1);this.show()};HsAjax=function(c,d){this.a=c;this.content=d};HsAjax.prototype.run=function(){try{this.xmlHttp=new XMLHttpRequest()}catch(d){try{this.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){this.onError()}}}this.src=hs.getSrc(this.a);if(this.src.match("#")){var c=this.src.split("#");this.src=c[0];this.id=c[1]}var f=this;this.xmlHttp.onreadystatechange=function(){if(f.xmlHttp.readyState==4){if(f.id){f.getElementContent()}else{f.loadHTML()}}};this.xmlHttp.open("GET",this.src,true);this.xmlHttp.send(null)};HsAjax.prototype.getElementContent=function(){hs.genContainer();var d=window.opera?{src:this.src}:null;this.iframe=hs.createElement("iframe",d,{position:"absolute",left:"-9999px"},hs.container);try{this.loadHTML()}catch(c){var f=this;setTimeout(function(){f.loadHTML()},1)}};HsAjax.prototype.loadHTML=function(){var c=this.xmlHttp.responseText;if(!hs.ie||hs.ieVersion()>=5.5){c=c.replace(/\s/g," ");if(this.iframe){c=c.replace(new RegExp("<link[^>]*>","gi"),"");c=c.replace(new RegExp("<script[^>]*>.*?<\/script>","gi"),"");var f=this.iframe.contentDocument||this.iframe.contentWindow.document;f.open();f.write(c);f.close();try{c=f.getElementById(this.id).innerHTML}catch(d){}hs.container.removeChild(this.iframe)}else{c=c.replace(new RegExp("^.*?<body[^>]*>(.*?)</body>.*?$","i"),"$1")}}hs.identifyContainer(this.content,"highslide-body").innerHTML=c;this.onLoad()};hs.addEventListener(window,"load",hs.preloadAjax);var Facebook_SDK_Helper=function(){return{debug:false,login_cbs:[],logout_cbs:[],initialized:false,available:true,log:function(c){if(this.debug&&window.console){window.console.log(c)}},isStageServer:function(){var c=location.host.indexOf("octosquid");return(c>-1)},isMSIE:function(){return"\v"=="v"},hasActiveX:function(){try{versionString=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");return true}catch(c){return false}return false},canInit:function(){return true;if(this.isMSIE()){return this.hasActiveX()}return true},init:function(d,f){if(this.canInit()){this.available=true}else{this.available=false;return}var c="37459380049";var e="http://www.squidoo.com/utility/fb_custom_channel";this.log("initializing FB SDK");if(this.isStageServer()){c="40817683610";e="http://octosquid.squidoo.com:2000/utility/fb_custom_channel"}if(d){this.login_cbs.push(d)}if(f){this.logout_cbs.push(f)}FB.init({appId:c,status:true,cookie:true,xfbml:true,channelUrl:e});FB.Event.subscribe("auth.sessionChange",function(g){if(g.session){Facebook_SDK_Helper.onLoggedIn(g.status,g.session)}else{Facebook_SDK_Helper.onLoggedOut(g.status,null)}});this.updateLoginStatus();this.initialized=true},login:function(){FB.login(function(c){if(c.session){Facebook_SDK_Helper.onLoggedIn(c.status,c.session)}else{Facebook_SDK_Helper.onLoggedOut(c.status,null)}});this.updateLoginStatus()},updateLoginStatus:function(){if(!this.available){return}FB.getLoginStatus(function(c){Facebook_SDK_Helper.log("look here");Facebook_SDK_Helper.log(c);if(c.session){Facebook_SDK_Helper.onLoggedIn(c.status,c.session,c.perms)}else{Facebook_SDK_Helper.onLoggedOut(c.status,null)}})},subscribe:function(c,d){if(!this.available){return}if(c){this.login_cbs.push(c)}if(d){this.logout_cbs.push(d)}if(this.initialized){this.updateLoginStatus()}},onLoggedIn:function(d,g,f){this.log("onLoggedIn");this.log(d);this.log(g);this.log(f);for(var e=0;e<this.login_cbs.length;e++){this.log("login callback: "+e.toString());var c=this.login_cbs[e];c(d,g,f)}},onLoggedOut:function(d,f){this.log("onLoggedOut");this.log(d);this.log(f);for(var e=0;e<this.logout_cbs.length;e++){this.log("logout callback: "+e.toString());var c=this.logout_cbs[e];c(d,f)}},getPageStats:function(d,c){if(!this.available){c({})}this.log("in getPageStats: "+d);this.log(FB);FB.api({method:"links.getStats",urls:d},function(e){Facebook_SDK_Helper.log(e);if(c){c(e)}})},getUid:function(){if(!this.available){return null}var c=null;if(FB._session&&FB._session.uid){c=FB._session.uid}return c},makeShareButtons:function(){if(!this.available){return}var c;this.log("in makeShareButtons");if(typeof(theLensName)!="undefined"){c="http://www.squidoo.com/"+theLensName}else{c=location.href}this.getPageStats(c,function(e){Facebook_SDK_Helper.log(e);var d=[];var f=0;if(e){f=e[0].total_count}d.push('<span class="fb_share_size_Small ">');d.push('<span class="FBConnectButton FBConnectButton_Small" style="cursor:pointer;">');d.push('<span class="FBConnectButton_Text">Share</span></span>');d.push('<span class="fb_share_count_nub_right "></span>');d.push('<span class="fb_share_count  fb_share_count_right"><span class="fb_share_count_inner">'+f+"</span></span></span>");Facebook_SDK_Helper.log(d.join(""));jQuery("a.fb_share").each(function(){Facebook_SDK_Helper.log("found a share link");var g=[];g.push("http://www.facebook.com/sharer.php?u=");g.push(Facebook_SDK_Helper.URLEncode("http://www.squidoo.com/"+theLensName));g.push("&t=");g.push(Facebook_SDK_Helper.URLEncode(jQuery(this).attr("title")));jQuery(this).html(d.join("")).attr("style","text-decoration: none;").attr("href",g.join("")).bind("click",function(){var j=jQuery(this).attr("href");var h;Facebook_SDK_Helper.log(j);_gaq.push(["_trackEvent","Share-Widgets","Facebook",theLensName]);window.open(j,"sharer","toolbar=0,status=0,width=626,height=436");jQuery(this).unbind("click");jQuery(this).bind("click",function(){return false});h=parseInt(jQuery(".fb_share_count_inner",jQuery(this)).html())+1;jQuery(".fb_share_count_inner",jQuery(this)).fadeOut("fast").html(h.toString()).fadeIn("fast");return false})})})},likeLens:function(c){_gaq.push(["_trackEvent","Share-Widgets","Facebook-Like",theLensName]);SquidgamingJS.post("/utility/fb_like_count",{lens_id:theLensId})},sharePopup:function(d,e){var c=[];c.push("http://www.facebook.com/sharer.php?u=");c.push(Facebook_SDK_Helper.URLEncode(d));c.push("&t=");c.push(Facebook_SDK_Helper.URLEncode(e));window.open(c.join(""),"sharer","toolbar=0,status=0,width=626,height=436")},get_status:function(){if(!this.available){return null}var c;try{this.safe_call(function(){FB.Connect.get_status().waitUntilReady(function(e){Facebook_Helper.log("get_status: "+e);c=e})})}catch(d){this.log("exception in Facebook_Helper::get_status: "+d.description)}return c},connect:function(f,e){try{var c=this.get_status();if(c==FB.ConnectState.connected){if(f){f()}}else{this.safe_call(function(){Facebook_Helper.log("requireSession");FB.Connect.requireSession(function(){if(f){Facebook_Helper.log("success connect");f()}},function(){if(e){Facebook_Helper.log("fail connect");e()}})})}}catch(d){this.log("exception in Facebook_Helper::connect: "+d.description)}},logout:function(c){try{this.safe_call(function(){FB.Connect.logout(c)})}catch(d){this.log("exception in Facebook_Helper::logout: "+d.description)}},getFriends:function(c){try{this.safe_call(function(){FB.Facebook.apiClient.friends_get(null,function(e){if(c){c(e)}})})}catch(d){this.log("exception in Facebook_Helper::getFriends: "+d.description)}},parseDomTree:function(){try{this.safe_call(function(){FB.XFBML.Host.parseDomTree()})}catch(c){this.log("exception in Facebook_Helper::parseDomTree: "+c.description)}},promptPublishAll:function(c){try{this.log("promptPublishAll");this.safe_call(function(){FB.Connect.showPermissionDialog("publish_stream",c,true)})}catch(d){this.log("exception in Facebook_Helper::promptPublishAll: "+d.description)}},promptPermission:function(d,c){try{this.log("promptPermission: "+d);this.safe_call(function(){FB.Facebook.apiClient.users_hasAppPermission(d,function(f){if(f===0){FB.Connect.showPermissionDialog(d,c)}else{c(true)}})})}catch(e){this.log("exception in Facebook_Helper::promptPermssion: "+e.description)}},checkAppPermission:function(d,c){try{this.safe_call(function(){Facebook_Helper.log("checking permission: "+d);FB.Facebook.apiClient.users_hasAppPermission(d,function(f){Facebook_Helper.log("permission status: "+f);c(f)})})}catch(e){this.log("exception in Facebook_Helper::hasAppPermission: "+e.description)}},URLEncode:function(n){var l="";var f=0;n=n.toString();var j=/(^[a-zA-Z0-9_.]*)/;while(f<n.length){var e=j.exec(n.substr(f));if(e!=null&&e.length>1&&e[1]!=""){l+=e[1];f+=e[1].length}else{if(n[f]==" "){l+="+"}else{var k=n.charCodeAt(f);var g=k.toString(16);l+="%"+(g.length<2?"0":"")+g.toUpperCase()}f++}}return l},URLDecode:function(e){var g=e;var c,d;var f=/(%[^%]{2})/;while((m=f.exec(g))!=null&&m.length>1&&m[1]!=""){b=parseInt(m[1].substr(1),16);d=String.fromCharCode(b);g=g.replace(m[1],d)}return g},dummy:function(){}}}();var Facebook_Helper=function(){return{init:function(){},get_uid:function(){Facebook_SDK_Helper.getUid()},dummy:function(){}}}();var Twitter_Helper=function(){return{cb:null,debug:false,log:function(c){if(this.debug&&window.console){console.log(c)}},track_event:function(d){var c="url="+escape("http://twitter.com/"+d)+"&lens_id="+theLensId;new Ajax.Request("/utility/track_click",{asynchronous:true,method:"post",postBody:c})},popup:function(e,d,g,c,k){var j=(screen.width-g)/2;var h=(screen.height-c)/2;if(k){var f="url="+escape(e)+"&lens_id="+theLensId;pageTracker._trackEvent("twitter_helper",d,theLensName);new Ajax.Request("/utility/track_click",{asynchronous:true,method:"post",postBody:f})}window.open(e,d,"status=0,location=0,toolbar=0,resizable=1,scrollbars=1,height="+c.toString()+",width="+g.toString()+",left="+j.toString()+",top="+h.toString())},tweet:function(d){var c="http://twitter.com/home?status="+d;this.track_event("tweet");this.popup(c,"twitter",780,480,false)},retweet:function(e,f,d){var c="http://twitter.com/home?status=RT+%40"+e+"%3A+"+f.replace(/#/gi,"%23")+"+"+d;this.track_event("retweet");this.popup(c,"twitter",780,480,false)},reply:function(e,d){var c="http://twitter.com/home?status=%40"+e+"%3A++"+d;this.track_event("reply");this.popup(c,"twitter",780,480,false)},finalize:function(d,e,c){new Ajax.Request("/utility/twitter_list_item_finalize",{postBody:"id="+d+"&lmi="+e,method:"post",asynchronous:true,onSuccess:function(f){var g=f.responseText;if(g=="ok"){if(c){c(true)}}else{if(c){c(false)}}}})},post:function(d,f,c){var e=110;if(d.length>e){alert("The message you entered is too long. Please limit to "+e.toString()+" characters.")}else{if(d.length==0){alert("You must enter a message.")}else{new Ajax.Request("/utility/twitter_list_post",{postBody:"msg="+d+"&lmi="+f,method:"post",asynchronous:true,onSuccess:function(g){var h=g.responseText.split("|");if(h[0]=="ok"){if(c){c(true)}}else{Twitter_Helper.do_oauth(function(){Twitter_Helper.finalize(h[1],f,c)})}}})}}},do_oauth:function(g){var c=380;var d=780;var f=(screen.width-d)/2;var e=(screen.height-c)/2;this.cb=g;window.open("/utility/twitter_oauth","twitter_oauth","status=0,location=0,toolbar=0,resizable=0,scrollbars=0,height="+c.toString()+",width="+d.toString()+",left="+f.toString()+",top="+e.toString())},search:function(e,c,f){var d="";for(var g in e){d+=g+"="+e[g]+"&"}new Ajax.Request("/utility/twitter_search",{postBody:d,method:"post",asynchronous:true,onSuccess:function(h){if(c){if(f){c(h,f)}else{c(h)}}}})},add_search_item:function(j,h,f,g,e,c){var d="";d="id="+j+"&lmi="+h+"&tweet="+f+"&tweet_time="+g+"&tweet_user="+e;new Ajax.Request("/utility/twitter_add_list_item",{postBody:d,method:"post",asynchronous:true,onSuccess:function(k){if(c){c()}}})},delete_list_item:function(f,e,c){var d;d="id="+f+"&lmi="+e;new Ajax.Request("/utility/twitter_del_list_item",{postBody:d,method:"post",asynchronous:true,onSuccess:function(g){if(c){c()}}})},promote_user_item:function(e,d){var c;c="id="+e+"&lmi="+d;new Ajax.Request("/utility/twitter_promote_list_item",{postBody:c,method:"post",asynchronous:true,onSuccess:function(f){}})},get_screen_name:function(c){new Ajax.Request("/utility/twitter_get_current_screen_name",{postBody:"",method:"post",asynchronous:true,onSuccess:function(d){if(c){c(d.responseText)}}})},_callback:function(){this.log("Twitter_OAuth._callback()");if(this.cb){this.cb()}}}}();var SquidooComments=function(){return{show_on_close_el:null,current_form:null,initial_type:"visitor",fb_available:false,captcha_loaded:false,debug:false,log:function(c){if(this.debug&&window&&window.console){window.console.log(c)}},setFocus:function(c){var f=c.parents("li:eq(0)");if(f.length==0){f=c.parents("div.module:eq(0)");if(f.length==0){return}}var d=f.offset();var e=d.top-0;c.focus();jQuery("html,body").animate({scrollTop:e},250)},display_tabs:function(h){var e=jQuery("li.gb_li_visitor",this.current_form);var g=jQuery("li.gb_li_squidoo",this.current_form);var f=jQuery("li.gb_li_facebook",this.current_form);var d=jQuery("li.gb_li_twitter",this.current_form);var c=jQuery("div.gb_email_check",this.current_form);if(h.visitor){e.show()}else{e.hide()}if(h.squidoo){g.show()}else{g.hide()}if(h.facebook){f.show()}else{f.hide()}if(h.twitter){d.show()}else{d.hide()}if(h.email_notify){c.show()}else{c.hide()}},new_form:function(h,e,d,g){if(this.current_form){this.close()}var f=jQuery("#primary_comment_input").clone().removeAttr("id").appendTo(e);jQuery("input[name='comment_lmi']",f).val(h);var c=jQuery("textarea",f);if(c){setTimeout(function(){SquidooComments.setFocus(c)},100)}f.show();this.switch_type(this.initial_type);this.show_on_close_el=d;this.current_form=f;this.display_tabs(g)},reply_form:function(f,d,c,e){pageTracker._trackEvent("Guestbook","Reply");this.new_form(f,c,null,e);jQuery("input[name='comment_parent_id']",this.current_form).val(d)},close:function(){if(this.current_form){this.current_form.parent().empty();this.current_form=null;if(this.show_on_close_el){this.show_on_close_el.show();this.show_on_close_el=null}}},save:function(){var e=true;this.hide_error();var d=jQuery.trim(jQuery("textarea",this.current_form).val());if(d==""){e=false;message="Your comment cannot be blank. Please enter a comment and try again."}if(e){var c=jQuery("form",this.current_form);var f=c.serialize();pageTracker._trackEvent("Guestbook","Submit");jQuery.post("/utility/post_blurb",f,function(g){SquidooComments.post_save(g)})}else{this.show_error(message)}return false},show_error:function(c){jQuery("#comment_error_message",this.current_form).html(c).show();setTimeout(function(){SquidooComments.hide_error()},5000)},hide_error:function(){this.log("here");jQuery("#comment_error_message",this.current_form).fadeOut(2500)},load_more:function(g,j,c,e,h,d){var f={lmi:j,per_page:c,page:e,show_photos:h?"true":"false",strip_html:d?"true":"false"};pageTracker._trackEvent("Guestbook","LoadMore");jQuery.post("/utility/more_blurbs",f,function(k){if(k!="error"){jQuery(g).parent().replaceWith(k)}})},cancel:function(){pageTracker._trackEvent("Guestbook","Cancel");this.close()},switch_fb:function(){var c=Facebook_SDK_Helper.getUid();this.log("switch_fb");this.log(c);this.log("calling init");Facebook_SDK_Helper.subscribe(function(){SquidooComments.log("logged in facebook");SquidooComments.fb_available=true;SquidooComments.switch_type("facebook")},function(){SquidooComments.switch_type(SquidooComments.initial_type)});Facebook_SDK_Helper.login()},switch_type:function(d){var c=false;if(d=="facebook"){if(!this.fb_available){return this.switch_fb()}}jQuery("ul.gb_select li",this.current_form).removeClass("gb_selected");jQuery("ul.gb_select li.gb_li_"+d,this.current_form).addClass("gb_selected");jQuery("div.gb_type_elements div",this.current_form).hide();jQuery("div.gb_type_elements div.gb_elements_"+d,this.current_form).show();jQuery("input[name='comment_type']",this.current_form).val(d);jQuery("#gb_type_"+d).attr("checked","checked");if((d=="facebook")||(d=="twitter")){jQuery("div.gb_captcha",this.current_form).hide()}else{jQuery("div.gb_captcha",this.current_form).show();if(!this.captcha_loaded){jQuery.get("/utility/load_captcha/new",function(e){jQuery("div.gb_captcha").html(e);SquidooComments.captcha_loaded=true})}}this.initial_type=d;return true},set_initial_type:function(c){this.initial_type=c},set_fb_available:function(c){this.fb_available=c},post_save:function(d){var c;var e=JSON.parse(d);this.captcha_loaded=false;if(this.current_form){c=this.current_form.parent()}if(e.status=="success"){if(e.post_type=="facebook"){if(e.fb_data){var h=e.fb_data;var g=null;if(h.lens_image!=""){g=[{type:"image",href:h.module_url,src:h.lens_image}]}FB.ui({method:"stream.publish",message:h.comment_body,attachment:{name:h.module_title,caption:"{*actor*} just commented on "+h.module_title,description:h.module_abstract,href:h.module_url,media:g},action_links:[{text:"Join Discussion",href:h.module_url},{text:"View Lens",href:h.lens_url}],user_message_prompt:"Invite your friends to join the discussion:"},function(j){if(j&&j.post_id){SquidooComments.log("Post was published.")}else{SquidooComments.log("Post was not published.")}})}}this.close();var f=jQuery('<div class="gb_notice">'+e.message+"</div>");c.append(f);setTimeout(function(){f.hide()},5000)}else{this.show_error(e.message)}},xableFollowerEmail:function(d){var e=d.attr("checked");var c=jQuery("div.gb_follower_email_div",this.current_form);if(e){c.show()}else{c.hide()}},dummy:function(){}}}();if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());var SquidgamingJS=function(){return{debug:false,windowActive:true,inInline:false,initCount:0,initCalled:false,log:function(msg){if(this.debug&&window.console){console.log(msg)}},post:function(url,data,callback,dataType){this.log("in SquidgamingJS.post");if(jQuery.isFunction(data)){type=type||callback;callback=data;data=null}return jQuery.ajax({type:"POST",url:url,data:data,success:function(response){var passThru;passThru=SquidgamingJS.processAjaxResponse(response);if(callback){callback(passThru)}},dataType:"text"})},get:function(url,data,callback,type){this.log("in SquidgamingJS.get");if(jQuery.isFunction(data)){type=type||callback;callback=data;data=null}return jQuery.ajax({type:"GET",url:url,data:data,success:function(response){var passThru;passThru=SquidgamingJS.processAjaxResponse(response);if(callback){callback(passThru)}},dataType:"text"})},processAjaxResponse:function(val){var result=val;try{if(val.indexOf("||sg||")>-1){var parts=val.split("||sg||");var sgVal=jQuery.trim(parts[0]);result=jQuery.trim(parts[1]);this.handleSGInstructions(sgVal)}}catch(e){this.log(e)}return result},handleSGInstructions:function(sgString){this.log("in handleSGInstructions: "+hasGaming);if(!hasGaming){return}this.log(sgString);var o=this.parseJSON(sgString);this.log(o);if(o.levelNavDisplay){jQuery("#game_nav > li:eq(0)").html(o.levelNavDisplay)}if(o.pointsNavDisplay){jQuery("#game_nav > li:eq(1)").html(o.pointsNavDisplay)}if(o.trophiesNavDisplay){jQuery("#game_nav > li:eq(2)").html(o.trophiesNavDisplay)}if(o.uiInterruptions){var interruptions=o.uiInterruptions;for(var i=0;i<interruptions.length;i++){var cur_int=interruptions[i];this.log("int: "+i.toString());this.log(cur_int);if(cur_int.type=="points_dismissable"){this.log("opening points_dismissable");jQuery("#sg_container").html(cur_int.markup);this.openOverlay(true)}else{if(cur_int.type=="points_simple"){this.log("opening points_simple");this.log(cur_int.markup);jQuery("#sg_container").html(cur_int.markup);this.autoSlideOverlay()}else{if(cur_int.type=="points_flash"){this.log("updating points_flash");this.pointsFlash(cur_int.markup)}else{if(cur_int.type=="away"){this.log("opening away");jQuery("#sg_container").html(cur_int.markup);this.openOverlay(true)}else{if(cur_int.type=="trophy"){this.log("opening trophy");jQuery("#sg_container").html(cur_int.markup);this.openOverlay(true)}else{if(cur_int.type=="level"){this.log("updating level");jQuery("#sg_container").html(cur_int.markup);this.openOverlay(true)}}}}}}}}},openOverlay:function(withOnion){this.windowActive=false;if(withOnion){jQuery("#default_onion").show()}jQuery("#sg_container > div").show()},closeOverlay:function(){jQuery("#sg_container > div").hide();jQuery("#default_onion").hide();this.windowActive=true},autoSlideOverlay:function(){jQuery("#sg_container > div").css("top","-140px").show().animate({top:"+=180"},"slow");setTimeout(function(){jQuery("#sg_container > div").fadeOut("fast")},4000)},pointsFlash:function(markup){var old_markup=jQuery("#game_nav > li:eq(1)").html();jQuery("#game_nav > li:eq(1)").addClass("pts_alert").html(markup);setTimeout(function(){jQuery("#game_nav > li:eq(1)").removeClass("pts_alert").html(old_markup)},6000)},checkAway:function(){this.log("checkAway: "+this.windowActive+", "+this.inInline);if(!this.windowActive){return}if(this.inInline){setTimeout(function(){SquidgamingJS.checkAway()},30000);return}SquidgamingJS.get("/utility/gaming_away_notice");setTimeout(function(){SquidgamingJS.checkAway()},30000)},windowBlur:function(){this.log("windowBlur");this.windowActive=false},windowFocus:function(){this.log("windowFocus");this.windowActive=true;this.checkAway()},initHooks:function(){this.log("in initHooks");if(this.initCalled){return}this.initCalled=true;if(typeof hasGaming=="undefined"){if(this.initCount<10){this.initCount+=1;setTimeout(function(){SquidgamingJS.initHooks()},500*(this.initCount));return}}if(!hasGaming){return}window.onblur=function(){SquidgamingJS.windowBlur()};window.onfocus=function(){SquidgamingJS.windowFocus()};setTimeout(function(){SquidgamingJS.checkAway()},2000)},inlineInstructions:function(types){this.log("inlineInstructions");this.inInline=true;if(jQuery("#game_nav_inline > li:eq(0)").length>0){jQuery("#game_nav > li:eq(0)").html(jQuery("#game_nav_inline > li:eq(0)").html())}if(jQuery("#game_nav_inline > li:eq(1)").length>0){jQuery("#game_nav > li:eq(1)").html(jQuery("#game_nav_inline > li:eq(1)").html())}if(jQuery("#game_nav_inline > li:eq(2)").length>0){jQuery("#game_nav > li:eq(2)").html(jQuery("#game_nav_inline > li:eq(2)").html())}for(var i=0;i<types.length;i++){var cur_int=types[i];this.log(cur_int);if(cur_int=="points_dismissable"){this.log("opening points_dismissable");jQuery("#sg_container").html(jQuery("#game_int_inline_"+cur_int).html());this.openOverlay(true)}else{if(cur_int=="points_simple"){this.log("opening points_simple");jQuery("#sg_container").html(jQuery("#game_int_inline_"+cur_int).html());this.autoSlideOverlay()}else{if(cur_int=="points_flash"){this.log("updating points_flash");this.pointsFlash(jQuery("#game_int_inline_"+cur_int).html())}else{if(cur_int=="away"){this.log("opening away");jQuery("#sg_container").html(jQuery("#game_int_inline_"+cur_int).html());this.openOverlay(true)}else{if(cur_int=="trophy"){this.log("opening trophy");jQuery("#sg_container").html(jQuery("#game_int_inline_"+cur_int).html());this.openOverlay(true)}else{if(cur_int=="level"){this.log("updating level");jQuery("#sg_container").html(jQuery("#game_int_inline_"+cur_int).html());this.openOverlay(true)}}}}}}}this.inInline=false},sharePopup:function(url,name,width,height,do_track){var left=(screen.width-width)/2;var top=(screen.height-height)/2;if(do_track){var postString="url="+escape(url)+"&lens_id="+theLensId;pageTracker._trackEvent("twitter_helper",name,theLensName);new Ajax.Request("/utility/track_click",{asynchronous:true,method:"post",postBody:postString})}window.open(url,name,"status=0,location=0,toolbar=0,resizable=1,scrollbars=1,height="+height.toString()+",width="+width.toString()+",left="+left.toString()+",top="+top.toString())},moreActivities:function(start_num){jQuery.post("/lensmaster/activity_ajax",{start_num:start_num},function(response){jQuery("#activity_table tr:last").after(response).hide()})},parseJSON:function(str){str=str.replace(/\n/g," ");if((typeof JSON=="object")&&(typeof JSON.parse=="function")){this.log("JSON.parse");return JSON.parse(str)}if(typeof(str)=="string"){this.log("eval");return eval("("+str+")")}else{return str}},_d:null}}();jQuery(document).ready(function(){SquidgamingJS.initHooks()});if(typeof pageLoadActions!="undefined"){pageLoadActions.push(function(){SquidgamingJS.initHooks()})}var UnifiedLogin=function(){return{debug:false,visible_el_name:null,captcha_loaded:false,is_registration:false,no_onion:false,reg_type:"standard",login_callback:null,log:function(message){if(this.debug&&window.console){console.log(message);var markup=jQuery("#debug_div").html();jQuery("#debug_div").html(markup+"<br />"+message)}},hideVisible:function(){this.log("in hideVisible");if(this.visible_el_name){this.log(this.visible_el_name);jQuery(this.visible_el_name).hide()}},showPage:function(name){this.hideVisible();this.visible_el_name=name;if(jQuery("#lgn_login").length==0){jQuery("#unified-login-overlay").load("/utility/unifiedlogin",function(){window.scrollTo(0,0);jQuery(name).show();FB.XFBML.parse(document.getElementById(name.substr(1)))}).show()}else{window.scrollTo(0,0);jQuery(name).show();FB.XFBML.parse(document.getElementById(name.substr(1)))}},closeOverlay:function(){this.hideVisible();jQuery("#default_onion").hide()},register:function(reg_type,cb){if(cb){this.login_callback=cb}if(this.badMSIEActiveX()){document.location.href="/member/registration";return}if(reg_type){this.reg_type=reg_type}if(this.reg_type=="standard"){jQuery("#lgn_register_complete a.btn_35").html("Build My First Page!").removeClass("btn_gray")}else{if(this.reg_type=="wizard"){jQuery("#lgn_register_complete a.btn_35").html("Continue").removeClass("btn_gray")}else{if(this.reg_type=="quick"){jQuery("#lgn_register_complete a.btn_35").html("Close").addClass("btn_gray")}}}this.is_registration=true;if(!this.no_onion){jQuery("#default_onion").show()}if(Facebook_SDK_Helper.available){this.registerFB()}else{this.registerSquidoo()}},registerFB:function(){this.showPage("#lgn_reg_fb");this.init()},registerSquidoo:function(){jQuery(this.visible_el_name).hide();this.showPage("#lgn_reg_squidoo");jQuery("#lgn_reg_squidoo div.gb_captcha",this.current_form).show();if(!this.captcha_loaded){jQuery.get("/utility/load_captcha/new",function(res){jQuery("#lgn_reg_squidoo div.gb_captcha").html(res);UnifiedLogin.captcha_loaded=true})}},isMSIE:function(){return"\v"=="v"},hasActiveX:function(){try{versionString=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");return true}catch(x){return false}return false},badMSIEActiveX:function(){if(this.isMSIE()){return !this.hasActiveX()}return false},login:function(cb){if(cb){this.login_callback=cb}if(this.badMSIEActiveX()){document.location.href="/member/login";return}this.is_registration=false;jQuery("button[type=submit]",jQuery("#lgn_login")).removeClass("btn_gray").html("Login");if(!this.no_onion){jQuery("#default_onion").show()}this.showPage("#lgn_login");this.init()},init:function(){this.log("UnifiedLogin.init");if(Facebook_SDK_Helper.available){Facebook_SDK_Helper.subscribe(function(status,session,permissions){UnifiedLogin.onFBLogin(status,session,permissions)},function(){UnifiedLogin.onFBLogout(status,null)})}else{this.log("Facebook_SDK_Helper not available");jQuery(".lgn_fb_option").hide()}},connect:function(){this.showPage("#lgn_connect")},unknown:function(){this.showPage("#lgn_fb_unknown");FB.api("/me",function(response){UnifiedLogin.log(response);jQuery("#lgn_fb_unknown_name").html(response.first_name)})},onFBLogin:function(status,session,permissions){this.log("UnifiedLogin.onFBLogin");if(!this.is_registration){jQuery.get("/utility/can_fb_login",function(response){var o=UnifiedLogin.parseJSON(response);if(o.result){UnifiedLogin.closeRefresh();if(UnifiedLogin.login_callback){try{UnifiedLogin.login_callback(o.user_type)}catch(e){}}else{UnifiedLogin.closeRefresh()}}else{UnifiedLogin.unknown()}})}else{this.getCurrentPermissions(function(has_all){if(has_all){jQuery("#lgn_reg_fb_nosession").hide();jQuery("#lgn_reg_fb_session").show();jQuery("#lgn_reg_fb").addClass("reg_wide").removeClass("reg_narrow");FB.api("/me",function(response){UnifiedLogin.log(response);jQuery("#lgn_reg_fb_name").html(response.name);UnifiedLogin.getUsername(response);UnifiedLogin.getEmailAddress(function(resp_email){UnifiedLogin.log(resp_email);jQuery("#lgn_register_email").val(resp_email)})});FB.XFBML.parse()}else{}})}},onFBLogout:function(status,session){this.log("UnifiedLogin.onFBLogout")},getUsername:function(fb_user_object){jQuery.post("/utility/fb_user_username",fb_user_object,function(response){UnifiedLogin.log(response);var o=UnifiedLogin.parseJSON(response);jQuery("#lgn_register_username").val(o.username)})},getExtendedPermissions:function(){FB.login(function(response){if(response.session){if(response.perms){UnifiedLogin.log(response)}else{UnifiedLogin.log(response)}}else{UnifiedLogin.log(response)}},{perms:"email,read_stream,publish_stream,offline_access"})},getCurrentPermissions:function(cb){var query="SELECT publish_stream, email FROM permissions WHERE uid="+FB.getSession().uid;UnifiedLogin.log(query);FB.api({method:"fql.query",query:query},function(response){var has_all=true;UnifiedLogin.log(response);if(response.length){has_all=true;perms=response[0];has_all=has_all&&(perms.email==1);has_all=has_all&&(perms.publish_stream==1);UnifiedLogin.log(has_all)}else{has_all=false;UnifiedLogin.log("No permissions returned at all")}cb(has_all)})},getEmailAddress:function(cb){var query="SELECT uid, email FROM user WHERE uid="+FB.getSession().uid;UnifiedLogin.log(query);FB.api({method:"fql.query",query:query},function(response){UnifiedLogin.log(response);var email="";if(response.length){data=response[0];email=data.email}else{UnifiedLogin.log("No query data returned")}cb(email)})},connectAccount:function(the_form){jQuery("div",the_form).removeClass("form_error");var email=jQuery("#lgn_connect_email",the_form).val();var password=jQuery("#lgn_connect_password",the_form).val();var valid=true;if(jQuery.trim(email)==""){valid=false;jQuery("#lgn_connect_email_div",the_form).addClass("form_error")}if(jQuery.trim(password)==""){valid=false;jQuery("#lgn_connect_password_div",the_form).addClass("form_error")}if(!valid){return false}jQuery.post("/utility/fb_login_connect",the_form.serialize(),function(response){var o=UnifiedLogin.parseJSON(response);UnifiedLogin.log(o);if(o.status=="success"){UnifiedLogin.closeRefresh()}else{jQuery("#lgn_connect_gen_err",the_form).html(o.reason);jQuery("#lgn_connect_gen_div",the_form).addClass("form_error")}});return false},loginSquidoo:function(the_form){jQuery("div",the_form).removeClass("form_error");var email=jQuery("#lgn_squidoo_email",the_form).val();var password=jQuery("#lgn_squidoo_password",the_form).val();var valid=true;if(jQuery.trim(email)==""){valid=false;jQuery("#lgn_squidoo_email_div",the_form).addClass("form_error")}if(jQuery.trim(password)==""){valid=false;jQuery("#lgn_squidoo_password_div",the_form).addClass("form_error")}if(!valid){return false}jQuery("button[type=submit]",the_form).addClass("btn_gray").html("logging in");jQuery.post("/utility/ajax_login",the_form.serialize(),function(response){var obj;UnifiedLogin.log(response);try{obj=UnifiedLogin.parseJSON(response)}catch(ex){UnifiedLogin.log(ex);obj={status:"fail",reason:"Login failed. Please try again."}}UnifiedLogin.log(obj);if(obj.status=="success"){if(UnifiedLogin.login_callback){try{UnifiedLogin.login_callback(obj.user_type)}catch(e){}}else{UnifiedLogin.closeRefresh()}}else{jQuery("button[type=submit]",the_form).removeClass("btn_gray").html("Login");jQuery("#lgn_squidoo_gen_err",the_form).html(obj.reason);jQuery("#lgn_squidoo_gen_div",the_form).addClass("form_error")}});return false},validateAndRegister:function(reg_form){jQuery("div",reg_form).removeClass("form_error");var tos_checked=jQuery("#accept_lmtos",reg_form).attr("checked");var email=jQuery("#lgn_register_email",reg_form).val();var username=jQuery("#lgn_register_username",reg_form).val();var valid=true;if(!tos_checked){valid=false;jQuery("#lgn_register_tos_div",reg_form).addClass("form_error")}if(jQuery.trim(email)==""){valid=false;jQuery("#lgn_register_email_div",reg_form).addClass("form_error")}if(jQuery.trim(username)==""){valid=false;jQuery("#lgn_register_username_div",reg_form).addClass("form_error")}if(!valid){return false}jQuery.post("/utility/fb_login_register",reg_form.serialize(),function(response){var o=UnifiedLogin.parseJSON(response);UnifiedLogin.log(o);if(o.status=="fail"){var cur_field;for(var i=0;i<o.err_fields.length;i++){cur_field=o.err_fields[i];jQuery("#lgn_register_"+cur_field+"_div",reg_form).addClass("form_error");if(cur_field=="email"){jQuery("#lgn_register_email_err",reg_form).html(o.err_msgs.email).addClass("error_n")}if(cur_field=="username"){jQuery("#lgn_register_username_err",reg_form).html(o.err_msgs.username).addClass("error_n")}if(cur_field=="tos"){jQuery("#lgn_register_tos_err",reg_form).html(o.err_msgs.tos).addClass("error_n")}}}else{UnifiedLogin.showPage("#lgn_register_complete")}});return false},validateAndRegisterSquidoo:function(reg_form){jQuery("button[type=submit]",reg_form).addClass("btn_working").html("Working");jQuery("div",reg_form).removeClass("form_error");jQuery(".error_y",reg_form).html("").removeClass("error_y");jQuery(".error_n",reg_form).html("").removeClass("error_n");var tos_checked=jQuery("#lgn_register_sq_lmtos",reg_form).attr("checked");var email=jQuery("#lgn_register_sq_email",reg_form).val();var username=jQuery("#lgn_register_sq_username",reg_form).val();var password=jQuery("#lgn_register_sq_password",reg_form).val();var verify=jQuery("#lgn_register_sq_verify",reg_form).val();var valid=true;if(!tos_checked){valid=false}if(jQuery.trim(email)==""){valid=false;jQuery("#email_address_err").html("Enter email address").removeClass("error_y").addClass("error_n").show();jQuery("#email_address_err").closest("div.form_item").addClass("form_error")}if(jQuery.trim(username)==""){valid=false;jQuery("#desired_username_err").html("Enter username").removeClass("error_y").addClass("error_n").show();jQuery("#desired_username_err").closest("div.form_item").addClass("form_error")}if(jQuery.trim(password)==""){valid=false;jQuery("#password_err").html("Enter password").removeClass("error_y").addClass("error_n").show();jQuery("#password_err").closest("div.form_item").addClass("form_error")}if(password!=verify){valid=false;jQuery("#password_confirmation_err").html("Does not match password").removeClass("error_y").addClass("error_n").show();jQuery("#password_confirmation_err").closest("div.form_item").addClass("form_error")}if(!valid){jQuery("button[type=submit]",reg_form).removeClass("btn_working").html("Join Now!");return false}jQuery.post("/utility/fb_login_register",reg_form.serialize(),function(response){var o=UnifiedLogin.parseJSON(response);UnifiedLogin.log(o);if(o.status=="fail"){var cur_field;jQuery("button[type=submit]",reg_form).removeClass("btn_working").html("Join Now!");for(var i=0;i<o.err_fields.length;i++){cur_field=o.err_fields[i];jQuery("#lgn_register_"+cur_field+"_div",reg_form).addClass("form_error");if(cur_field=="email"){jQuery("#email_address_err").html(o.err_msgs.email).removeClass("error_y").addClass("error_n").show();jQuery("#email_address_err").closest("div.form_item").addClass("form_error")}if(cur_field=="username"){jQuery("#desired_username_err").html(o.err_msgs.username).removeClass("error_y").addClass("error_n").show();jQuery("#desired_username_err").closest("div.form_item").addClass("form_error")}if(cur_field=="tos"){jQuery("#lgn_register_tos_err",reg_form).html(o.err_msgs.tos)}}}else{UnifiedLogin.showPage("#lgn_register_complete")}});return false},closeRefresh:function(){this.closeOverlay();document.location.reload()},closeRegister:function(){this.log(this.reg_type);this.closeOverlay();if(this.reg_type=="standard"){document.location="/wizard/start"}else{if(this.reg_type=="wizard"){document.location="/wizard/step1"}else{if(this.reg_type=="quick"){document.location="/build/quick"}else{if(this.reg_type=="cb"){try{if(this.login_callback){this.login_callback("new")}}catch(e){}}}}}},squidooLogoutRefresh:function(){jQuery.get("/member/ajax_logout",function(){UnifiedLogin.closeOverlay();document.location.reload()})},fbLogoutRefresh:function(){FB.logout(function(){UnifiedLogin.closeOverlay();document.location.reload()})},validateUsername:function(parent_el,skip_if_empty){var val=jQuery("#lgn_register_sq_username").val();if((jQuery.trim(val)=="")&&skip_if_empty){return}jQuery("#desired_username_err").html("Checking...").removeClass("form_error").show();jQuery.post("/member/ajax_validate_registration",{data_type:"username",value:val},function(res){var res_o=UnifiedLogin.parseJSON(res);if(res_o.result==true){jQuery("#desired_username_err").html(res_o.msg).removeClass("error_n").addClass("error_y").show();jQuery(parent_el).addClass("form_error")}else{jQuery("#desired_username_err").html(res_o.msg).removeClass("error_y").addClass("error_n").show();jQuery(parent_el).addClass("form_error")}})},usernameKeyUp:function(e){this.log(e);var charCode=(e.which)?e.which:e.keyCode;if((charCode==45)||(charCode==8)||(charCode==9)||(charCode==95)||((charCode>=97)&&(charCode<=122))||((charCode>=65)&&(charCode<=90))||((charCode>=48)&&(charCode<=57))){return true}return false},validateEmail:function(parent_el,skip_if_empty){var val=jQuery("#lgn_register_sq_email").val();if((jQuery.trim(val)=="")&&skip_if_empty){return}jQuery("#email_address_err").html("Checking...").removeClass("form_error").show();jQuery.post("/member/ajax_validate_registration",{data_type:"email_address",value:val},function(res){var res_o=UnifiedLogin.parseJSON(res);if(res_o.result==true){jQuery("#email_address_err").html(res_o.msg).removeClass("error_n").addClass("error_y").show();jQuery(parent_el).addClass("form_error")}else{jQuery("#email_address_err").html(res_o.msg).removeClass("error_y").addClass("error_n").show();jQuery(parent_el).addClass("form_error")}})},validatePassword:function(parent_el,skip_if_empty){var val=jQuery("#lgn_register_sq_password").val();if((jQuery.trim(val)=="")&&skip_if_empty){return}if(val.length<6){jQuery("#password_err").html("Password too short").removeClass("error_y").addClass("error_n").show();jQuery(parent_el).addClass("form_error")}else{jQuery("#password_err").html("OK").removeClass("error_n").addClass("error_y").show();jQuery(parent_el).addClass("form_error")}},validatePasswordConf:function(parent_el,skip_if_empty){var pass=jQuery("#lgn_register_sq_password").val();var pass_conf=jQuery("#lgn_register_sq_verify").val();if((jQuery.trim(pass_conf)=="")&&skip_if_empty){return}if(pass!=pass_conf){jQuery("#password_confirmation_err").html("Passwords do not match").removeClass("error_y").addClass("error_n").show();jQuery(parent_el).addClass("form_error")}else{jQuery("#password_confirmation_err").html("OK").removeClass("error_n").addClass("error_y").show();jQuery(parent_el).addClass("form_error")}},parseJSON:function(str){if(typeof(str)=="string"){return eval("("+str+")")}else{return str}},__d:null}}();