function lib_bwcheck()
{
	this.ver = navigator.appVersion;
	this.agent = navigator.userAgent;
	this.dom = document.getElementById?1:0;
	this.print = window.print?1:0;
	this.opera5 = this.agent.indexOf("Opera 5")>-1;
	this.ie5 = (this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6 = (this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4 = (document.all && !this.dom && !this.opera5)?1:0;
	this.ie = this.ie4||this.ie5||this.ie6;
	this.mac = this.agent.indexOf("Mac")>-1;
	this.ns6 = (this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4 = (document.layers && !this.dom)?1:0;
	this.bw = (this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5);
	return this;
}
var bw = new lib_bwcheck();

function handleOver()
{
    el = window.event.srcElement;
    if (el.tagName == "IMG") //Check if over image
        if ((el.overSrc != null) && (el.overSrc != "")) //check if valid overSrc
        { 
            if(el.srcOri == null) el.srcOri = el.src;
            el.srcBackup = el.src; //Back up the src
            el.src = el.overSrc;
        }
}
function handleOut()
{
    el = window.event.srcElement;
    if(el.tagName == "IMG") //Check if over image
        if((el.overSrc != null) && (el.overSrc != "") && (el.srcBackup != null)) //Also check for valid backup
            el.src = el.srcBackup;
}
if(bw.ie) {
	document.onmouseover=handleOver;
	document.onmouseout=handleOut;
}

function MM_openBrWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}

function IsDigit() {
	return ((event.keyCode > 47) && (event.keyCode < 58));
}

function ShowNewPhoto(p_strElement,p_arrImageSmall,p_arrImageBig,p_intPosition)
{
	if(p_intPosition >= 0 && p_intPosition < p_arrImageSmall.length)
		m_intPhotoPosition = p_intPosition;
	else if(p_intPosition == p_arrImageSmall.length)
		m_intPhotoPosition = 0;
	else if(p_intPosition == -1)
		m_intPhotoPosition = p_arrImageSmall.length-1;

	ShowSmallImage(p_strElement,p_arrImageSmall[m_intPhotoPosition],p_arrImageBig[m_intPhotoPosition]);
	document.getElementById('PhotoCount').innerHTML = m_intPhotoPosition + 1;
}

function SetPageInLayer(p_strUrl, p_strLayer, p_strIframe)
{
	ShowElement(p_strLayer,0);
	document.getElementById(p_strLayer).filters(0).Apply();
	document.getElementById(p_strLayer).filters(0).Play();
	document.getElementById(p_strIframe).src = p_strUrl;
}

function ShowSmallImage(lcElement,lcImageSmall,lcImageBig){
	if(!llImageLoaded){
		return false;
	}else{
		llImageLoaded = false;
	
		loImageSmall = new Image();
		loImageSmall.src = lcImageSmall;
		
		if(loImageSmall.height>0 && loImageSmall.height != null){
			Loaded();
		}else{
			loImageSmall.onload = Loaded;
		}
	}
	function Loaded(){
		llImageLoaded = true;
		document.getElementById(lcElement).big = lcImageBig;
		/*document.getElementById(lcElement).filters(0).Apply();
		document.getElementById(lcElement).filters(0).Play();*/
		Slide(lcElement,lcImageSmall,loImageSmall.height,document.getElementById(lcElement).height,10);
	}
}

function Slide(lcElement,lcImage,lnMinMaxHeight,lnCurrentHeight,lnSpeed){
	/*
	if(lnMinMaxHeight > 200){
		ShowBigImage(lcImage);
		return true;
	}
	*/
	
	if(lnCurrentHeight < lnMinMaxHeight){
		if(lnCurrentHeight+lnSpeed > lnMinMaxHeight){
			lnCurrentHeight = lnMinMaxHeight;
		}else{
			lnCurrentHeight = lnCurrentHeight + lnSpeed;
		}
		document.getElementById(lcElement).src = lcImage;
		document.getElementById(lcElement).height = lnCurrentHeight;
		setTimeout('Slide("'+lcElement+'","'+lcImage+'",'+lnMinMaxHeight+','+lnCurrentHeight+','+lnSpeed+')', 1);
	}else if(lnCurrentHeight > lnMinMaxHeight){
		if(lnCurrentHeight-lnSpeed < lnMinMaxHeight){
			lnCurrentHeight = lnMinMaxHeight;
		}else{
			lnCurrentHeight = lnCurrentHeight - lnSpeed;
		}
		document.getElementById(lcElement).src = lcImage;
		document.getElementById(lcElement).height = lnCurrentHeight;
		setTimeout('Slide("'+lcElement+'","'+lcImage+'",'+lnMinMaxHeight+','+lnCurrentHeight+','+lnSpeed+')', 1);
	}else{
		document.getElementById(lcElement).src = lcImage;
	}

}

function Uword(lcWord){
	var lcRet = "";
	lcRet = lcWord.substring(0,1).toUpperCase();
	lcRet = lcRet+lcWord.substring(1,lcWord.length);
	return lcRet;
}

function DateStyle(lcDate){
	var lcRet = lcDate;
	/*
	var lnCode = event.keyCode;
	if (lnCode != 8){
		if (lcDate.length==2 || lcDate.length==5){
			lcRet = lcDate+"-";
		} else {
			lcRet = lcDate.substring(0,10);
		}
	}
	*/
	return lcDate;
}

function GetPage(strUrl,strQueryString)
{
	if(typeof window.activexobject == "undefined")
	{
		objXml = new ActiveXObject("Microsoft.XMLHTTP");
		objXml.Open("POST", strUrl, false, "", "");
		objXml.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		objXml.setRequestHeader("User-Agent", "RequestStreetAndTown");
		objXml.Send(strQueryString);
		return objXml.responseText;
	} 
	else
	{
		return "";
	}
}

function GetStreetAndTown(p_strZipCode,p_strHouseNumber,p_strStreet,p_strTown)
{
	var l_oZipCode = document.getElementById(p_strZipCode);
	var l_oHouseNumber = document.getElementById(p_strHouseNumber);
	var l_oStreet = document.getElementById(p_strStreet);
	var l_oTown = document.getElementById(p_strTown);

	var l_strStreet = l_oStreet.value;
	var l_strTown = l_oTown.value;
	
	if(l_oZipCode.value != "" && l_oHouseNumber.value != "")
	{
		CreateIframe("GetStreetAndTown.aspx?ZipCode=" + l_oZipCode.value + "&HouseNumber=" + l_oHouseNumber.value + "&FieldZipCode=" + p_strZipCode + "&FieldHouseNumber=" + p_strHouseNumber + "&FieldStreet=" + p_strStreet + "&FieldTown=" + p_strTown);
		if(l_oStreet.value == "")
			l_oStreet.value = l_strStreet;
		if(l_oTown.value == "")
			l_oTown.value = l_strTown;
	}

	function CreateIframe(p_strUrl)
	{
		this.frameName = 'FileLoader' + this.id;
		if(document.all)
		{
			var l_strHtml = '';
			l_strHtml += '<IFRAME ID="' + this.frameName + '"';
			l_strHtml += ' NAME="' + this.frameName + '"';
			l_strHtml += ' STYLE="display: none;"';
			l_strHtml += ' SRC="' + p_strUrl + '">';
			l_strHtml += '<\/IFRAME>';
			document.body.insertAdjacentHTML('beforeEnd', l_strHtml);
		}
		else if(document.getElementById)
		{
			var l_oIframe = document.createElement('IFRAME');
			l_oIframe.id = l_oIframe.name = this.frameName;
			l_oIframe.style.display = 'none';
			l_oIframe.src = p_strUrl;
			document.body.appendChild(l_oIframe);
		}
	}
}

function ChangeStyle(lcIdentifier,lcClass) {
	if(typeof lcIdentifier == "object") {
		lcIdentifier.className=lcClass;
	} else {
		var oField = new getObject(lcIdentifier);
		if(oField.obj.length != 0) {
			for(i=0;i<oField.obj.length;i++) 
				oField.obj[i].className = lcClass;
		}
		else
			oField.obj.className = lcClass;
	}
}

function CheckEmail(cAddress)
{
	var validRegExp = /^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-z]{2,6}$/i;
	
	if(cAddress.search(validRegExp) == -1)
	{
		return false;
	}
	if(cAddress.indexOf("@") == -1)
		return false;
	if(AmpersandInString(cAddress))
		return false;
	return true;
}

function ShowElement(cElement,nCount,lInfo) {
	//var oElement=document.getElementsByName(cElement)[nCount].style;
	var oElement = new getObject(cElement);
	oElement = nCount==0?oElement.style:document.getElementsByName(cElement)[nCount].style;
	if(lInfo) return oElement.display;
	else {
		if(oElement.display=="none") oElement.display='';
		else oElement.display="none";
	}
}

function ToggleIcon(cElement,nCount,oIcon,cSrc) {
	var oElement=document.getElementsByName(cElement)[nCount].style;
	if(oElement.display=="none") oIcon.src=cSrc+'close.gif';
	else oIcon.src=cSrc+'open.gif';
}

function SyncInput(oInput) {
	var aInput = document.getElementsByName(oInput.id);
	for(i=0;i<aInput.length;i++) {
		if(oInput.sourceIndex!=aInput[i].sourceIndex) {
			switch(aInput[i].tagName) {
				case "INPUT":
					aInput[i].value=oInput[oInput.selectedIndex].value;
					break;
				case "SELECT":
					aInput[i].selectedIndex=oInput[oInput.selectedIndex].index;
					break;
			}		
		}
	}	
}

function AmpersandInString(cString)
{
	return (cString.indexOf("&")>-1);
}

function QuoteInString(cString)
{
	return (cString.indexOf("'")>-1);
}
//checkdate controlleerd of een datum een bestaande datum is.
//input : a - datum(dmj)
//output: 1 - datum bestaat, 0 - datum is incorrect
//checkdate is gegarandeerd tot 2100. Want 2100 is deelbaar door
//100 maar niet door 400 en is dus geen schrikkeljaar.
function checkdate(a){
//	window.onerror=null // for all other strange errors
	var err=0;
	var psj=0;
	var t=0,tt=0;

	if(a.length == 10)
	{
		//dag
		while (t<=10 && ((a.substring(t,t+1) != '/') && (a.substring(t,t+1) != '-') && (a.substring(t,t+1) != '.') && (a.substring(t,t+1) != '\\')))
		{t++}
		b = a.substring(0,t);
		c = a.substring(t,t+1);
		tt = ++t;

		//maand
		while (t<=10 && ((a.substring(t,t+1) != '/') && (a.substring(t,t+1) != '-') && (a.substring(t,t+1) != '.') && (a.substring(t,t+1) != '\\')))
		{t++}
		d = a.substring(tt,t);
		e = a.substring(t,t+1);
		tt = ++t;

		//jaar
		while (t<=10 && ((a.substring(t,t+1) != '/') && (a.substring(t,t+1) != '-') && (a.substring(t,t+1) != '.') && (a.substring(t,t+1) != '\\')))
		{t++}
		f = a.substring(tt,t);

		//basic error checking
		if (isNaN(b)) err=1
		if (isNaN(d)) err=1
		if (isNaN(f)) err=1
		if (b<1 || b>31) err = 1
		if ((c != '/') && (c != '-') && (c != '.') && (c != '\\')) err = 1
		if (d<1 || d>12) err = 1
		if ((e != '/') && (e != '-') && (c != '.') && (c != '\\')) err = 1
		if (!(1000<f && f<9999)) err = 1

		//advanced error checking

		// months with 30 days
		if(d==4 || d==6 || d==9 || d==11) {
			if (b==31) err=1
		}

		// february, leap year
		if(d==2) {
			var g=parseInt(f/4)
			if (isNaN(g)) {
				err=1
			}
			if (b>29) err=1
			if (b==29 && ((f/4)!=parseInt(f/4))) err=1
			if (b==29 && ((f/100)==parseInt(f/100)) && ((f/400)!=parseInt(f/400))) err=1
		}
	}
	else
	{
		err = 1;
	}

	if (err==1)
	{
		return(0); //incorrect date
	}
	else
	{
		return(1); //date OK
	}
}

// SEARCH AND COOKIE FUNCTIONS ////////////////////////////////////////////////////////////////////
function ChangeArea(nCountry) {
	doc.Area.length=1;
	doc.Area.options[doc.Area.length-1].value='';
	doc.Area.options[doc.Area.length-1].text="Gebied";
	for(i=0;i<aArea.length;i++) {
			var aTmp=aArea[i].split(",");					
			if(aTmp[0]*1==nCountry) {
				doc.Area.length++;
  			doc.Area.options[doc.Area.length-1].value=aTmp[1];
   			doc.Area.options[doc.Area.length-1].text=aTmp[2];
			}
	}
}

// functions for in Search
function SaveCriteria(cName,cValue) {
	var today = new Date();
	var expires = new Date();
	expires.setTime(today.getTime()+1000*60*60*24*365);
	SetCookieItem(cName,cValue);
	return true;
}

function SetCriteriaDirectly(tcValue,tcName) {
  var lcValue=tcValue;
  if(lcValue != null) {
		if(eval(tcName + ".type") == 'select-one' || eval(tcName + ".type") == 'select')
		{
   		for(var i=0; i < eval(tcName+'.length'); i++) {
				if(eval(tcName+'.options[i].text==lcValue') || eval(tcName+'.options[i].value==lcValue')) {
					eval(tcName+'.selectedIndex=i');
				}
   		}
   	}
   	else
   	{
   		eval(tcName + ".value = '" + lcValue + "'");
   	}   
  }
}

function SetCriteria(tcCookie,tcName) {
  var lcValue=GetCookieItemValue(tcCookie);
  if(lcValue != null) {
		if(eval(tcName + ".type") == 'select-one' || eval(tcName + ".type") == 'select')
		{
   		for(var i=0; i < eval(tcName+'.length'); i++) {
				if(eval(tcName+'.options[i].text==lcValue') || eval(tcName+'.options[i].value==lcValue')) {
					eval(tcName+'.selectedIndex=i');
				}
   		}
   	}
   	else
   	{
   		eval(tcName + ".value = '" + lcValue + "'");
   	}   
  }
}

function SetInputValue(tcCookie,tcName,tcType) {
	var lcValue=GetCookieItemValue(tcCookie);
	if(lcValue != null && lcValue != 'undefined') {
		switch(tcType.toLowerCase()) {
			case "text":
				eval(tcName+'.value=lcValue');
				break;
			case "checkbox":
				eval(tcName+'.checked='+lcValue);
				break;
			case "radio":
				eval(tcName+'['+lcValue+'].checked=true');
				break;
			case "select":
				SetCriteria(tcCookie,tcName);
				break;
			default: 
				alert("unknown type");
		}
  }
}

function SetCookieItem(name, value, expires, path, domain, secure) {
	var CookieItem = name + "=" + escape(value);
	CookieItem += ((expires) ? "; expires=" + expires.toGMTString() : "");
	CookieItem += ((path) ? "; path=" + path : "");
	CookieItem += ((domain) ? "; domain=" + domain : "");
	CookieItem += ((secure) ? "; secure" : "");
	// this actually adds or replaces the item! surprise behaviour.
	document.cookie = CookieItem;
}

function GetCookieItemValue(name)
{
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf(prefix);
	var end;
	
	if (begin == -1)
		return null;
	begin += prefix.length;
		
	end = document.cookie.indexOf(";", begin);
	if (end == -1)
		end = dc.length;

	return unescape(dc.substring(begin, end));
}

// END SEARCH AND COOKIE FUNCTIONS ////////////////////////////////////////////////////////////////

function CheckEmail(cAddress)
{
	var validRegExp = /^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-z]{2,6}$/i;
	
	if(cAddress.search(validRegExp) == -1)
	{
		return false;
	}
	if(cAddress.indexOf("@") == -1)
		return false;
	if(AmpersandInString(cAddress))
		return false;
	return true;
}

