// JavaScript Document

function openpop(f,n,w,h,i){
	x=(screen.availWidth-w) / 2; y=((screen.availHeight-h) / 2)-10;
	var BEpop=window.open(f,n,'width='+w+',height='+h+','+i+',top='+y+',left='+x+',screenY='+y+',screenX='+x);
	if(BEpop) { BEpop.focus();
	}else{ alert("Popups moeten aanstaan voor deze functie.");}
}

function showinf(id){
	FindIt("infdiv"+id).style.visibility = "visible";
}
		
function hideinf(id){
  FindIt("infdiv"+id).style.visibility = "hidden";
}



function showDictionary(DIVid,dir){
	if(dir==1){
		FindIt(DIVid).style.display = "block";
	}else{
		FindIt(DIVid).style.display = "none";
	}
}


// the money function ------------------------------------------		
		function money(Mnum)
			{
				Mnum = Math.round(Mnum*100)/100;
				Mnum = ''+Mnum+'';
								
				if(Mnum == '' || Mnum == '0') { Mnum = '0,00'; }else{
				Mafter = Mnum.split('.'); 
				
				MCount = Mafter.length
			
				if(MCount == 2)
					{
						Mlength = Mafter[1].length;
						if (Mlength == 1)
						{
							Mnum = Mnum+'0';	
						}
					}else{
						Mnum = Mnum+'.00';
					}

				Mnum = Mnum.replace('.',',');
				}
				
				return Mnum;
			}
 // end money function ------------------------------------------
 
 
 function preloadImages() {
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}
 
