var Myzone=function(){var Myzone_translateTags={};var Myzone_urls={};var Myzone_pollvote=0;var Myzone_voting=false;function getFieldValues(fields){var i=fields.length;var params={};while(i--){var elm=$("#"+fields[i]);var domEl=elm.get(0);if(domEl){if(domEl.tagName=="INPUT"){if(elm.attr("type").toLowerCase()=="checkbox"){if(elm.attr("checked")){params[fields[i]]=1;}
else{params[fields[i]]=0;}}
else{params[fields[i]]=elm.val();}}
else{params[fields[i]]=elm.val();}}}
return params;}
function postForm(params,url,fnc){$.ajax({method:"POST",type:"POST",url:url,data:params,timeout:10000,beforeSend:function(){},complete:function(){},success:fnc.success,error:function(XMLHttpRequest,textStatus,errorThrown){}});}
return{voteBase:function(poll_id,isNew,isWidget){if(Myzone_pollvote==0){alert(Myzone_translateTags.pollVote);}else{if(!Myzone_voting){if(isWidget){$("#poll_tabs_sub_poll_current").hide();$("#poll_tabs_sub_poll_result").hide();}
Myzone_voting=true;var url=Myzone_urls.pollVoteUrl;var params={};params.poll_id=poll_id;params.vote_id=Myzone_pollvote;params.isNew=isNew;var fnc={success:function(html){if(document.getElementById('poll_'+poll_id)){}
$(".poll_"+poll_id).html(html);$.nyroModalManual({content:Myzone_translateTags.pollMessage});return false;}};postForm(params,url,fnc);}}},vote:function(poll_id){this.voteBase(poll_id,'false',false);},vote_new:function(poll_id,isWidget){this.voteBase(poll_id,'true',isWidget);},setVote:function(vote_id){Myzone_pollvote=vote_id;},setTranslateTags:function(tags){Myzone_translateTags=tags;},setUrls:function(urlObj){Myzone_urls=urlObj;},setUrl:function(type,url){Myzone_urls[type]=url;},getLoginBox:function(){var url=Myzone_urls.loginBoxUrl;var params={};var fnc={success:function(html){if(document.getElementById('loginbox')){document.getElementById('loginbox').innerHTML=html;}}};postForm(params,url,fnc);},getPollBox:function(){var url=Myzone_urls.pollBoxUrl;var params={};var fnc={success:function(html){if(document.getElementById('pollbox')){document.getElementById('pollbox').innerHTML=html;}}};postForm(params,url,fnc);},removeBuddie:function(id){var url=Myzone_urls.removeBuddieUrl;var params={};params.member_id=id
var fnc={success:function(html){$("#buddie_"+id).remove();if($("li.buddielist").length==0){$("#buddies_none").show();}}};postForm(params,url,fnc);},removeFavorite:function(id){var url=Myzone_urls.removeFavoriteUrl;var params={};params.item_id=id
var fnc={success:function(html){$("#favorite_"+id).remove();if($("li.favoritelist").length==0){$("#favorite_none").show();}}};postForm(params,url,fnc);},removeCv:function(id){var url=Myzone_urls.removeCvUrl;var params={};params.id=id
var fnc={success:function(html){$("#cv_"+id).remove();if($("li.cvlist").length==0){$("#cv_none").show();}}};postForm(params,url,fnc);},removeForumAlert:function(id){var url=Myzone_urls.removeForumAlertUrl;var params={};params.item_id=id
var fnc={success:function(html){$("#forumalertlist_"+id).remove();if($("li.forumalertlist").length==0){$("#forumalerts_none").show();}}};postForm(params,url,fnc);},switchForumAlertLink:function(){if($("#forumalert_add_link").css('display')=="none"){$("#forumalert_add_link").show();$("#forumalert_remove_link").hide();}else{$("#forumalert_add_link").hide();$("#forumalert_remove_link").show();}},showDodelink:function(){if($("#dodelink_div").css('display')=="none"){$("#dodelink_div").show();$("#nieuwesite_div").hide();}else{$("#dodelink_div").hide();}},showNieuwesite:function(){if($("#nieuwesite_div").css('display')=="none"){$("#nieuwesite_div").show();$("#dodelink_div").hide();}else{$("#nieuwesite_div").hide();}},sendDeadLink:function(){var url=Myzone_urls.deadLinkUrl;var fields=["dodelink_remark","dodelink_item_id"];var params=getFieldValues(fields);var fnc={success:function(html){Myzone.showDodelink();if(document.getElementById('dodelinkUrl')){tb_show('',document.getElementById('dodelinkUrl').value);}}};postForm(params,url,fnc);},sendNewSite:function(){var url=Myzone_urls.newSiteUrl;var fields=["nieuwesite_title","nieuwesite_url","nieuwesite_item_id"];var params=getFieldValues(fields);var fnc={success:function(html){Myzone.showNieuwesite();if(document.getElementById('nieuwesiteUrl')){tb_show('',document.getElementById('nieuwesiteUrl').value);}}};postForm(params,url,fnc);},activateForumMessage:function(item_id){var url=Myzone_urls.activateForumUrl;var params={};params.item_id=item_id;var fnc={success:function(html){$(".admin_"+item_id).parent().find("a.admin_"+item_id).each(function(){$(this).toggle();});$(".admin_"+item_id).parents("tr").removeClass("notActive");}};postForm(params,url,fnc);},deactivateForumMessage:function(item_id){var url=Myzone_urls.deactivateForumUrl;var params={};params.item_id=item_id;var fnc={success:function(html){$(".admin_"+item_id).parent().find("a.admin_"+item_id).each(function(){$(this).toggle();});$(".admin_"+item_id).parents("tr").addClass("notActive");}};postForm(params,url,fnc);},setAanwezigOpEvent:function(item_id,aanwezig){if(aanwezig){var url=Myzone_urls.aanwezigOpEventUrl;}else{var url=Myzone_urls.afwezigOpEventUrl;}
var params={};params.item_id=item_id;var fnc={success:function(html){$("#list_event_"+item_id).html(html);}};postForm(params,url,fnc);},showPollResults:function(item_id){$("#poll_results_"+item_id).show();$("#poll_vote_"+item_id).hide();},showPollVote:function(item_id){$("#poll_results_"+item_id).hide();$("#poll_vote_"+item_id).show();}};}();