function AmpersandInString(cString)
{
	return (cString.indexOf("&")>-1);
}

function QuoteInString(cString)
{
	return (cString.indexOf("'")>-1);
}			

// Form Checks
function IsArray(obj){return(typeof(obj.length)=="undefined")?false:true;}

function ReadRadio(lcField) {
	if(IsArray(lcField)) {
		for(var i=0;i<lcField.length;i++) {	
			if(lcField[i].checked == true) {
				lcValue = lcField[i].value;
				break;
			} else {
				lcValue = "";
			}
		}
	}else{
		if (lcField.checked == true) {
			lcValue = lcField;
		} else {
			lcValue = "";
		}
	}
	return lcValue;
}

function AgeCheck(pBirthDate, pMaxAge) {
	if(checkdate(pBirthDate)) {
		var dCurrentDate = new Date();
		var aBirthDate = pBirthDate.split('-');	
		var iYearDiff = dCurrentDate.getFullYear()-parseInt(aBirthDate[2]);
		var iMonthDiff = (dCurrentDate.getMonth()+1)-parseInt(aBirthDate[1]);
		var iDayDiff = dCurrentDate.getDate()-parseInt(aBirthDate[0]);	
		if(iYearDiff > pMaxAge) {
			return true;
		}
		else {
			if(iYearDiff==pMaxAge&&iMonthDiff>0) {return true;}
			else {
				if(iMonthDiff==0&&iDayDiff>=0) {return true;}
			}
		}
	}
	return false;
}

