function saveOnline(){pajax=objetoAjax();pajax.open("POST",SitePath+"saveOnline.php",true);pajax.onreadystatechange=function(){if(pajax.readyState==4){};};pajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");pajax.send(null)}function updateProfileOnline(){Notify=document.getElementById("notify-txt");pdivResult=document.getElementById("ChatOnline");pajax=objetoAjax();pajax.open("POST",SitePath+"send_chat.php?a=updateProfileOnline",true);pajax.onreadystatechange=function(){if(pajax.readyState==4){var a=pajax.responseText;pdivResult.innerHTML=a}};pajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");pajax.send(null)}function updateStatus2(a){Notify=document.getElementById("notify-txt");sdivResult=document.getElementById("StatusUser");sajax=objetoAjax();sajax.open("POST",SitePath+"send_chat.php?a=status2",true);sajax.onreadystatechange=function(){if(sajax.readyState==4){var a=sajax.responseText;sdivResult.innerHTML=a}};sajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");sajax.send("friend="+a)}function updateStatus(a){Notify=document.getElementById("notify-txt");sdivResult=document.getElementById("StatusUser");sajax=objetoAjax();sajax.open("POST",SitePath+"send_chat.php?a=status",true);sajax.onreadystatechange=function(){if(sajax.readyState==4){var a=sajax.responseText;sdivResult.innerHTML='<div class="userOnline'+a+'"></div>'}};sajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");sajax.send("friend="+a)}function updateChatOnline(){Notify=document.getElementById("notify-txt");divResult=document.getElementById("ChatOnline");ajax=objetoAjax();ajax.open("POST",SitePath+"send_chat.php?a=updateOnline",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var a=ajax.responseText;divResult.innerHTML=a}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send(null)}function updateChat(a,b){Notify=document.getElementById("notify-txt");divResult=document.getElementById("ChatPanel");ajax=objetoAjax();ajax.open("POST",SitePath+"send_chat.php?a=update",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var a=ajax.responseText;divResult.innerHTML=a;if(b=="profile"){$(document).ready(function(){$("#Scroll").tinyscrollbar_update("relative")})}else if(b=="page"){$(document).ready(function(){$("#UsersScroll").tinyscrollbar_update("relative")})}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("friend="+a)}function sendChat(a,b){Notify=document.getElementById("notify-txt");divResult=document.getElementById("ChatPanel");Msg=Replace(document.send_chat.mensagem.value);if(Msg==""){document.send_chat.mensagem.focus();$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML="Por favor insira uma mensagem!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},3e3)})}else{ajax=objetoAjax();ajax.open("POST",SitePath+"send_chat.php?a=add",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var c=ajax.responseText;var d=c.split(",");var e=d[0];var f=d[1];if(e=="Erro"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=f;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},3e3)})}else if(e=="Sucesso"){updateChat(a,b);document.send_chat.mensagem.value="";document.send_chat.mensagem.focus()}else{$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=f;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},3e3)})}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("friend="+a+"&mensagem="+Msg)}}function Util(a,b,c){ajax=objetoAjax();ajax.open("POST",SitePath+"util.php",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var d=ajax.responseText;if(d=="ok"){if(a=="yes"){var e=Number(b)+1;var f="("+e+")";document.getElementById("dUtil_"+c).innerHTML="<a href=\"javascript:;\" onclick=\"Util('no', '"+e+"', '"+c+'\');" title="Marcar como útil? (desfazer)">'+f+" útil (desfazer)</a>"}else if(a=="no"){var e=Number(b)-1;if(e==0){var f=""}else{var f="("+e+")"}document.getElementById("dUtil_"+c).innerHTML="<a href=\"javascript:;\" onclick=\"Util('yes', '"+e+"', '"+c+'\');" title="Marcar como útil?">'+f+" útil</a>"}}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("util="+c+"&mode="+a)}function ViewFavorites(){Notify=document.getElementById("notify-txt");a_DivResult=document.getElementById("aFavorites");a_ajax=objetoAjax();a_ajax.open("POST",SitePath+"favorites.php?act=up",true);a_ajax.onreadystatechange=function(){if(a_ajax.readyState==4){var a=a_ajax.responseText;a_DivResult.innerHTML=a;$("#fvScroll").tinyscrollbar().tinyscrollbar_update("relative")}};a_ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");a_ajax.send(null)}function addFavorites(a,b,c,d){Notify=document.getElementById("notify-txt");ajax=objetoAjax();ajax.open("POST",SitePath+"favorite.php",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var c=ajax.responseText;if(c=="ok"){if(b=="yes"){$(document).ready(function(){$("#notify").fadeIn(100);$("#Favorites").fadeOut(200);Notify.innerHTML="Tutorial adicionado aos Favoritos com sucesso!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},2e3)})}else if(b=="no"){$(document).ready(function(){$("#notify").fadeIn(100);$("#addRemoveF_"+a).fadeOut(300,function(){ViewFavorites()});Notify.innerHTML="Tutorial removido dos Favoritos com sucesso!";var b=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(b)},2e3)})}}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("me="+c+"&tutorial="+d+"&id_v="+b)}function ViewCount(){c_DivResult=document.getElementById("fCount");c_DivResult2=document.getElementById("mCount");c_ajax=objetoAjax();c_ajax.open("POST",SitePath+"addfriend.php?act=count",true);c_ajax.onreadystatechange=function(){if(c_ajax.readyState==4){var a=c_ajax.responseText;var b=a.split(",");var c=b[0];var d=b[1];c_DivResult.innerHTML=c;c_DivResult2.innerHTML=d}};c_ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");c_ajax.send(null)}function ViewRemoveFriends(a){Notify=document.getElementById("notify-txt");a_DivResult=document.getElementById("aFriends");a_ajax=objetoAjax();a_ajax.open("POST",SitePath+"addfriend.php?act=remove",true);a_ajax.onreadystatechange=function(){if(a_ajax.readyState==4){var b=a_ajax.responseText;a_DivResult.innerHTML=b;if(a=="remove"){$(document).ready(function(){$("#frScroll").tinyscrollbar().tinyscrollbar_update("relative");$("#nfrScroll").tinyscrollbar().tinyscrollbar_update("relative");$("#notify").fadeIn(100);Notify.innerHTML="Usuário Removido Com Sucesso!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},2e3)})}}};a_ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");a_ajax.send(null)}function ViewAddFriends(a){rNotify=document.getElementById("notify-txt");r_DivResult=document.getElementById("rFriends");r_ajax=objetoAjax();r_ajax.open("POST",SitePath+"myfriend.php?act=add",true);r_ajax.onreadystatechange=function(){if(r_ajax.readyState==4){var b=r_ajax.responseText;r_DivResult.innerHTML=b;if(a=="add"){$(document).ready(function(){$("#frScroll").tinyscrollbar().tinyscrollbar_update("relative");$("#nfrScroll").tinyscrollbar().tinyscrollbar_update("relative");$("#notify").fadeIn(100);rNotify.innerHTML="Usuário Adicionado Com Sucesso!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},2e3)})}}};r_ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");r_ajax.send(null)}function _addFriend(a,b,c,d){ajax=objetoAjax();ajax.open("POST",SitePath+"friend.php",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var c=ajax.responseText;if(c=="ok"){if(b=="yes"){$(document).ready(function(){$("#addRemove_"+a).fadeOut(300,function(){ViewAddFriends("add");ViewRemoveFriends("add");ViewCount()})})}else if(b=="no"){$(document).ready(function(){$("#addRemove_"+a).fadeOut(300,function(){ViewAddFriends("remove");ViewRemoveFriends("remove");ViewCount()})})}}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("me="+c+"&friend="+d+"&id_v="+b)}function addFriendAll(a,b,c){Notify=document.getElementById("notify-txt");ajax=objetoAjax();ajax.open("POST",SitePath+"friend.php",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var d=ajax.responseText;if(d=="ok"){if(a=="yes"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML="Usuário adicionado com sucesso!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},2e3)});document.getElementById("iFriendAll_"+c).innerHTML="<a href=\"javascript:;\" onclick=\"addFriendAll('no', '"+b+"', '"+c+'\'); return false;" class="_remove" title="Adicionar Amigo?"><div class="removeIcon"></div> remover</a>'}else if(a=="no"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML="Usuário removido com sucesso!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},2e3)});document.getElementById("iFriendAll_"+c).innerHTML="<a href=\"javascript:;\" onclick=\"addFriendAll('yes', '"+b+"', '"+c+'\'); return false;" class="_add" title="Remover Amigo?"><div class="addIcon"></div> adicionar</a>'}}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("me="+b+"&friend="+c+"&id_v="+a)}function addFriend(a,b,c){Notify=document.getElementById("notify-txt");ajax=objetoAjax();ajax.open("POST",SitePath+"friend.php",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var d=ajax.responseText;if(d=="ok"){if(a=="yes"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML="Usuário adicionado com sucesso!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},2e3)});document.getElementById("Friend").innerHTML="<a href=\"javascript:;\" onclick=\"addFriend('no', '"+b+"', '"+c+'\'); return false;" class="remove" title="Adicionar Amigo?"><div class="removeIcon"></div> remover amigo</a>'}else if(a=="no"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML="Usuário removido com sucesso!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},2e3)});document.getElementById("Friend").innerHTML="<a href=\"javascript:;\" onclick=\"addFriend('yes', '"+b+"', '"+c+'\'); return false;" class="add" title="Remover Amigo?"><div class="addIcon"></div> adicionar amigo</a>'}}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("me="+b+"&friend="+c+"&id_v="+a)}function EditSocial(){Notify=document.getElementById("notify-txt");divResult=document.getElementById("loaderS");divResult.innerHTML="<img src='"+SitePath+"images/loading.gif' align='texttop' /> salvando...";Mode=Replace(document.edit_social.modeSocial.value);Url=Replace(document.edit_social.linkSocial.value);if(Url==""){document.edit_social.linkSocial.focus();$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML="Por favor insira um link!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},3e3)});divResult.innerHTML=""}else{ajax=objetoAjax();ajax.open("POST",SitePath+"edit_social.php?a=add",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var a=ajax.responseText;var b=a.split(",");var c=b[0];var d=b[1];if(c=="Erro"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},3e3)});divResult.innerHTML=""}else if(c=="Sucesso"){closeSocial();ViewSocial();$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},2e3)});divResult.innerHTML=""}else{$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},3e3)});divResult.innerHTML=""}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("mode="+Mode+"&link="+Url)}}function EditConfig(){Notify=document.getElementById("notify-txt");divResult=document.getElementById("loaderC");divResult.innerHTML="<img src='"+SitePath+"images/loading.gif' align='texttop' /> salvando...";vEmail=$("input:checkbox[name=vemail]:checked").val();vGenre=$("input:checkbox[name=vgenre]:checked").val();vDateBirth=$("input:checkbox[name=vdate_birth]:checked").val();cVideo=$("input:checkbox[name=cvideo]:checked").val();nFriend=$("input:checkbox[name=nfriend]:checked").val();nComments=$("input:checkbox[name=ncomments]:checked").val();ajax=objetoAjax();ajax.open("POST",SitePath+"edit_profile.php?a=config",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var a=ajax.responseText;var b=a.split(",");var c=b[0];var d=b[1];if(c=="Erro"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},3e3)});divResult.innerHTML=""}else if(c=="Sucesso"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},2e3)});divResult.innerHTML=""}else{$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},3e3)});divResult.innerHTML=""}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("vemail="+vEmail+"&vgenre="+vGenre+"&vdate_birth="+vDateBirth+"&cvideo="+cVideo+"&nfriend="+nFriend+"&ncomments="+nComments)}function EditProfile(){Notify=document.getElementById("notify-txt");divResult=document.getElementById("loader");divResult.innerHTML="<img src='"+SitePath+"images/loading.gif' align='texttop' /> salvando...";uName=document.getElementById("uName");Name=Replace(document.edit_profile.name.value);Genre=$("input:radio[name=genre]:checked").val();DateBirth=Replace(document.edit_profile.date_birth.value);Email=Replace(document.edit_profile.email.value);Portfolio=Replace(document.edit_profile.portfolio.value);Site=Replace(document.edit_profile.site.value);About=Replace(document.edit_profile.about.value);if(Name==""){document.edit_profile.name.focus();$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML="Por favor insira seu nome!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},3e3)});divResult.innerHTML=""}else if(Email==""){document.edit_profile.email.focus();$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML="Por favor insira seu e-mail!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},3e3)});divResult.innerHTML=""}else{ajax=objetoAjax();ajax.open("POST",SitePath+"edit_profile.php?a=info",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var a=ajax.responseText;var b=a.split(",");var c=b[0];var d=b[1];if(c=="ErroEmail"){document.edit_profile.email.focus();$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},3e3)});divResult.innerHTML=""}else if(c=="Erro"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},3e3)});divResult.innerHTML=""}else if(c=="Sucesso"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},2e3)});divResult.innerHTML="";uName.innerHTML=Name}else{$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},3e3)});divResult.innerHTML=""}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("name="+Name+"&genre="+Genre+"&date_birth="+DateBirth+"&email="+Email+"&portfolio="+Portfolio+"&site="+Site+"&about="+About)}}function Save(a,b){Notify=document.getElementById("notify-txt");ajax=objetoAjax();ajax.open("POST",SitePath+"addtutorial.php?a=save",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var c=ajax.responseText;var d=c.split(",");var e=d[0];var f=d[1];if(e=="Sucesso"){autoSave(a,b);$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=f;var a=window.setInterval(function(){$("#notify").fadeOut(300);location=SitePath+"criar-tutorial";clearInterval(a)},3e3)})}else if(e=="Erro"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=f;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},2e3)})}else{$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=f;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},2e3)})}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("id_tut="+a)}function autoSave(a,b){divResult=document.getElementById("b_autoSave");divImage=document.getElementById("muda_img");divResult.innerHTML="Salvando  <img src='"+SitePath+"images/loading.gif' align='texttop' />";Title=Replace(document.mytutorial.title.value);Category=document.mytutorial.category.value;Description=Replace(document.mytutorial.description.value);Comments=$("input:radio[name=ncomments]:checked").val();Author=Replace(document.mytutorial.author.value);lAuthor=Replace(document.mytutorial.linkauthor.value);Fonte=Replace(document.mytutorial.fonte.value);Tags=Replace(document.mytutorial.tags.value);if(b=="normal"){ContentTxt=Replace(CKEDITOR.instances.c_tutorial.getData())}else{Video=Replace(document.mytutorial.video.value)}if(Title==""){if(b=="normal"){slideOpen("Full","btn1","btn2")}document.mytutorial.title.focus();divResult.innerHTML="Salvar"}else if(Description==""){if(b=="normal"){slideOpen("Full","btn1","btn2")}document.mytutorial.description.focus();divResult.innerHTML="Salvar"}else{ajax=objetoAjax();ajax.open("POST",SitePath+"addtutorial.php?a=autosave&mode="+b,true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var a=ajax.responseText;var b=a.split(",");var c=b[0];var d=b[1];var e=b[2];if(c=="Erro"){divResult.innerHTML=d}else if(c=="Sucesso"){divResult.innerHTML=d;var f=window.setInterval(function(){divResult.innerHTML="Salvar";clearInterval(f)},3e3)}else if(c=="vSucesso"){divResult.innerHTML=d;divImage.innerHTML='<img src="'+SitePath+"thumb.php?img="+e+'&w=430&h=130" width="430" height="130" />';var f=window.setInterval(function(){divResult.innerHTML="Salvar";clearInterval(f)},3e3)}else{divResult.innerHTML=d}}};if(b=="normal"){Query="title="+Title+"&category="+Category+"&description="+Description+"&comments="+Comments+"&author="+Author+"&linkauthor="+lAuthor+"&fonte="+Fonte+"&tags="+Tags+"&content="+ContentTxt+"&id_tut="+a}else{Query="title="+Title+"&category="+Category+"&description="+Description+"&comments="+Comments+"&video="+Video+"&author="+Author+"&linkauthor="+lAuthor+"&fonte="+Fonte+"&tags="+Tags+"&id_tut="+a}ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send(Query)}}function Search(){Notify=document.getElementById("notify-txt");cSearch=Replace(document.fsearch.csearch.value).replace(/ /gi,"+").replace(/\//gi,"+");if(cSearch==""){document.fsearch.csearch.focus();$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML="Digite algo para buscar!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)})}else{location=SitePath+"search/"+cSearch}}function CreateVideoTutorial(){Notify=document.getElementById("notify-txt");Category=document.videotutorial.category.value;Comments=$("input:radio[name=vcomments]:checked").val();Video=Replace(document.videotutorial.video.value);Author=Replace(document.videotutorial.author.value);lAuthor=Replace(document.videotutorial.linkauthor.value);Fonte=Replace(document.videotutorial.fonte.value);if(Video==""){document.videotutorial.video.focus();$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML="Por favor insira um link de video!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)})}else if(Category==""){$(document).ready(function(){var a=window.setInterval(function(){$("#selectBox3").addClass("expanded");$("#dropDown3").slideDown(300);clearInterval(a)},1)});$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML="Por favor selecione uma categoria!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)})}else{ajax=objetoAjax();ajax.open("POST",SitePath+"addtutorial.php?a=video",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var a=ajax.responseText;var b=a.split(",");var c=b[0];var d=b[1];var e=b[2];if(c=="Erro"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)})}else if(c=="Sucesso"){location=SitePath+"criar-tutorial/"+e}else if(c=="vErro"){document.videotutorial.video.focus();$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)})}else{$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)})}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("category="+Category+"&comments="+Comments+"&video="+Video+"&author="+Author+"&linkauthor="+lAuthor+"&fonte="+Fonte)}}function CreateTutorial(){Notify=document.getElementById("notify-txt");Title=Replace(document.newtutorial.title.value);Category=document.newtutorial.category.value;Description=Replace(document.newtutorial.description.value);Comments=$("input:radio[name=ncomments]:checked").val();Author=Replace(document.newtutorial.author.value);lAuthor=Replace(document.newtutorial.linkauthor.value);Fonte=Replace(document.newtutorial.fonte.value);if(Title==""){document.newtutorial.title.focus();$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML="Por favor insira um título!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)})}else if(Category==""){$(document).ready(function(){var a=window.setInterval(function(){$("#selectBox").addClass("expanded");$("#dropDown").slideDown(300);clearInterval(a)},1)});$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML="Por favor selecione uma categoria!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)})}else if(Description==""){document.newtutorial.description.focus();$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML="Por favor insira uma descrição!";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)})}else{ajax=objetoAjax();ajax.open("POST",SitePath+"addtutorial.php?a=new",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var a=ajax.responseText;var b=a.split(",");var c=b[0];var d=b[1];var e=b[2];if(c=="Erro"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)})}else if(c=="Sucesso"){location=SitePath+"criar-tutorial/"+e}else{$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)})}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("title="+Title+"&category="+Category+"&description="+Description+"&comments="+Comments+"&author="+Author+"&linkauthor="+lAuthor+"&fonte="+Fonte)}}function CreateAccount(a){Notify=document.getElementById("notify-txt");Name=Replace(document.forms[a+"cadastro"].nome.value);Email=Replace(document.forms[a+"cadastro"].email.value);Profile=Replace(document.forms[a+"cadastro"].profile.value);Login=Replace(document.forms[a+"cadastro"].usuario.value);Pass=Replace(document.forms[a+"cadastro"].senha.value);ajax=objetoAjax();ajax.open("POST",SitePath+"create_account.php",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var b=ajax.responseText;var c=b.split(",");var d=c[0];var e=c[1];$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=e;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)});if(d=="ErroName"){document.forms[a+"cadastro"].nome.focus()}else if(d=="ErroEmail"){document.forms[a+"cadastro"].email.focus()}else if(d=="ErroProfile"){document.forms[a+"cadastro"].profile.focus()}else if(d=="ErroLogin"){document.forms[a+"cadastro"].usuario.focus()}else if(d=="ErroPass"){document.forms[a+"cadastro"].senha.focus()}else if(d=="Sucesso"){var f=window.setInterval(function(){location=SitePath+"profile/";clearInterval(f)},4e3)}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("name="+Name+"&email="+Email+"&profile="+Profile+"&login="+Login+"&pass="+Pass)}function Forgotten(a){Notify=document.getElementById("notify-txt");Email=Replace(document.forms[a+"login"].email.value);if(Email==""){document.forms[a+"login"].email.focus()}else{ajax=objetoAjax();ajax.open("POST",SitePath+"forgotten.php",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var b=ajax.responseText;var c=b.split(",");var d=c[0];var e=c[1];if(d=="Erro"){document.forms[a+"login"].email.focus();$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=e;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)})}else if(d=="Sucesso"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=e;var a=window.setInterval(function(){$("#notify").fadeOut(300);location=SitePath+"profile/";clearInterval(a)},4e3)})}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("email="+Email)}}function EditAccount(a){Notify=document.getElementById("notify-txt");NewPassDiv=document.getElementById("new_pass");Login=Replace(document.edit_account.usuario.value);Pass=Replace(document.edit_account.senha.value);NewPass=Replace(document.edit_account.novasenha.value);ajax=objetoAjax();ajax.open("POST",SitePath+"edit_account.php",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var a=ajax.responseText;var b=a.split(",");var c=b[0];var d=b[1];$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)});if(c=="ErroLogin"){document.edit_account.usuario.focus()}else if(c=="ErroPass"){document.edit_account.senha.focus()}else if(c=="ErroNewPass"){document.edit_account.novasenha.focus();NewPassDiv.style.display="block"}else if(c=="Sucesso"){}else if(c=="SucessoSenha"){var e=window.setInterval(function(){location.reload(true);clearInterval(e)},4e3)}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("login="+Login+"&pass="+Pass+"&new_pass="+NewPass)}function ExecuteLogin(a){Notify=document.getElementById("notify-txt");Login=Replace(document.forms[a+"login"].usuario.value);Pass=Replace(document.forms[a+"login"].senha.value);Salvar=$("input:checkbox[name="+a+"confirma]:checked").val();if(Login==""){document.forms[a+"login"].usuario.focus()}else if(Pass==""){document.forms[a+"login"].senha.focus()}else{ajax=objetoAjax();ajax.open("POST",SitePath+"login.php",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var a=ajax.responseText;var b=a.split(",");var c=b[0];var d=b[1];if(c=="Erro"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)})}else if(c=="Sucesso"){location.reload(true)}else if(c=="SucessoSenha"){location.reload(true)}else{$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)})}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("login="+Login+"&pass="+Pass+"&confirma="+Salvar)}}function tProfile(a,b,c){Notify=document.getElementById("notify-txt");Txt=document.getElementById(c);Span=document.getElementById(b);if(Txt.value==""){Span.style.display="none"}else{Span.style.display="block"}cTxt=Replace(Txt.value);ajax=objetoAjax();ajax.open("POST",SitePath+"verificar.php?mode=profile",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var a=ajax.responseText;var b=a.split(",");var c=b[0];var d=b[1];var e=b[2];if(c=="Erro"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=e;var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)});Span.innerHTML='http://tutorial.thiagobueno.net/profile/<b><font color="#B51F1F">'+d+"</font></b><br />"}else if(c=="Sucesso"){Span.innerHTML='http://tutorial.thiagobueno.net/profile/<b><font color="#3079ED">'+d+"</font></b><br />"}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("profile="+cTxt)}function showElement(a){a=document.getElementById(a);if(a.style.display=="block"){$(document).ready(function(){$(a).slideUp(500)})}else if(a.style.display=="none"){$(document).ready(function(){$(a).slideDown(500)})}}function Comments(a){Div=document.getElementById("div_comments");Link=document.getElementById("btn_comments");if(a=="show"){Link.style.display="none";$(document).ready(function(){$(Div).fadeIn(500)})}else if(a=="hide"){Div.style.display="none";$(document).ready(function(){$(Link).fadeIn(500)})}}function ViewComments(a){CommentsDiv=document.getElementById("comments");ajax=objetoAjax();ajax.open("POST",SitePath+"upCmm.php",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var a=ajax.responseText;CommentsDiv.innerHTML=a;$(document).ready(function(){$("#notify").fadeOut(300)})}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("cpage="+a)}function addComments(a,b,c,d){Notify=document.getElementById("notify-txt");LoaderDiv=document.getElementById("loader_"+d+b);LoaderDiv.innerHTML='<img src="'+SitePath+'images/loader.gif" /><br />';Nome=Replace(document.forms[a+"_"+d+b].nome.value);Email=Replace(document.forms[a+"_"+d+b].email.value);Site=Replace(document.forms[a+"_"+d+b].site.value);Msg=Replace(document.forms[a+"_"+d+b].mensagem.value);ajax=objetoAjax();ajax.open("POST",SitePath+"addComments.php?mode="+a,true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var e=ajax.responseText;var f=e.split(",");var g=f[0];var h=f[1];if(g=="success"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=h;if(a=="add"){LoaderDiv.innerHTML="";Comments("hide");document.forms[a+"_"+d+b].reset()}ViewComments(c);var e=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(e)},4e3)})}else if(g=="error"){$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=h;LoaderDiv.innerHTML=""})}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("page="+c+"&id="+d+"&nome="+Nome+"&email="+Email+"&site="+Site+"&mensagem="+Msg)}function closeResponse(a,b){ResponseDiv=document.getElementById(a+"_"+b);ResponseDiv.innerHTML=""}function openResponse(a,b,c,d){ResponseDiv=document.getElementById(a+"_"+c+b);ResponseDiv.innerHTML='<img src="'+SitePath+'images/loader.gif" />';ajax=objetoAjax();ajax.open("POST",SitePath+"addResponse.php",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var a=ajax.responseText;ResponseDiv.innerHTML=a}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("mode="+a+"&rr="+b+"&id="+c+"&page="+d)}function sendContact(a){Notify=document.getElementById("notify-txt");LoaderDiv=document.getElementById("loader");LoaderDiv.innerHTML='<img src="'+SitePath+'images/loader.gif" /><br />';Nome=Replace(document.contact.nome.value);Email=Replace(document.contact.email.value);Assunto=Replace(document.contact.assunto.value);Msg=Replace(document.contact.mensagem.value);Cod=document.contact.captcha_txt.value;ajax=objetoAjax();ajax.open("POST",SitePath+"send_contact.php",true);ajax.onreadystatechange=function(){if(ajax.readyState==4){var a=ajax.responseText;var b=a.split(",");var c=b[0];var d=b[1];$(document).ready(function(){$("#notify").fadeIn(100);Notify.innerHTML=d;LoaderDiv.innerHTML="";var a=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(a)},4e3)});if(c=="ErroNome"){document.contact.nome.focus()}else if(c=="ErroEmail"){document.contact.email.focus()}else if(c=="ErroAssunto"){document.contact.assunto.focus()}else if(c=="ErroMsg"){document.contact.mensagem.focus()}else if(c=="ErroCod"){document.contact.captcha_txt.focus()}else if(c=="Sucesso"){document.getElementById("captcha").src=SitePath+"securimage/securimage_show.php";document.contact.reset()}}};ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.send("user="+a+"&nome="+Nome+"&email="+Email+"&assunto="+Assunto+"&mensagem="+Msg+"&codigo="+Cod)}function slideOpen(a,b,c){element_d=document.getElementById(a);element_n=document.getElementById(b);element_o=document.getElementById(c);element_n.style.display="none";element_o.style.display="block";$(document).ready(function(){$(element_d).slideDown(300,function(){element_d.style.display="block"})})}function slideNormal(a){element_d=document.getElementById(a);if(element_d.style.display=="block"){$(document).ready(function(){$(element_d).slideUp(300,function(){element_d.style.display="none"})})}else if(element_d.style.display=="none"){$(document).ready(function(){$(element_d).slideDown(300,function(){element_d.style.display="block"})})}}function slideToggle(a,b,c){element_d=document.getElementById(a);element_n=document.getElementById(b);element_o=document.getElementById(c);if(element_d.style.display=="block"){element_n.style.display="block";element_o.style.display="none";$(document).ready(function(){$(element_d).slideUp(300,function(){element_d.style.display="none"})})}else if(element_d.style.display=="none"){element_n.style.display="none";element_o.style.display="block";$(document).ready(function(){$(element_d).slideDown(300,function(){element_d.style.display="block"})})}}function ViewSocial(){Notify=document.getElementById("notify-txt");a_DivResult=document.getElementById("upSocial");a_ajax=objetoAjax();a_ajax.open("POST",SitePath+"social.php?act=up",true);a_ajax.onreadystatechange=function(){if(a_ajax.readyState==4){var a=a_ajax.responseText;a_DivResult.innerHTML=a;$("#asScroll").tinyscrollbar_update("relative")}};a_ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");a_ajax.send(null)}function DeleteSocial(a){Notify=document.getElementById("notify-txt");var b=getHTTPObject();b.open("GET",SitePath+"delete_social.php?id="+a,true);b.onreadystatechange=function(){if(b.readyState==4){if(b.status==200){$(document).ready(function(){$("#DeleteBoxOverlay").fadeOut(300);$("#s_"+a).fadeOut(400);$("#DeleteBox").slideUp(200);$("#notify").fadeIn(100);ViewSocial();Notify.innerHTML='<span class="sucesso">Item apagado com sucesso!</div>';var b=window.setInterval(function(){$("#notify").fadeOut(300);clearInterval(b)},2e3)})}}};b.send(null)}function DeleteSocialShow(a){$(document).ready(function(){$("#DeleteBoxOverlay").fadeIn(300);$("#DeleteBox").slideDown(200)});document.getElementById("alertTxtDelete").innerHTML='Deseja realmente apagar o item?<br><a class="verLink" href="javascript:;" onclick="DeleteSocial(\''+a+'\'); return false;">SIM</a> - <a class="verLink" href="javascript:;" onclick="DeleteClose(); return false;">NÃO</a><br><br>'}function SocialShow(a){$(document).ready(function(){$("#DeleteBoxOverlay").fadeIn(300);$("#DeleteBox").slideDown(200)});document.getElementById("alertTxtDelete").innerHTML="<b>E-mail:</b><br>"+a}function DeleteClose(){$(document).ready(function(){$("#DeleteBoxOverlay").fadeOut(300);$("#DeleteBox").slideUp(200)})}function OpenUserComments(a){element_n=document.getElementById("cc_"+a);if(element_n.style.display=="block"){$(document).ready(function(){$(element_n).slideUp(300)})}else if(element_n.style.display=="none"){$(document).ready(function(){$(element_n).slideDown(300)})}}function closeSocial(){document.getElementById("modeSocial").value="";document.getElementById("linkSocial").value="";showSocial=document.getElementById("showSocial");showAddSocial=document.getElementById("showAddSocial");$(document).ready(function(){$(showSocial).fadeIn(300);showAddSocial.style.display="none"})}function addSocial(a){document.getElementById("modeSocial").value=a;document.getElementById("SocialTitle").innerHTML="adicionar link para: <b>"+titleSocial(a)+"</b>";showSocial=document.getElementById("showSocial");showAddSocial=document.getElementById("showAddSocial");$(document).ready(function(){$(showAddSocial).fadeIn(300);showSocial.style.display="none"})}function titleSocial(a){if(a=="deviantart"){string="deviantART"}if(a=="facebook"){string="Facebook"}if(a=="flickr"){string="Flickr"}if(a=="hi5"){string="Hi5"}if(a=="lastfm"){string="Last.fm"}if(a=="linkedin"){string="LinkedIn"}if(a=="msn"){string="MSN Messenger"}if(a=="myspace"){string="MySpace"}if(a=="orkut"){string="Orkut"}if(a=="googleplus"){string="Google+"}if(a=="skype"){string="Skype"}if(a=="tumblr"){string="Tumblr"}if(a=="twitter"){string="Twitter"}if(a=="vimeo"){string="Vimeo"}if(a=="youtube"){string="YouTube"}return string}function socialHide(a){a=document.getElementById(a);a.style.display="none"}function socialShow(a){element_d=document.getElementById(a);element_l="l"+a;$(document).ready(function(){$(element_d).fadeIn(300);if(element_l=="las"){$("#las").addClass("current");$("#lnas").removeClass("current")}else if(element_l=="lnas"){$("#las").removeClass("current");$("#lnas").addClass("current")}})}function hide(a){a=document.getElementById(a);a.style.display="none"}function show(a){element_d=document.getElementById(a);element_l="l"+a;$(document).ready(function(){$(element_d).fadeIn(300);if(element_l=="lfr"){$("#lfr").addClass("current");$("#lnfr").removeClass("current");$("#lcfr").removeClass("current")}else if(element_l=="lnfr"){$("#lfr").removeClass("current");$("#lnfr").addClass("current");$("#lcfr").removeClass("current")}else if(element_l=="lcfr"){$("#lfr").removeClass("current");$("#lnfr").removeClass("current");$("#lcfr").addClass("current")}})}function crecall(a,b){if(a.value==""){a.value=b}}function cclear(a,b){if(a.value==b){a.value=""}}function go_top(){$("a[href^=#top]").bind("click",function(){$("html,body").animate({scrollTop:0},800);return false})}function fechaTutorial(a){element_d=document.getElementById(a);$(document).ready(function(){$(element_d).slideUp(400,function(){$("#Tutorial1").delay(20).fadeIn(400);$("#Tutorial2").delay(120).fadeIn(400)})})}function abreTutorial(a){element_d=document.getElementById(a);$(document).ready(function(){$("#Tutorial1").delay(120).fadeOut(400,function(){$(element_d).slideDown(400)});$("#Tutorial2").delay(20).fadeOut(400)})}function Replace(a){sString=unescape(a);sString=sString.replace(/&/gi,"%26");sString=sString.replace(/\+/gi,"%2B");return sString}var SitePath="http://tutorial.thiagobueno.net/";$(document).ready(function(){go_top();$("input").customInput();$(".social_network ul li").fadeTo(0,.5);$(".social_network ul li").hover(function(){$(this).fadeTo(100,1)},function(){$(this).fadeTo(100,.5)});$(".img_cc").fadeTo(0,.8);$(".img_cc").hover(function(){$(this).fadeTo(100,1)},function(){$(this).fadeTo(100,.8)});$(".logo a").fadeTo(0,.8);$(".logo a").hover(function(){$(this).fadeTo(120,1)},function(){$(this).fadeTo(120,.8)});$("#cBusca").hover(function(){$("#dBusca").fadeIn(300)},function(){$("#dBusca").fadeOut(300)});$("#tScroll").tinyscrollbar();$("#cScroll").tinyscrollbar();var a=$("#UsersScroll");a.tinyscrollbar();var b=$("#Scroll");b.tinyscrollbar();var c=$("#fvScroll");c.tinyscrollbar();var d=$("#frScroll");d.tinyscrollbar();var e=$("#nfrScroll");e.tinyscrollbar();var f=$("#cfrScroll");f.tinyscrollbar();var g=$("#asScroll");g.tinyscrollbar();$("#lnfr").click(function(){e.tinyscrollbar_update("relative");d.tinyscrollbar_update("relative");f.tinyscrollbar_update("relative");return false});$("#lfr").click(function(){e.tinyscrollbar_update("relative");d.tinyscrollbar_update("relative");f.tinyscrollbar_update("relative");return false});$("#lcfr").click(function(){e.tinyscrollbar_update("relative");d.tinyscrollbar_update("relative");f.tinyscrollbar_update("relative");return false});$("#las").click(function(){g.tinyscrollbar_update("relative");return false});$("#lnas").click(function(){g.tinyscrollbar_update("relative");return false})});$(document).ready(function(){var a=$("select.nCategory");var b=$("<div>",{width:a.outerWidth(),className:"tzSelect",html:'<div id="selectBox" class="selectBox"></div>'});var c=$("<ul>",{className:"dropDown",id:"dropDown"});var d=b.find(".selectBox");a.find("option").each(function(b){var e=$(this);if(b==a.attr("selectedIndex")){d.html(e.text())}if(e.data("skip")){return true}var f=$("<li>",{html:'<a href="javascript:;"><img src="'+e.data("icon")+'" /><span>'+e.data("html-text")+"</span></a>"});f.click(function(){d.html('<img src="'+e.data("icon")+'" /> '+e.text());c.trigger("hide");a.val(e.val());return false});c.append(f)});b.append(c.hide());a.hide().after(b);c.bind("show",function(){if(c.is(":animated")){return false}d.addClass("expanded");c.slideDown(300)}).bind("hide",function(){if(c.is(":animated")){return false}d.removeClass("expanded");c.slideUp(300)}).bind("toggle",function(){if(d.hasClass("expanded")){c.trigger("hide")}else c.trigger("show")});d.click(function(){c.trigger("toggle");return false});$(document).click(function(){c.trigger("hide")})});$(document).ready(function(){var a=$("select.vCategory");var b=$("<div>",{width:a.outerWidth(),className:"tzSelect",html:'<div id="selectBox3" class="selectBox"></div>'});var c=$("<ul>",{className:"dropDown",id:"dropDown3"});var d=b.find(".selectBox");a.find("option").each(function(b){var e=$(this);if(b==a.attr("selectedIndex")){d.html(e.text())}if(e.data("skip")){return true}var f=$("<li>",{html:'<a href="javascript:;"><img src="'+e.data("icon")+'" /><span>'+e.data("html-text")+"</span></a>"});f.click(function(){d.html('<img src="'+e.data("icon")+'" /> '+e.text());c.trigger("hide");a.val(e.val());return false});c.append(f)});b.append(c.hide());a.hide().after(b);c.bind("show",function(){if(c.is(":animated")){return false}d.addClass("expanded");c.slideDown(300)}).bind("hide",function(){if(c.is(":animated")){return false}d.removeClass("expanded");c.slideUp(300)}).bind("toggle",function(){if(d.hasClass("expanded")){c.trigger("hide")}else c.trigger("show")});d.click(function(){c.trigger("toggle");return false});$(document).click(function(){c.trigger("hide")})});$(document).ready(function(){var a=$("select.enCategory");var b=$("<div>",{width:a.outerWidth(),className:"tzSelect",html:'<div id="selectBox" class="selectBox"></div>'});var c=$("<ul>",{className:"dropDown",id:"dropDown"});var d=b.find(".selectBox");a.find("option").each(function(b){var e=$(this);if(b==a.attr("selectedIndex")){d.html('<img src="'+e.data("icon")+'" /> '+e.text())}if(e.data("skip")){return true}var f=$("<li>",{html:'<a href="javascript:;"><img src="'+e.data("icon")+'" /><span>'+e.data("html-text")+"</span></a>"});f.click(function(){d.html('<img src="'+e.data("icon")+'" /> '+e.text());c.trigger("hide");a.val(e.val());return false});c.append(f)});b.append(c.hide());a.hide().after(b);c.bind("show",function(){if(c.is(":animated")){return false}d.addClass("expanded");c.slideDown(300)}).bind("hide",function(){if(c.is(":animated")){return false}d.removeClass("expanded");c.slideUp(300)}).bind("toggle",function(){if(d.hasClass("expanded")){c.trigger("hide")}else c.trigger("show")});d.click(function(){c.trigger("toggle");return false});$(document).click(function(){c.trigger("hide")})});$(document).ready(function(){function e(a){if(a==0){$("#leftControl").hide()}else{$("#leftControl").show()}if(a==d-1){$("#rightControl").hide()}else{$("#rightControl").show()}}var a=0;var b=920;var c=$(".slide");var d=c.length;$("#slidesContainer").css("overflow","hidden");c.wrapAll('<div id="slideInner"></div>').css({"float":"left",width:b});$("#slideInner").css("width",b*d);$(".tutorial_box_container").prepend('<span class="control" id="leftControl"></span>').append('<span class="control" id="rightControl"></span>');$(document).keydown(function(c){switch(c.keyCode){case 37:if(a==0){}else{a=$(this).attr("id")=="rightControl"?a+1:a-1;e(a);$("#slideInner").animate({marginLeft:b*-a})}break;case 39:if(a==d-1){}else{a=$(this).attr("id")=="rightControl"?a-1:a+1;e(a);$("#slideInner").animate({marginLeft:b*-a})}break}});e(a);$(".control").bind("click",function(){a=$(this).attr("id")=="rightControl"?a+1:a-1;e(a);$("#slideInner").animate({marginLeft:b*-a})})});$(document).ready(function(){var a="dropdown-active",b,c,d;var e=function(){if(b){b.removeClass(a);c.hide()}};$(".dropdown").each(function(){var a=$(this);var f=a.next("div.dropdown-menu"),g=a.parent();var h=function(){e();b=a.addClass("dropdown-active");c=f.show();d=g};a.bind("click",function(a){if(a)a.stopPropagation();if(a)a.preventDefault();h()});a.bind("focus",function(){h()})});$(document.body).bind("click",function(a){if(d){var b=d[0];if(!$.contains(b,a.target)||!b==a.target){e()}}})})
