var dtCh="/";var minYear=1900;var maxYear=2100;function isInteger(s){var i;for(i=0;i<s.length;i++){var c=s.charAt(i);if(((c<"0")||(c>"9")))return false;}
return true;}
function stripCharsInBag(s,bag){var i;var returnString="";for(i=0;i<s.length;i++){var c=s.charAt(i);if(bag.indexOf(c)==-1)returnString+=c;}
return returnString;}
function daysInFebruary(year){return(((year%4==0)&&((!(year%100==0))||(year%400==0)))?29:28);}
function DaysArray(n){for(var i=1;i<=n;i++){this[i]=31
if(i==4||i==6||i==9||i==11){this[i]=30}
if(i==2){this[i]=29}}
return this}
function isDate(dtStr){var daysInMonth=DaysArray(12)
var pos1=dtStr.indexOf(dtCh)
var pos2=dtStr.indexOf(dtCh,pos1+1)
var strDay=dtStr.substring(0,pos1)
var strMonth=dtStr.substring(pos1+1,pos2)
var strYear=dtStr.substring(pos2+1)
strYr=strYear
if(strDay.charAt(0)=="0"&&strDay.length>1)strDay=strDay.substring(1)
if(strMonth.charAt(0)=="0"&&strMonth.length>1)strMonth=strMonth.substring(1)
for(var i=1;i<=3;i++){if(strYr.charAt(0)=="0"&&strYr.length>1)strYr=strYr.substring(1)}
month=parseInt(strMonth)
day=parseInt(strDay)
year=parseInt(strYr)
if(pos1==-1||pos2==-1){alert("Datum moet zo gevormd zijn : mm/dd/yyyy")
return false}
if(strMonth.length<1||month<1||month>12){alert("Geen geldige maand")
return false}
if(strDay.length<1||day<1||day>31||(month==2&&day>daysInFebruary(year))||day>daysInMonth[month]){alert("Geen geldige dag")
return false}
if(strYear.length!=4||year==0||year<minYear||year>maxYear){alert("Geen geldig jaar: 4 getallen tussen "+minYear+" en "+maxYear)
return false}
if(dtStr.indexOf(dtCh,pos2+1)!=-1||isInteger(stripCharsInBag(dtStr,dtCh))==false){alert("Geen geldige datum")
return false}
return true}
function validateDate(sender,args){if(isDate(args.Value)==false){args.IsValid=false;return;}
args.IsValid=true;}
function hideCalendar(cb){cb.hide();}
function NeatUpload_OnSubmitForm_aspnetForm(){}
function showHelp(icon,help){var loc=Sys.UI.DomElement.getLocation(icon);var helpDiv=$get("helpDiv");var div=helpDiv.style;var helpText="";switch(help.toLowerCase()){case'klbnaam':helpText='Deze naam zal gebruikt worden in de mails naar de planaanvrager.<br />Dit is de meestal de naam van de organisatie waarvoor u KLB-zones beheert. U kan hier ook de naam van bvb. een disctrict aan toevoegen.';break;case'odbnaam':helpText='Dit is de meestal de naam van de organisatie waarvoor u ODB-zones beheert. U kan hier ook de naam van bvb. een disctrict aan toevoegen.';break;case'pavnaam':helpText='Deze naam zal gebruikt worden in de mails naar de klb\'s.<br />Dit is de meestal de naam van de organisatie waarvoor u planaanvragen doet.';break;case'klbmailto':helpText='Dit e-mailadres wordt gebruikt om de bevestiging- en herinneringsmails naartoe te sturen.';break;case'pavmailto':helpText='Dit e-mailadres wordt gebruikt om het detail van de planaanvraag naartoe te sturen.';break;case'admin2toevoegen':helpText='U kan een operator toegang geven voor het volledige beheer van uw zones. Deze moet zich echter eerst registreren met dezelfde rollen.';break;case'pavadmin2toevoegen':helpText='U kan een operator toegang geven voor het volledige beheer van uw planaanvragen. Deze moet zich echter eerst registreren met dezelfde rollen.';break;}
Sys.UI.DomElement.setLocation(helpDiv,loc.x+20,loc.y+20);helpDiv.innerHTML='<div class="tooltipBox">'+helpText+'</div>';if(div.visibility=="hidden"||div.display=="none"||div.display==""){icon.style.cursor='pointer';div.visibility="visible";div.display="block";}
else{icon.style.cursor='pointer';div.visibility="hidden";div.display="none";}}
function showUserMessage(icon,help){var loc=Sys.UI.DomElement.getLocation(icon);var helpDiv=$get("helpDiv");var div=helpDiv.style;var helpText='';if(help!=''){helpText='<img src="progress_s.gif" alt="even geduld" style="vertical-align:middle" />';localService.getUserMessageByCode(help,updateUserMessage,OnErrorUserMessage);}Sys.UI.DomElement.setLocation(helpDiv,loc.x+20,loc.y+20);helpDiv.innerHTML='<div class="tooltipBox">'+helpText+'</div>';if(div.visibility=="hidden"||div.display=="none"||div.display==""){icon.style.cursor='pointer';div.visibility="visible";div.display="block";}
else{icon.style.cursor='pointer';div.visibility="hidden";div.display="none";}}
function updateUserMessage(result){var helpDiv=$get("helpDiv");var loc=Sys.UI.DomElement.getLocation(helpDiv);helpDiv.innerHTML='<div class="tooltipBox">'+result+'</div>';var helpBounds=Sys.UI.DomElement.getBounds(helpDiv);var winBounds=Sys.UI.DomElement.getBounds(document.documentElement);var addx=0;var addy=0;if((loc.x+helpBounds.width)>winBounds.width){addx=(helpBounds.width+addx)*-1};if((loc.y+helpBounds.height)>winBounds.height){addy=(helpBounds.height+addy)*-1};Sys.UI.DomElement.setLocation(helpDiv,loc.x+addx,loc.y+addy);}
function OnErrorUserMessage(arg){alert(arg._message);}
var ss={smoothScroll:function(anchor,steps){if(!anchor)return true;if(steps)ss.STEPS=steps;var destx=Sys.UI.DomElement.getLocation($get(anchor)).x;var desty=Sys.UI.DomElement.getLocation($get(anchor)).y;clearInterval(ss.INTERVAL);cypos=ss.getCurrentYPos();ss_stepsize=parseInt((desty-cypos)/ss.STEPS);ss.INTERVAL=setInterval('ss.scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10);},scrollWindow:function(scramount,dest,anchor){wascypos=ss.getCurrentYPos();isAbove=(wascypos<dest);window.scrollTo(0,wascypos+scramount);iscypos=ss.getCurrentYPos();isAboveNow=(iscypos<dest);if((isAbove!=isAboveNow)||(wascypos==iscypos)){window.scrollTo(0,dest);clearInterval(ss.INTERVAL);}},getCurrentYPos:function(){if(document.body&&document.body.scrollTop)
return document.body.scrollTop;if(document.documentElement&&document.documentElement.scrollTop)
return document.documentElement.scrollTop;if(window.pageYOffset)
return window.pageYOffset;return 0;}}
ss.STEPS=25;
function toggleVisibility(div) {var div=$get(div).style;if(div.visibility=="hidden"){div.visibility="visible";div.display="block";}else{div.visibility="hidden";div.display="none";}}