function IsMinOneChecked(p_oCheckbox)
{
	var l_blnChecked = false;

	if(!IsArray(p_oCheckbox))
	{
		if(p_oCheckbox.type == "checkbox")
			if(p_oCheckbox.checked)
				l_blnChecked = true;
		if(p_oCheckbox.type == "hidden")
			if(p_oCheckbox.value != "")
				l_blnChecked = true;
	}
	else
	{
		for(i = 0; i <= p_oCheckbox.length-1; i++)
		{
			if(p_oCheckbox[i].type == "checkbox")
				if(p_oCheckbox[i].checked)
					l_blnChecked = true;
			if(p_oCheckbox[i].type == "hidden")
				if(p_oCheckbox[i].value != "")
					l_blnChecked = true;
		}
	}
		
	return l_blnChecked;
}

var llImageLoaded = true;

function GetOption(p_oSelectObject,p_oInputText,p_oInputValue,p_oEditButton,p_intOptionRank)
{
	var l_blnSuccess = false;
	
	if(p_intOptionRank == null)
		p_intOptionRank = p_oSelectObject.selectedIndex;
	
	if(p_intOptionRank != -1)
	{
		p_oInputText.value = p_oSelectObject.options[p_intOptionRank].text;
		p_oInputValue.value = p_oSelectObject.options[p_intOptionRank].value;
		p_oEditButton.style.display = '';
		l_blnSuccess = true;
	}
	else
	{
		p_oEditButton.style.display = 'none';
	}
	
	return l_blnSuccess;
}

