(function(a){a.fn.uiButton=function(){return this.each(function(){a(this).addClass("ui-state-default ui-corner-all").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){a(this).addClass("ui-state-focus")}).blur(function(){a(this).removeClass("ui-state-focus")})})};a.uiButtonPane=function(){return a(".ui-dialog-buttonpane button").addClass("ui-button")}})(jQuery);$(document).ready(function(){$(".ui-button").uiButton()});$(document).ready(function(){var a=escape($("#taf-title").val());var d=escape($("#taf-url").val());var b=escape($("#taf-description").val());var e=escape($("#taf-ga").val());var f;$("#taf").dialog({autoOpen:false,buttons:{Close:function(){$(this).dialog("close")}},minHeight:430,minWidth:600,modal:true,open:function(g){$(this).tabs();$.uiButtonPane();pageTracker._trackPageview("/redirect/taf/open"+e+"/"+f)},overlay:{opacity:0.5,background:"black"},title:"Share this page with a friend",width:600});$(".taf-link").click(function(g){f=$(this).attr("gasrc")||"undefined";$("#taf").dialog("open")});function c(h,k,g){var n='<table class="links">';var j=0;var o=(Math.ceil(k.length/g)-1)*g;while(j<k.length){if(j%g==0){n+="<tr>"}n+="<td"+(j>=o?' class="last"':"")+'><a href="'+k[j].u.replace("$t",a).replace("$u",d).replace("$d",b)+'" class="'+k[j].c+'"'+(k[j].u.substr(0,4)=="http"?' target="_blank"':"")+" onclick=\"javascript:pageTracker._trackPageview('/redirect/taf/"+escape(k[j].c)+e+'\')"><div class="i"/><div class="t">'+k[j].t+"</div></a></td>";if(j%g==g-1){n+="</tr>"}j++}while(j%g!=0){n+="<td></td>";if(j%g==g-1){n+="</tr>"}j++}h.append(n+"</table>")}c($("#taf-bookmark"),[{c:"favorites",t:"My Browser Favorites",u:"javascript:addToFavorites()"},{c:"delicious",t:"Delicious",u:"http://delicious.com/post?url=$u&title=$t"},{c:"myaol-favorites",t:"MyAOL Favorites",u:"http://favorites.my.aol.com/ffclient/AddFeed?url=$u"},{c:"google-bookmarks",t:"Google Bookmarks",u:"http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=$u&title=$t"},{c:"yahoo-bookmarks",t:"Yahoo! Bookmarks",u:"http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&u=$u&t=$t"},{c:"windowslive",t:"Windows Live Favorites",u:"https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=$u&title=$t&top=1"}],3);c($("#taf-share"),[{c:"digg",t:"Digg",u:"http://digg.com/submit?url=$u&title=$t&bodytext=$d"},{c:"facebook",t:"Facebook",u:"http://www.facebook.com/sharer.php?u=$u&t=$t"},{c:"myspace",t:"MySpace",u:"http://www.myspace.com/index.cfm?fuseaction=postto&u=$u&t=$t&c=$d"},{c:"twitter",t:"Twitter",u:"http://twitter.com/home/?status=$t%3A%20$u"},{c:"technorati",t:"Technorati",u:"http://www.technorati.com/faves?add=$u"},{c:"reddit",t:"reddit",u:"http://reddit.com/submit?url=$u&title=$t"},{c:"stumbleupon",t:"StumbleUpon",u:"http://www.stumbleupon.com/submit?url=$u"},{c:"linkedin",t:"Linkedin",u:"http://www.linkedin.com/shareArticle?mini=true&url=$u&title=$t&summary=$d"},{c:"bebo",t:"bebo",u:"http://www.bebo.com/c/share?Url=$u&Title=$t"},{c:"yahoo-buzz",t:"Yahoo! Buzz",u:"http://buzz.yahoo.com/submit?submitUrl=$u&submitHeadline=$t&submitSummary=$d"}],5);$.each([["taf-from-name","your name"],["taf-from-email","your email address"],["taf-to-name","your friend's name"],["taf-to-email","your friend's email address"],["taf-message","if you want, enter here a message for your friend"]],function(h,j){var g=$("#"+j[0]);if(!g.val()||g.val()==j[1]){g.addClass("tip").val(j[1]).one("focus",function(){$(this).removeClass("tip").val("")})}});$("#taf-submit").click(function(){$("#taf-from-error").hide();$("#taf-to-error").hide();$("#taf-generic-error").hide();$("#taf-submit").hide();$("#taf-submiting").show();$.ajax({type:"POST",url:$("#taf-form").attr("action")+"/Ajax",data:{url:$("#taf-url").val(),fromname:$("#taf-from-name").val(),fromemail:$("#taf-from-email").val(),copy:$("#taf-copy").attr("checked"),toname:$("#taf-to-name").val(),toemail:$("#taf-to-email").val(),message:$("#taf-message").val()},dataType:"json",cache:false,timeout:60000,success:function(g){if(typeof(g.error.status)=="undefined"){if(pageTracker){pageTracker._trackPageview("/redirect/taf/email"+e)}$("#taf-form").hide();$("#tag-again-msg").html("Thank you for sharing Manidoo with your friend!<br><br>Your email message was sent successfully to "+$("#taf-to-name").val()+".<br/><br/><a href='http://content.manidoo.com/TellAFriend/Gifts/palm.pdf' target='_blank' class='taf-link' onclick='pageTracker._trackPageview(\"/redirect/taf/email-gift\" + ga);'>Click here to download your FREE PDF that shows your luck in the palm of your hand!</a>");$("#taf-again").show()}else{if(g.data.fromname||g.data.fromemail){document.getElementById("taf-from-error").style.display="table-row"}if(g.data.toname||g.data.toemail){document.getElementById("taf-to-error").style.display="table-row"}}},error:function(){document.getElementById("taf-generic-error").style.display="table-row"},complete:function(){$("#taf-submiting").hide();$("#taf-submit").show()}})});$("#taf-again-btn").click(function(){$("#taf-again").hide();$.each(["taf-to-name","taf-to-email","taf-message"],function(g,h){$("#"+h).val("")});$("#taf-form").show()})});function addToFavorites(){try{var b=$("#taf-url").val();var a=$("#taf-title").val();if(window.sidebar){window.sidebar.addPanel(a,b,"")}else{if(window.external){window.external.AddFavorite(b,a)}else{alert("Press Control+D to bookmark.")}}}catch(c){}}$(document).ready(function(){$("#navigation area").jHelperTip({trigger:"hover",source:"attribute",attrName:"alt",opacity:0.8,autoClose:true,topOff:-115,leftOff:-60,aC:"#navigationTip"});if($("#leftSidebar").length!=0){$(window).scroll(function(){$("#leftSidebar").animate({top:25+$(document).scrollTop()},{queue:false,duration:500})})}});(function(a){a.fn.jHelperTip=function(c){var e=a.extend({},a.fn.jHelperTip.defaults,c);if(a(e.ttC).length==0){a('<div id="'+e.ttC.slice(1)+'"></div>').appendTo("body")}if(a(e.dC).length==0){a('<div id="'+e.dC.slice(1)+'"></div>').appendTo("body")}if(a(e.aC).length==0){a('<div id="'+e.aC.slice(1)+'"></div>').appendTo("body")}a(e.ttC).add(e.aC).css({position:"absolute",display:"inline"}).hide();a(e.dC).hide();var f=function(){if(e.source=="attribute"){a(e.aC).hide().empty()}else{a(e.ttC).hide().empty()}};a(".jHelperTipClose").bind("click",f);a(e.ttC).bind("mouseover",function(){a(e.ttC).show();return false});var b=function(h,g){if(e.source=="ajax"){d(g);a(e.ttC).html('<div><img src="'+e.loadingImg+'"/> '+e.loadingText+"</div>").show();a.ajax({type:e.type,url:e.url,data:e.data,success:function(i){a(e.ttC).html(i);a(".jHelperTipClose").unbind("click",f);a(".jHelperTipClose").bind("click",f)}})}else{if(e.source=="container"){a(e.ttC).show().empty();a(e.dC).clone(true).show().appendTo(e.ttC)}}if(e.source=="attribute"){a(e.aC).html(a(h).attr(e.attrName))}};var d=function(i){var h=i.pageY+e.topOff;var g=i.pageX+e.leftOff;if(e.source=="attribute"){a(e.aC).css({top:h,left:g,opacity:e.opacity}).show()}else{a(e.ttC).css({top:h,left:g,opacity:e.opacity}).show()}};if(e.trigger=="hover"){a(this).bind("mouseover",function(g){g.preventDefault();b(this,g);return false});a(this).bind("mousemove",function(g){d(g);return false});a(this).bind("mouseout",function(g){if(e.source=="attribute"){a(e.aC).hide().empty()}else{a(e.ttC).hide().empty()}return false})}else{if(e.trigger=="click"){a(this).bind("click",function(g){b(this,g);d(g);a(document).bind("click",function(h){if(e.autoClose){if(e.source=="attribute"){a(e.aC).hide().empty()}else{a(e.ttC).hide().empty()}}});return false})}}};a.fn.jHelperTip.defaults={trigger:"click",topOff:3,leftOff:10,source:"container",attrName:"",ttC:"#jHelperTipContainer",dC:"#jHelperTipDataContainer",aC:"#jHelperTipAttrContainer",opacity:1,loadingImg:"ajax-loader.gif",loadingText:"Loading...",type:"GET",autoClose:true}})(jQuery);var Class=function(b){var c=function(){if(this.initialize&&arguments[0]!="noinit"){return this.initialize.apply(this,arguments)}else{return this}};for(var a in this){c[a]=this[a]}c.prototype=b;return c};Class.empty=function(){};Class.prototype={extend:function(e){var c=new this("noinit");var a=function(h,g){if(!h.apply||!g.apply){return false}return function(){this.parent=h;return g.apply(this,arguments)}};for(var d in e){var f=c[d];var b=e[d];if(f&&f!=b){b=a(f,b)||b}c[d]=b}return new Class(c)},implement:function(b){for(var a in b){this.prototype[a]=b[a]}}};Object.extend=function(){var a=arguments;a=a[1]?[a[0],a[1]]:[this,a[0]];for(var b in a[1]){a[0][b]=a[1][b]}return a[0]};Object.Native=function(){for(var a=0;a<arguments.length;a++){arguments[a].extend=Class.prototype.implement}};new Object.Native(Function,Array,String,Number,Class);Array.prototype.forEach=Array.prototype.forEach||function(a,b){for(var c=0;c<this.length;c++){a.call(b,this[c],c,this)}};Array.prototype.map=Array.prototype.map||function(a,b){var d=[];for(var c=0;c<this.length;c++){d[c]=a.call(b,this[c],c,this)}return d};Array.prototype.every=Array.prototype.every||function(a,b){for(var c=0;c<this.length;c++){if(!a.call(b,this[c],c,this)){return false}}return true};Array.prototype.some=Array.prototype.some||function(a,b){for(var c=0;c<this.length;c++){if(a.call(b,this[c],c,this)){return true}}return false};Array.prototype.indexOf=Array.prototype.indexOf||function(b,a){a=a||0;if(a<0){a=Math.max(0,this.length+a)}while(a<this.length){if(this[a]===b){return a}a++}return -1};Array.extend({each:Array.prototype.forEach,copy:function(){var b=[];for(var a=0;a<this.length;a++){b[a]=this[a]}return b},remove:function(b){var a=0;while(a<this.length){if(this[a]==b){this.splice(a,1)}else{a++}}return this},test:function(b,a){return this.indexOf(b,a)!=-1},extend:function(b){for(var a=0;a<b.length;a++){this.push(b[a])}return this},associate:function(a){var d={},c=Math.min(this.length,a.length);for(var b=0;b<c;b++){d[a[b]]=this[b]}return d},rgbToHex:function(d){if(this.length<3){return false}if(this[3]&&(this[3]==0)&&!d){return"transparent"}var a=[];for(var b=0;b<3;b++){var c=(this[b]-0).toString(16);a.push((c.length==1)?"0"+c:c)}return d?a:"#"+a.join("")},hexToRgb:function(c){if(this.length!=3){return false}var b=[];for(var a=0;a<3;a++){b.push(parseInt((this[a].length==1)?this[a]+this[a]:this[a],16))}return c?b:"rgb("+b.join(",")+")"},merge:function(b){for(var a=0;a<b.length;a++){if(!this.test(b[a])){this.push(b[a])}}},grep:function(a,c){if(typeof a=="string"){a=new Function("a","i","return "+a)}var d=[];for(var e=0,b=this.length;e<b;e++){if(!c&&a(this[e],e)||c&&!a(this[e],e)){d.push(this[e])}}return d},map:function(a){if(typeof a=="string"){a=new Function("a","return "+a)}var c=[];for(var d=0,b=this.length;d<b;d++){var e=a(this[d],d);if(e!==null&&e!=undefined){if(e.constructor!=Array){e=[e]}c=c.concat(e)}}return c},removeDuplicates:function(){for(var b=0,a=this.length;b<a;b++){for(var c=0;c<b;c++){if(this[b]==this[c]){this.splice(b,1);b--;a--;c--}}}return this}});Array.indexOf=function(a,c){for(var b=0,d=c.length;b<d;b++){if(c[b]==a){return b}}return -1};String.prototype.getInt=function(d,b,e){for(var a=e;a>=b;a--){var c=this.substring(d,d+a);if(c.length<b){return null}if(c.isInteger()){return c}}return null};String.prototype.isInteger=function(){var a="1234567890";for(var b=0;b<this.length;b++){if(a.indexOf(this.charAt(b))==-1){return false}}return true};