var ISIE=false;


// >>> START JQUERY >>>
$(document).ready(function() {
						
								
// check of het Internet Explorer is
ISIE=$.browser.msie; 
// css preloader:
$.preloadCssImages();



// ### FORM  OPTIONS EN SPAM CHECK ###
$(".datumveld").datepicker({dateFormat: 'dd-mm-yy', changeMonth: true, changeYear: true});
$( ".submit_button, a.button").button();


// limiet voor textarea
$('.ta_limit100').keyup(function() {
      var maxlen = 450;
      var len = this.value.length;
      if (len >= maxlen) { this.value = this.value.substring(0, maxlen); }
      $('#charleft').text("Max chars:" + (maxlen - len));
  });

	


}); // END DOC READY


// Check whether string s is empty.
function isEmpty(s){return((s==null)||(s.length==0))}



// Jelastic plugin:
(function(g){g.fn.extend({elastic:function(){var h=["paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","lineHeight","fontFamily","width","fontWeight"];return this.each(function(){function i(c,j){curratedHeight=Math.floor(parseInt(c,10));a.height()!=curratedHeight&&a.css({height:curratedHeight+"px",overflow:j})}function k(){var c=a.val().replace(/&/g,"&amp;").replace(/ /g,"&nbsp;").replace(/<|>/g,"&gt;").replace(/\n/g,"<br />"),j=b.html().replace(/<br>/ig,"<br />");if(c+"&nbsp;"!= j){b.html(c+"&nbsp;");if(Math.abs(b.height()+l-a.height())>3){c=b.height()+l;if(c>=d)i(d,"auto");else c<=e?i(e,"hidden"):i(c,"hidden")}}}if(this.type!="textarea")return false;var a=g(this),b=g("<div />").css({position:"absolute",display:"none","word-wrap":"break-word"}),l=parseInt(a.css("line-height"),10)||parseInt(a.css("font-size"),"10"),e=parseInt(a.css("height"),10)||l*3,d=parseInt(a.css("max-height"),10)||Number.MAX_VALUE,f=0;if(d<0)d=Number.MAX_VALUE;b.appendTo(a.parent());for(f=h.length;f--;)b.css(h[f].toString(), a.css(h[f].toString()));a.css({overflow:"hidden"});a.bind("keyup change cut paste",function(){k()});a.bind("blur",function(){if(b.height()<d)b.height()>e?a.height(b.height()):a.height(e)});a.live("input paste",function(){setTimeout(k,250)});k()})}})})(jQuery);$("textarea").elastic();


// antispam 
// doe checks op formulieren met class webform:
$(".webform").validate({rules:{antispam_veld:{required:true,minlength:6}},messages:{antispam_veld:{required:"Vul de juiste code in.",minlength:"Code bestaat uit 6 cijfers"}},submitHandler:function(form){var imgID=$(".webform #antispam_img").attr("title");var spamNaam=$(".webform input#antispam_veld").val();if($(".webform #spamchecker").val()!="true"){$.get('/include/ajax_antispam.asp?antispam='+spamNaam+'&imgID='+imgID,function(response){if(response=="true"){$(".webform #spamchecker").val("true");form.submit();}else{$(".webform #antispam_msg").html("<img src=\"/images/folders/arrow_down.png\" alt=\"Fout!\" style=\"vertical-align:middle;\"/>Vul de juiste code in.<br/>");$(".webform #antispam_msg").show("fast");return false;}});}else{form.submit();}}});$(".weblogin").validate();

// Get querystring from url:
;(function($){$.extend({getQueryString:function(name){function parseParams(){var params={},e,a=/\+/g,r=/([^&=]+)=?([^&]*)/g,d=function(s){return decodeURIComponent(s.replace(a," "));},q=window.location.search.substring(1);while(e=r.exec(q))
params[d(e[1])]=d(e[2]);return params;}
if(!this.queryStringParams)
this.queryStringParams=parseParams();return this.queryStringParams[name];}});})(jQuery);


// Jquery cookie:
jQuery.cookie=function(key,value,options){if(arguments.length>1&&(value===null||typeof value!=="object")){options=jQuery.extend({},options);if(value===null){options.expires=-1;}
if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);}
return(document.cookie=[encodeURIComponent(key),'=',options.raw?String(value):encodeURIComponent(String(value)),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}
options=value||{};var result,decode=options.raw?function(s){return s;}:decodeURIComponent;return(result=new RegExp('(?:^|; )'+encodeURIComponent(key)+'=([^;]*)').exec(document.cookie))?decode(result[1]):null;};


// mailto nospam:
jQuery.fn.nospam=function(settings){settings=jQuery.extend({replaceText:false,filterLevel:'normal'},settings);return this.each(function(){e=null;if(settings.filterLevel=='low'){if($(this).is('a[rel]')){e=$(this).attr('rel').replace('][','@').replace(/\//g,'.')}else{e=$(this).text().replace('][','@').replace(/\//g,'.')}}else{if($(this).is('a[rel]')){e=$(this).attr('rel').split('').reverse().join('').replace('][','@').replace(/\//g,'.')}else{e=$(this).text().split('').reverse().join('').replace('][','@').replace(/\//g,'.')}}if(e){if($(this).is('a[rel]')){$(this).attr('href','mailto:'+e);if(settings.replaceText){$(this).text(e)}}else{$(this).text(e)}}})};