function AddOption(p_oSelectObject,p_strOptionText,p_strOptionValue,p_oEditButton)
{
	var l_blnSuccess = false;
	
	if(p_strOptionText != "" && p_strOptionValue != "")
	{
		if(p_oEditButton != null)
		{
			var l_oOptionObject = new Option(p_strOptionText,p_strOptionValue);
			var l_intOptionRank = p_oSelectObject.selectedIndex;
			p_oSelectObject.options[l_intOptionRank] = l_oOptionObject;

			p_oEditButton.style.display = 'none';

			l_blnSuccess = true;
		}
		else
		{
			if(!ReCheck(p_oSelectObject,p_strOptionText,p_strOptionValue))
			{
				var l_oOptionObject = new Option(p_strOptionText,p_strOptionValue);
				var l_intOptionRank = p_oSelectObject.options.length;
				p_oSelectObject.options[l_intOptionRank] = l_oOptionObject;
				l_blnSuccess = true;
			}
		}
	}
	
	return l_blnSuccess;
}

function DeleteOption(p_oSelectObject,p_oEditButton,p_intOptionRank)
{
	var l_blnSuccess = false;
	
	if(p_intOptionRank == null)
		p_intOptionRank = p_oSelectObject.selectedIndex;
	
	if(p_oSelectObject.selectedIndex != -1)
	{
		if(p_oSelectObject.options.length != 0)
		{
			p_oSelectObject.options[p_intOptionRank] = null;
			l_blnSuccess = true;
		}
	}
	
	p_oEditButton.style.display = 'none';
	
	return l_blnSuccess;
}

