function popup_xl(aimage,ai,atot,atitle,asubtitle) {
	var html = '';
	var aprev = '';
	var anext = '';
	var leeg = '';
	var aimg = '';
	var i = 0;
    var boxWidth = 400;
    var boxHeight = 440;
    i = parseInt(ai) - 1;
    if(i >= 0) {
		aimg = document.getElementById('th'+i).src;
		aimg = aimg.substring(aimg.lastIndexOf('/')+1);
		aprev = "<a href=javascript:popup_xl(\'" + aimg + "\'," + i + "," + atot + ",\'" + document.getElementById('th'+i).title + "\',\'\');> <b><</b> </a>";
		}
    i = parseInt(ai) + 1;
    if(i <= atot) {
		aimg = document.getElementById('th'+i).src;
		aimg = aimg.substring(aimg.lastIndexOf('/')+1);
		anext = "<a href=javascript:popup_xl(\'" + aimg + "\'," + i + "," + atot + ",\'" + document.getElementById('th'+i).title + "\',\'\');> <b>></b> </a>";
		aimg = "<a href=javascript:popup_xl(\'" + aimg + "\'," + i + "," + atot + ",\'" + document.getElementById('th'+i).title + "\',\'\');> <img id=\"xl_image\" src=\'images/th/" + aimage + "\' height=400 border=0/> </a>";
		}
	else {
		aimg = "<a href=javascript:close_xl();><img id=\"xl_image\" src=\'images/th/" + aimage + "\' height=400 border=0 /></a>"
		}
	html = 
		'<table width="400" height="50" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">' +
		'<tr><td width="80%"></td></tr>' +
		'<tr>' +
		'<td align="center" height="100%">' + 
		'<table width="400">' +
		'<tr><td></td><td align="right"><a href="javascript:close_xl();"> <b>X</b> </a></td></tr>' +
		'<tr>' +
		'<td width="10%">' + aprev + '</td>' +
		'<td width="80%" align=center>' + aimg + '</td>' +
		'<td width="10%" align=right>' + anext + '</td>' +
		'</tr>' +
		'<tr><td></td><td align="left"><font size="-2">' + atitle + '</font>'
	html = html + 		
		'</td></tr></table>' +
		'</td>' +
		'</tr>' +
		'</table>'
	document.getElementById('xl').innerHTML = html;

	var body = getDocumentBody();
	var iLeft = (body.clientWidth - boxWidth) / 2 - 200;
	var iTop = (body.clientHeight - boxHeight) / 2 + 100;
	if(iTop >= 30) iTop -= 20;

	var contentHolder = document.getElementById('xl');

	contentHolder.style.left = iLeft + getScrollLeft();
	contentHolder.style.top = iTop + getScrollTop();
	contentHolder.style.width = boxWidth;
	contentHolder.style.height = boxHeight;

	contentHolder.style.visibility = 'visible';
	}
	
function close_xl(){document.getElementById('xl').style.visibility='hidden';}


function getDocumentBody(){return document.body||document.documentElement;}

function getScrollLeft(){
	var result = 0;
	var body = document.body;
	var docEl = document.documentElement;
	// Netscape compliant:
	if(classOf(window.pageYOffset) == 'Number') {result = window.pageXOffset;}
	// DOM compliant:
	else if(body && body.scrollLeft) {result = body.scrollLeft;}
	// IE6 standards compliant mode:
	else if(docEl && docEl.scrollLeft) {result = docEl.scrollLeft;}
	return result;
      }
function getScrollTop(){
	var result = 0;
	var body = document.body;
	var docEl = document.documentElement;
	// Netscape compliant:
	if(classOf(window.pageYOffset) == 'Number') result = window.pageYOffset;
	// DOM compliant:
	else if(body && body.scrollTop) result = body.scrollTop;
	// IE6 standards compliant mode:
	else if(docEl && docEl.scrollTop) result = docEl.scrollTop;
	return result;
      }
function classOf(o){
	//if(o == undefined) return "undefined"; // Is X-Browser safe ?
	//if(o == null) return "null"; // Is X-Browser safe ?
	if(!o) return "null";
	var type = new Object().toString.call(o);
	return type.slice(8,-1); // slice Class from "[Object Class]";
      }
	
function delConfirm(url){if(confirm('ben je zeker dat je dit wil verwijderen?')){document.location=url;}}

function CheckAndForward(message,url){if(confirm(message)){document.location=url;}}

function showCalendar(){document.getElementById('div_calendar').style.visibility='visible';} 
	
function pasteCalendar()
	{	alert(document.getElementById('div_calendar').attributes.valueOf);
		//document.getElementById('txt_verjaardag').text = document.getElementById('div_calendar').value;
	}
	
	
function swapImgRestore() {
	var i, x, a = document.imgs;
	for(i=0; a && i<a.length && (x = a[i]) && x.oSrc; i++){
		x.src = x.oSrc;
	}
}

function preloadImages(imgs) {
	var d = document;
	if(d.images){
		if(!d.pimgs) d.pimgs = new Array();
		var i, j = d.pimgs.length;
		for(i=0; i<imgs.length; i++){
			d.pimgs[j] = new Image;
			d.pimgs[j++].src = imgs[i];
		}
	}
}

function findObj(n, d) {
	var p,i,x;
	if(!d) d=document;
	if((p = n.indexOf("?")) > 0 && parent.frames.length){
		d = parent.frames[n.substring(p+1)].document;
		n = n.substring(0,p);
	}
	if(!(x = d[n]) && d.all) x = d.all[n];
	for(i=0; !x && i < d.forms.length; i++) x = d.forms[i][n];
	for(i=0; !x && d.layers && i < d.layers.length; i++) x = findObj(n, d.layers[i].document);
	if(!x && d.getElementById) x = d.getElementById(n);
	return x;
}

function swapImage(imgName, arg1, rollOver, arg3) {
	var i, j = 0, x, a = [imgName, arg1, rollOver, arg3];
	document.imgs = new Array;
	for(i = 0; i < (a.length-2); i+=3){
		if ((x = findObj(a[i])) != null){
			document.imgs[j++] = x;
			if(!x.oSrc) x.oSrc = x.src;
			x.src = a[i+2];
		}
	}
}

function openShopMap(event,long,lat){
	var w;
	w=window.open(hosturl+'dsp_googlemap.cfm?geo_long='+long+'&geo_lat='+lat,'gmap','toolbar=1,status=0,location=0,scrollbars=0,width=640,height=480');
	return false;
}

function verzenden()
	{	document.frmContact.submit();
//	alert('tel='+document.frmContact.txtTel.value+'');
//	if (document.frmContact.txtTel.value=='' || document.frmContact.txtName.value=='' || document.frmReserv.txtEmail.value=='' || document.frmReserv.txtSelect.value=='' || document.frmReserv.txtStatus.value=='')
//		{	alert('Alle velden met * invullen aub');
//			return;
//		}
//	else
//		{	//alert('alles ingevuld');
//			document.frmContact.submit();
//		}
	}	



//ADMIN

function Bewaren()
	{
	document.frmContent.submit();
	}

function delConfirm(id,type)
	{
	if (confirm('ben je zeker dat je dit project wil verwijderen?'))
		{	document.location='admin.asp?wp=2&a=1&p='+id+'&type='+type;
		}
	else
		{	
		}
	}


function delConfirmFoto(pid,lngtype,fotoid)
	{
	if (confirm('ben je zeker dat je deze foto wil verwijderen?'))
		{	document.location='admin.asp?wp=4&a=1&p='+pid+'&type='+lngtype+'&f='+fotoid;
		}
	else
		{	
		}
	}
