$(document).ready(function(){if($("#default_css").length){doResize();$(window).resize(function(){doResize()})}});function doResize(){if($(window).width()>1240){if($("#default_css").attr("href")!=defaultCssWide){$("#default_css").attr("href",defaultCssWide)}}else{if($("#default_css").attr("href")!=defaultCssSmall){$("#default_css").attr("href",defaultCssSmall)}}}function getTimer(){var B=new Date();var A=B-now+"<br />";now=B;return A}var original=new Date();var now=new Date();var wrapper=$("#wrapper");$(document).ready(function(){original=new Date();onDocumentStart();setTimeout(onDocumentCompletion,10)});function onDocumentStart(){original=new Date();initScrolling();initResizingAndMinMax();initRoundedCorners();initTableZebra()}function initResizingAndMinMax(){initResizing();initMinMax()}function onDocumentCompletion(){completeMinMax();completeResizing();initRijHover();initPresentieLijst();initUserSelectieLijst();initDeleteConfirmations();initPresentieLijstHotKeys();initDateTimePicker();disableAutoCompleteOnAllTextInputs();initPrint();initAanwezigheidForm();initFormValidatie();if(masterPageName!="Site"){sneltoetsen()}initUserSelectie();initAanwezigheidJsonSave();initVakkenPakket();initZwaarteRanking();var A=$("#MainContent form input:visibleByParent, #MainContent form textarea:visibleByParent");tableSelect();if(A.length>0){try{A[0].focus()}catch(B){}}if($("#HuiswerkEdit").length>0){reloadItemEdit();loadCurrentAanwezigheid();$("#vak_0").focus()}initLeerlingGegevens();initLeerlingEdit();initTinyEditor()}function initTinyEditor(){tinyMCE.init({mode:"specific_textareas",editor_selector:"tiny",theme:"advanced",theme_advanced_buttons1:"bold,italic,underline",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left"})}function initLeerlingGegevens(){$("#leerlinggegevens_show").click(function(){$(this).hide();$("#leerlinggegevens_hide").show();$("#leerlinggegevens_div").show()});$("#leerlinggegevens_hide").click(function(){$(this).hide();$("#leerlinggegevens_show").show();$("#leerlinggegevens_div").hide()})}function initLeerlingEdit(){var B=$("tr.factuurAdresRow");if(B.length>0){var A=$("#FactuurAdresIsVerschillend");if(!A.attr("checked")){B.each(function(){$(this).toggle()})}A.change(function(){var C=($(this).attr("checked"));B.each(function(){$(this).toggle();if(!C){$(this).find("input").each(function(){$(this).val("")})}})})}}function initScrolling(){if(masterPageName=="VestigingLeerling"){enableScrolling("openstaande_memos_table",3);enableScrolling("openstaande_cijfers_table",3);enableScrolling("huiswerkoverzichtTable",10)}if(masterPageName=="VestigingBegeleider"){enableScrolling("openstaande_memos_table",3)}if(masterPageName=="LeerlingInformatie"){enableScrolling("openstaande_cijfers_table",10);enableScrolling("huiswerkoverzichtTable",10)}enableScrolling("openstaande_vestigingmemos_table",3);enableScrolling("presentielijst_table",15)}function reloadItemEdit(){$("input.datumpicker").each(function(){$(this).attr("title","* dd-mm-jjjj");$(this).rules("add",{required:true,remote:datumIsValid})});sneltoetsen();disableAutoCompleteOnAllTextInputs();$("input.datumpicker").datepicker({dateFormat:"d-m-yy",showOn:"button",numberOfMonths:2,buttonImage:"/Content/Images/Icons/calendar.jpg",duration:""});$(".planning .begeleiderdropdown").unbind("change");$(".planning .begeleiderdropdown").change(function(){changeBegeleider(this)});$(".planning input.datumpicker").unbind("change");$(".planning input.datumpicker").change(function(){changeDatum(this)});$("#SaveMeerdereLeerlingen").unbind("click");$("#SaveMeerdereLeerlingen").click(function(){$.get(leerlingURL,function(A){$("#leerlingenLijst").append(A);$(".huiswerkedit_leerlinglijst a").click(function(){$(this).parent().parent().find(":checkbox").each(function(){this.checked=!this.checked})});$("#SaveMeerdereLeerlingen").hide()});return false});$("#ShowRooster").unbind("click");$("#ShowRooster").click(function(){var A=new Date();var B="ts"+A.getMonth()+A.getDay()+A.getHours()+A.getMinutes()+A.getSeconds()+A.getMilliseconds();var C=roosterURL+"&ts="+B;$.get(C,function(D){$("#roosterDiv").append(D);$("#ShowRooster").hide()});return false});$("#ShowWeekOverzicht").unbind("click");$("#ShowWeekOverzicht").click(function(){$.get(huiswerkWeekOverzichtURL,function(A){$("#weekOverzichtDiv").append(A);$("#ShowWeekOverzicht").hide()});return false});$(".addHuiswerkItem").unbind("click");$(".addHuiswerkItem").click(function(){disableClicks();var A=parseInt($("#aantalItems").attr("value"));var B=huiswerkItemURL+$("#aantalItems").attr("value");$.get(B,function(C){A=A+1;$("#aantalItems").attr("value",A);$("#newItemsPlaceholder").append(C);$("#vak_"+A).focus();loadCurrentAanwezigheid();initTableZebra();reloadItemEdit();$(".vakDropDown").focus()});return false});$(".removeItem").unbind("click");$(".removeItem").click(function(){if(confirm("Item verwijderen?")){var A=this.id.replace("removeItem_","");$("#item_"+A).remove();$("#ITEMDELETED_"+A).attr("value","1")}return false});$(".removePlanning").unbind("click");$(".removePlanning").click(function(){if(confirm("Planning verwijderen?")){var A=this.id.replace("removePlanning_","");$("#planning_rij1_"+A).remove();$("#planning_rij2_"+A).remove();$("#planning_rij3_"+A).remove()}return false});$(".addPlanning").unbind("click");$(".addPlanning").click(function(){getPlanning(this,1);return false});$(".fillPlanning").unbind("click");$(".fillPlanning").click(function(){getPlanning(this,0);return false});$(".omschrijving").each(function(){setFocusBlurDing(this,"omschrijving")});$(".beoordeling").each(function(){setFocusBlurDing(this,"beoordeling")})}function setFocusBlurDing(A,B){if($(A).attr("value")==""){$(A).attr("value",B);$(A).css("color","gray");$(A).focus(function(){if($(this).attr("value")==B){$(this).attr("value","");$(this).css("color","black")}});$(A).blur(function(){if($(this).attr("value")==""){$(this).attr("value",B);$(this).css("color","gray")}})}}function getPlanning(F,H){disableClicks();var E=F.id.replace("addPlanning_","");E=E.replace("fillPlanning_","");var A=parseInt($("#aantalPlanningItems_"+E).attr("value"));var D=$("#huiswerkType_"+E).children("[@selected]").text();var G=$("#huiswerkDatum_"+E).attr("value");var B=$("#planMethode_"+E).children("[@selected]").val();var C=buildUrl(huiswerkPlanningenURL,"huiswerkType="+D+"&date="+G+"&listOrder="+A+"&parentListOrder="+E+"&mode="+H+"&planMethode="+B);$.get(C,function(I){if(I.indexOf("PlanningID_")>0){$("#fillPlanning_"+E).remove();$("#planning_"+E).children("tbody").append(I);if(H==0){var K=$("#omschrijving_"+E+"_0").val();var J=$("#beoordeling_"+E+"_0").val();var L=$("#begeleider_"+E+"_0").val();if(L==""&&K=="omschrijving"&&J=="beoordeling"){$("#planning_rij1_"+E+"_0").remove();$("#planning_rij2_"+E+"_0").remove();$("#planning_rij3_"+E+"_0").remove()}}loadCurrentAanwezigheid();reloadItemEdit()}else{alert("Kan geen planning toevoegen - huiswerkdatum ligt in het verleden of leerling is niet aanwezig voor aangegeven datum.");reloadItemEdit()}});return false}function changeHuiswerkPlanning(F,C,A){var E=A.Datum;var D=A.Omschrijving;var B=C+"_"+F;$("#omschr_"+B).html(D);$("#wanneerDoen_"+B).attr("value",E)}function checkForChangeDatum(A){var B=A.id.replace("wanneerDoen","omschr");if($("#"+B).html()==""){changeDatum(A)}}function changeDatum(B){var F=buildUrl(aanwezigheidJsonURL,"user="+username+"&date="+B.value);var C=B.id.replace("wanneerDoen","omschr");var E=new Date();var D=E.getDate()+"-"+(E.getMonth()+1)+"-"+E.getFullYear();var G=B.id.replace("wanneerDoen_","");if(D==B.value){$("#planning_rij1_"+G).addClass("today");$("#planning_rij2_"+G).addClass("today");$("#planning_rij3_"+G).addClass("today")}else{$("#planning_rij1_"+G).removeClass("today");$("#planning_rij2_"+G).removeClass("today");$("#planning_rij3_"+G).removeClass("today")}$.getJSON(F,function(H){$("#"+C).html(H.Omschrijving);if(H.Omschrijving=="Komt niet"){$("#planning_rij1_"+G).addClass("komtniet");$("#planning_rij2_"+G).addClass("komtniet");$("#planning_rij3_"+G).addClass("komtniet")}else{$("#planning_rij1_"+G).removeClass("komtniet");$("#planning_rij2_"+G).removeClass("komtniet");$("#planning_rij3_"+G).removeClass("komtniet")}});var A=B.id.replace("wanneerDoen","begeleider");changeBegeleider($("#"+A)[0])}function changeBegeleider(A){var B=A.id.replace("begeleider","");if(A.value==""){$("#omschr_b"+B).html("")}else{var D=$("#wanneerDoen"+B)[0].value;var C=buildUrl(aanwezigheidJsonURL,"user="+A.value+"&date="+D);$.getJSON(C,function(E){$("#omschr_b"+B).html(E.Omschrijving)})}}function loadCurrentAanwezigheid(){$(".planning input.datumpicker").each(function(){checkForChangeDatum(this)})}function disableClicks(){$("#HuiswerkEdit a").each(function(){$(this).unbind("click")})}var validForm=true;function initFormValidatie(){if($("#HuiswerkEditForm").length>0){$("#HuiswerkEditForm").validate();var B=true;function A(C){if(B){return"LET OP: huiswerk is nog niet opgeslagen."}}window.onbeforeunload=A;$(".Annuleren").click(function(){B=false});$("#HuiswerkEditForm").submit(function(){if($("#HuiswerkEditForm").validate().numberOfInvalids()==0){$("#HuiswerkEditForm #Opslaan").attr("disabled","disabled");B=false;$(this).find(".omschrijving").each(function(){if($(this).attr("value")=="omschrijving"){$(this).attr("value","")}});$(this).find(".beoordeling").each(function(){if($(this).attr("value")=="beoordeling"){$(this).attr("value","")}})}})}if($("#NieuweLeerling").length>0){$("#NieuweLeerling").validate({rules:{Voornaam:{required:true},Achternaam:{required:true},SchoolID:{required:true}},messages:{Voornaam:{required:"Voornaam verplicht"},Achternaam:{required:"Achternaam verplicht"},SchoolID:{required:"selecteer een school"}}})}if($("#BewerkGegevens").length>0){$("#BewerkGegevens").validate({rules:{Voornaam:{required:true},Achternaam:{required:true},SchoolID:{required:true}},messages:{Voornaam:{required:"Voornaam verplicht"},Achternaam:{required:"Achternaam verplicht"},SchoolID:{required:"selecteer een school"}}})}if($("#EditBegeleider").length>0){$("#EditBegeleider").validate({rules:{UserName:{required:true},Voornaam:{required:true},Achternaam:{required:true},Email:{required:true,email:true}},messages:{UserName:{required:"Gebruikersnaam verplicht"},Voornaam:{required:"Voornaam verplicht"},Achternaam:{required:"Achternaam verplicht"},Email:{required:"Emailadres verplicht",email:"Onjuist emailadres"}}})}if($("#CijferEdit").length>0){$("#CijferEdit").validate({rules:{Waarde:{required:true,remote:cijferIsValid},Zwaarte:{required:true,remote:zwaarteIsValid}},messages:{Waarde:{required:"Cijfer verplicht",remote:"Ongeldig cijfer, cijfer moet tussen de 1 en 10 liggen"},Zwaarte:{required:"Weegfactor verplicht",remote:"Weegfactor moet groter dan 0 zijn"}}})}if($("#MemoLeerling").length>0){$("#MemoLeerling").validate({rules:{titel:{required:true}},messages:{titel:{required:"Titel verplicht"}}})}if($("#MemoVestiging").length>0){$("#MemoVestiging").validate({rules:{titel:{required:true}},messages:{titel:{required:"Titel verplicht"}}})}if($("#EditSchool").length>0){$("#EditSchool").validate({rules:{Naam:{required:true},Email:{email:true}},messages:{Naam:{required:"Naam verplicht"},Email:{email:"onjuist emailadres"}}})}if($("#EditContactPersoon").length>0){$("#EditContactPersoon").validate({rules:{Voornaam:{required:true},Achternaam:{required:true},Email:{required:true,email:true}},messages:{Voornaam:{required:"Voornaam verplicht"},Achternaam:{required:"Achternaam verplicht"},Email:{required:"Email verplicht",email:"Onjuist e-mailadres"}}})}if($("#VestigingInstellingen").length>0){$("#VestigingInstellingen").validate({rules:{Email:{required:true,email:true}},messages:{Email:{required:"Email verplicht",email:"Onjuist e-mailadres"}}})}if($("#EditVak").length>0){$("#EditVak").validate({rules:{Naam:{required:true}},messages:{Naam:{required:"Naam verplicht"}}})}$("form").validate();$("input.datumpicker").each(function(){$(this).attr("title","* d-m-jjjj");$(this).rules("add",{required:true,remote:datumIsValid})})}function isValidDate(C){re=new RegExp("[0-9]{1}[0-9]*(-){1}[0-9]{1}[0-9]*(-){1}[0-9]{4}");if(re.test(C)){dateArray=C.split("-");if(parseInt(dateArray[0])<32&&parseInt(dateArray[1])<13&&parseInt(dateArray[2])>1900&&parseInt(dateArray[2])<2100){dag=dateArray[0];maand=dateArray[1];jaar=dateArray[2];var B=(maand+"/"+dag+"/"+jaar);var A=new Date(B);if(A.getDate()!=dag){return false}if(A.getMonth()!=maand-1){return false}if(A.getFullYear()!=jaar){return false}return true}else{return false}}else{return false}}var scrollbar=0;var upImage="<img src='/Content/Images/up.gif' alt='up' />";var downImage="<img src='/Content/Images/down.gif' alt='down' />";var minImage="<img src='/Content/Images/min.gif' alt='min' />";var plusImage="<img src='/Content/Images/plus.gif' alt='max' />";function initDateTimePicker(){$("input.datumpicker").datepicker({dateFormat:"d-m-yy",numberOfMonths:2,showOn:"button",buttonImage:"/Content/Images/Icons/calendar.jpg",duration:""})}function disableAutoCompleteOnAllTextInputs(){var A=document.getElementsByTagName("input");for(var B=0,C=A.length;B<C;B++){if(A.item(B).type=="text"){A.item(B).setAttribute("autocomplete","off")}}}function completeResizing(){$("a.sizerUp").each(function(){var A=$(this).css("display");$(this).hide();$(this).html(upImage);if(A!="none"){$(this).fadeIn("slow")}});$("a.sizerDown").each(function(){var A=$(this).css("display");$(this).hide();$(this).html(downImage);if(A!="none"){$(this).fadeIn("slow")}});$("a.sizerUp").click(function(){var B=$(this).attr("target");var A=parseInt(getFromCookie(B+"_rows"+masterPageName))-1;if(B=="weekoverzicht"){resizeHuiswerkOverzicht(B,A)}else{if(A>0){setScrollHeight(B,A)}}return false});$("a.sizerDown").click(function(){var B=$(this).attr("target");var A=parseInt(getFromCookie(B+"_rows"+masterPageName))+1;if(B=="weekoverzicht"){resizeHuiswerkOverzicht(B,A)}else{setScrollHeight(B,A)}return false})}function initResizing(){var A=getFromCookie("weekoverzicht_rows"+masterPageName);var B=A!=null&&A!=NaN?A:13;resizeHuiswerkOverzicht("weekoverzicht",B)}function resizeHuiswerkOverzicht(B,A){if($("#overzicht").length>0&&A>3){saveInCookie(B+"_rows"+masterPageName,A);$("#overzicht .week").height((A*10)+1);$("#overzicht .weekdag").height(A*10);$("#overzicht .weekdag .huiswerk").height((A*10)-25);$("#overzicht .weekend").height((A*5)-1);$("#overzicht .weekend .huiswerk").height((A*5)-25);$("#overzicht .bijles").height(88);$("#overzicht .bijles .weekdag").height(87);$("#overzicht .bijles .weekdag .huiswerk").height(62);$("#overzicht .bijles .weekend").height(43);$("#overzicht .bijles .weekend .huiswerk").height(22)}}function completeMinMax(){$("a.minmax").each(function(){var A=$(this);var B=A.attr("target");var C=getFromCookie(B);A.hide();if(C!=null&&C=="+"){A.html(plusImage)}else{A.html(minImage)}A.fadeIn("slow")});$("a.minmax").click(function(){var A=$(this).attr("target");if($(A).css("display")!="none"){$(this).html(plusImage);saveInCookie(A,"+");$(this).parent().find(".sizerDown").hide();$(this).parent().find(".sizerUp").hide()}else{$(this).html(minImage);saveInCookie(A,"-");$(this).parent().find(".sizerDown").show();$(this).parent().find(".sizerUp").show()}$(A).toggle("fast");return false})}function initMinMax(){$("a.minmax").each(function(){var A=$(this);var B=A.attr("target");var C=getFromCookie(B);if(C!=null&&C=="+"){$(B).hide();$(this).parent().find(".sizerDown").hide();$(this).parent().find(".sizerUp").hide()}else{$(B).show()}})}function saveInCookie(A,B){$.cookie(A,B,{expires:30})}function getFromCookie(A){return $.cookie(A)}function initTableZebra(){$("table.rowspanned").each(function(){var C=$(this).find("tr").length;var B=false;for(var A=0;A<C;A++){var D=$(this).find("tr").eq(A);var F=parseInt(D.find("td:first").attr("rowspan"));if(F>0){B=!B;if(B){for(var E=A;E<A+F;E++){$(this).find("tr").eq(E).addClass("odd")}}A=A+F-1}}});$("table:not(.rowspanned) tr:odd").addClass("odd")}function enableScrolling(E,C){var A=getFromCookie(E+"_rows"+masterPageName);var D=A!=null&&A!=NaN?A:C;var B=$("#"+E);if(B.length==1){setScrollHeight(E,D)}}function setScrollHeight(D,C){saveInCookie(D+"_rows"+masterPageName,C);var B=$("#"+D);var A=17*C;B.parent().height(A);B.parent().css("overflow","auto");B.parent().css("overflow-x","hidden")}function scrollbarWidth(){var B=$('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div>');$("body").append(B);var C=$("div",B).innerWidth();B.css("overflow-y","scroll");var A=$("div",B).innerWidth();$(B).remove();return(C-A)}function initRijHover(){rijHover("#aanwezigheid_table tr");rijHover("#openstaande_memos_table tr");rijHover("#openstaande_cijfers_table tr");rijHover("#openstaande_vestigingmemos_table tr");rijHover("#presentielijst_table tr")}var doVerwijder=false;function rijHover(A){$(A).hover(function(B){$(this).addClass("hover");$(this).css({cursor:"pointer"})},function(){$(this).removeClass("hover");$(this).css({cursor:"default"})}).click(function(){if(doVerwijder){doVerwijder=false;return true}if($(this).find("a").length>2){return true}var B=$(this).find("a").attr("href");if(B!=""&&B!=undefined&&B!=null){window.location.href=B}return false})}function buildUrl(A,B){if(A.match("\\?")){return A+B}else{return A+"?"+B}}function initPresentieLijst(){$("#PresentieLijstTypeDropDown").change(function(){redirectPresentielijst()});$("#PresentieLijstOrderDropDown").change(function(){redirectPresentielijst()})}function redirectPresentielijst(){var E=$("#PresentieLijstTypeDropDown")[0].value;var D=$("#PresentieLijstOrderDropDown")[0].value;var B=new Date();var C="ts"+B.getMonth()+B.getDay()+B.getHours()+B.getMinutes()+B.getSeconds()+B.getMilliseconds();var A=buildUrl(presentielijstURL,"PresentieLijstType="+E+"&PresentieLijstOrder="+D+"&ts="+C);$("#presentielijst #presentielijst_content").load(A,function(F){initTableZebra();rijHover("#presentielijst_table tr");enableScrolling("presentielijst_table",10);$("a.presentielijstLink").each(function(){$(this).attr("href",$(this).attr("href")+"?ref="+window.location.href)})})}function initPrint(){$(".print").attr("target","_new")}function initUserSelectieLijst(){$("#UserSelectieDropDown").change(function(){window.location.href=buildUrl(refreshControllerUrl,"user="+this.value+"&ref="+window.location.href)});$("a.presentielijstLink").each(function(){$(this).attr("href",$(this).attr("href")+"?ref="+window.location.href)})}function initDeleteConfirmations(){$(".leerlingLijst input.verwijder").click(function(){doVerwijder=confirm("Weet je zeker dat je deze leerling DEFINITIEF wilt verwijderen?");return doVerwijder});$(".huiswerkTypes a.verwijder").click(function(){doVerwijder=confirm("Weet je zeker dat je dit huiswerkttype wilt verwijderen?");return doVerwijder});$(".vakkenLijst a.verwijder").click(function(){doVerwijder=confirm("Weet je zeker dat je dit vak wilt verwijderen?");return doVerwijder});$(".scholenLijst a.verwijder").click(function(){doVerwijder=confirm("Weet je zeker dat je deze school wilt verwijderen?");return doVerwijder});$("#gegevens_vakkenpakket .verwijder").click(function(){doVerwijder=confirm("Weet je zeker dat je dit vak wilt verwijderen?");return doVerwijder});$(".cijferLijst .verwijder").click(function(){doVerwijder=confirm("Weet je zeker dat je dit cijfer wilt verwijderen?");return doVerwijder});$(".cijferLijstOpen .verwijder").click(function(){doVerwijder=confirm("Weet je zeker dat je geen cijfer wilt invoeren voor dit huiswerkitem?");return doVerwijder});$("#contactPersonen input.verwijder").click(function(){doVerwijder=confirm("Weet je zeker dat je deze contactpersoon wilt loskoppelen van deze leerling?");return doVerwijder});$("#ContactPersonenOverzicht input.verwijder").click(function(){doVerwijder=confirm("Weet je zeker dat je deze contactpersoon volledig wilt verwijderen?");return doVerwijder});$(".ContactPersoonGegevensLeerlingen input.verwijder").click(function(){doVerwijder=confirm("Weet je zeker dat je deze leerling wilt loskoppelen van deze contactpersoon?");return doVerwijder})}function movePresentieLijstFocus(A){$("input, select, textarea").blur();$("#presentielijst_table tr").removeClass("currentSelect");$("#presentielijst_table tr:eq("+A+")").addClass("currentSelect");var B=((A+2)*28)>$("#presentielijst_content").height()?((A+2)*28)-$("#presentielijst_content").height():"";$("#presentielijst_content").scrollTop(B);return false}function initPresentieLijstHotKeys(){var B=$("#presentielijst_content table tr").length-1;var A=-1;if(B!=-1){$(document).bind("keydown","Shift+up",function(){A==0?A:A--;return movePresentieLijstFocus(A)});$(document).bind("keydown","Shift+left",function(){A==0?A:A--;return movePresentieLijstFocus(A)});$(document).bind("keydown","Shift+down",function(){A==B?A:A++;return movePresentieLijstFocus(A)});$(document).bind("keydown","Shift+right",function(){A==B?A:A++;return movePresentieLijstFocus(A)});$(document).bind("keydown","Shift+return",function(){if(A>=0){var C=$("#presentielijst_content table tr:eq("+A+")").find("a").attr("href");if(C!=undefined){window.location.href=C}}return false});$(document).bind("keydown","Shift+backspace",function(){A=-1;$("#presentielijst_content table tr").removeClass("currentSelect");return false})}}function initAanwezigheidForm(){$("select.Komt[value='False']").parents("tr").find("input").attr("disabled","disabled");$("select.Komt").change(function(){if($(this).val()=="False"){$(this).parents("tr").find("input").attr("disabled","disabled")}else{$(this).parents("tr").find("input").removeAttr("disabled")}});$("input.Vrij, input.Begin, input.Eind, input.Tijd").timeEntry();$("input.Vrij").change(function(){var D=$(this).val().split(":");var A=D[0];var B=D[1];if(B>30){if(A==23){A="0"}else{A=parseInt(A)+1}B=parseInt(B)-30;if(B<10){B="0"+B}if(A<10){A="0"+A}}else{if(B==30){if(A==23){A="0"}else{A=parseInt(A)+1}B="00";if(A<10){A="0"+A}}else{B=parseInt(B)+30}}var C=A+":"+B;$(this).parents("tr").find("input.Begin").val(C)})}function moveTableSelect(A){$("table.select tr").removeClass("currentSelect");$("table.select tr:eq("+A+")").addClass("currentSelect");return false}function tableSelect(){var B=0;var A=$("table.select tr").length-1;if(A!=-1){$(document).bind("keydown",{combi:"up",disableInInput:true},function(){B==1?B:B--;return moveTableSelect(B)});$(document).bind("keydown",{combi:"left",disableInInput:true},function(){B==1?B:B--;return moveTableSelect(B)});$(document).bind("keydown",{combi:"down",disableInInput:true},function(){B==A?B:B++;return moveTableSelect(B)});$(document).bind("keydown",{combi:"right",disableInInput:true},function(){B==A?B:B++;return moveTableSelect(B)});$(document).bind("keydown",{combi:"return",disableInInput:true},function(){if(B>=1){var C=$("table.select tr:eq("+B+")").find("a").attr("href");if(C!=undefined){window.location.href=C}}})}}function sneltoetsen(){if(leerling!=""&&leerling!=undefined&&vestiging!=undefined&&vestiging!=""){$(document).bind("keydown",{combi:"Shift+g",disableInInput:true},function(){window.location.href=leerlingGegevensUrl});$(document).bind("keydown",{combi:"Shift+n",disableInInput:true},function(){window.location.href=nieuwHuiswerkUrl});$(document).bind("keydown",{combi:"Shift+m",disableInInput:true},function(){window.location.href=memoLeerlingUrl});$(document).bind("keydown",{combi:"Shift+h",disableInInput:true},function(){window.location.href=huiswerkOverzichtUrl});$(document).bind("keydown",{combi:"Shift+c",disableInInput:true},function(){window.location.href=cijferOverzichtUrl});$(document).bind("keydown",{combi:"Shift+a",disableInInput:true},function(){window.location.href=aanwezigheidOverzichtUrl})}else{if(vestiging!=""){$(document).bind("keydown",{combi:"Shift+m",disableInInput:true},function(){window.location.href=memoVestigingUrl});$(document).bind("keydown",{combi:"Shift+h",disableInInput:true},function(){window.location.href=huiswerkTypeUrl})}}if(vestiging!=""){$(document).bind("keydown",{combi:"Shift+d",disableInInput:true},function(){window.location.href=dagOverzichtUrl;return false});$(document).bind("keydown",{combi:"Shift+v",disableInInput:true},function(){window.location.href=vestigingHomeUrl});$(document).bind("keydown",{combi:"Shift+l",disableInInput:true},function(){window.location.href=leerlingLijstUrl});$(document).bind("keydown",{combi:"Shift+b",disableInInput:true},function(){window.location.href=begeleidersLijstUrl});$(document).bind("keydown",{combi:"Shift+s",disableInInput:true},function(){window.location.href=schoolLijstUrl});$(document).bind("keydown",{combi:"Shift+k",disableInInput:true},function(){window.location.href=vakLijstUrl})}$(document).bind("keyup","Ctrl+Shift+s",function(){$("input[value='Opslaan']").click();return false});$(document).bind("keyup","esc",function(){var A=$("a:contains('Annuleren')").attr("href");A!=undefined?window.location.href=A:false});$(document).bind("keydown","Ctrl+Shift+e",function(){var A=$("a:contains('Annuleren')").attr("href");A!=undefined?window.location.href=A:false;return false});$(document).bind("keydown",{combi:"Shift+p",disableInInput:true},function(){var A=$("a.print").attr("href");A!=undefined?window.open(A):false});$(document).bind("keydown",{combi:"Shift+n",disableInInput:true},function(){var A=$("a.n").attr("href");A!=undefined?window.location.href=A:false});$(document).bind("keydown",{combi:"Shift+w",disableInInput:true},function(){var A=$("a.w").attr("href");A!=undefined?window.location.href=A:false});$(document).bind("keydown","Ctrl+Shift+i",function(){var A=$("a:contains('Inchecken')").attr("href");A!=undefined?window.location.href=A:false;return false});$(document).bind("keydown","Ctrl+Shift+u",function(){var A=$("a:contains('Uitchecken')").attr("href");A!=undefined?window.location.href=A:false});$(document).bind("keydown","Ctrl+Shift+l",function(){window.location.href="/Authentication/LogOut"});$(document).bind("keydown","Ctrl+Shift+z",function(){$("#addHuiswerkItem").click();return false});$(document).bind("keydown",{combi:"Shift+1",disableInInput:true},function(){$("#UserSelectieDropDown").focus()});$(document).bind("keydown",{combi:"Shift+2",disableInInput:true},function(){$("#PresentieLijstTypeDropDown").focus()})}function initUserSelectie(){$("#BegeleiderUserSelectie").change(function(){var A=$("#BegeleiderUserSelectie option:selected").text();window.location=begeleiderOverzichtUrl+"/Lijst/"+A});$("#LeerlingUserSelectie").change(function(){var A=$("#LeerlingUserSelectie option:selected").text();window.location=leerlingOverzichtUrl+"/Lijst/"+A})}function initAanwezigheidJsonSave(){$("#gegevens_aanwezigheid #Opslaan").click(function(){$("#tdSave").hide();var C=$("#Komt").val();var A=$("#Begin").val();var E=$("#EndActual").val();var B=$("#MemoTitle").val();var D=$("#MemoText").val();var F=$("#Afgehandeld").attr("checked");var G=buildUrl(aanwezigheidSaveJSonUrl,"Komt="+C+"&Begin="+A+"&EndActual="+E+"&MemoTitle="+B+"&MemoText="+D+"&Afgehandeld="+F);$.getJSON(G,function(H){if(H!=""){if(H.substring(1,0)=="F"){$("#tdSave").show();$("#tdMessage").show();$("#tdMessage").html(H)}else{$("#gegevens_aanwezigheid").enabled=false;$("#tdMessage").show();$("#tdMessage").html("");$("#tdMessage").append("<b>Aanwezigheid is opgeslagen</b><br />");$("#tdMessage").append("<b style='color:red;'>Let op:</b> er zijn "+H+" ingeplande huiswerkitems voor deze leerling.<br /><br />");$("#tdMessage").append("<span style='color:black;'>"+huiswerkBewerkRedirectLink+"&nbsp;"+aanwezigheidOverzichtLink+"</span>")}}else{window.location.href=aanwezigheidOverzichtUrl}});return false})}function initVakkenPakket(){if($("#VakkenPakket").length){var A=$("#VakkenPakket").find("input[type='checkbox']");A.each(function(){if($(this).attr("checked")){$(this).parent().parent().find(".zwaarte").show()}else{$(this).parent().parent().find(".zwaarte").hide()}});A.click(function(){if($(this).attr("checked")){$(this).parent().parent().find(".zwaarte").show()}else{$(this).parent().parent().find(".zwaarte").hide()}})}}function initZwaarteRanking(){var A=0;var B=null;if($("#Moeilijkheid").length>0){B=$("#Moeilijkheid")}if($("input[id*='Zwaarte']").length>0){B=$("input[id*='Zwaarte']")}if(B!=null){B.each(function(){var C=$(this);if(C!=null){A=C.val();C.parent().find(".rank_star:lt("+A+")").css({filter:"alpha(opacity=100)","-moz-opacity":"1",opacity:"1",cursor:"pointer"});C.parent().find(".rank_star").attr("src","/Content/Images/Icons/Ranking/star"+A+".png");C.parent().find(".rank_star").hover(function(){var D=$(this).attr("title");C.parent().find(".rank_star:lt("+D+")").css({filter:"alpha(opacity=100)","-moz-opacity":"1",opacity:"1",cursor:"pointer"});C.parent().find(".rank_star").attr("src","/Content/Images/Icons/Ranking/star"+D+".png")},function(){var D=C.val();D--;C.parent().find(".rank_star:gt("+D+")").css({filter:"alpha(opacity=10)","-moz-opacity":".10",opacity:".10",cursor:"default"});D++;C.parent().find(".rank_star").attr("src","/Content/Images/Icons/Ranking/star"+D+".png")});C.parent().find(".rank_star").click(function(){var D=$(this).attr("title");C.val(D);var E=D--;C.parent().find(".rank_star:gt("+D+")").css({filter:"alpha(opacity=10)","-moz-opacity":".10",opacity:".10",cursor:"default"});C.parent().find(".rank_star:lt("+E+")").css({filter:"alpha(opacity=100)","-moz-opacity":"1",opacity:"1",cursor:"pointer"});D++;C.parent().find(".rank_star").attr("src","/Content/Images/Icons/Ranking/star"+D+".png")})}})}}function initRoundedCorners(){if(masterPageName!="Site"){$("#navigatie a").each(function(){var A=$(this).html();$(this).html("<span class='leftcorner'>&nbsp;</span><span class='menumiddle'>"+A+"</span><span class='rightcorner'>&nbsp;</span>")})}}jQuery.expr[":"].visibleByParent=function(A){return jQuery(A).is(":visible")&&jQuery(A).css("display")!="none"};