function ReCheck(p_oSelectObject, p_strOptionText, p_strOptionValue)
{ 
	var l_blnSuccess = false;
	
	for(i = 0; i < p_oSelectObject.options.length; i++)
	{
		if(p_strOptionText == p_oSelectObject.options[i].text || p_strOptionValue == p_oSelectObject.options[i].value)
		{
			l_blnSuccess = true;
			break;
		}
	}
	
  return l_blnSuccess;
}

function IsNumeric(text)
{
	if(text.length <= 0)
		return false;

	var ValidChars = "0123456789.";
	var IsNumber=true;
	var Char;

	for (i = 0; i < text.length && IsNumber == true; i++){ 
		Char = text.charAt(i); 
		if (ValidChars.indexOf(Char) == -1){
			IsNumber = false;
		}
	}
	return IsNumber;
}

function URLEncode(plaintext)
{
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";

	var encoded = "";
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";				// x-www-urlencoded, rather than %20
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
			    alert( "Unicode Character '" 
                        + ch 
                        + "' cannot be encoded using standard URL encoding.\n" +
				          "(URL encoding only supports 8-bit characters.)\n" +
						  "A space (+) will be substituted." );
				encoded += "+";
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	} // for

	return encoded;
	//return false;
};

function URLDecode(encoded)
{
   // Replace + with ' '
   // Replace %xx with equivalent character
   // Put [ERROR] in output if %xx is invalid.
   var HEXCHARS = "0123456789ABCDEFabcdef"; 
	//var encoded = document.URLForm.F2.value;
   var plaintext = "";
   var i = 0;
   while (i < encoded.length) {
       var ch = encoded.charAt(i);
	   if (ch == "+") {
	       plaintext += " ";
		   i++;
	   } else if (ch == "%") {
			if (i < (encoded.length-2) 
					&& HEXCHARS.indexOf(encoded.charAt(i+1)) != -1 
					&& HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) {
				plaintext += unescape( encoded.substr(i,3) );
				i += 3;
			} else {
				alert( 'Bad escape combination near ...' + encoded.substr(i) );
				plaintext += "%[ERROR]";
				i++;
			}
		} else {
		   plaintext += ch;
		   i++;
		}
	} // while
   return plaintext;
   //return false;
};

