function isValidEmailAddress(emailAddress) {
	var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
	return pattern.test(emailAddress);
}

function IsNumeric(sText) {
var ValidChars = "0123456789.";
var IsNumber=true;
var Char;
for (k = 0; k < sText.length && IsNumber == true; k++) 
  { 
  Char = sText.charAt(k); 
  if (ValidChars.indexOf(Char) == -1) 
	 {
	 IsNumber = false;
	 }
  }
return IsNumber;
}

function isAlphabet(elem) {
	var alphaExp = /^[a-zA-Z]+$/;
	if(elem.match(alphaExp))
		return true;
	else
		return false;
}

function changeFontSize(inc)
{
	var standardSize = jQuery('html').css('font-size');
	standardSize = parseInt(standardSize.replace("px", ""));
	if(inc=='normal'){
	jQuery(".resizer").css("font-size", '100%');
	jQuery(".normal").addClass("selected");
	jQuery(".big").removeClass("selected");
	}
	if(inc=='big'){
	jQuery(".resizer").css("font-size", '130%');
	jQuery(".big").addClass("selected");
	jQuery(".normal").removeClass("selected");
	}
}

function showHide(id) {
	$(".links #link-"+id).hover(
		function() {
			$(".links #link-"+id).addClass("hover");
			$(".expls #expl-"+id).css("display","block");
		},
		function() {
			$(".links #link-"+id).removeClass("hover");
			$(".expls #expl-"+id).css("display","none");
		}
	);
}

function showArticle(id) {
	$(".vormen .link").removeClass("selected");
	$(".articles .art").css("display","none");
	
	$(".vormen #link-"+id).addClass("selected");
	$(".articles #art-"+id).css("display","block");
	
	$(".iframe"+id).height($(".iframe"+id).contents().find("#column-middle").height());
}

function printDiv(id)
{
	$(".articles .email_print").hide();
	$(".articles .hidden").hide();
	
	win = window.open();
    self.focus();
    win.document.open();
    win.document.write('<'+'html'+'><'+'head'+'><'+'style'+'>');
    win.document.write('body, td { font-family: Verdana; font-size: 10pt;}');
    win.document.write('<'+'/'+'style'+'><'+'/'+'head'+'><'+'body'+'>');
	win.document.write($(".articles #art-"+id).html());
    win.document.write('<'+'/'+'body'+'><'+'/'+'html'+'>');
    win.document.close();
    
	// als de print functie te snel aangeroepen wordt is de pagina nog niet geladen en wordt een half lege pagina geprint
	var t=setTimeout("win.print(); win.close();",100);
	
	$(".articles .email_print").show();
}

/*
// orginele functie
function printDiv(id) {
	$(".articles .email_print").hide();
	$(".articles .hidden").hide();
	w=window.open();
	w.document.write($(".articles #art-"+id).html());
	w.print();
	w.close();
	$(".articles .email_print").show();
}
*/

function emailDiv(id) {
	link = document.location.href;
	subj = $(".articles #art-"+id+" .art_title").text();
	body = $(".articles #art-"+id+" .art_sdesc").text()+"%0A%0aGa naar bericht: "+link;
	
	window.location.href="mailto:?subject="+subj+"&body="+body;
}

jQuery(document).ready(function(){
	if (jQuery.browser.msie && jQuery.browser.version == 7)
		jQuery('body').addClass("ie7");
	if (jQuery.browser.msie && jQuery.browser.version == 8)
		jQuery('body').addClass("ie8");
	
	if (!jQuery.browser.msie) jQuery(".round").corner("3px");
});


$(function() {
   $(".font-size .normal").mouseover(function(){
      $(".font-size .normal img").attr("src","/images/text-size-1-active.png");
   });
   $(".font-size .normal").mouseout(function(){
      if($(this).attr("class") != "normal selected")
      {
        $(".font-size .normal img").attr("src","/images/text-size-2.png");
      }
   });

   $(".font-size .big").mouseover(function(){
      $(".font-size .big img").attr("src","/images/text-size-1-active.png");
   });
   $(".font-size .big").mouseout(function(){
      if($(this).attr("class") != "normal selected")
      {
        $(".font-size .big img").attr("src","/images/text-size-2.png");
      }
   });
});

//  functie om de framesize aan te passen
function adjustIFrameSize (iframeWindow) {
	if (iframeWindow.document.height) 
	{
		var iframeElement = document.getElementById
		(iframeWindow.name);
		iframeElement.style.height = iframeWindow.document.height + 'px';
		iframeElement.style.width = iframeWindow.document.width + 'px';
	}
	else if (document.all) 
	{
		var iframeElement = document.all[iframeWindow.name];
		if (iframeWindow.document.compatMode &&
		iframeWindow.document.compatMode!= 'BackCompat')
		{
			iframeElement.style.height =
			iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
			iframeElement.style.width =
			iframeWindow.document.documentElement.scrollWidth + 5 + 'px';
		}
		else 
		{
			iframeElement.style.height =
			iframeWindow.document.body.scrollHeight + 5 + 'px';
			iframeElement.style.width =
			iframeWindow.document.body.scrollWidth + 5 + 'px';
		}
	}
}
