function boxsize()
{var left=$('.boxleft').height();var right=$('.boxright').height();}
function httprequest()
{$('.tmenu a').click(function(){$('.tmenu a').removeClass('sel');$(this).addClass('sel');$('.content_load').show();$('#content_ajax').hide();$.post('http://'+sitename+'/manager/pages/'+$(this).attr('rel'),function(data){$('.content_load').fadeOut(300,function(){$(this).hide();$('#content_ajax').html(data).fadeIn(500);});});});}
function playmusic(server_domain,directory,file_name,obj){obj_flash="player_flash"+obj;obj_jpg="player"+obj;document.getElementById(obj_flash).style.display="block";document.getElementById(obj_jpg).style.display="none";$flag=1;while(total_players>=$flag){obj_flash_outros="player_flash"+$flag;if(obj_flash_outros!=obj_flash){document.getElementById(obj_flash_outros).style.display="none";document.getElementById(obj_flash_outros).innerHTML="";outros_player="player"+$flag;document.getElementById(outros_player).style.display="block";}
$flag++;}
path=d_static+"/swf/player.swf";var so=new SWFObject(path,"music","38","12","8","#336699");so.addParam("wmode","transparent");so.addParam("FlashVars","s="+server_domain+"&d="+directory+"&fn="+file_name);so.write(obj_flash);}
function mainMenu(value){$('.itens li a').removeClass('sel');$('a[href="#'+value+'"]').addClass('sel');}
function boxone()
{$('#centralize .top_content .boxmenu a.choose').click(function(){if($('#centralize .top_content .boxmenu .boxmenucon').is('.open')){$('#centralize .top_content .boxmenu .boxmenucon, #centralize .top_content .boxmenu a .arrow').removeClass('open').hide();$('#centralize .top_content .boxmenu a .arrow').show();}else{$('#centralize .top_content .boxmenu .boxmenucon, #centralize .top_content .boxmenu a .arrow').addClass('open').show();}});}
function boxtwo()
{$('#centralize .content .boxright .top .feature a.choose').click(function(){if($('#centralize .content .boxright .top .featurecon').is('.open')){$('#centralize .content .boxright .top .featurecon, #centralize .content .boxright .top .feature a .arrow').removeClass('open').hide();$('#centralize .content .boxright .top .feature a .arrow').show();}else{$('#centralize .content .boxright .top .featurecon, #centralize .content .boxright .top .feature a .arrow').addClass('open').show();}});}
function init()
{$('a[href="#"]').click(function(){return false});$('.tip').tipTip({maxWidth:'200px',edgeOffset:7});}
$(function(){init();httprequest();boxsize();boxone();boxtwo();$('#centralize .top_content .boxbar ul li.size div.increase').animate({width:130},1000);$('ul.itens li').click(function(){$('ul.itens li').removeClass('sel');$(this).addClass('sel');});$('div.itens li a').click(function(){$('div.itens li').removeClass('sel');$('div.itens li.'+($(this).attr('rel'))+'').addClass('sel');});$('.boxleft .boxfriends .reload').click(function(){$.post('/manager/ajax/friends_min',function(data){$('.boxleft .boxfriends .users').html(data);$('.tip').tipTip({maxWidth:'auto',edgeOffset:7});});});$('.boxleft .boxcommunity .reload').click(function(){$.post('/manager/ajax/communities_min',function(data){$('.boxleft .boxcommunity .communities').html(data);});});$('.qcat .suggest input[type="button"]').click(function(){var h=$('.qcat .suggest input[name="hash"]').val();var c=$('.qcat .suggest input[name="newcategory"]').val();$.post('/manager/dashboard/category_suggest',{h:h,c:c},function(){$('.qcat .suggest').html('<h3>A sugestão será avaliada, muito obrigado em nos ajudar.</h3>');});});$('.fake_player').click(function(){var i=$(this).attr('rel');$('.fake_player').show();$(this).hide();$('.play_player').hide();$('.play_player[rel="'+i+'"]').show();path=d_static+"/swf/player.swf";var so=new SWFObject(path,"music","38","12","8","#336699");so.addParam("wmode","transparent");so.addParam("FlashVars",$(this).find('img').attr('rel'));so.write('play_player'+i);});$('.friends_wait .row div div a').click(function(){var r=$(this).attr('rel');var i=$(this).attr('id');var c=$(this).attr('class');$.post('/manager/ajax/friend',{d:i,a:c},function(data){var html=$('.row[rel="'+r+'"]').html(data).fadeOut(1200,function(){$('.row[rel="'+r+'"]').html('');checkInvites('friends_wait');});});});$('.communities_wait .row div div a').click(function(){var r=$(this).attr('rel');var i=$(this).attr('id');var c=$(this).attr('class');$.post('/manager/ajax/community_wait',{d:i,a:c},function(data){var html=$('.row[rel="'+r+'"]').html(data).fadeOut(1200,function(){$('.row[rel="'+r+'"]').html('');checkInvites('communities_wait');});});});$('.message_reply').click(function(){var r=$(this).attr('rel');$('#content_reply').animate({height:280},400,function(){$(this).load(r,function(){window.scrollTo(0,$('#content_reply').position().top);messageReply();});});});$('.message_trash').click(function(){var r=$(this).attr('rel');$(this).hide();$.post(r,{p:''},function(data){$('.pagename').html('Lixeira : <strong>Mensagem</strong>');total=$('.mmessages .inbox b').html();$('.mmessages .inbox b').html(parseInt(total)-1);total=$('.mmessages .trash b').html();$('.mmessages .trash b').html(parseInt(total)+1);});});$('#new_messages .read_now').click(function(){var r=$(this).attr('rel');$('#new_messages .row[rel="'+r+'"]').fadeOut(300,function(){$.post('/manager/ajax/message_read_quick',{i:r},function(data){$(this).html('');$('#tiptip_holder').hide();var t=$('#new_messages').attr('rel')-1;$('#new_messages').attr('rel',t);if(!t){$('#new_messages').fadeOut(300);}})});});$('.commentspho .gnewcomment .delete').click(function(){var i=$(this).attr('rel');var g=$('.commentspho .gnewcomment').attr('rel');if(confirm('Tem certeza que deseja apagar o comentário?')){$.post('/manager/ajax/gallery_photos_comments_delete/'+g,{c:i},function(data){$('.commentspho .gnewcomment .photo[rel="'+i+'"]').html('<b>Comentário apagado com sucesso</b>').delay(1200).fadeOut(300);});}});$('.messages.comments .row a.read_now').click(function(){var i=$(this).attr('rel');var g=$('.messages.comments').attr('rel');if(confirm('Tem certeza que deseja apagar o comentário?')){$.post('/manager/ajax/textmain_comments_delete/'+g,{c:i},function(data){$('.messages.comments .row[rel="'+i+'"]').html('<b>Comentário apagado com sucesso</b>').delay(1200).fadeOut(300);});}});iframeTinyEditor()
$('.thickboxteste').click(function(){var iFrameDOM=$("iframe#tinyeditor").contents();iFrameDOM.find("img").css({border:'15px solid red'});});$('.light a.add').click(function(){changeLightIntelligence($(this).attr('rel'),'a');});$('.light a.del').click(function(){changeLightIntelligence($(this).attr('rel'),'d');});$('.light a.delete').click(function(){if(confirm('Deseja apagar este comentário?')){var r=$(this).attr('rel');var d=(r).split('|');d=d[0]+'|'+d[1];$.post('/manager/ajax/topic_comment_delete',{h:r},function(data){$('.row[rel="'+d+'"]').hide();});}});var ctoptxtvalue="Escreva um comentário para o tópico...";$('#centralize .profile.boxright .commenttopic textarea.textcomment').Watermark(ctoptxtvalue);$('#centralize .profile.boxright .commenttopic textarea.textcomment').focus(function(){$(this).animate({height:100},400)
$('#centralize .profile.boxright .commenttopic input[type="button"]').show();});$('#centralize .profile.boxright .commenttopic textarea.textcomment').blur(function(){var t=$(this).val();if(t==ctoptxtvalue){$(this).animate({height:18},400);$('#centralize .profile.boxright .commenttopic input[type="button"]').hide();}else{}});$('#centralize .profile.boxright .commenttopic input[type="button"]').click(function(){var comment=$('#centralize .profile.boxright .commenttopic textarea.textcomment').val();var i=$(this).attr('rel');var photo=$('.header.min .photo img').attr('src');var profile=$('.header.min .photo a.myphoto').attr('href');var fullname=$('.header.min .infos .name').html();$.post('/manager/ajax/topic_comment_add',{c:comment,it:i});$('#centralize .profile.boxright .commenttopic').fadeOut(600,function(){$(this).css({marginBottom:'10px'}).html('<div class="row"><a name="12"></a><div class="ut"><span><a href="'+profile+'"><img src="'+photo+'"></a></span><p class="ston"><b><a href="'+profile+'">'+fullname+'</a> </b>escreveu há menos de um minuto</p></div><div class="tp"><p rel="12|16" class="raty_total light_nothing"><b>0</b></p><p class="msg">'+comment+'</p></div></div><br class="clear" />').fadeIn(600)});});$('.createaccount').click(function(){if(!$('#account').height()){$('#account').animate({height:200},800,function(){$('#account .loading').fadeIn(200);$('#account .form').hide();$('#account .form').load('/frm_createaccount',function(){$('#account .loading').fadeOut(200,function(){$('#account .form').fadeIn(300);});});});}else{$('#account .form').fadeOut(200);$('#account .loading').fadeOut(200);$('#account').animate({height:0},800,function(){$('#account .form').hide();});}});$('.loginaccount').click(function(){if(!$('#account').height()){$('#account').animate({height:106},800,function(){$('#account .loading').fadeIn(200);$('#account .form').hide();$('#account .form').load('/frm_login',function(){$('#account .loading').fadeOut(200,function(){$('#account .form').fadeIn(300);});});});}else{$('#account .form').fadeOut(200);$('#account .loading').fadeOut(200);$('#account').animate({height:0},800,function(){$('#account .form').hide();});}});$('.multiple .i input[type="button"]').click(function(){$('.multiple .frm').hide();var i=$(this).attr('rel');$('.multiple #pwd_'+i).show();});$('.list_designs .design a').hover(function(){$(this).prepend('<div class="izoom"></div>');})
$('.background_list .d, .videol .d, .images .d').click(function(){if(confirm('Tem certeza que deseja apagar?')){return true;}
return false;});});function changeLightIntelligence(rel,value)
{var r=(rel).split('|');$('.light[rel="'+r[0]+'|'+r[1]+'"]').fadeOut(300);$.post('/manager/ajax/topic_raty',{d:r,ac:value},function(data){var total=$('.raty_total[rel="'+r[0]+'|'+r[1]+'"] b').html();if(value=='d'){total--;}else{total++;}
$('.raty_total[rel="'+r[0]+'|'+r[1]+'"] b').html(total);$('.raty_total[rel="'+r[0]+'|'+r[1]+'"]').removeClass('light_nothing, light_strong');if(total<=0){$('.raty_total[rel="'+r[0]+'|'+r[1]+'"]').addClass('light_nothing');}else{$('.raty_total[rel="'+r[0]+'|'+r[1]+'"]').addClass('light_strong');}});}
function iframeTinyEditor()
{var iFrameDOM=$("iframe#tinyeditor").contents();iFrameDOM.find("img").css({margin:'10px'}).attr('valign','absmiddle')
iFrameDOM.find("img").dblclick(function(){if($(this).is('.right')){$(this).attr('align','left').addClass('left').removeClass('right');}else{$(this).attr('align','right').addClass('right').removeClass('left');}})}
function checkInvites(value)
{var t=$('.'+value+' .row div').length;if(!t){$('#'+value).fadeOut(300);}}
function messageReply(){$('.frm_mreply .cancel').click(function(){$('#content_reply').html('');});$('.frm_mreply input[name="commit"]').click(function(){var val=$('#message_user_reply').val();var r=$('.message_reply').attr('rel');$.post(r,{v:val},function(data){total=$('.mmessages .sent b').html();$('.mmessages .sent b').html(parseInt(total)+1);$('.frm_mreply h3').html(data).delay(1800).fadeOut(800);$('.frm_mreply textarea, .frm_mreply input, .frm_mreply a').hide();});});}
function loadTweets(username)
{$(".tweet").html('');$(".tweet").tweet({avatar_size:36,count:6,username:username,list:"",loading_text:"Aguarde..."});}
