$(document).ready(function(){$('#most_like .content_small').mouseover(function(event){$(".baloon",this).show()});$('#most_like .content_small').mouseout(function(event){$(".baloon",this).hide()});var flashvars={};var params={};params.wmode='Transparent';params.scale='noscale';params.menu='false';swfobject.embedSWF("/lib/swfs/whyilovemac_splash.swf","wilm_content","948","310","9.0.0","/lib/swfs/expressInstall.swf",flashvars,params);function _utf8_encode(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c)}else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128)}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128)}}return utftext}$('#member_main_thumbs').hide();var box_height=155;var listing_type="newest";var how_many_videos=0;var page_amount=0;var max_height=0;var videos_per_page=0;var loaded_pages=new Array();var exact_page=0;var resetpages=0;$(".page_numbers").hide();initTiling();function initTiling(){max_height=800;videos_per_page=Math.floor(max_height/box_height)*4;getHowManyVideos()}function getHowManyVideos(){var requestData=new Object();requestData.gethowmanyusers=1;$.ajax({type:"POST",url:"/vactions/",data:requestData,success:function(videos_amount){how_many_videos=videos_amount;initApp()}})}function initApp(){buildPageMarkers();buildPage(1)}function gotoPage(page_no){buildPage(page_no)}function buildPageMarkers(){page_amount=Math.ceil(how_many_videos/videos_per_page);$(".page_numbers").html("");for(var i=1;i<=page_amount;i++){$(".page_numbers").append('<a href=# class="page_link_'+i+'"> &#149; </a>');$('.page_numbers a.page_link_'+i).data("link_id",{id:i});$('.page_numbers a.page_link_'+i).click(function(event){event.preventDefault();gotoPage($(this).data("link_id").id);for(var j=1;j<=page_amount;j++){$('.page_numbers a.page_link_'+j).css("color","#888888");$('.page_numbers a.page_link_'+j).css("font-size","20px")}$(this).css("color","#bc1717");$(this).css("font-size","22px")})};$('.dragger_right').click(function(event){event.preventDefault();if(exact_page!=page_amount){gotoPage(exact_page+1)}});$('.dragger_left').click(function(event){event.preventDefault();if(exact_page-1!=0){gotoPage(exact_page-1)}})}function buildPage(page_no){jumpToMarkerPageOf(page_no);retrieveVideosForPage(page_no)}function jumpToMarkerPageOf(page_no){for(var j=1;j<=page_amount;j++){$('.page_numbers a.page_link_'+j).css("color","#888888")}$('.page_numbers a.page_link_'+page_no).css("color","#bc1717");$('.page_numbers a.page_link_'+page_no).css("font-size","22px")}function retrieveVideosForPage(page_no){if(page_no==exact_page&&resetpages!=1){resetpages=0;return}exact_page=page_no;var requestData=new Object();requestData.getusers=1;requestData.pageno=escape(page_no);requestData.usersperpage=escape(videos_per_page);$.ajax({type:"POST",url:"/vactions/",data:requestData,success:function(xml){var page_text="";$(xml).find("user").each(function(){if($(this).attr("t")!="-1"){page_text+='<div class="box">';page_text+='	<a href="/'+$(this).attr("u")+'/">';page_text+='		<img src="/lib/users/'+$(this).attr("t")+'_128.jpg" width="100" height="100">';page_text+='		<div class="left">'+Base64.decode($(this).attr("r"))+'</div>';page_text+='	</a>';page_text+='</div>'}else{page_text+='<div class="box">';page_text+='</div>'}});$(".boxes .boxesinner").html(page_text);$('#member_pane .box').mouseover(function(event){$(".baloon",this).show()});$('#member_pane .box').mouseout(function(event){$(".baloon",this).hide()});$('#member_main_thumbs').fadeIn("fast");$(".page_numbers").show()}})}});