$(function(){$.cookie("sentAry",null);if(!$.cookie("sentAry")){var R=new Array();$.cookie("sentAry","wo")}else{var R=$.cookie("sentAry").split(",")}if(!$.cookie("userid")){$("#login_notice").show();return }var T="";userinfoArea=$("div#userinfo");myprofile=$(".myprofile");switch(page_type){case"avatar":$("#avatarslist .ul_container li").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}).click(function(){$("#avatarslist .ul_container li").removeClass("active");$(this).addClass("active");userselectAvatar=$(this).attr("avatarid");$("#avatarselected #DEFAULT img").attr("src","/img/avatars/big/"+userselectAvatar);return false});$("#setavatar").click(function(){if(userselectAvatar!=""){$.post("/ajax/userprofile.php?a=changeavatar&t="+new Date().getTime(),{wo:"wo",newavatar:userselectAvatar},function(W,X){if(W.status==1){if($.cookie("remember")==1){$.cookie("avatar",W.avatar,{expires:365,path:"/"})}else{$.cookie("avatar",W.avatar,{path:"/"})}$.cookie("avatarChange",1,{path:"/"});window.location.href="/myprofile.html"}else{}},"json")}return false});$.post("/ajax/userprofile.php?a=avatar&t="+new Date().getTime(),{wo:"wo"},function(X,Y){if(X.status==1){userinfoArea.show();$("#avatarbuilder").css("display","block");$(".bmain").html(X.userinfo.username);var W=lang.site_url+"/user.html?u="+X.userinfo.username;$(".userprofilenicelink a").html(W);$(".userprofilenicelink a").attr("href",W);$("span#level span").html(X.userinfo.level);$("span#points span").html(X.userinfo.points);$("#awardsCount").html(X.userinfo.awards);$("#fullbarcontainer #fullbar").css("width",X.userinfo.points+"%");$("#up_leftbox_username").html(X.userinfo.username);$("#up_leftbox_name").html(X.userinfo.firstname+" "+X.userinfo.lastname);$("#up_leftbox_gender").html(X.userinfo.sex);$("#up_leftbox_age").html(X.userinfo.age);$("#up_last_login").html(X.userinfo.last_visit);$("#up_leftbox_email").html(X.userinfo.email);$(".userAvatar").css("background-image","url(\""+X.userinfo.avatar_big+"\")");$(".privacy a").html(X.userinfo.infoprivate);$("#avatarselected #DEFAULT img").attr("src",X.userinfo.avatar_big);myprofile.show()}},"json");break;case"myprofile":uid=$.cookie("userid");totalBoardMessage=0;$.post("/ajax/userprofile.php?a=myprofile&t="+new Date().getTime(),{wo:"wo"},function(Y,a){if(Y.status==1){$("a#deleteall_wall").hover(function(){$("a#deleteall_wall span.ico").hide();$("a#deleteall_wall span.mesg").show()},function(){$("a#deleteall_wall span.ico").show();$("a#deleteall_wall span.mesg").hide()}).click(function(){N(totalBoardMessage);return false});$("span.showicons").hover(function(){$(this).addClass("hover");$("span.icons_container").show()},function(){$(this).removeClass("hover");$("span.icons_container").hide()});Q($.cookie("userid"),1,10);$("#wall_post_new_message a.bluebutton").click(function(){msg=$("textarea").val();if(msg.length<3){alert("You have a max of 255 characters.");return false}$("textarea").val("");$("iframe").contents().find("body").html("");$("div.maxchars span").text(255);$.post("/ajax/board.php?a=submit_board&num=10&p=1&t="+new Date().getTime(),{fid:uid,message:msg},function(b,c){if(b.status==1){totalBoardMessage=b.totalItems;$("div.friends_wallmessages").hide();$("div.friends_wallmessages").fadeIn();$("div.friends_wallmessages").html(b.boards);$("div.friends_wallmessages li").hover(function(){$(this).children(".links").css("visibility","visible")},function(){$(this).children(".links").css("visibility","hidden")});$(".links a.reply").click(function(){var d=$(this).parent().next().find("a").attr("href");window.location.href=d+"#reply_wall";return false});if($.cookie("userid")==uid){$(".links a.delete").click(function(){var d=$(this).attr("href").substr(1);$.post("/ajax/board.php?a=del&t="+new Date().getTime(),{bid:d},function(f,e){if(f.status==1){alert(f.message);Q(uid,1,10)}},"json");return false})}if(b.pager){$("#paging_wall").show();$("#paging_wall").html(b.pager);$("span.pagine span").has("a").unbind().click(function(){H=$(this).find("a").attr("href").substr(1);$("div.friends_wallmessages").html("<div class=\"wall_nomessages\"><div><img src=\"/img/indicator.gif\" /></div></div>");$("#paging_wall").hide();Q(uid,H,10)})}}else{if(b.message){Q(uid,H,10);alert(b.message)}}},"json");return false});userinfoArea.show();if($.cookie("avatarChange")==1){$.cookie("avatarChange",null);$("#flashMessage .good .middle .text").text("Avatar changed!");$("#flashMessage").slideDown();setTimeout(function(){$("#flashMessage").slideUp()},6000)}if($.cookie("settingChange")==1){$.cookie("settingChange",null);$("#flashMessage .good .middle .text").text("Your new settings are saved!");$("#flashMessage").slideDown();setTimeout(function(){$("#flashMessage").slideUp()},6000)}if($.cookie("basicChange")==1){$.cookie("basicChange",null);$("#flashMessage .good .middle .text").text("Your info has been updated!");$("#flashMessage").slideDown();setTimeout(function(){$("#flashMessage").slideUp()},6000)}if($.cookie("emailChange")==1){$.cookie("emailChange",null);$("#flashMessage .good .middle .text").text("Your new email has been saved!");$("#flashMessage").slideDown();setTimeout(function(){$("#flashMessage").slideUp()},6000)}if($.cookie("passwordChange")==1){$.cookie("passwordChange",null);$("#flashMessage .good .middle .text").text("Your new password is saved!");$("#flashMessage").slideDown();setTimeout(function(){$("#flashMessage").slideUp()},6000)}$(".bmain").html(Y.userinfo.username);$(".userprofilenicelink a").html(Y.userinfo.friends_url);$(".userprofilenicelink a").attr("href",Y.userinfo.friends_url);$("span#level span").html(Y.userinfo.level);$("span#points span").html(Y.userinfo.points);$("#awardsCount").html(Y.userinfo.awards);$("#fullbarcontainer #fullbar").css("width",Y.userinfo.points+"%");$("#up_leftbox_username").html(Y.userinfo.username);$("#up_leftbox_name").html(Y.userinfo.firstname+" "+Y.userinfo.lastname);$("#up_leftbox_gender").html(Y.userinfo.sex);$("#up_leftbox_age").html(Y.userinfo.age);$("#up_last_login").html(Y.userinfo.last_visit);$("#up_leftbox_email").html(Y.userinfo.email);$(".userAvatar").css("background-image","url(\""+Y.userinfo.avatar_big+"\")");$(".privacy a").html(Y.userinfo.infoprivate);myprofile.show();I(Y.userinfo.new_friend);$("span.awardsCount").text(Y.awards_total);$("span.friendsCount").text(Y.friends_total);if(Y.myfriends.length==0){$(".friends_latest_list ul").hide();$(".friends_latest_list div.total").hide();$(".friends_latest_list .friends_friendlist_nofriends").show()}else{W="";$.each(Y.myfriends,function(b,c){W+="<li>     <a href=\""+c.friends_url+"\"><img height=\"50\" width=\"50\" border=\"0\" src=\"/img/_/profile/avatar_border_small_white.gif\" style=\"background-image: url(&quot;"+c.avatar_small+"&quot;);\" alt=\""+c.username+"\">"+c.username+"</a> </li>"});$(".friends_latest_list ul").html(W);$(".friends_latest_list ul").show()}$("#container_left #latestFriends").show();if(Y.mycomments.length==0){$("#mycomments_profile ol").html("<li>         <p class=\"comment_meta\"><a href=\"#\"></a></p>         <p class=\"comment_text\">Here's where you'll find an overview of the comments you've made on any games.<br><br></p>     </li>     <li style=\"height: 60px;\" class=\"even\"><br><br></li>")}else{var W="";$.each(Y.mycomments,function(b,c){if(b%2==0){W+="<li class=\"even\"><p class=\"comment_meta\"><a href=\""+c.url+"\">"+c.title+"</a></p>     <p class=\"comment_text\">"+c.comment+"</p>     <p class=\"comment_meta\"><span class=\"comment_date\">"+c.time_ago+"</span></p></li>"}else{W+="<li><p class=\"comment_meta\"><a href=\""+c.url+"\">"+c.title+"</a></p>     <p class=\"comment_text\">"+c.comment+"</p>     <p class=\"comment_meta\"><span class=\"comment_date\">"+c.time_ago+"</span></p></li>"}});$("#mycomments_profile ol").html(W)}$("#container_left #mycomments").show();$("#profilecontent").show();if(Y.myawards.length==0){$("#myawards_content .noresults").show();$("#myawards_content .results").hide();$("#myawards_content .latestBottomLinks").hide()}else{$("#myawards_content .noresults").hide();$("#myawards_content .results").show();var W="";$.each(Y.myawards,function(b,c){if(b%2==0&&b!=Y.myawards.length){if(b==0){W+="<ul>"}else{W+="</ul><ul>"}}if(c.title){W+="<li><div class=\"thumb\"><a href=\""+c.url+"\"><img height=\"38\" width=\"38\" style=\"background-image: url(/img/_/profile/awards_"+c.type+".png);\" src=\"/img/_/layout/ha/award_medium_white.gif\"></a></div><div class=\"info\"><span class=\"title\"><a href=\""+c.url+"\">"+c.title+"<br></a></span><span class=\"points\">score ( "+c.score+" )</span></div></li>"}else{W+="<li><div class=\"thumb\"><img height=\"38\" width=\"38\" src=\"/img/_/layout/ha/award_small_white.gif\"></div><span class=\"noaward\"></span></li>"}});W+="</ul>";var Z="";$.each(Y.lastAwards,function(b,c){if(b!=2){Z+="<li>"}else{Z+="<li style=\"margin-right: 0px;\">"}Z+="<a href=\""+c.url+"\"  class=\"image tooltipd\" title=\""+c.description+"\"><img src=\""+c.image+"\" alt=\"Plink\" title=\""+c.title+"\" width=\"120\" height=\"90\" onerror=\"javascript:if(this.src!='/img/noimage.gif') this.src='/img/noimage.gif'\" /></a> <span><a href=\""+c.url+"\"  class=\"tooltipd\" title=\""+c.description+"\">"+c.title+"</a></span></li>"});$(".awardgames ul").html(Z);$("#myawards_content .results").html(W);$("#myawards_content .latestBottomLinks").hide()}if(Y.myhighscore.length==0){$("#highscores .noresults").show();$("#highscores .results").hide();$("#highscores .hrlike").hide()}else{$("#highscores .noresults").hide();var W="";$.each(Y.myhighscore,function(c,d){if(c%2==0){var b="even"}else{var b="odd"}if(d.title){W+="<li class=\""+b+"\"><div style=\"position: relative;\" class=\"image\"><a href=\""+d.url+"\" class=\"tooltipd\" title=\""+d.description+"\"><span class=\"cropper\"><img height=\"32\" width=\"43\" src=\""+d.image+"\"><span class=\"rounder\">&nbsp;</span></span></a><span style=\"display: none;\" class=\"time\"><span class=\"highscoresbox_time\">"+d.time_ago+"</span></span></div><div class=\"infotext\"><span class=\"gametitle\"><a href=\""+d.url+"\"class=\"tooltipd\" title=\""+d.description+"\">"+d.title+"</a></span><div class=\"gamescore\">"+d.score+"</div><span style=\"display: none;\" class=\"time\"><span class=\"highscoresbox_time\">"+d.time_ago+"</span></span></div></li>"}else{W+="<li class=\"noresult "+b+"\"><div class=\"image noresult\"></div><div class=\"infotext\">Go set some high scores!</div></li>"}});$("#highscores .results ul").html(W);var Z="";$.each(Y.lastHighscore,function(c,d){if(c%2==0){var b="even"}else{var b="odd"}if(d.title){Z+="<li class=\""+b+"\"><div style=\"position: relative;\" class=\"image\"><a href=\""+d.url+"\" class=\"tooltipd\" title=\""+d.description+"\"><span class=\"cropper\"><img height=\"32\" width=\"43\" src=\""+d.image+"\"><span class=\"rounder\">&nbsp;</span></span></a></div><div class=\"infotext\"><span class=\"gametitle\"><a href=\""+d.url+"\"class=\"tooltipd\" title=\""+d.description+"\">"+d.title+"</a></span></div></li>"}else{Z+="<li class=\"noresult "+b+"\"><div class=\"image noresult\"></div><div class=\"infotext\">Go set some high scores!</div></li>"}});$("#highscores .morehsg ul").html(Z);$("#highscores .results").show();$("#highscores .hrlike").show()}var W="";if(Y.myfave.length==0){var X=Y.new2_games;W+="<li id=\"mygame_0\" class=\"firstsubcatgame\" style=\"padding-right: 5px;\" ><div>No fave games yet.</div> <div>You haven't saved any games as favorites yet. When you like a game you're playing, click to add it to your Faves and it'll be saved here!</div><p class=\"title\" style=\"font-weight: bold;\">Try these awesome games!</p></li>";W+="<li style=\"height: 57px;\" class=\"empty\" id=\"mygame_2\">         <div style=\"position: relative;\" class=\"image\">             <a class=\"tooltipd\" href=\""+X[0].url+"\" title=\""+X[0].description+"\">             <span style=\"position: absolute; left: 0pt; top: 10px;\" class=\"cropper\">                 <img height=\"32\" width=\"43\" src=\""+X[0].image+"\">                 <span class=\"rounder\">&nbsp;&nbsp;</span>             </span>             </a>         </div>         <div class=\"infotext\">             <span style=\"position: absolute; left: 59px; top: 7px;\" class=\"gametitle\">                 <a class=\"tooltipd\" href=\""+X[0].url+"\" title=\""+X[0].description+"\">"+X[0].title+"</a>             </span>         </div>         </li>";W+="<li style=\"height: 57px;\" class=\"odd empty\" id=\"mygame_3\">         <div style=\"position: relative;\" class=\"image\">             <a class=\"tooltipd\" href=\""+X[1].url+"\" title=\""+X[1].description+"\">             <span style=\"position: absolute; left: 0pt; top: 10px;\" class=\"cropper\">                 <img height=\"32\" width=\"43\" src=\""+X[1].image+"\">                 <span class=\"rounder\">&nbsp;&nbsp;</span>             </span>             </a>         </div>         <div class=\"infotext\">             <span style=\"position: absolute; left: 59px; top: 7px;\" class=\"gametitle\">                 <a class=\"tooltipd\" href=\""+X[1].url+"\" title=\""+X[1].description+"\">"+X[1].title+"</a>             </span>         </div>         </li>"}else{$.each(Y.myfave,function(c,d){if(c%2==0){var b="even"}else{var b="odd"}if(c==0){W+="<li class=\"empty firstsubcatgame\"><a class=\"image tooltipd\" href=\""+d.url+"\" title=\""+d.description+"\">     <img height=\"90\" width=\"120\" src=\""+d.image+"\" onerror=\"javascript:if(this.src!='/img/noimage.gif') this.src='/img/noimage.gif'\"> </a> <div class=\"firstgamedata\">     <div class=\"played_count\">"+d.timesplayed+" plays/wk</div>     <div class=\"rating_number\">"+d.rating+"%<img src=\"/img/_/layout/boxes/subcategory/ratingface.gif\" alt=\":)\"></div> </div> <div class=\"game_name\"><a class=\"tooltipd\" href=\""+d.url+"\" title=\""+d.description+"\">"+d.title+"</a></div><div class=\"recentDelete\">     <a href=\"#"+d.id+"\" class=\"tooltipd recentDelete recentDelete-x\" title=\"Remove\">         <span>&nbsp;</span>     </a> </div></li>"}else{if(d.title){W+="<li class=\"empty "+b+"\"><a class=\"image tooltipd\" href=\""+d.url+"\" title=\""+d.description+"\">"+d.title+"<span class=\"tipthumbnail\"><img height=\"75\" width=\"100\" src=\"/cimg/thumbnails/100X75/5/5/148655/20100611103449_My-Forest-Adventures.png\" onerror=\"javascript:if(this.src!='/img/noimage.gif') this.src='/img/noimage.gif'\"></span> </a><div class=\"recentDelete\" style=\"visibility: hidden;\">     <a href=\"#"+d.id+"\" class=\"tooltipd recentDelete recentDelete-x\" title=\"Remove\">         <span>&nbsp;</span>     </a> </div></li>"}else{W+="<li class=\"empty "+b+"\"></li>"}}})}$("ul#favorite-list-myprofile1").html(W);$("ul#favorite-list-myprofile1 li").hover(function(){$(this).children().has(".recentDelete").css("visibility","visible")},function(){$(this).children().has(".recentDelete").css("visibility","hidden")});$("ul#favorite-list-myprofile1 li div.recentDelete").click(function(){alert($(this).find("a").attr("href"));return false});$(".rightcolumn #faves").show();$(".rightcolumn #faves .bottom .middle a.moregames").hide();$(".rightcolumn #faves .bottom .middle a#see_more_games").css("display","block");var W="";if(Y.myplayed.length==0){W+="<li class=\"even firstsubcatgame\"><div style=\"font-weight: bold;\">No recent plays!</div><div>When you play games while logged in, we'll save your most recent plays here for easy access.</div><p class=\"title\" style=\"font-weight: bold;\"></p></li>";W+="<li class=\"odd\">&nbsp;</li>";W+="<li class=\"even\">&nbsp;</li>";W+="<li class=\"odd\">&nbsp;</li>";W+="<li class=\"even\">&nbsp;</li>";W+="<li class=\"odd\">&nbsp;</li>"}else{$.each(Y.myplayed,function(c,d){if(c%2==0){var b="even"}else{var b="odd"}if(c==0){W+="<li class=\"empty firstsubcatgame\"><a class=\"image tooltipd\" href=\""+d.url+"\" title=\""+d.description+"\">     <img height=\"90\" width=\"120\" src=\""+d.image+"\" onerror=\"javascript:if(this.src!='/img/noimage.gif') this.src='/img/noimage.gif'\"> </a> <div class=\"firstgamedata\">     <div class=\"played_count\">"+d.timesplayed+" plays/wk</div>     <div class=\"rating_number\">"+d.rating+"%<img src=\"/img/_/layout/boxes/subcategory/ratingface.gif\" alt=\":)\"></div> </div> <div class=\"game_name\"><a class=\"tooltipd\" href=\""+d.url+"\" title=\""+d.description+"\">"+d.title+"</a></div><div class=\"recentDelete\">     <a href=\"#"+d.id+"\" class=\"tooltipd recentDelete recentDelete-x\" title=\"Remove\">         <span>&nbsp;</span>     </a> </div></li>"}else{if(d.title){W+="<li class=\"empty "+b+"\"><a class=\"image tooltipd\" href=\""+d.url+"\" title=\""+d.description+"\">"+d.title+"<span class=\"tipthumbnail\"><img height=\"75\" width=\"100\" src=\"/cimg/thumbnails/100X75/5/5/148655/20100611103449_My-Forest-Adventures.png\" onerror=\"javascript:if(this.src!='/img/noimage.gif') this.src='/img/noimage.gif'\"></span> </a><div class=\"recentDelete\" style=\"visibility: hidden;\">     <a href=\"#"+d.id+"\" class=\"tooltipd recentDelete recentDelete-x\" title=\"Remove\">         <span>&nbsp;</span>     </a> </div></li>"}else{W+="<li class=\"empty "+b+"\"></li>"}}})}$("ul#recentlyGames").html(W);$("ul#recentlyGames li").hover(function(){$(this).children().has(".recentDelete").css("visibility","visible")},function(){$(this).children().has(".recentDelete").css("visibility","hidden")});$("ul#recentlyGames li div.recentDelete").click(function(){alert($(this).find("a").attr("href"));return false});$("#recentplayed .moregames").css("display","block");spiApplyImageTooltip($("a.tooltipi"),tooltip_thumbnail_width);spiApplyTooltip($("a.tooltipd"));F()}},"json");break;case"myfave":$.post("/ajax/userprofile.php?a=myfave&t="+new Date().getTime(),{wo:"wo"},function(X,Y){if(X.status==1){userinfoArea.show();$(".bmain").html(X.userinfo.username);$(".userprofilenicelink a").html(X.userinfo.friends_url);$(".userprofilenicelink a").attr("href",X.userinfo.friends_url);$("span#level span").html(X.userinfo.level);$("span#points span").html(X.userinfo.points);$("#awardsCount").html(X.userinfo.awards);$("#fullbarcontainer #fullbar").css("width",X.userinfo.points+"%");$("#up_leftbox_username").html(X.userinfo.username);$("#up_leftbox_name").html(X.userinfo.firstname+" "+X.userinfo.lastname);$("#up_leftbox_gender").html(X.userinfo.sex);$("#up_leftbox_age").html(X.userinfo.age);$("#up_last_login").html(X.userinfo.last_visit);$("#up_leftbox_email").html(X.userinfo.email);$(".userAvatar").css("background-image","url(\""+X.userinfo.avatar_big+"\")");$(".privacy a").html(X.userinfo.infoprivate);myprofile.show();I(X.userinfo.new_friend);$("span.awardsCount").text(X.awards_total);$("span.friendsCount").text(X.friends_total);$("#container_left #latestFriends").show();if(X.myfriends.length==0){$(".friends_latest_list ul").hide();$(".friends_latest_list div.total").hide();$(".friends_latest_list .friends_friendlist_nofriends").show()}else{W="";$.each(X.myfriends,function(Z,a){W+="<li>     <a href=\""+a.friends_url+"\"><img height=\"50\" width=\"50\" border=\"0\" src=\"/img/_/profile/avatar_border_small_white.gif\" style=\"background-image: url(&quot;"+a.avatar_small+"&quot;);\" alt=\""+a.username+"\">"+a.username+"</a> </li>"});$(".friends_latest_list ul").html(W);$(".friends_latest_list ul").show()}var W="";$.each(X.myfave,function(a,b){if((a+1)%5==0){var Z=" last"}else{var Z=""}if(b.title){W+="<li class=\"indicator"+Z+"\"><div class=\"recentDelete\">  <a class=\"recentDelete\" href=\"\">   <span>    Remove  </span>  </a> </div> <a title=\""+b.description+"\" class=\"tooltip recentItem\" href=\""+b.url+"\">  <img height=\"90\" width=\"120\" src=\""+b.image+"\" onerror=\"javascript:if(this.src!='/img/noimage.gif') this.src='/img/noimage.gif'\">  <span class=\"newmark\" style=\"display: none; background-image: url(&quot;/img/_/layout/79,new_label.gif&quot;);\">NEW</span> "+b.title+" </a></li>"}else{if(a==0){W+="<li class=\"empty firstsubcatgame\"><span>Save a fave here</span></li>"}else{if(a==4){W+="<li class=\"empty last\"><span>Save a fave here</span></li>"}else{W+="<li class=\"empty\"><span>Save a fave here</span></li>"}}}});$("#favorite-list-myprofile").html(W);W="";$.each(X.myplayed,function(a,b){if((a+1)%5==0){var Z=" class=\"last\""}else{var Z=""}if(b.title){W+="<li"+Z+" style=\"background: none repeat scroll 0% 0% transparent;\"><div class=\"recentDelete\" style=\"visibility: visible;\"><a class=\"recentDelete\" href=\"#\" style=\"visibility: visible;\"><span>Remove</span></a></div> <a title=\""+b.description+"\" class=\"tooltip recentItem\" href=\""+b.url+"\">     <img height=\"90\" width=\"120\" src=\""+b.image+"\" onerror=\"javascript:if(this.src!='/img/noimage.gif') this.src='/img/noimage.gif'\">     <span class=\"newmark\" style=\"display: none; background-image: url(&quot;/img/_/layout/79,new_label.gif&quot;);\">NEW</span><span class=\"gameTitle\">"+b.title+"</span></a></li>"}else{if(a==4){W+="<li class=\"last\"><span class=\"recentlyEmpty\">Play more games!</span></li>"}else{W+="<li><span class=\"recentlyEmpty\">Play more games!</span></li>"}}});$("#recentlyGames").html(W)}},"json");break;case"myfriends":var A="Type a name or username...";$("input.friends_search_username").val(A);$("input.friends_search_username").focus(function(){if($(this).val()==A){$(this).val("");$(this).addClass("searchBold")}});$("input.friends_search_username").blur(function(){if($(this).val()==""){$(this).val("Type a name or username...");$(this).removeClass("searchBold")}});$.post("/ajax/userprofile.php?a=myfriends&t="+new Date().getTime(),{wo:"wo"},function(W,X){if(W.status==1){userinfoArea.show();$(".bmain").html(W.userinfo.username);$(".userprofilenicelink a").html(W.userinfo.friends_url);$(".userprofilenicelink a").attr("href",W.userinfo.friends_url);$("span#level span").html(W.userinfo.level);$("span#points span").html(W.userinfo.points);$("#awardsCount").html(W.userinfo.awards);$("#fullbarcontainer #fullbar").css("width",W.userinfo.points+"%");$("#up_leftbox_username").html(W.userinfo.username);$("#up_leftbox_name").html(W.userinfo.firstname+" "+W.userinfo.lastname);$("#up_leftbox_gender").html(W.userinfo.sex);$("#up_leftbox_age").html(W.userinfo.age);$("#up_last_login").html(W.userinfo.last_visit);$("#up_leftbox_email").html(W.userinfo.email);$(".userAvatar").css("background-image","url(\""+W.userinfo.avatar_big+"\")");$(".privacy a").html(W.userinfo.infoprivate);myprofile.show();$("span.awardsCount").text(W.awards_total);$("span.friendsCount").text(W.friends_total);if(W.FriendsRequest.length==0){$("div.friends_messages").hide()}else{$("div.friends_messages").show();temp="";$.each(W.FriendsRequest,function(Y,Z){temp+="<div class=\"message_container message_invitation pngfixme\" noticeaction=\"newinvitation\" mesg=\""+Y+"\">     <div class=\"mleft\">&nbsp;</div>     <div class=\"mmid nofix\">         <div class=\"avatar\">             <a href=\""+Z.friends_url+"\">             <img alt=\"\" src=\""+Z.avatar_small+"\">               </a>         </div>         <div class=\"message twoliner\"><strong>"+Z.username+"</strong> would like to add you as a friend. Do you accept?</div>         <div class=\"links\">             <a href=\"#"+Y+"\" class=\"reject\" style=\"display: block;\">Ignore</a>             <a href=\"#"+Y+"\" class=\"accept\" style=\"display: block;\">Accept</a>         </div>     </div>     <div class=\"mright\">&nbsp;</div> </div>"});$("div.friends_messages").html(temp);$("div.links a.accept").click(function(){var Z=$(this).attr("href").substr(1);var c=W.FriendsRequest[Z].username;var a=W.FriendsRequest[Z].friends_url;var b=fid=W.FriendsRequest[Z].userid;var Y=$(this).parent().parent().parent();$.get("/ajax/friends.php?a=accept&t="+new Date().getTime(),{wo:"wo",fid:b},function(d,e){if(d.status==1){temp="<div class=\"message_container message_info pngfixme\" noticeaction=\"accepted\">     <div class=\"mleft\">&nbsp;</div>     <div class=\"mmid nofix\">         <div class=\"message done\">Yay, <strong>"+c+"</strong> has been added to your friends list!</div>         <div class=\"links\">             <a href=\""+a+"#reply_wall\" class=\"wall\" style=\"display: inline;\">Leave a post.</a>             <a href=\"#invite\" class=\"invite\" style=\"display: none;\">Add as a Friend</a>             <a href=\"#\" class=\"close\" style=\"display: none;\">&nbsp;</a>         </div>     </div>     <div class=\"mright\">&nbsp;</div> </div>";Y.replaceWith(temp)}},"json")});$("div.links a.reject").click(function(){var Z=$(this).attr("href").substr(1);var c=W.FriendsRequest[Z].username;var a=W.FriendsRequest[Z].friends_url;var b=fid=W.FriendsRequest[Z].userid;var Y=$(this).parent().parent().parent();$.get("/ajax/friends.php?a=reject&t="+new Date().getTime(),{wo:"wo",fid:b},function(d,e){if(d.status==1){temp="<div class=\"message_container message_info pngfixme\" noticeaction=\"rejected\" mesg=\"1\">     <div class=\"mleft\">&nbsp;</div>     <div class=\"mmid nofix\">         <div class=\"message attention\">You have ignored <strong>"+c+"</strong>'s friend request. This user will not be added to your friends list.</div>         <div class=\"links\">             <a href=\""+a+"#reply_wall\" class=\"wall\" style=\"display: none;\">Leave a post.</a>             <a href=\"#invite\" class=\"invite\" style=\"display: none;\">Add as a Friend</a>             <a href=\"#\" class=\"close\" style=\"display: block;\">&nbsp;</a>         </div>     </div>     <div class=\"mright\">&nbsp;</div> </div>";$(this).parent().parent().parent().replaceWith(temp);$("div.links a.close").unbind().click(function(){Y.hide()})}},"json")})}if(W.myfriends.length==0){$("div.my_friends_holder div.my_friends_results_holder").hide();$("div.my_friends_holder div.my_friends_no_friends").show()}else{if(W.friends_total==1){$(".my_friends_total_holder .my_friends_total").html(lang.have_friend)}else{$(".my_friends_total_holder .my_friends_total").html(lang.have_friends(W.friends_total))}$("span.friendsCount").text(W.friends_total);temp="";$.each(W.myfriends,function(Z,a){if(Z%2==0){var Y="evenitem"}else{var Y="odditem"}if(a.infoprivate!=1){temp+="<li class=\""+Y+"\"><div class=\"friends_search_item_holder\">  <div class=\"avatar\">   <a href=\""+a.friends_url+"\">    <img height=\"50\" width=\"50\" border=\"0\" alt=\""+a.username+"\" style=\"background-image: url(&quot;"+a.avatar_small+"&quot;);\" src=\"/img/_/profile/avatar_border_small_blue.gif\">   </a>    </div>  <p class=\"usernameHolder\"><a href=\""+a.friends_url+"\">"+a.username+"</a></p>  <p class=\"usernameHolder\">"+a.name+"</p>  <p class=\"usernameHolder\">"+a.sex+"</p>  <p class=\"usernameHolder usernameHolderBlue\">AWARDS "+a.awards+" (Level&nbsp;"+a.level+")</p>     <p class=\"userActionLink\"><a href=\""+a.friends_url+"#reply_wall\">Leave a post</a><br><a href=\"#"+a.userid+"\" class=\"friends_search_result_action friends_search_item_bottomlink\">Remove from my friends</a></p><p>      </p></div></li>"}else{temp+="<li class=\""+Y+"\"><div class=\"friends_search_item_holder\">  <div class=\"avatar\">   <a href=\""+a.friends_url+"\">    <img height=\"50\" width=\"50\" border=\"0\" alt=\""+a.username+"\" style=\"background-image: url(&quot;"+a.avatar_small+"&quot;);\" src=\"/img/_/profile/avatar_border_small_blue.gif\">   </a>    </div>  <p class=\"usernameHolder\"><a href=\""+a.friends_url+"\">"+a.username+"</a></p>  <p class=\"usernameHolder\">&nbsp;</p>  <p class=\"usernameHolder usernameHolderPrivate\">Private Profile</p>  <p class=\"usernameHolder usernameHolderBlue\">&nbsp;</p>     <p class=\"userActionLink\"><a href=\""+a.friends_url+"#reply_wall\">Leave a post</a><br><a href=\"#"+a.userid+"\" class=\"friends_search_result_action friends_search_item_bottomlink\">Remove from my friends</a></p><p>      </p></div></li>"}});if(W.pager){$(".my_friends_pagination").html("<span class=\"pagine\">"+W.pager+"</span>");$(".my_friends_pagination").show();$("span.pagine span").has("a").unbind().click(function(){H=$(this).find("a").attr("href").substr(1);J(H)})}$("ul.my_friends_results").html(temp);$(".friends_search_result_action").unbind().click(function(){M($(this).attr("href").substr(1))})}}},"json");function J(W){$(".my_friends_pagination").hide();$(".my_friends_holder .my_friends_results_holder").hide();$(".my_friends_holder .my_friends_no_friends").html("<img src=\"/img/indicator.gif\" />");$(".my_friends_holder .my_friends_no_friends").show();$(".friends_search_total_holder").hide();$("ul.friends_search_results").hide();$(".friends_search_pagination").hide();$.get("/ajax/myfriends.php",{wo:"wo",p:W},function(X,Y){if(X.status==1){$(".my_friends_holder .my_friends_no_friends").hide();$(".my_friends_holder .my_friends_results_holder").fadeIn();if(X.friends_total==1){$(".my_friends_total_holder .my_friends_total").html(lang.have_friend)}else{$(".my_friends_total_holder .my_friends_total").html(lang.have_friends(X.friends_total))}$("span.friendsCount").text(X.friends_total);temp="";$.each(X.myfriends,function(a,b){if(a%2==0){var Z="evenitem"}else{var Z="odditem"}if(b.infoprivate!=1){temp+="<li class=\""+Z+"\"><div class=\"friends_search_item_holder\">  <div class=\"avatar\">   <a href=\""+b.friends_url+"\">    <img height=\"50\" width=\"50\" border=\"0\" alt=\""+b.username+"\" style=\"background-image: url(&quot;"+b.avatar_small+"&quot;);\" src=\"/img/_/profile/avatar_border_small_blue.gif\">   </a>    </div>  <p class=\"usernameHolder\"><a href=\""+b.friends_url+"\">"+b.username+"</a></p>  <p class=\"usernameHolder\">"+b.name+"</p>  <p class=\"usernameHolder\">"+b.sex+"</p>  <p class=\"usernameHolder usernameHolderBlue\">AWARDS "+b.awards+" (Level&nbsp;"+b.level+")</p>     <p class=\"userActionLink\"><a href=\""+b.friends_url+"#reply_wall\">Leave a post</a><br><a href=\"#"+b.userid+"\" class=\"friends_search_result_action friends_search_item_bottomlink\">Remove from my friends</a></p><p>      </p></div></li>"}else{temp+="<li class=\""+Z+"\"><div class=\"friends_search_item_holder\">  <div class=\"avatar\">   <a href=\""+b.friends_url+"\">    <img height=\"50\" width=\"50\" border=\"0\" alt=\""+b.username+"\" style=\"background-image: url(&quot;"+b.avatar_small+"&quot;);\" src=\"/img/_/profile/avatar_border_small_blue.gif\">   </a>    </div>  <p class=\"usernameHolder\"><a href=\""+b.friends_url+"\">"+b.username+"</a></p>  <p class=\"usernameHolder\">&nbsp;</p>  <p class=\"usernameHolder usernameHolderPrivate\">Private Profile</p>  <p class=\"usernameHolder usernameHolderBlue\">&nbsp;</p>     <p class=\"userActionLink\"><a href=\""+b.friends_url+"#reply_wall\">Leave a post</a><br><a href=\"#"+b.userid+"\" class=\"friends_search_result_action friends_search_item_bottomlink\">Remove from my friends</a></p><p>      </p></div></li>"}});if(X.pager){$(".my_friends_pagination").html("<span class=\"pagine\">"+X.pager+"</span>");$(".my_friends_pagination").show();$("span.pagine span").has("a").unbind().click(function(){H=$(this).find("a").attr("href").substr(1);J(H)})}$("ul.my_friends_results").html(temp);$(".friends_search_result_action").unbind().click(function(){M($(this).attr("href").substr(1))})}},"json")}var H=1;function U(W){H=W;$("div.buttons a.bluebutton").click();H=1}$("div.buttons a.bluebutton").click(function(){if($("input.friends_search_username").val()!=""&&$("input.friends_search_username").val()!=A){$(".showMyFriends").show();$(".my_friends_holder .my_friends_results_holder").hide();$(".my_friends_holder .my_friends_no_friends").html("<img src=\"/img/indicator.gif\" />");$(".my_friends_holder .my_friends_no_friends").show();$(".friends_search_total_holder").hide();$("ul.friends_search_results").hide();$(".friends_search_pagination").hide();var W=$("input.friends_search_username").val();$.get("/ajax/search_friends.php",{wo:"wo",keyword:W,p:H},function(X,Y){if(X.status==1){$(".my_friends_holder .my_friends_no_friends").hide();temp="";if(X.friends.length>0){$.each(X.friends,function(a,b){if(a%2==0){var Z="evenitem"}else{var Z="odditem"}var c;if(!in_array($.cookie("sentAry").split(","),b.userid)){if(b.userid!=$.cookie("userid")){c="<p class=\"userActionLink\"><a href=\"#"+b.userid+","+b.username+"\" class=\"friends_search_result_action\">Send friend request</a></p>"}else{c=""}}else{c="<span href=\"#\" class=\"friends_search_result_action userActionLink\">Friend request sent</span>"}if(b.infoprivate!=1){temp+="<li class=\""+Z+"\"><div class=\"friends_search_item_holder\">  <div class=\"avatar\">   <a href=\""+b.friends_url+"\">    <img height=\"50\" border=\"0\" width=\"50\" alt=\""+b.username+"\" style=\"background-image: url(&quot;"+b.avatar_small+"&quot;);\" src=\"/img/_/profile/avatar_border_small_blue.gif\">   </a>  </div>  <p class=\"usernameHolder\"><a href=\""+b.friends_url+"\">"+b.username+"</a></p>  <p class=\"usernameHolder\">"+b.name+"</p>  <p class=\"usernameHolder\">"+b.sex+"</p>  <p class=\"usernameHolder usernameHolderBlue\">AWARDS "+b.awards+" (Level&nbsp;"+b.level+")</p>     "+c+"   </div></li>"}else{temp+="<li class=\""+Z+"\"><div class=\"friends_search_item_holder\">  <div class=\"avatar\">   <a href=\""+b.friends_url+"\">    <img height=\"50\" border=\"0\" width=\"50\" alt=\""+b.username+"\" style=\"background-image: url(&quot;"+b.avatar_small+"&quot;);\" src=\"/img/_/profile/avatar_border_small_blue.gif\">   </a>  </div>  <p class=\"usernameHolder\"><a href=\""+b.friends_url+"\">"+b.username+"</a></p>  <p class=\"usernameHolder\">&nbsp;</p>  <p class=\"usernameHolder usernameHolderPrivate\">Private Profile</p>  <p class=\"usernameHolder usernameHolderBlue\">&nbsp;</p>     "+c+"   </div></li>"}});$(".friends_search_total_holder span.friends_search_total").html(X.friends_total+" matches for \""+W+"\" found!");$(".friends_search_total_holder").show();$("ul.friends_search_results").html(temp);$("ul.friends_search_results").show();$(this).parent().replaceWith("<span href=\"#\" class=\"friends_search_result_action userActionLink\">Friend request sent</span>");if(X.pager){$(".friends_search_pagination").html("<span class=\"pagine\">"+X.pager+"</span>");$(".friends_search_pagination").show();$("span.pagine span").has("a").unbind().click(function(){var Z=$(this).find("a").attr("href").substr(1);U(Z)})}$(".friends_search_result_action").unbind().click(function(){$(this).parent().replaceWith("<span href=\"#\" class=\"friends_search_result_action userActionLink\">Friend request sent</span>");var b=$(this).attr("href").substr(1);var a=b.split(",");uid=a[0];R.push(uid);$.cookie("sentAry",R.join(),{path:"/"});var Z=a[1];$.get("/ajax/friends.php?a=request",{wo:"wo",fid:uid},function(c,d){if(c.status==1){D(Z)}},"json")})}else{$(".friends_search_no_results").show()}}},"json")}return false});break;case"myawards":$.post("/ajax/userprofile.php?a=myawards",{wo:"wo"},function(X,Y){if(X.status==1){userinfoArea.show();$(".bmain").html(X.userinfo.username);$(".userprofilenicelink a").html(X.userinfo.friends_url);$(".userprofilenicelink a").attr("href",X.userinfo.friends_url);$("span#level span").html(X.userinfo.level);$("span#points span").html(X.userinfo.points);$("#awardsCount").html(X.userinfo.awards);$("#fullbarcontainer #fullbar").css("width",X.userinfo.points+"%");$("#up_leftbox_username").html(X.userinfo.username);$("#up_leftbox_name").html(X.userinfo.firstname+" "+X.userinfo.lastname);$("#up_leftbox_gender").html(X.userinfo.sex);$("#up_leftbox_age").html(X.userinfo.age);$("#up_last_login").html(X.userinfo.last_visit);$("#up_leftbox_email").html(X.userinfo.email);$(".userAvatar").css("background-image","url(\""+X.userinfo.avatar_big+"\")");$(".privacy a").html(X.userinfo.infoprivate);myprofile.show();I(X.userinfo.new_friend);$("span.awardsCount").text(X.awards_total);$("span.friendsCount").text(X.friends_total);$("#container_left #latestFriends").show();if(X.myfriends.length==0){$(".friends_latest_list ul").hide();$(".friends_latest_list div.total").hide();$(".friends_latest_list .friends_friendlist_nofriends").show()}else{W="";$.each(X.myfriends,function(Z,a){W+="<li>     <a href=\""+a.friends_url+"\"><img height=\"50\" width=\"50\" border=\"0\" src=\"/img/_/profile/avatar_border_small_white.gif\" style=\"background-image: url(&quot;"+a.avatar_small+"&quot;);\" alt=\""+a.username+"\">"+a.username+"</a> </li>"});$(".friends_latest_list ul").html(W);$(".friends_latest_list ul").show()}if(X.myawards.length==0){$("#myawards_content .noresults").show();$("#myawards_content .results").hide()}else{$("#myawards_content .noresults").hide();$("#myawards_content .results").show();var W="";$.each(X.myawards,function(Z,a){if(Z%2==0&&Z!=X.myawards.length){if(Z==0){W+="<ul class=\"even\">"}else{W+="</ul><ul>"}}if(a.title){W+="<li><div class=\"thumb\"><a href=\""+a.url+"\"><img height=\"38\" width=\"38\" style=\"background-image: url(/img/_/profile/awards_"+a.type+".png);\" src=\"/img/_/layout/ha/award_medium_white.gif\"></a></div><div class=\"info\"><span class=\"title\"><a href=\""+a.url+"\">"+a.title+"<br></a></span><span class=\"points\">score ( "+a.score+" )</span></div></li>"}else{W+="<li><div class=\"thumb\"><img height=\"38\" width=\"38\" src=\"/img/_/layout/ha/award_small_white.gif\"></div><span class=\"noaward\"></span></li>"}});W+="</ul>";$("#myawards_content .results").html(W);if(X.pager){$("#myawards_content div.paginer span.pagine").html(X.pager);$("#myawards_content div.paginer").show();$("span.pagine span").has("a").unbind().click(function(){H=$(this).find("a").attr("href").substr(1);P(H)})}}}},"json");break;case"settings":$.post("/ajax/userprofile.php?a=settings",{wo:"wo"},function(X,Y){if(X.status==1){userinfoArea.show();$(".bmain").html(X.userinfo.username);var W=lang.site_url+"/user.html?u="+X.userinfo.username;$(".userprofilenicelink a").html(W);$(".userprofilenicelink a").attr("href",W);$("span#level span").html(X.userinfo.level);$("span#points span").html(X.userinfo.points);$("#awardsCount").html(X.userinfo.awards);$("#fullbarcontainer #fullbar").css("width",X.userinfo.points+"%");$("#up_leftbox_username").html(X.userinfo.username);$("#up_leftbox_name").html(X.userinfo.firstname+" "+X.userinfo.lastname);$("#up_leftbox_gender").html(X.userinfo.sex);$("#up_leftbox_age").html(X.userinfo.age);$("#up_last_login").html(X.userinfo.last_visit);$("#up_leftbox_email").html(X.userinfo.email);$(".userAvatar").css("background-image","url(\""+X.userinfo.avatar_big+"\")");$(".privacy a").html(X.userinfo.infoprivate);myprofile.show();$("#settings").show();$("a#setprivacy").click(function(){$.get("/ajax/mysetting.php?a=myprivacy",{wo:"wo",privacy:$("input[name=userprivacy]:checked").val()},function(Z,a){if(Z.status==1){$.cookie("settingChange",1);window.location.href="/myprofile.html"}},"json")})}},"json");break;case"change_info":$.post("/ajax/userprofile.php?a=settings",{wo:"wo"},function(X,Y){if(X.status==1){userinfoArea.show();$(".bmain").html(X.userinfo.username);var W=lang.site_url+"/user.html?u="+X.userinfo.username;$(".userprofilenicelink a").html(W);$(".userprofilenicelink a").attr("href",W);$("span#level span").html(X.userinfo.level);$("span#points span").html(X.userinfo.points);$("#awardsCount").html(X.userinfo.awards);$("#fullbarcontainer #fullbar").css("width",X.userinfo.points+"%");$("span#f_username").html(X.userinfo.username);$("input#f_givenname").val(X.userinfo.firstname);$("input#f_surname").val(X.userinfo.lastname);if(X.userinfo.gender=="m"){$("input#f_male").attr("checked",true)}else{$("input#f_female").attr("checked",true)}$("select#f_dob_month option[value="+X.userinfo.birthday_m+"]").attr("selected",true);$("select#f_dob_day option[value="+X.userinfo.birthday_d+"]").attr("selected",true);$("select#f_dob_year option[value="+X.userinfo.birthday_y+"]").attr("selected",true);$("span#f_email_current").html(X.userinfo.email);$(".userAvatar").css("background-image","url(\""+X.userinfo.avatar_big+"\")");$(".privacy a").html(X.userinfo.infoprivate);myprofile.show();$("#main_profile").show();$("#changeprofile").show();$("a#save_basic").click(function(){if(!B()||!L()){return false}$("div.ok").hide();$("div#intro").hide();$("div#basic_confirmation_intro").show();$("div.changeprofile_content #basic").hide();$("div.changeprofile_content #basic_confirmation").show();$("div.changeprofile_content #email").hide();$("div.changeprofile_content #email_confirmation").hide();$("div.changeprofile_content #password").hide();$("#f_cpassword").val("");if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var Z=$(this.hash);Z=Z.length&&Z||$("[name="+this.hash.slice(1)+"]");if(Z.length){var a=Z.offset().top;$("html,body").animate({scrollTop:a},1000);return false}}});$("#cancel_basic_confirmation").click(function(){$("div#intro").show();$("div#basic_confirmation_intro").hide();$("div#email_confirmation_intro").hide();$("div.changeprofile_content #basic").show();$("div.changeprofile_content #basic_confirmation").hide();$("div.changeprofile_content #email").show();$("div.changeprofile_content #email_confirmation").hide();$("div.changeprofile_content #password").show();return false});$("#save_basic_confirmation").click(function(){if($("#f_cpassword").val().length<6){$("input#f_cpassword").addClass("validationError");$("#f_cpassword_error").show();$("#f_cpassword_error").css("visibility","visible")}else{$("#f_cpassword_error").hide();$("input#f_cpassword").removeClass("validationError");$.post("/ajax/change_info.php?a=basic",{password:$("input#f_cpassword").val(),firstname:$("input#f_givenname").val(),lastname:$("input#f_surname").val()},function(Z,a){if(Z.status==1){if(Z.password_error==1){$("#f_cpassword_error .errorbox .main .content").html("Whoops, this isn't the right password! Try again.");$("input#f_cpassword").addClass("validationError");$("#f_cpassword_error").show();$("#f_cpassword_error").css("visibility","visible")}else{$.cookie("basicChange",1);window.location.href="/myprofile.html"}}},"json")}return false});$("a#save_email").click(function(){if(!V()){return false}$("div.ok").hide();$("div#intro").hide();$("div#basic_confirmation_intro").hide();$("div#email_confirmation_intro").show();$("div.changeprofile_content #basic").hide();$("div.changeprofile_content #basic_confirmation").hide();$("div.changeprofile_content #email").hide();$("div.changeprofile_content #email_confirmation").show();$("div.changeprofile_content #password").hide();$("#f_ecpassword").val("");if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var Z=$(this.hash);Z=Z.length&&Z||$("[name="+this.hash.slice(1)+"]");if(Z.length){var a=Z.offset().top;$("html,body").animate({scrollTop:a},1000);return false}}});$("#cancel_email_confirmation").click(function(){$("div#intro").show();$("div#basic_confirmation_intro").hide();$("div#email_confirmation_intro").hide();$("div.changeprofile_content #basic").show();$("div.changeprofile_content #basic_confirmation").hide();$("div.changeprofile_content #email").show();$("div.changeprofile_content #email_confirmation").hide();$("div.changeprofile_content #password").show();return false});$("#save_email_confirmation").click(function(){if($("#f_ecpassword").val().length<6){$("input#f_ecpassword").addClass("validationError");$("#f_ecpassword_error").show();$("#f_ecpassword_error").css("visibility","visible")}else{$("#f_ecpassword_error").hide();$("input#f_ecpassword").removeClass("validationError");$.post("/ajax/change_info.php?a=email",{password:$("input#f_ecpassword").val(),email:$("input#f_email").val(),},function(Z,a){if(Z.status==1){if(Z.password_error==1){$("#f_ecpassword_error .errorbox .main .content").html("Whoops, this isn't the right password! Try again.");$("input#f_ecpassword").addClass("validationError");$("#f_ecpassword_error").show();$("#f_ecpassword_error").css("visibility","visible")}else{$.cookie("emailChange",1);window.location.href="/myprofile.html"}}},"json")}return false});$("#save_password").click(function(){if(!K()||!S()||!O()){return false}$.post("/ajax/change_info.php?a=password",{password:$("input#f_old_password").val(),newpasswd:$("input#f_password").val(),},function(Z,a){if(Z.status==1){if(Z.password_error==1){$("#f_old_password_error .errorbox .main .content").html("Whoops, this isn't the right password! Try again.");$("input#f_ecpassword").addClass("validationError");$("#f_old_password_error").show();$("#f_old_password_error").css("visibility","visible");$("#f_old_password_ok").hide()}else{$.cookie("passwordChange",1);window.location.href="/myprofile.html"}}},"json");return false})}},"json");break;case"userprofile":var G=$().getParmByUrl("u");$("div#profilecontent div.navigationbox div.navigation ul li:eq(0) a").attr("href","/user_profile.html?u="+G);$("div#profilecontent div.navigationbox div.navigation ul li:eq(1) a").attr("href","/user_awords.html?u="+G);$("div#profilecontent div.navigationbox div.navigation ul li:eq(2) a").attr("href","/user_friends.html?u="+G);$.post("/ajax/friendprofile.php?a=myprofile&t="+new Date().getTime(),{wo:"wo",username:G},function(Y,a){if(Y.status==1){if(Y.info){$("#privateprofile").show();return }userinfoArea.show();$(".bmain").html(Y.userinfo.username);var X=lang.site_url+"/user.html?u="+Y.userinfo.username;$(".userprofilenicelink a").html(X);$(".userprofilenicelink a").attr("href",X);$("span#level span").html(Y.userinfo.level);$("span#points span").html(Y.userinfo.points);$("#awardsCount").html(Y.userinfo.awards);$("#fullbarcontainer #fullbar").css("width",Y.userinfo.points+"%");$("#up_leftbox_username").html(Y.userinfo.username);$("#up_leftbox_name").html(Y.userinfo.firstname+" "+Y.userinfo.lastname);$("#up_leftbox_gender").html(Y.userinfo.sex);$("#up_leftbox_age").html(Y.userinfo.age);$(".userAvatar").css("background-image","url(\""+Y.userinfo.avatar_big+"\")");$(".report-link-holder").html("");myprofile.hide();if(Y.userinfo.infoprivate==0){$("table#profileData tbody tr:eq(1)").show()}C(Y);$("span.username").text(Y.userinfo.username);if(Y.userinfo.infoprivate==1){$(".profilePanelHolder").hide();$("#privateprofile").show();return }$("span.awardsCount").text(Y.awards_total);$("span.friendsCount").text(Y.friends_total);if(Y.myfriends.length==0){$(".friends_latest_list ul").hide();$(".friends_latest_list div.total").hide();$(".friends_latest_list .friends_friendlist_nofriends").show();$("#container_left #latestFriends").hide()}else{W="";$.each(Y.myfriends,function(b,c){W+="<li>     <a href=\""+c.friends_url+"\"><img height=\"50\" width=\"50\" border=\"0\" src=\"/img/_/profile/avatar_border_small_white.gif\" style=\"background-image: url(&quot;"+c.avatar_small+"&quot;);\" alt=\""+c.username+"\">"+c.username+"</a> </li>"});$(".friends_latest_list ul").html(W);$(".friends_latest_list ul").show();$(".friends_latest_list div.total a").attr("href","/user_friends.html?u="+G);$("#container_left #latestFriends").show()}if(Y.mycomments.length==0){$("#mycomments_profile ol").html("<li>         <p class=\"comment_meta\"><a href=\"#\"></a></p>         <p class=\"comment_text\">Here's where you'll find an overview of the comments you've made on any games.<br><br></p>     </li>     <li style=\"height: 60px;\" class=\"even\"><br><br></li>")}else{var W="";$.each(Y.mycomments,function(b,c){if(b%2==0){W+="<li class=\"even\"><p class=\"comment_meta\"><a href=\""+c.url+"\">"+c.title+"</a></p>     <p class=\"comment_text\">"+c.comment+"</p>     <p class=\"comment_meta\"><span class=\"comment_date\">"+c.time_ago+"</span></p></li>"}else{W+="<li><p class=\"comment_meta\"><a href=\""+c.url+"\">"+c.title+"</a></p>     <p class=\"comment_text\">"+c.comment+"</p>     <p class=\"comment_meta\"><span class=\"comment_date\">"+c.time_ago+"</span></p></li>"}});$("#mycomments_profile ol").html(W)}$("#container_left #mycomments").show();$("#profilecontent").show();if(Y.myawards.length==0){$("#myawards_content .noresults").show();$("#myawards_content .results").hide();$(".latestBottomLinks").hide()}else{$("#myawards_content .noresults").hide();$("#myawards_content .results").show();var W="";$.each(Y.myawards,function(b,c){if(b%2==0&&b!=Y.myawards.length){if(b==0){W+="<ul>"}else{W+="</ul><ul>"}}if(c.title){W+="<li><div class=\"thumb\"><a href=\""+c.url+"\"><img height=\"38\" width=\"38\" style=\"background-image: url(/img/_/profile/awards_"+c.type+".png);\" src=\"/img/_/layout/ha/award_medium_white.gif\"></a></div><div class=\"info\"><span class=\"title\"><a href=\""+c.url+"\">"+c.title+"<br></a></span><span class=\"points\">score ( "+c.score+" )</span></div></li>"}else{W+="<li><div class=\"thumb\"><img height=\"38\" width=\"38\" src=\"/img/_/layout/ha/award_small_white.gif\"></div><span class=\"noaward\"></span></li>"}});W+="</ul>";var Z="";$.each(Y.lastAwards,function(b,c){if(b!=2){Z+="<li>"}else{Z+="<li style=\"margin-right: 0px;\">"}Z+="<a href=\""+c.url+"\"  class=\"image tooltipd\" title=\""+c.description+"\"><img src=\""+c.image+"\" alt=\"Plink\" title=\""+c.title+"\" width=\"120\" height=\"90\" onerror=\"javascript:if(this.src!='/img/noimage.gif') this.src='/img/noimage.gif'\" /></a> <span><a href=\""+c.url+"\"  class=\"tooltipd\" title=\""+c.description+"\">"+c.title+"</a></span></li>"});$(".awardgames ul").html(Z);$("#myawards_content .results").html(W)}if(Y.myhighscore.length==0){$("#highscores .noresults").show();$("#highscores .results").hide();$("#highscores .hrlike").hide()}else{$("#highscores .noresults").hide();var W="";$.each(Y.myhighscore,function(c,d){if(c%2==0){var b="even"}else{var b="odd"}if(d.title){W+="<li class=\""+b+"\"><div style=\"position: relative;\" class=\"image\"><a href=\""+d.url+"\" class=\"tooltipd\" title=\""+d.description+"\"><span class=\"cropper\"><img height=\"32\" width=\"43\" src=\""+d.image+"\"><span class=\"rounder\">&nbsp;</span></span></a><span style=\"display: none;\" class=\"time\"><span class=\"highscoresbox_time\">"+d.time_ago+"</span></span></div><div class=\"infotext\"><span class=\"gametitle\"><a href=\""+d.url+"\"class=\"tooltipd\" title=\""+d.description+"\">"+d.title+"</a></span><div class=\"gamescore\">"+d.score+"</div><span style=\"display: none;\" class=\"time\"><span class=\"highscoresbox_time\">"+d.time_ago+"</span></span></div></li>"}else{W+="<li class=\"noresult "+b+"\"><div class=\"image noresult\"></div><div class=\"infotext\">Go set some high scores!</div></li>"}});$("#highscores .results ul").html(W);$("#highscores .results").show()}var W="";if(Y.myfave.length==0){$(".rightcolumn #faves").hide()}else{$.each(Y.myfave,function(c,d){if(c%2==0){var b="even"}else{var b="odd"}if(c==0){W+="<li class=\"empty firstsubcatgame\"><a class=\"image tooltipd\" href=\""+d.url+"\" title=\""+d.description+"\">     <img height=\"90\" width=\"120\" src=\""+d.image+"\" onerror=\"javascript:if(this.src!='/img/noimage.gif') this.src='/img/noimage.gif'\"> </a> <div class=\"firstgamedata\">     <div class=\"played_count\">"+d.timesplayed+" plays/wk</div>     <div class=\"rating_number\">"+d.rating+"%<img src=\"/img/_/layout/boxes/subcategory/ratingface.gif\" alt=\":)\"></div> </div> <div class=\"game_name\"><a class=\"tooltipd\" href=\""+d.url+"\" title=\""+d.description+"\">"+d.title+"</a></div><div class=\"recentDelete\">     <a href=\"#"+d.id+"\" class=\"tooltipd recentDelete recentDelete-x\" title=\"Remove\">         <span>&nbsp;</span>     </a> </div></li>"}else{if(d.title){W+="<li class=\"empty "+b+"\"><a class=\"image tooltipd\" href=\""+d.url+"\" title=\""+d.description+"\">"+d.title+"<span class=\"tipthumbnail\"><img height=\"75\" width=\"100\" src=\"/cimg/thumbnails/100X75/5/5/148655/20100611103449_My-Forest-Adventures.png\" onerror=\"javascript:if(this.src!='/img/noimage.gif') this.src='/img/noimage.gif'\"></span> </a><div class=\"recentDelete\" style=\"visibility: hidden;\">     <a href=\"#"+d.id+"\" class=\"tooltipd recentDelete recentDelete-x\" title=\"Remove\">         <span>&nbsp;</span>     </a> </div></li>"}else{W+="<li class=\"empty "+b+"\"></li>"}}});$("ul#favorite-list-myprofile1").html(W);$(".rightcolumn #faves").show()}$(".h3title").html(Y.userinfo.username+"'S BOARD");Q(Y.userinfo.userid,1,10);if(Y.isfriend==0||Y.isfriend==3){$(".friends_wallmessage_form .wall_user_notfriends #already_request").hide();$(".friends_wallmessage_form .wall_user_notfriends #send_request").show();$(".friends_wallmessage_form .wall_user_notfriends").show();$("div#send_request").click(function(){$(".friends_wallmessage_form .wall_user_notfriends #already_request").show();$(".friends_wallmessage_form .wall_user_notfriends #send_request").hide();$.get("/ajax/friends.php?a=request",{wo:"wo",fid:Y.userinfo.userid},function(b,c){if(b.status==1){D(Y.userinfo.username);W="<div class=\"message_container message_info pngfixme\" noticeaction=\"alreadyinvited\" mesg=\"0\">     <div class=\"mleft\">&nbsp;</div>     <div class=\"mmid nofix\">         <div class=\"message attention\">You've already sent a friend request.</div>         <div class=\"links\">             <a href=\"/user/hejone1#reply_wall\" class=\"wall\" style=\"display: none;\">Leave a post.</a>             <a href=\"#invite\" class=\"invite\" style=\"display: none;\">Add as a Friend</a>             <a href=\"#\" class=\"close\" style=\"display: none;\">&nbsp;</a>         </div>     </div>     <div class=\"mright\">&nbsp;</div> </div>";$("div.friends_messages").html(W);W="<div class=\"friends_profilePanel_holder\">  <div class=\"friends_profilePanel_header\">Friend request sent</div>  <span class=\"friends_profilePanel_pending\">Friend request sent</span> </div>";$("div.profilePanelHolder").html(W)}},"json")})}else{if(Y.isfriend==1||$.cookie("userid")==Y.userinfo.userid){$(".friends_wallmessage_form .wall_user_notfriends").hide();$(".friends_wallmessage_form .container").show();F();$("span.showicons").hover(function(){$(this).addClass("hover");$("span.icons_container").show()},function(){$(this).removeClass("hover");$("span.icons_container").hide()});$("#wall_post_new_message a.bluebutton").click(function(){msg=$("textarea").val();if(msg.length<3){alert("You have a max of 255 characters.");return false}$("textarea").val("");$("iframe").contents().find("body").html("");$("div.maxchars span").text(255);fid=Y.userinfo.userid;$.post("/ajax/board.php?a=submit_board&num=10&p=1&t="+new Date().getTime(),{fid:fid,message:msg},function(b,c){if(b.status==1){$("div.friends_wallmessages").hide();$("div.friends_wallmessages").fadeIn();$("div.friends_wallmessages").html(b.boards);$("div.friends_wallmessages li").hover(function(){$(this).children(".links").css("visibility","visible")},function(){$(this).children(".links").css("visibility","hidden")});$(".links a.reply").click(function(){var d=$(this).parent().next().find("a").attr("href");window.location.href=d+"#reply_wall";return false});if($.cookie("userid")==fid){$(".links a.delete").click(function(){var d=$(this).attr("href").substr(1);$.post("/ajax/board.php?a=del&t="+new Date().getTime(),{bid:d},function(f,e){if(f.status==1){alert(f.message);Q(fid,1,10)}},"json");return false})}if(b.pager){$("#paging_wall").show();$("#paging_wall").html(b.pager);$("span.pagine span").has("a").unbind().click(function(){H=$(this).find("a").attr("href").substr(1);$("div.friends_wallmessages").html("<div class=\"wall_nomessages\"><div><img src=\"/img/indicator.gif\" /></div></div>");$("#paging_wall").hide();Q(fid,H,10)})}}else{if(b.message){Q(fid,H,10);alert(b.message)}}},"json");return false})}else{$(".friends_wallmessage_form .wall_user_notfriends #already_request").show();$(".friends_wallmessage_form .wall_user_notfriends #send_request").hide();$(".friends_wallmessage_form .wall_user_notfriends").show()}}spiApplyImageTooltip($("a.tooltipi"),tooltip_thumbnail_width);spiApplyTooltip($("a.tooltipd"))}},"json");break;case"userawards":var G=$().getParmByUrl("u");$("div#profilecontent div.navigationbox div.navigation ul li:eq(0) a").attr("href","/user_profile.html?u="+G);$("div#profilecontent div.navigationbox div.navigation ul li:eq(1) a").attr("href","/user_awords.html?u="+G);$("div#profilecontent div.navigationbox div.navigation ul li:eq(2) a").attr("href","/user_friends.html?u="+G);$.post("/ajax/friendprofile.php?a=myawards",{wo:"wo",username:G},function(Y,Z){if(Y.status==1){if(Y.info){$("#privateprofile").show();return }userinfoArea.show();$(".bmain").html(Y.userinfo.username);var X=lang.site_url+"/user.html?u="+Y.userinfo.username;$(".userprofilenicelink a").html(X);$(".userprofilenicelink a").attr("href",X);$("span#level span").html(Y.userinfo.level);$("span#points span").html(Y.userinfo.points);$("#awardsCount").html(Y.userinfo.awards);$("#fullbarcontainer #fullbar").css("width",Y.userinfo.points+"%");$("#up_leftbox_username").html(Y.userinfo.username);$("#up_leftbox_name").html(Y.userinfo.firstname+" "+Y.userinfo.lastname);$("#up_leftbox_gender").html(Y.userinfo.sex);$("#up_leftbox_age").html(Y.userinfo.age);$(".userAvatar").css("background-image","url(\""+Y.userinfo.avatar_big+"\")");$(".report-link-holder").html("");myprofile.hide();$("#profilecontent").show();if(Y.userinfo.infoprivate==0){$("table#profileData tbody tr:eq(1)").show()}C(Y);$("span.username").text(Y.userinfo.username);if(Y.userinfo.infoprivate==1){$("#profilecontent").hide();$("#privateprofile").show();return }$("span.awardsCount").text(Y.awards_total);$("span.friendsCount").text(Y.friends_total);$("#container_left #latestFriends").show();if(Y.myfriends.length==0){$(".friends_latest_list ul").hide();$(".friends_latest_list div.total").hide();$(".friends_latest_list .friends_friendlist_nofriends").show();$("#container_left #latestFriends").hide()}else{W="";$.each(Y.myfriends,function(a,b){W+="<li>     <a href=\""+b.friends_url+"\"><img height=\"50\" width=\"50\" border=\"0\" src=\"/img/_/profile/avatar_border_small_white.gif\" style=\"background-image: url(&quot;"+b.avatar_small+"&quot;);\" alt=\""+b.username+"\">"+b.username+"</a> </li>"});$(".friends_latest_list ul").html(W);$(".friends_latest_list ul").show()}if(Y.myawards.length==0){$("#myawards_content .noresults").show();$("#myawards_content .results").hide()}else{$("#myawards_content .noresults").hide();$("#myawards_content .results").show();var W="";$.each(Y.myawards,function(a,b){if(a%2==0&&a!=Y.myawards.length){if(a==0){W+="<ul class=\"even\">"}else{W+="</ul><ul>"}}if(b.title){W+="<li><div class=\"thumb\"><a href=\""+b.url+"\"><img height=\"38\" width=\"38\" style=\"background-image: url(/img/_/profile/awards_"+b.type+".png);\" src=\"/img/_/layout/ha/award_medium_white.gif\"></a></div><div class=\"info\"><span class=\"title\"><a href=\""+b.url+"\">"+b.title+"<br></a></span><span class=\"points\">score ( "+b.score+" )</span></div></li>"}else{W+="<li><div class=\"thumb\"><img height=\"38\" width=\"38\" src=\"/img/_/layout/ha/award_small_white.gif\"></div><span class=\"noaward\"></span></li>"}});W+="</ul>";$("#myawards_content .results").html(W)}if(Y.pager){$("#myawards_content div.paginer span.pagine").html(Y.pager);$("#myawards_content div.paginer").show();$("span.pagine span").has("a").unbind().click(function(){H=$(this).find("a").attr("href").substr(1);P(H)})}}},"json");break;case"userfriends":var G=$().getParmByUrl("u");$("div#profilecontent div.navigationbox div.navigation ul li:eq(0) a").attr("href","/user_profile.html?u="+G);$("div#profilecontent div.navigationbox div.navigation ul li:eq(1) a").attr("href","/user_awords.html?u="+G);$("div#profilecontent div.navigationbox div.navigation ul li:eq(2) a").attr("href","/user_friends.html?u="+G);$.post("/ajax/friendprofile.php?a=myfriends&t="+new Date().getTime(),{wo:"wo",username:G},function(X,Y){if(X.status==1){if(X.info){$("#privateprofile").show();return }userinfoArea.show();$(".bmain").html(X.userinfo.username);var W=lang.site_url+"/user.html?u="+X.userinfo.username;$(".userprofilenicelink a").html(W);$(".userprofilenicelink a").attr("href",W);$("span#level span").html(X.userinfo.level);$("span#points span").html(X.userinfo.points);$("#awardsCount").html(X.userinfo.awards);$("#fullbarcontainer #fullbar").css("width",X.userinfo.points+"%");$("#up_leftbox_username").html(X.userinfo.username);$("#up_leftbox_name").html(X.userinfo.firstname+" "+X.userinfo.lastname);$("#up_leftbox_gender").html(X.userinfo.sex);$("#up_leftbox_age").html(X.userinfo.age);$(".userAvatar").css("background-image","url(\""+X.userinfo.avatar_big+"\")");$(".report-link-holder").html("");myprofile.hide();$("#profilecontent").show();if(X.userinfo.infoprivate==0){$("table#profileData tbody tr:eq(1)").show()}C(X);$("span.username").text(X.userinfo.username);if(X.userinfo.infoprivate==1){$("#profilecontent").hide();$("#privateprofile").show();return }$("span.awardsCount").text(X.awards_total);$("span.friendsCount").text(X.friends_total);if(X.myfriends.length==0){$("div.user_friends_results_holder").hide();$("div.user_friends_no_friends").show()}else{$("span.friendsCount").text(X.friends_total);temp="";$.each(X.myfriends,function(a,b){if(a%2==0){var Z="evenitem"}else{var Z="odditem"}if(!in_array($.cookie("sentAry").split(","),b.userid)){if(b.userid!=$.cookie("userid")){action="<p class=\"userActionLink\"><a href=\"#"+b.userid+","+b.username+"\" class=\"friends_search_result_action\">Send friend request</a></p>"}else{action=""}}else{action="<span href=\"#\" class=\"friends_search_result_action userActionLink\">Friend request sent</span>"}if(b.infoprivate!=1){temp+="<li class=\""+Z+"\"><div class=\"friends_search_item_holder\">  <div class=\"avatar\">   <a href=\""+b.friends_url+"\">    <img height=\"50\" width=\"50\" border=\"0\" alt=\""+b.username+"\" style=\"background-image: url(&quot;"+b.avatar_small+"&quot;);\" src=\"/img/_/profile/avatar_border_small_blue.gif\">   </a>    </div>  <p class=\"usernameHolder\"><a href=\""+b.friends_url+"\">"+b.username+"</a></p>  <p class=\"usernameHolder\">"+b.name+"</p>  <p class=\"usernameHolder\">"+b.sex+"</p>  <p class=\"usernameHolder usernameHolderBlue\">AWARDS "+b.awards+" (Level&nbsp;"+b.level+")</p>     <p class=\"userActionLink\"><a href=\""+b.friends_url+"#reply_wall\">Leave a post</a><br><a href=\"#"+b.userid+"\" class=\"friends_search_result_action friends_search_item_bottomlink\">Remove from my friends</a></p><p>      </p></div></li>"}else{temp+="<li class=\""+Z+"\"><div class=\"friends_search_item_holder\">  <div class=\"avatar\">   <a href=\""+b.friends_url+"\">    <img height=\"50\" width=\"50\" border=\"0\" alt=\""+b.username+"\" style=\"background-image: url(&quot;"+b.avatar_small+"&quot;);\" src=\"/img/_/profile/avatar_border_small_blue.gif\">   </a>    </div>  <p class=\"usernameHolder\"><a href=\""+b.friends_url+"\">"+b.username+"</a></p>  <p class=\"usernameHolder\">&nbsp;</p>  <p class=\"usernameHolder usernameHolderPrivate\">Private Profile</p>  <p class=\"usernameHolder usernameHolderBlue\">&nbsp;</p>     <p class=\"userActionLink\"><a href=\""+b.friends_url+"#reply_wall\">Leave a post</a><br><a href=\"#"+b.userid+"\" class=\"friends_search_result_action friends_search_item_bottomlink\">Remove from my friends</a></p><p>      </p></div></li>"}});if(X.pager){$(".user_friends_pagination").html("<span class=\"pagine\">"+X.pager+"</span>");$(".user_friends_pagination").show();$("span.pagine span").has("a").unbind().click(function(){H=$(this).find("a").attr("href").substr(1);alert(H);J(H)})}else{$(".user_friends_pagination").hide()}$("ul.user_friends_results").html(temp);$(".friends_search_result_action").unbind().click(function(){})}}},"json");break}function M(W){$.floatbox({bg:"floatbox-bg",box:"floatbox-box1",content:"<div class=\"popup_shadow\" style=\"display: block;\">                  <div class=\"popup_container\" style=\"margin-top: 0px;\">   <div class=\"popup_header\"><span class=\"popup_title popup_friends\">REMOVING A FRIEND</span>   <a href=\"#\" class=\"popup_closelink\">Close</a>  </div>   <div class=\"popup_content\"><div class=\"popup_content_body\">   <div class=\"popup_content_simple \"><span class=\"popup_content_header\">Are you sure you want to remove this user from your friends list? You won't be able to access their friends-only features anymore.</span>  </div>  <div class=\"cb\"></div>  </div><div class=\"popup_type_bottom\"><a class=\"popup_blue_button\" href=\"#\">No, please keep this friend.<span></span></a><div class=\"cb\"></div> or <a href=\"#\" class=\"popup_bottom_button\">Yes, remove this friend.</a> </div>  <div class=\"cb\"></div></div>   <div class=\"popup_footer\">&nbsp;</div>  </div>  </div>",fade:true,bgConfig:{position:($.browser.msie)?"absolute":"fixed",zIndex:8,width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:"#000",opacity:"0.5",display:"none"},boxConfig:{position:($.browser.msie)?"absolute":"fixed",zIndex:9,width:370+"px",marginLeft:"-"+(394/2)+"px",height:"170px",top:"50%",left:"50%",display:"none"}});$(".popup_closelink").click(function(){$.floatbox.CloseBox();return false});$(".popup_blue_button").click(function(){$.floatbox.CloseBox();return false});$(".popup_bottom_button").click(function(){$.get("/ajax/friends.php?a=delete",{wo:"wo",fid:W},function(X,Y){if(X.status==1){if(page_type=="userprofile"||page_type=="userawards"||page_type=="userfriends"){history.go(0)}else{J(1);$(".popup_shadow .popup_content").html("<div class=\"popup_content_body\">   <div class=\"popup_content_doublelined popup_ok_highlight\"><span class=\"popup_content_header\">You have removed this user from your friends list.</span><br><span class=\"popup_content_info\">You can request to add this user as a friend again anytime you like.</span>  </div>  <div class=\"cb\"></div>  </div><div class=\"popup_type_bottom\"><a class=\"popup_blue_button\" href=\"#\">Close<span></span></a>  <div class=\"cb\"></div>  </div>");$(".popup_blue_button").unbind().click(function(){$.floatbox.CloseBox();return false})}}},"json");return false});return false}function P(W){$("#myawards_content .results").html("<img src=\"/img/indicator.gif\" />");$("div.paginer").hide();$.get("/ajax/awards.php",{wo:"wo",p:W,fid:$.cookie("userid")},function(Y,Z){if(Y.status==1){var X="";$.each(Y.myawards,function(a,b){if(a%2==0&&a!=Y.myawards.length){if(a==0){X+="<ul class=\"even\">"}else{X+="</ul><ul>"}}if(b.title){X+="<li><div class=\"thumb\"><a href=\""+b.url+"\"><img height=\"38\" width=\"38\" style=\"background-image: url(/img/_/profile/awards_"+b.type+".png);\" src=\"/img/_/layout/ha/award_medium_white.gif\"></a></div><div class=\"info\"><span class=\"title\"><a href=\""+b.url+"\">"+b.title+"<br></a></span><span class=\"points\">score ( "+b.score+" )</span></div></li>"}else{X+="<li><div class=\"thumb\"><img height=\"38\" width=\"38\" src=\"/img/_/layout/ha/award_small_white.gif\"></div><span class=\"noaward\"></span></li>"}});X+="</ul>";$("#myawards_content .results").html(X);if(Y.pager){$("#myawards_content div.paginer span.pagine").html(Y.pager);$("#myawards_content div.paginer").show();$("span.pagine span").has("a").unbind().click(function(){H=$(this).find("a").attr("href").substr(1);P(H)})}}},"json")}function I(Y){var X="";var W="";if(Y==1){W="You have a new friend request! Click <a href=\"/myfriends.html\">here</a> to respond."}else{if(Y>1){W="You have "+Y+" new friend requests! Click <a href=\"/myfriends.html\">here</a> to respond."}else{}}if(Y>0){X="<div class=\"message_container message_info pngfixme\" noticeaction=\"newfriendrequests\" mesg=\"0\">     <div class=\"mleft\">&nbsp;</div>     <div class=\"mmid nofix\">         <div class=\"message attention\">"+W+"</div>         <div class=\"links\">             <a href=\"/user/#reply_wall\" class=\"wall\" style=\"display: none;\">Leave a post.</a>             <a href=\"#invite\" class=\"invite\" style=\"display: none;\">Add as a Friend</a>             <a href=\"#\" class=\"close\" style=\"display: block;\">&nbsp;</a>         </div>     </div>     <div class=\"mright\">&nbsp;</div> </div>";$(".friends_messages").html(X);$(".friends_messages").fadeIn();$("div.links a.close").unbind().click(function(){var Z=$(this).parent().parent().parent();Z.fadeOut()})}}function D(W){$.floatbox({bg:"floatbox-bg",box:"floatbox-box1",content:"<div class=\"popup_shadow\" style=\"display: block;\">          <div class=\"popup_container\" style=\"margin-top: 0px;\">   <div class=\"popup_header\"><span class=\"popup_title popup_friends\">Friend request sent</span></div>   <div class=\"popup_content\"><div class=\"popup_content_body\">   <div class=\"popup_content_simple popup_ok_highlight\"><span class=\"popup_content_header\">You have requested to add "+W+" to your friends list.</span>  </div>  <div class=\"cb\"></div>  </div><div class=\"popup_type_bottom\"><a class=\"popup_blue_button\" href=\"#\">Close<span></span></a>  <div class=\"cb\"></div>  </div></div>   <div class=\"popup_footer\">&nbsp;</div>  </div>  </div>",fade:true,bgConfig:{position:($.browser.msie)?"absolute":"fixed",zIndex:8,width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:"#000",opacity:"0.5",display:"none"},boxConfig:{position:($.browser.msie)?"absolute":"fixed",zIndex:9,width:370+"px",marginLeft:"-"+(394/2)+"px",height:"170px",top:"50%",left:"50%",display:"none"}});$(".popup_blue_button").click(function(){$.floatbox.CloseBox();return false})}function N(W){$.floatbox({bg:"floatbox-bg",box:"floatbox-box1",content:"<div class=\"popup_shadow\" style=\"display: block;\"> <div class=\"popup_container\" style=\"margin-top: 0px;\">   <div class=\"popup_header\"><span class=\"popup_title \">DELETE POSTS?</span>   <a href=\"#\" class=\"popup_closelink\">Close</a>  </div>   <div class=\"popup_content\"><div class=\"popup_content_body\">   <div class=\"popup_content_doublelined popup_yellow_highlight\"><span class=\"popup_content_header\">Are you sure you want to delete all "+W+" posts on this page? </span><br><span class=\"popup_content_info\">This cannot be undone.</span>  </div>  <div class=\"cb\"></div>  </div><div class=\"popup_type_bottom\"><a class=\"popup_blue_button\" href=\"#\">Delete<span></span></a><div class=\"cb\"></div> or <a href=\"#\" class=\"popup_bottom_button\">Cancel</a> </div>  <div class=\"cb\"></div></div>   <div class=\"popup_footer\">&nbsp;</div>  </div> </div>",fade:true,bgConfig:{position:($.browser.msie)?"absolute":"fixed",zIndex:8,width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:"#000",opacity:"0.5",display:"none"},boxConfig:{position:($.browser.msie)?"absolute":"fixed",zIndex:9,width:370+"px",marginLeft:"-"+(394/2)+"px",height:"170px",top:"50%",left:"50%",display:"none"}});$(".popup_blue_button").click(function(){$.post("/ajax/board.php?a=del&t="+new Date().getTime(),{bid:"all"},function(Y,X){if(Y.status==1){Q(uid,1,10);$(".popup_shadow").html("<div class=\"popup_container\" style=\"margin-top: 0px;\">   <div class=\"popup_header\"><span class=\"popup_title \">POSTS DELETED</span>   <a href=\"#\" class=\"popup_closelink\">Close</a>  </div>   <div class=\"popup_content\"><div class=\"popup_content_body\">   <div class=\"popup_content_simple popup_ok_highlight\"><span class=\"popup_content_header\">All posts on this page have been deleted.</span>  </div>  <div class=\"cb\"></div>  </div><div class=\"popup_type_bottom\"><a class=\"popup_blue_button\" href=\"#\">Close<span></span></a>  <div class=\"cb\"></div>  </div></div>   <div class=\"popup_footer\">&nbsp;</div>  </div>");$(".popup_blue_button").unbind().click(function(){$.floatbox.CloseBox();return false})}},"json");return false});$(".popup_closelink").click(function(){$.floatbox.CloseBox();return false});$(".popup_bottom_button").click(function(){$.floatbox.CloseBox();return false})}function C(W){if(W.isfriend!=0&&W.isfriend!=1&&W.isfriend!=2&&W.isfriend!=3){$("div.profilePanelHolder").hide()}else{if(W.isfriend==1){temp="<div class=\"friends_profilePanel_holder\">  <div class=\"friends_profilePanel_header\">We're friends!</div>  <div class=\"friends_profilePanel_accepted\"><a href=\"#"+W.userinfo.userid+"\" class=\"friends_profilePanel_actionlink\">Remove from friends list</a></div>   <div class=\"friends_profilePanel_msgBox\">   <div class=\"friends_profilePanel_msgBox_header\"><a href=\"#\" class=\"friends_profilePanel_closelink\">Close</a></div>   <div class=\"friends_profilePanel_msgBox_msg\"><p>You have deleted username</p></div>   <div class=\"friends_profilePanel_msgBox_footer\"></div>  </div> </div>";$("div.profilePanelHolder").html(temp);$("div.friends_profilePanel_accepted a.friends_profilePanel_actionlink").click(function(){M($(this).attr("href").substr(1));return false})}else{if(W.isfriend==2){temp="<div class=\"message_container message_info pngfixme\" noticeaction=\"alreadyinvited\" mesg=\"0\">     <div class=\"mleft\">&nbsp;</div>     <div class=\"mmid nofix\">         <div class=\"message attention\">You've already sent a friend request.</div>         <div class=\"links\">             <a href=\"/user/hejone1#reply_wall\" class=\"wall\" style=\"display: none;\">Leave a post.</a>             <a href=\"#invite\" class=\"invite\" style=\"display: none;\">Add as a Friend</a>             <a href=\"#\" class=\"close\" style=\"display: none;\">&nbsp;</a>         </div>     </div>     <div class=\"mright\">&nbsp;</div> </div>";$("div.friends_messages").html(temp);$("div.friends_messages").show();$("div.links a.invite").click(function(){alert("333");return false});temp="<div class=\"friends_profilePanel_holder\">  <div class=\"friends_profilePanel_header\">Friend request sent</div>  <span class=\"friends_profilePanel_pending\">Friend request sent</span> </div>";$("div.profilePanelHolder").html(temp)}else{if(W.isfriend==3){temp="<div class=\"message_container message_invitation pngfixme\" noticeaction=\"newinvitation\" mesg=\"0\">     <div class=\"mleft\">&nbsp;</div>     <div class=\"mmid nofix\">         <div class=\"avatar\">             <a href=\""+W.userinfo.friends_url+"\">             <img alt=\"\" src=\""+W.userinfo.avatar_small+"\">               </a>         </div>         <div class=\"message twoliner\"><strong>"+W.userinfo.username+"</strong> would like to add you as a friend. Do you accept?</div>         <div class=\"links\">             <a href=\"#\" class=\"reject\" style=\"display: block;\">Ignore</a>             <a href=\"#\" class=\"accept\" style=\"display: block;\">Accept</a>         </div>     </div>     <div class=\"mright\">&nbsp;</div> </div>";$("div.friends_messages").html(temp);$("div.friends_messages").show();var Z=W.userinfo.username;var X=W.userinfo.friends_url;var Y=fid=W.userinfo.userid;$("div.links a.accept").click(function(){var a=$(this).parent().parent().parent();$.get("/ajax/friends.php?a=accept&t="+new Date().getTime(),{wo:"wo",fid:Y},function(b,c){if(b.status==1){temp="<div class=\"message_container message_info pngfixme\" noticeaction=\"accepted\">     <div class=\"mleft\">&nbsp;</div>     <div class=\"mmid nofix\">         <div class=\"message done\">Yay, <strong>"+Z+"</strong> has been added to your friends list!</div>         <div class=\"links\">             <a href=\""+X+"#reply_wall\" class=\"wall\" style=\"display: inline;\">Leave a post.</a>             <a href=\"#invite\" class=\"invite\" style=\"display: none;\">Add as a Friend</a>             <a href=\"#\" class=\"close\" style=\"display: none;\">&nbsp;</a>         </div>     </div>     <div class=\"mright\">&nbsp;</div> </div>";a.replaceWith(temp)}},"json");return false});$("div.links a.reject").click(function(){var a=$(this).parent().parent().parent();$.get("/ajax/friends.php?a=reject&t="+new Date().getTime(),{wo:"wo",fid:Y},function(b,c){if(b.status==1){temp="<div class=\"message_container message_info pngfixme\" noticeaction=\"rejected\" mesg=\"1\">     <div class=\"mleft\">&nbsp;</div>     <div class=\"mmid nofix\">         <div class=\"message attention\">You have ignored <strong>"+Z+"</strong>'s friend request. This user will not be added to your friends list.</div>         <div class=\"links\">             <a href=\""+X+"#reply_wall\" class=\"wall\" style=\"display: none;\">Leave a post.</a>             <a href=\"#invite\" class=\"invite\" style=\"display: none;\">Add as a Friend</a>             <a href=\"#\" class=\"close\" style=\"display: block;\">&nbsp;</a>         </div>     </div>     <div class=\"mright\">&nbsp;</div> </div>";$(this).parent().parent().parent().replaceWith(temp);$("div.links a.close").unbind().click(function(){a.hide()})}},"json");return false});temp="<div class=\"friends_profilePanel_holder\">  <div class=\"friends_profilePanel_header\">Friend request sent</div>  <span class=\"friends_profilePanel_pending\">Friend request sent</span> </div>";$("div.profilePanelHolder").html(temp)}else{temp="<div class=\"message_container message_info pngfixme\" noticeaction=\"inviteuser\" mesg=\"0\">     <div class=\"mleft\">&nbsp;</div>     <div class=\"mmid nofix\">         <div class=\"message noicon\">Do you want to request to add this user as a friend?</div>         <div class=\"links\">             <a href=\"/user/buttercup121#reply_wall\" class=\"wall\" style=\"display: none;\">Leave a post.</a>             <a href=\"#invite\" class=\"invite\" style=\"display: inline;\">Add as a Friend</a>             <a href=\"#\" class=\"close\" style=\"display: none;\">&nbsp;</a>         </div>     </div>     <div class=\"mright\">&nbsp;</div> </div>";$("div.friends_messages").html(temp);$("div.friends_messages").show();$("div.links a.invite").click(function(){$.get("/ajax/friends.php?a=request",{wo:"wo",fid:W.userinfo.userid},function(a,b){if(a.status==1){D(W.userinfo.username);temp="<div class=\"message_container message_info pngfixme\" noticeaction=\"alreadyinvited\" mesg=\"0\">     <div class=\"mleft\">&nbsp;</div>     <div class=\"mmid nofix\">         <div class=\"message attention\">You've already sent a friend request.</div>         <div class=\"links\">             <a href=\"/user/hejone1#reply_wall\" class=\"wall\" style=\"display: none;\">Leave a post.</a>             <a href=\"#invite\" class=\"invite\" style=\"display: none;\">Add as a Friend</a>             <a href=\"#\" class=\"close\" style=\"display: none;\">&nbsp;</a>         </div>     </div>     <div class=\"mright\">&nbsp;</div> </div>";$("div.friends_messages").html(temp);temp="<div class=\"friends_profilePanel_holder\">  <div class=\"friends_profilePanel_header\">Friend request sent</div>  <span class=\"friends_profilePanel_pending\">Friend request sent</span> </div>";$("div.profilePanelHolder").html(temp)}},"json");return false});temp="<div class=\"friends_profilePanel_holder\">  <div class=\"friends_profilePanel_header\">Send friend request</div>  <div class=\"friends_profilePanel_none\"><a href=\"#"+W.userinfo.userid+"\" class=\"friends_profilePanel_actionlink\">Send friend request</a></div>   <div class=\"friends_profilePanel_msgBox\">   <div class=\"friends_profilePanel_msgBox_header\"><a href=\"#\" class=\"friends_profilePanel_closelink\">Close</a></div>   <div class=\"friends_profilePanel_msgBox_msg\"><p>You have requested to add "+W.userinfo.username+" to your friends list.</p></div>   <div class=\"friends_profilePanel_msgBox_footer\"></div>  </div> </div>";$("div.profilePanelHolder").html(temp);$("div.friends_profilePanel_holder a.friends_profilePanel_actionlink").click(function(){uid=$(this).attr("href").substr(1);$.get("/ajax/friends.php?a=request",{wo:"wo",fid:uid},function(a,b){if(a.status==1){$("div.friends_profilePanel_holder div.friends_profilePanel_msgBox").show();temp="<div class=\"message_container message_info pngfixme\" noticeaction=\"alreadyinvited\" mesg=\"0\">     <div class=\"mleft\">&nbsp;</div>     <div class=\"mmid nofix\">         <div class=\"message attention\">You've already sent a friend request.</div>         <div class=\"links\">             <a href=\"/user/hejone1#reply_wall\" class=\"wall\" style=\"display: none;\">Leave a post.</a>             <a href=\"#invite\" class=\"invite\" style=\"display: none;\">Add as a Friend</a>             <a href=\"#\" class=\"close\" style=\"display: none;\">&nbsp;</a>         </div>     </div>     <div class=\"mright\">&nbsp;</div> </div>";$("div.friends_messages").html(temp);$("div.friends_messages").slideDown();temp="<div class=\"friends_profilePanel_holder\">  <div class=\"friends_profilePanel_header\">Friend request sent</div>  <span class=\"friends_profilePanel_pending\">Friend request sent</span> </div>";$("div.friends_profilePanel_holder div.friends_profilePanel_msgBox a.friends_profilePanel_closelink").click(function(){$(this).parent().parent().hide();$("div.profilePanelHolder").html(temp);return false})}},"json");return false})}}}}}$("#form_basic #f_givenname").focus(function(){$("#f_givenname_error").hide();$("#f_givenname_ok").hide();$("#f_givenname_help > div").show()});$("#form_basic #f_givenname").blur(function(){B()});$("#form_basic #f_surname").focus(function(){$("#f_surname_error").hide();$("#f_surname_ok").hide();$("#f_surname_help > div").show()});$("#form_basic #f_surname").blur(function(){L()});function B(){if($("#f_givenname").val().length>0){$("#f_givenname_ok").show();$("#f_givenname_error").hide();$("input#f_givenname").removeClass("validationError");$("#f_givenname_help > div").hide();return true}else{$("input#f_givenname").addClass("validationError");$("#f_givenname_error").show();$("#f_givenname_error").css("visibility","visible");$("#f_givenname_help > div").hide();return false}}function L(){if($("#f_surname").val().length>0){$("#f_surname_ok").show();$("#f_surname_error").hide();$("input#f_surname").removeClass("validationError");$("#f_surname_help > div").hide();return true}else{$("input#f_surname").addClass("validationError");$("#f_surname_error").show();$("#f_surname_error").css("visibility","visible");$("#f_surname_help > div").hide();return false}}$("#form_email #f_email").focus(function(){$("#f_email_error").hide();$("#f_email_ok").hide();$("#f_email_help > div").show()});$("#form_email #f_email").blur(function(){V()});function V(){if(E($("#f_email").val())){$("#f_email_ok").show();$("#f_email_error").hide();$("input#f_email").removeClass("validationError");$("#f_email_help > div").hide();return true}else{$("input#f_email").addClass("validationError");$("#f_email_error").show();$("#f_email_error").css("visibility","visible");$("#f_email_help > div").hide();return false}}function E(W){var X=new RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?");if(!X.test(W)||W.indexOf(".")==-1){return false}else{return true}}$("#form_password #f_old_password").focus(function(){$("#f_old_password_error").hide();$("#f_old_password_ok").hide();$("#f_old_password_help > div").show()});$("#form_password #f_old_password").blur(function(){K()});function K(){if($("#f_old_password").val().length>=6){$("#f_old_password_ok").show();$("#f_old_password_error").hide();$("input#f_old_password").removeClass("validationError");$("#f_old_password_help > div").hide();return true}else{$("input#f_old_password").addClass("validationError");$("#f_old_password_error .errorbox .main .content").html("This password is too short!");$("#f_old_password_error").show();$("#f_old_password_error").css("visibility","visible");$("#f_old_password_help > div").hide();return false}}$("#form_password #f_password").focus(function(){$("#f_password_error").hide();$("div#f_password_ok").hide();$("#f_password_help > div").show()});$("#form_password #f_password").blur(function(){S()});function S(){if($("#f_password").val().length>=6){$("div#f_password_ok").show();$("#f_password_error").hide();$("input#f_password").removeClass("validationError");$("#f_password_help > div").hide();return true}else{$("input#f_password").addClass("validationError");$("#f_password_error").show();$("#f_password_error").css("visibility","visible");$("#f_password_help > div").hide();return false}}$("#form_password #f_password_repeat").focus(function(){$("#f_password_repeat_error").hide();$("#f_password_repeat_ok").hide();$("#f_password_repeat_help > div").show()});$("#form_password #f_password_repeat").blur(function(){O()});function O(){if($("#f_password_repeat").val()==$("#f_password").val()&&$("#f_password_repeat").val().length>0){$("#f_password_repeat_ok").show();$("#f_password_repeat_error").hide();$("input#f_password_repeat").removeClass("validationError");$("#f_password_repeat_help > div").hide();return true}else{$("input#f_password_repeat").addClass("validationError");$("#f_password_repeat_error").show();$("#f_password_repeat_error").css("visibility","visible");$("#f_password_repeat_help > div").hide();return false}}function Q(X,Y,W){$.post("/ajax/board.php?a=read&num="+W+"&p="+Y+"&t="+new Date().getTime(),{fid:X},function(Z,a){if(Z.status==1){totalBoardMessage=Z.totalItems;$("div.friends_wallmessages").hide();$("div.friends_wallmessages").fadeIn();$("div.friends_wallmessages").html(Z.boards);$("div.friends_wallmessages li").hover(function(){$(this).children(".links").css("visibility","visible")},function(){$(this).children(".links").css("visibility","hidden")});$(".links a.reply").click(function(){var b=$(this).parent().next().find("a").attr("href");window.location.href=b+"#reply_wall";return false});if($.cookie("userid")==X){$(".links a.delete").click(function(){var b=$(this).attr("href").substr(1);$.post("/ajax/board.php?a=del&t="+new Date().getTime(),{bid:b},function(d,c){if(d.status==1){alert(d.message);Q(X,1,W)}},"json");return false})}if(Z.pager){$("#paging_wall").show();$("#paging_wall").html(Z.pager);$("span.pagine span").has("a").unbind().click(function(){H=$(this).find("a").attr("href").substr(1);$("div.friends_wallmessages").html("<div class=\"wall_nomessages\"><div><img src=\"/img/indicator.gif\" /></div></div>");$("#paging_wall").hide();Q(X,H,W);return false})}}},"json")}function F(){$("textarea").rte({max_content_length:255,iconlist_div:"icons",smileys_path:"/img/smile/",smileys:{"[em:1:]":{url:"1.gif",desc:""},"[em:2:]":{url:"2.gif",desc:""},"[em:3:]":{url:"3.gif",desc:""},"[em:4:]":{url:"4.gif",desc:""},"[em:5:]":{url:"5.gif",desc:""},"[em:6:]":{url:"6.gif",desc:""},"[em:7:]":{url:"7.gif",desc:""},"[em:8:]":{url:"8.gif",desc:""},"[em:9:]":{url:"9.gif",desc:""},"[em:10:]":{url:"10.gif",desc:""},"[em:11:]":{url:"11.gif",desc:""},"[em:12:]":{url:"12.gif",desc:""},"[em:13:]":{url:"13.gif",desc:""},"[em:14:]":{url:"14.gif",desc:""},"[em:15:]":{url:"15.gif",desc:""},"[em:16:]":{url:"16.gif",desc:""},"[em:17:]":{url:"17.gif",desc:""},"[em:18:]":{url:"18.gif",desc:""},"[em:19:]":{url:"19.gif",desc:""},"[em:20:]":{url:"20.gif",desc:""},"[em:21:]":{url:"21.gif",desc:""}}})}})

