<!--
/*
*	setStyle()
*
*	Stel een CSS style of class in voor een object met een ID.
*	
*	id		varchar		Het ID van het object.
*	style	varchar		De style die aangepast moet, bijv: backgroundColor
*	value	varchar		Nieuwe waarde die `style` moet krijgen, bijv: #FFF
*
*	Voorbeelden:
*		onClick="setStyle('menu','class','knopuit');"
*		onMouseOver="setStyle('knop1','backgoundColor','#ff0000');"
*/
function setStyle( id, style, value ) {
	
	var obj = document.getElementById( id );

	if( style == 'class' ) {
		obj.className = value;
	}
	else {
		obj.style[style] = value;
	}
}


/**
*	areYouSure()
*
*	Popup de vraag of het echt weg moet?
*	Ja:		Redirect naar delete.php
*	Nee:	Geen actie
*/
function areYouSure(uri){
	if(confirm("Weet u zeker dat u deze pagina, inclusief ALLE \nsub-pagina's, definitief wilt verwijderen?")){
		document.location.href = uri;
	}
}


/**
*	switchDiv
*
*	Maakt een bepaalde div wel of niet zichtbaar.
*/
function switchDiv(lang)
{
	var langs = new Array;
	langs[0]='nl'; langs[1]='en'; langs[2]='de'; langs[3]='fr'; langs[4]='es';
		for (i=0; i<langs.length; i++)
	{
		var l = langs[i];
		if (l == lang)
		{
			setStyle('lang-'+l, 'display', 'block');
			setStyle('knop-'+l, 'class', 'selected');
		}
		else
		{
			setStyle('lang-'+l, 'display', 'none');
			setStyle('knop-'+l, 'class', '');
		}
	}
}


/**
*	previewImg
*
*	Preview een afbeelding in een bepaalde DIV.
*/
function previewImg(img, div, std)
{
	if (img != '')
	{
		var html = '<img src="../../images/'+img+'" alt="">';	
	}
	else
	{
		var html = '<img src="../img/'+std+'" alt="Geen afbeelding">';
	}

	document.getElementById(div).innerHTML = html;
}


/**
*	previewImg
*
*	Preview een afbeelding in een bepaalde DIV.
*/
function showImage(img, div, std)
{
	if (img != '')
	{
		var html = '<img src="../images/forsale/'+img+'" height="300" alt="">';
	}
	else
	{
		var html = '<img src="../images/forsale/'+std+'" height="300" alt="Geen afbeelding">';
	}

	document.getElementById(div).innerHTML = html;
}


/**
*	populateFields()
*
*	Set the values of <input> fields.
*/
function populateField(fld, str, dflt)
{
	var tmp = document.getElementById(fld).value;
	if (tmp == dflt)
	{
		document.getElementById(fld).value = str;
	}
}

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 670;
defaultHeight = 670;

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;
//PositionX = (screen.width - defaultWidth) / 2;
//PositionY = (screen.width - defaultHeight) / 2;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}
