$(document).ready(function(){var c=0;var e=0;var f="";var b=5;$(".aj_arrow").click(function(){var g=$(this).attr("id").split("-");switch(g[0]){case"foto":var h=g[1].split("_");switch(h[0]){case"user":if($(this).is(".previous")){c=c+b;f="previous"}else{c-=b;if(c<0){c=0}f="next"}$.ajax({type:"POST",url:"/ajax.php?module=foto&function=getLast",cache:false,data:"userid="+h[1]+"&count=4&start="+c,dataType:"json",success:function(k){if(k.resp=="OK"){var j=a(k.fotobox);if(j!=""){$("div#foto-user-list").html(j)}else{if(f=="previous"){c=c-b}else{c=c+b}}}}});break;case"groep":if($(this).is(".previous")){e=e+b;f="previous"}else{e-=b;if(e<0){e=0}f="next"}$.ajax({type:"POST",url:"/ajax.php?module=foto&function=getLast",cache:false,data:"groepid="+h[1]+"&count="+b+"&start="+e,dataType:"json",success:function(k){if(k.resp=="OK"){var j=a(k.fotobox);if(j!=""){$("div#foto-groep-list").html(j)}else{if(f=="previous"){e=e-b}else{e=e+b}}}}});break}break;case"video":alert("this is not yet implemented");break;case"blog":alert("this is not yet implemented");break}return false});function a(j){var g="";for(var h in j){g+='<div class="articleBox"> <a href="'+j[h].link+'"><img src="'+j[h].thumbnail+'" border="0" /></a>';g+='<H1><a href="'+j[h].link+'">'+j[h].title+"</a></H1>";g+='<div class=user><a href="'+j[h].username+'">'+j[h].username+"</a></div>";g+="</div>"}return g}function d(g){var h=$(".shortnews").attr("id").split("-");$.ajax({type:"POST",url:"/ajax.php?module=news&function=getShort",cache:false,data:"action="+g+"&currentid="+h[1],dataType:"json",success:function(k){if(k.resp=="OK"&&k.artikel!=null){$(".shortnews").remove();var j=jQuery('<div class="shortnews" id="news-'+k.artikel.id+'"><h2>'+k.artikel.news_title+'</h2><span class="date">'+k.artikel.news_date+"</span><p>"+k.artikel.news_text+"</p></div>").hide();j.prependTo(".content-nieuws");j.show()}}});return false}$("#shortnewsbutton-previous").click(function(){return d("previous")});$("#shortnewsbutton-next").click(function(){return d("next")});jQuery.each(jQuery.browser,function(g){if($.browser.msie&&jQuery.browser.version==6){$("div#dropdown ul li").hover(function(){$("ul",this).css("display","block")},function(){$("ul",this).css("display","none")})}})});$(function(){$("div.kaderrechts").corner("tl bl");$("#container").corner("bottom");$("div#content").corner("keep bl br");$(".articleBox .articleBox_thumb a").hover(function(){$(this).parent(".articleBox_thumb").parent(".articleBox").find("em").animate({opacity:"show"},"fast");$(this).mousemove(function(a){$(this).parent(".articleBox_thumb").parent(".articleBox").find("em").css("left",a.pageX+15);$(this).parent(".articleBox_thumb").parent(".articleBox").find("em").css("top",a.pageY+15)})},function(){$(this).parent(".articleBox_thumb").parent(".articleBox").find("em").animate({opacity:"hide"},"fast")});$("div.featuredfront").hover(function(){$("span#indekijker").html($(this).find("img").attr("title"))},function(){$("span#indekijker").html("")});$("div.nieuwstemediafront").hover(function(){$("span#nieuwste").html($(this).find("img").attr("title"))},function(){$("span#nieuwste").html("")});$.swapImage(".swapImage");if($("#menu").length>0){$("#menu").accordion({active:"div.selected",header:"div.head",alwaysOpen:false,animated:true,showSpeed:400,hideSpeed:800})}});function ASL_add_foto_album(b){var a="";a=prompt("Geef een album naam:","Nieuw album");if(a!=null){$.ajax({type:"POST",url:"/ajax.php?module=foto&function=addAlbum",cache:false,data:"album="+escape(a),dataType:"json",success:function(c){if(c.resp=="OK"){$("select#foto_albums").addOption(c.album,true)}}})}return false}function ASL_add_video_album(b){var a="";a=prompt("Geef een album naam:","Nieuw album");if(a!=null){$.ajax({type:"POST",url:"/ajax.php?module=video&function=addAlbum",cache:false,data:"album="+escape(a),dataType:"json",success:function(c){if(c.resp=="OK"){$("select#video_albums").addOption(c.album,true)}}})}return false}function ASL_add_audio_album(b){var a="";a=prompt("Geef een album naam:","Nieuw album");if(a!=null){$.ajax({type:"POST",url:"/ajax.php?module=audio&function=addAlbum",cache:false,data:"album="+escape(a),dataType:"json",success:function(c){if(c.resp=="OK"){$("select#audio_albums").addOption(c.album,true)}}})}return false}function ASL_groepen_checkUrl(){var b=document.groep_form;var c=b.elements.asl_groep_url.value;var a=b.elements.asl_groep_checkurl;$.ajax({type:"POST",url:"/ajax.php?module=groepen&function=check_url",cache:false,data:"url="+c,dataType:"json",beforeSend:function(){$(a).attr("disabled","true")},success:function(d){if(d.resp!="OK"){alert(d.ERRORMSG)}else{alert("Deze url is nog beschikbaar.")}},complete:function(){$(a).removeAttr("disabled")}});return false}function ASL_BB_insertAtCursor(d,c){var d=d;var c=c;if(document.selection){d.focus();sel=document.selection.createRange();sel.text=c}else{if(d.selectionStart||d.selectionStart=="0"){var b=d.selectionStart;var a=d.selectionEnd;d.value=d.value.substring(0,b)+c+d.value.substring(a,d.value.length)}else{d.value+=c}}}function ASL_video(c){var a={};var d={};var b={};a.showdigits="true";a.autostart="true";a.fullscreen="true";a.file="/getplaylist/"+c+".xml";d.flashvars="plugins=adttext,viral&adttext.config=http%3A%2F%2Fvads.theconnection.be%2Ftuub.xml&viral.functions=recommendations&viral.recommendations=/feeds/player/relatedvideos.xml?video="+c;d.allowfullscreen="true";d.allowscriptaccess="always";d.wmode="opeque";swfobject.embedSWF(ASL.config.staticURL+"/swf/player-4.6.swf","videobox","400","305","9.0.0",false,a,d,b);return}function ASL_videoBox(c){var a={};var d={};var b={};a.ena_fullscr=1;a.playmask=1;a.topvids="/feeds/player/topvideos.xml";a.xml_link="/getplaylist/";a.video_id=c;d.allowfullscreen="true";d.allowscriptaccess="always";d.wmode="opeque";swfobject.embedSWF("/swf/tuub_vid_player.swf","videobox","400","300","9.0.0",false,a,d,b);return}function ASL_audio(b){var a={};var d={};var c={};a.showdigits="true";a.autostart="false";a.fullscreen="false";a.file="/getaudioplaylist/"+b+".xml";d.allowfullscreen="false";swfobject.embedSWF(ASL.config.staticURL+"/swf/player-4.6.swf","audiobox","400","225","9.0.0",false,a,d,c);return}function ASL_add_video_comment(e){var f=e.asl_reactie.value;var b=e.video_id.value;var a=e.video_userid.value;if(f!=""){var c=e.elements.submit;var d=$(c).attr("value");$.ajax({beforeSend:function(){$(c).attr("value","Aan het posten..");$(c).attr("disabled","true");e.elements.asl_reactie.disabled=true},type:"POST",url:"/ajax.php?module=video&function=addcomment",cache:false,data:"video_userid="+a+"&video_id="+b+"&comment="+escape(f),dataType:"json",success:function(h){if(h.resp=="OK"){var k=h.comment;var j=jQuery(k).hide();var g=h.comment_id;j.prependTo("div.video div.reactie");$("div.video div.reactie #comment-"+g).show("slow");e.asl_reactie.value=""}},complete:function(){$(c).attr("value",d);$(c).removeAttr("disabled");e.elements.asl_reactie.disabled=false}})}return false}function ASL_add_foto_comment(c){var f=c.asl_reactie.value;var e=c.foto_id.value;var d=c.foto_userid.value;if(f!=""){var a=c.elements.submit;var b=$(a).attr("value");$.ajax({beforeSend:function(){$(a).attr("value","Aan het posten..");$(a).attr("disabled","true");c.elements.asl_reactie.disabled=true},type:"POST",url:"/ajax.php?module=foto&function=addcomment",cache:false,data:"foto_userid="+d+"&foto_id="+e+"&comment="+escape(f),dataType:"json",success:function(h){if(h.resp=="OK"){var k=h.comment;var j=jQuery(k).hide();var g=h.comment_id;j.prependTo("div.foto div.reactie");$("div.foto div.reactie #comment-"+g).show("slow");c.asl_reactie.value=""}},complete:function(){$(a).attr("value",b);$(a).removeAttr("disabled");c.elements.asl_reactie.disabled=false}})}return false}function ASL_add_blog_comment(d){var e=d.asl_reactie.value;var a=d.blog_id.value;var f=d.blog_userid.value;if(e!=""){var b=d.elements.submit;var c=$(b).attr("value");$.ajax({beforeSend:function(){$(b).attr("value","Aan het posten..");$(b).attr("disabled","true");d.elements.asl_reactie.disabled=true},type:"POST",url:"/ajax.php?module=blog&function=addcomment",cache:false,data:"blog_id="+a+"&profile_id="+f+"&comment="+escape(e),dataType:"json",success:function(h){if(h.resp=="OK"){var k=h.comment;var j=jQuery(k).hide();var g=h.comment_id;j.prependTo("div#reactie-"+a);$("div#reactie-"+a+" div#comment-"+g).show("slow",function(){});d.asl_reactie.value="";ASL_blog_show_comment_form(a)}},complete:function(){$(b).attr("value",c);$(b).removeAttr("disabled");d.elements.asl_reactie.disabled=false}})}return false}function ASL_blog_show_comment_form(a){$("div#blog-reactieform-"+a).toggle();return false}function ASL_add_friend(a,b){$.ajax({type:"POST",url:"/ajax.php?module=friends&function=addfriend",cache:false,data:"profile_id="+a+"&friendid="+b,dataType:"json",success:function(c){if(c.resp=="OK"){$("li#isFriend").html('<a href="#" onclick="return ASL_remove_friend('+a+","+b+');">Verwijder uit vriendenlijst</a>');$("div#ok").html("Vriendje toegevoegd!");$("div#top-message div#ok").show();$("div#top-message").show("slow");$("li#isBlocked").hide()}}});return false}function ASL_remove_friend(a,b){$.ajax({type:"POST",url:"/ajax.php?module=friends&function=removefriend",cache:false,data:"profile_id="+a+"&friendid="+b,dataType:"json",success:function(c){if(c.resp=="OK"){$("li#isFriend").html('<a href="#" onclick="return ASL_add_friend('+a+","+b+');">Voeg toe aan vrienden</a>');$("div#ok").html("Vriendje verwijderd!");$("div#top-message div#ok").show();$("div#top-message").show("slow");$("li#isBlocked").show()}}});return false}function ASL_block_friend(a,b){$.ajax({type:"POST",url:"/ajax.php?module=friends&function=blockfriend",cache:false,data:"profile_id="+a+"&friendid="+b,dataType:"json",success:function(c){if(c.resp=="OK"){$("li#isBlocked").html('<a href="#" onclick="return ASL_unblock_friend('+a+","+b+');">Verwijder van vijanden</a>');$("div#ok").html("Deze persoon is bij deze geblokkeerd van je profiel!");$("div#top-message div#ok").show();$("div#top-message").show("slow");$("li#isFriend").hide()}}});return false}function ASL_unblock_friend(a,b){$.ajax({type:"POST",url:"/ajax.php?module=friends&function=unblockfriend",cache:false,data:"profile_id="+a+"&friendid="+b,dataType:"json",success:function(c){if(c.resp=="OK"){$("li#isBlocked").html('<a href="#" onclick="return ASL_block_friend('+a+","+b+');">Voeg toe aan vijanden</a>');$("div#ok").html("Deze persoon is bij deze gedeblokkeerd!");$("div#top-message div#ok").show();$("div#top-message").show("slow");$("li#isFriend").show()}}});return false}function ASL_remove_groep(a){if(confirm("Deze groep definitief verwijderen?")){$.ajax({type:"POST",url:"/ajax.php?module=groepen&function=removeGroep",cache:false,data:"groepid="+a,dataType:"json",success:function(b){if(b.resp=="OK"){$("div#ok").html("Deze groep is verwijderd.");$("div#top-message div#ok").show();$("div#top-message").show("slow");$("div#removable_groepen div#groep_"+a).hide("slow")}else{if(b.resp=="ERROR"){alert(b.ERRORMSG)}}}})}return false}function ASL_subscr_groep(a,b){$.ajax({type:"POST",url:"/ajax.php?module=groepen&function=subscribeGroep",cache:false,data:"userid="+a+"&groepid="+b,dataType:"json",success:function(c){if(c.resp=="OK"){$("li#isGroep").html('<a href="#" onclick="return ASL_remove_groep('+a+","+b+');">Deze groep verlaten</a>');$("div#ok").html("Je bent nu lid van deze groep! Voor sommige groepen dient lidmaatschap wel goedgekeurd te worden.");$("div#top-message div#ok").show();$("div#top-message").show("slow")}}});return false}function ASL_unsubscr_groep(b,a){if(confirm("Deze groep verlaten?")){$.ajax({type:"POST",url:"/ajax.php?module=groepen&function=unsubscribeGroep",cache:false,data:"groepid="+b+"&userid="+a,dataType:"json",success:function(c){if(c.resp=="OK"){$("li#isGroep").html('<a href="#" onclick="return ASL_subscr_groep('+a+","+b+');">Wordt lid van deze groep</a>');$("div#ok").html("Je bent geen lid van deze groep meer!");$("div#top-message div#ok").show();$("div#top-message").show("slow");$("div#groepen_user div#groep_"+b).hide("slow")}}})}return false}function ASL_confirmsubscr_groep(b,a){if(confirm("Lidmaatschap goedkeuren?")){$.ajax({type:"POST",url:"/ajax.php?module=groepen&function=confirmSubscrGroep",cache:false,data:"groepid="+b+"&userid="+a,dataType:"json",success:function(c){if(c.resp=="OK"){$("div#ok").html("Lidmaatschap goedgekeurd.");$("div#top-message div#ok").show();$("div#top-message").show("slow");$("div#userlist_unconfirmed div#user_"+a).hide("slow")}}})}return false}function ASL_denysubscr_groep(b,a){if(confirm("Lidmaatschap weigeren?")){$.ajax({type:"POST",url:"/ajax.php?module=groepen&function=denySubscrGroep",cache:false,data:"groepid="+b+"&userid="+a,dataType:"json",success:function(c){if(c.resp=="OK"){$("div#ok").html("Lidmaatschap geweigerd.");$("div#top-message div#ok").show();$("div#top-message").show("slow");$("div#userlist_unconfirmed div#user_"+a).hide("slow")}}})}return false}function ASL_removeban_groep(b,a){if(confirm("Lidmaatschap toestaan?")){$.ajax({type:"POST",url:"/ajax.php?module=groepen&function=removeBanGroep",cache:false,data:"groepid="+b+"&userid="+a,dataType:"json",success:function(c){if(c.resp=="OK"){$("div#ok").html("Lidmaatschap toegestaan.");$("div#top-message div#ok").show();$("div#top-message").show("slow");$data=$("div#userlist_banned div#user_"+a);$data.hide("slow")}}})}return false}function ASL_makeadmin_groep(b,a){if(confirm("Admin maken?")){$.ajax({type:"POST",url:"/ajax.php?module=groepen&function=makeUserAdmin",cache:false,data:"groepid="+b+"&userid="+a,dataType:"json",success:function(c){if(c.resp=="OK"){$("div#ok").html("User is admin.");$("div#top-message div#ok").show();$("div#top-message").show("slow");$("div#userlist_leden div#user_"+a+" div.userlist-action").html('<a href="#" class="makeadmin" onclick="return ASL_undoadmin_groep('+b+","+a+');">verwijder adminrechten</a> - <a href="#" class="ban" onclick="return ASL_denysubscr_groep('+b+","+a+');">Ban deze user</a>')}}})}return false}function ASL_undoadmin_groep(b,a){if(confirm("Deze user adminrechten afnemen?")){$.ajax({type:"POST",url:"/ajax.php?module=groepen&function=undoUserAdmin",cache:false,data:"groepid="+b+"&userid="+a,dataType:"json",success:function(c){if(c.resp=="OK"){$("div#ok").html("User is geen admin meer.");$("div#top-message div#ok").show();$("div#top-message").show("slow");$("div#userlist_leden div#user_"+a+" div.userlist-action").html('<a href="#" class="makeadmin" onclick="return ASL_makeadmin_groep('+b+","+a+');">maak deze user admin</a> - <a href="#" class="ban" onclick="return ASL_denysubscr_groep('+b+","+a+');">Ban deze user</a>')}}})}return false}function ASL_removeMedia_groep(a,c,b){if(confirm("Deze "+a+" uit deze groep verwijderen?")){$.ajax({type:"POST",url:"/ajax.php?module=groepen&function=removeMedia",cache:false,data:"type="+a+"&groepid="+c+"&mediaid="+b,dataType:"json",success:function(d){if(d.resp=="OK"){$("div#ok").html(a+" is verwijderd.");$("div#top-message div#ok").show();$("div#top-message").show("slow");$("div#"+a+"list div#"+a+"_"+b).hide();$("div#"+a+"-"+b).hide()}}})}return false}function TUUB_block_friend(a,b){$.ajax({type:"POST",url:"/ajax.php?module=friends&function=blockfriend",cache:false,data:"profile_id="+a+"&friendid="+b,dataType:"json",success:function(c){if(c.resp=="OK"){$("li#isBlocked").html('<a href="#" onclick="return ASL_unblock_friend('+a+","+b+');">Verwijder van vijanden</a>');$("div#ok").html("Deze persoon is bij deze geblokkeerd van je profiel!");$("div#top-message div#ok").show();$("div#top-message").show("slow");$("li#isFriend").hide()}}});return false}function TUUB_unblock_friend(a,b){$.ajax({type:"POST",url:"/ajax.php?module=friends&function=unblockfriend",cache:false,data:"profile_id="+a+"&friendid="+b,dataType:"json",success:function(c){if(c.resp=="OK"){$("li#isBlocked").html('<a href="#" onclick="return ASL_block_friend('+a+","+b+');">Voeg toe aan vijanden</a>');$("div#ok").html("Deze persoon is bij deze gedeblokkeerd!");$("div#top-message div#ok").show();$("div#top-message").show("slow");$("li#isFriend").show()}}});return false}function ASL_BB_insertAtCursor(d,c){var d=d;var c=c;if(document.selection){d.focus();sel=document.selection.createRange();sel.text=c}else{if(d.selectionStart||d.selectionStart=="0"){var b=d.selectionStart;var a=d.selectionEnd;d.value=d.value.substring(0,b)+c+d.value.substring(a,d.value.length)}else{d.value+=c}}}function TUUB_subscribe_event(a){var a=a;$.ajax({type:"POST",url:"/ajax.php?module=events&function=subscribe",cache:false,data:"eventid="+a,dataType:"json",success:function(b){if(b.resp=="OK"){$("span#event-inschrijven").html('<a href="#" onclick="return ASL_unsubscribe_event('+a+')">mij uitschrijven voor dit event</a>')}}});return false}function TUUB_unsubscribe_event(a){var a=a;$.ajax({type:"POST",url:"/ajax.php?module=events&function=unsubscribe",cache:false,data:"eventid="+a,dataType:"json",success:function(b){if(b.resp=="OK"){$("span#event-inschrijven").html('<a href="#" onclick="return ASL_subscribe_event('+a+')">mij inschrijven voor dit event</a>')}}});return false}function ASL_preview_blog(a,b){$.ajax({type:"GET",url:"/ajax.php?module=blog&function=getblogmessage&profile_id="+a+"&blog_id="+b,dataType:"json",beforeSend:function(){$("div#blogbox").hide()},success:function(c){$("div#blogbox div.blog-preview-title").html(c.title);$("div#blogbox div.blog-preview-message").html(c.bericht);$("div#blogbox div.blog-preview-info").html('geschreven door <a href="/'+c.username+'">'+c.username+"</a> op "+c.date)},complete:function(){$("div#blogbox").show("slow")}});return false}function ASL_admin_prof_background(d){var b=document.skin_aanpassen;var a=d.value;var c=b.elements.background_image;if(a==0){$(c).removeAttr("disabled")}else{$(c).attr("disabled","true")}return}function ASL_confirm_remove_account(a){if(a.profiel_verwijderen_keuze[0].checked==true){doyou=confirm("Weet u zeker dat u uw account wilt verwijderen?");return doyou}return false}function carouselect(a,b){ASL_videoBox(b);for(i=1;i<=4;i++){if(a==i){$("div#items div#item-"+i).attr("class","item")}else{$("div#items div#item-"+i).attr("class","item_notactive")}}return false}function regpage_toggle(){$("div#tuub-regform").toggle();$("div#aslpage-regform").toggle();return false}function ASL_jumpAlbum(targ,selObj){var location="?album=";location=(selObj.options[selObj.selectedIndex].value==0)?"./":"./"+selObj.options[selObj.selectedIndex].value;eval(targ+".location='"+location+"'")}function ASL_admin_jumpAlbum(targ,selObj){var location="?album=";location=(selObj.options[selObj.selectedIndex].value==0)?"./":"./?album="+selObj.options[selObj.selectedIndex].value;eval(targ+".location='"+location+"'")}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(b){var a=this.length;var c=Number(arguments[1])||0;c=(c<0)?Math.ceil(c):Math.floor(c);if(c<0){c+=a}for(;c<a;c++){if(c in this&&this[c]===b){return c}}return -1}}function TUUB_changeBg(a){var a=a;var b="";if(a==1){theme="orange"}if(a==2){theme="green"}if(a==3){theme="black"}$("link[@rel*=style][title]").each(function(c){if(this.getAttribute("title")!=""){this.disabled=true}if(this.getAttribute("title")==theme){this.disabled=false}});$("#theme-logo").attr("src","http://static.tuub.be/tuub/images/"+theme+"/logo_tuub.gif");$("#theme-leaderboard").attr("src","http://static.tuub.be/tuub/images/"+theme+"/leaderboard.gif");$("#theme-logout").attr("src","http://static.tuub.be/tuub/images/"+theme+"/btn_logout.gif");$("#theme-news").attr("src","http://static.tuub.be/tuub/images/"+theme+"/tit_tuub_news.gif");$("#theme-login").attr("src","http://static.tuub.be/tuub/images/"+theme+"/btn_login.gif");$("#theme-register").attr("src","http://static.tuub.be/tuub/images/"+theme+"/btn_registreerNu2.gif");$("#theme-search").attr("src","http://static.tuub.be/tuub/images/"+theme+"/btn_search.gif");$("#theme-kalender").attr("src","http://static.tuub.be/tuub/images/"+theme+"/tit_kalender.gif");$("#theme-category").attr("src","http://static.tuub.be/tuub/images/"+theme+"/tit_categorien.gif");$.cookie("theme",a,{expires:90,path:"/",domain:".tuub.be"});return false}$(document).ready(function(){function a(b){$("#chosen_image").attr("value",b.id);Ext.DomHelper.overwrite("images",{tag:"img",src:b.url,style:"margin:10px;visibility:hidden;"},true).show(true).frame()}$("#choose_image").click(function(){var b;if(!b){b=new ImageChooser({url:"/ajax.php?module=foto&function=getAll",width:515,height:350,title:"kies een foto"})}b.show(this,a)});$("#choose_media").click(function(){var b;if(!b){b=new MediaChooser({url:"/ajax.php?module=video&function=getAll",width:515,height:350,title:"kies mediabestand"})}b.show(this,a)})});function TUUB_kiesmedia(){jQuery.facebox(function(){$.ajax({type:"GET",url:"/ajax.php?module=podcast&function=getMedia",dataType:"json",success:function(a){if(a.resp=="OK"){jQuery.facebox(a.html)}else{jQuery.facebox("Voudje")}},error:function(){jQuery.facebox("Voudje")}})});return false}function TUUB_kiesmedia_kies(a,b){if(a=="video"){$("#mediatype").attr("value","2");$("#mediaid").attr("value",b);$.ajax({type:"GET",url:"/ajax.php?module=video&function=getVideo&video_id="+b,dataType:"json",success:function(c){if(c.resp=="OK"){$("#mediainfo").html("<img src='"+c.video.image+"' width='100'> <br/>"+c.video.title).show("slow")}}})}jQuery(document).trigger("close.facebox");return false}function TUUB_popup_flyer(){var a="/popups/flyer";winpops=window.open(a,"flyer","width=400,height=220,toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0");if(window.focus){winpops.focus()}return false}function TUUB_update_flyer(a){$("div#flyer").html('<a href="http://thumbs.aslpagecdn.be/events/'+a+'" class="thickbox" title=""><img src="http://thumbs.aslpagecdn.be/eventthumbnail/'+a+'" alt="" /></a>');return}function ASL_poll_get(){$.ajax({type:"GET",url:"/ajax.php?module=poll&function=get",dataType:"json",success:function(a){if(a.resp=="OK"){$("#right-poll").html(a.html)}}});return false}function ASL_poll_vote(){var a=$("input[@name='poll_ident']").val();var b=$("input[@name='option_id']:checked").val();$.ajax({type:"POST",url:"/ajax.php?module=poll&function=vote",data:"action=vote&poll_ident="+a+"&option_id="+b,dataType:"json",success:function(c){if(c.resp=="OK"){$("#right-poll").html(c.html)}}});return false}function ASL_poll_getResult(){var a=$("input[@name='poll_ident']").val();$.ajax({type:"GET",url:"/ajax.php?module=poll&function=getResult&action=results&poll_ident="+a,dataType:"json",success:function(b){if(b.resp=="OK"){$("#right-poll").html(b.html)}}});return false}function TUUB_emoticons_popup(b){var a="/popups/emoticons?form="+b;winpops=window.open(a,"emoticons","width=660,height=500,toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0");if(window.focus){winpops.focus()}return false}function ASL_emoticons_popup(a){return TUUB_emoticons_popup(a)}function TUUB_news_popup(b){var a="/popups/nieuws/"+b;winpops=window.open(a,"nieuws","width=400,height=220,toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0");if(window.focus){winpops.focus()}return false}var uploading=false;var colorSwitchThreshold=50;function attachUploadHandlers(){$("#upload_form").submit(beginUpload);if($.browser.msie){$("#upload_iframe").bind("readystatechange",completeUpload)}else{$("#upload_iframe").bind("load",completeUpload)}}function updateProgressBarGUI(a){$(".progress-bar .progress-bar-bg").width(a+"%");$(".progress-bar .progress-bar-text").text(a+"%");if(a>colorSwitchThreshold){if(!$(".progress-bar .progress-bar-text").is(".progress-50-percent")){$(".progress-bar .progress-bar-text").addClass("progress-50-percent")}}else{if(a==0){$(".progress-bar .progress-bar-text").removeClass("progress-50-percent")}}}function beginUpload(){if(checkAllowFileExtensions()){return false}$("#upload_button").attr("disabled","true");uploading=true;$("div.progress-bar").show();updateProgressBarGUI(0);getUploadProgress();return true}function stopUpload(){uploading=false;try{window.stop()}catch(a){try{document.execCommand("Stop")}catch(a){}}}function completeUpload(a){if(uploading&&(a.type&&(a.type=="load"||a.type=="readystatechange"))){uploading=false;updateProgressBarGUI(100);window.setTimeout(uploadDone,1000)}}function uploadDone(){var a=$("#UPLOAD_IDENTIFIER").val();parent.location="./?ok="+a}function getUploadProgress(){var b=$("#UPLOAD_IDENTIFIER").val();var a=new Date().getTime();$.ajax({type:"POST",url:"/ajax.php?module=upload&t="+a,cache:false,data:"id="+b,dataType:"json",success:updateProgressBar,complete:function(){if(uploading){window.setTimeout(getUploadProgress,500)}}})}function updateProgressBar(c){if(c!=null){if(c.errorCode==0){var f=$(".progress-bar .progress-bar-text");var b=$(".progress-bar .progress-bar-bg");var d=parseInt(c.progressData.bytes_uploaded);var e=parseInt(c.progressData.bytes_total);var a=parseInt((d/e)*100);updateProgressBarGUI(a)}}}function checkAllowFileExtensions(){if(allow_extensions=="undefined"||allow_extensions==""){return false}if(inputfiletype=="undefined"||inputfiletype==""){return true}theform=document.getElementById("upload_form");if(theform.elements[inputfiletype].value!=""){if(!theform.elements[inputfiletype].value.match(allow_extensions)){var a=theform.elements[inputfiletype].value;var c=a.lastIndexOf("\\");if(c<1){c=a.lastIndexOf("/")}var d=a.slice(c+1,a.length);var b=d.slice(d.indexOf(".")).toLowerCase();alert('Sorry, een bestand met "'+b+'" als extentie is niet toegelaten.');return true}}return false};