function getObject(name) {
	// usage: var x = new getObject('aap');
	// x.obj.value = 'aap' etc. of x.style
	
  if (document.getElementById) {
  	if(document.getElementById(name) != null) {
  		this.obj = document.getElementById(name);
			this.style = document.getElementById(name).style;
		}	else if(document.getElementsByName(name) != null) {	
			this.obj = document.getElementsByName(name);
			this.style = document.getElementsByName(name).style;
		}
  }
  else if (document.all) {
		this.obj = document.all[name];
		this.style = document.all[name].style;
  }
  else if (document.layers) {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function ShowBigImage(lcImageBig,lcComment) {
	if(llImageBigLoaded) {
		llImageBigLoaded = false;
		loImageBig = new Image();
		loImageBig.src = lcImageBig;
		if(loImageBig.height>0 && loImageBig.height != null)
			Loaded();
		else
			loImageBig.onload = Loaded;
	}
	else {
		//alert("Er is al een image aan het laden...");
	}
	function Loaded() {
		llImageBigLoaded = true;
		lnWidth = loImageBig.width;
		lnHeight = loImageBig.height;
		if(typeof lcComment != "undefined") lnHeight+=60;
		consoleRef = window.open('','popup','width='+lnWidth+',height='+lnHeight+',menubar=0,toolbar=0,status=0,scrollbars=auto,resizable=0');
		consoleRef.document.writeln('<html><head>');
		consoleRef.document.writeln('<title>'+document.title+'</title></head>');
		consoleRef.document.writeln('<body style="margin:0px">');
		consoleRef.document.writeln('<a href="JavaScript:close()"><img src="'+loImageBig.src+'" border="0"></a>');
		if(typeof lcComment != "undefined")
			consoleRef.document.writeln('<center><font face="Arial" size="2"><b>'+lcComment+'</b></font></center>');
		consoleRef.document.writeln('</body></html>');
		consoleRef.document.close();
	}
}
var llImageBigLoaded = true;

//Extra code to find position:
function findPos(oElement) {
  if(bw.ns4){   //Netscape 4
    x = document.layers.layerMenu.pageX
    y = document.layers.layerMenu.pageY
  }else{ //other browsers
    x=0; y=0; var el,temp
    el = bw.ie4?document.all[oElement]:document.getElementById(oElement);
    if(el.offsetParent){
      temp = el
      while(temp.offsetParent){ //Looping parent elements to get the offset of them as well
        temp=temp.offsetParent; 
        x+=temp.offsetLeft
        y+=temp.offsetTop;
      }
    }
    x+=el.offsetLeft
    y+=el.offsetTop
  }
  //Returning the x and y as an array
  return [x,y]
}