// JavaScript Document

// BROWSERDETECTIE
var d, dom, ie, ie4, ie5x, moz, mac, win, lin, old, ie5mac, ie5xwin, op;

d = document;
n = navigator;
na = n.appVersion;
nua = n.userAgent;
win = ( na.indexOf( 'Win' ) != -1 );
mac = ( na.indexOf( 'Mac' ) != -1 );
lin = ( nua.indexOf( 'Linux' ) != -1 );

if ( !d.layers ){
	dom = ( d.getElementById );
	op = ( nua.indexOf( 'Opera' ) != -1 ); 					// OPERA
	konq = ( nua.indexOf( 'Konqueror' ) != -1 ); 			// KONQUEROR (LINUX)
	saf = ( nua.indexOf( 'Safari' ) != -1 ); 				// SAFARI (MAC)
	moz = ( nua.indexOf( 'Gecko' ) != -1 && !saf && !konq); // FIREFOX
	ie = ( d.all && !op ); 									// IE < 4 --- ??? ---
	ie4 = ( ie && !dom ); 									// IE 4

	/*
	ie5x tests only for functionality. ( dom||ie5x ) would be default settings. 
	Opera will register true in this test if set to identify as IE 5
	*/

	ie5x = ( d.all && dom ); 								// IE 5 
	ie5mac = ( mac && ie5x ); 								// IE 5 (MAC)
	ie5xwin = ( win && ie5x ); 								// IE 5 (WIN)
}

// ------------------------------------------------------------------------------------------

// SCHERMGROOTTE BEPALEN
var myHeight = 0, myWidth = 0, boolImg = 1;

if( typeof( window.innerWidth ) == 'number' ) {
	//Non-IE
	myWidth = window.innerWidth;
	myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || 
												document.documentElement.clientHeight ) ) {
	//IE 6+ in 'standards compliant mode'
	myWidth = document.documentElement.clientWidth;
	myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	//IE 4 compatible
	myWidth = document.body.clientWidth;
	myHeight = document.body.clientHeight;
}

// ------------------------------------------------------------------------------------------

// AFBEELDINGEN ALLEEN NAAST NAVIGATIEBALK ZETTEN ALS HET VENSTER GROOT GENOEG IS
if(myWidth < 920) {
	boolImg = 0;
}

function imgInvoegen() {
	//if(boolImg) {
	//	document.write('<td align="center" valign="middle">');
	//	document.write('<img src="afbeeldingen/logotrans.gif" alt="WinFakt!" /></td>');
	//}
}

// ------------------------------------------------------------------------------------------

// CENTREREN WORDT BEMOEILIJKT DOOR SCROLLBAR
function kolomInvoegen() {
	if(op) {
		document.write('<td width="18"></td>');
	} else if(moz) {
		document.write('<td width="19"></td>');
	} else { // IE = standaard
		document.write('<td width="18"></td>');
	}
}

// ------------------------------------------------------------------------------------------

// POPUP MET FOTO OP ORIGINELE GROOTTE OPENEN
// pg = html-page - eventueel gewoon url van foto, w = width van foto, h = height van foto
function openwin(pg,w,h) {
	// GEEN SCROLLBARS (normaal niet nodig)
	if(moz) {
		w = w + 19;
	}
	
	var raampje = open("leeg.htm","_blank","width=" + w + ",height=" + h + 
					   ",status=no,toolbar=no,menubar=no,margin=0");
	// OPM: #: leeg, verder invullen
	//		pg: pagina of afbeelding meegeven
	// OPM: _blank: telkens nieuwe popup
	//		popup: (= naam) alles in 1 popup
	
	// RAAMPJE INVULLEN
	raampje.document.open();
	 // HTML: OPENEN
	raampje.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"' + 
		'"http://www.w3.org/TR/html4/loose.dtd"><html><head><title>WinFakt! Help - Voorbeeld</title>' + 
		'<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">' + 
		'<link rel="stylesheet" type="text/css" href="bestanden/stijl.css" />' + 
		'</head><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"' +
		'link="#007DC6" alink="#007DC6" vlink="#007DC6" class="voorgrond" onLoad="window.moveTo(' + 
		((myWidth - w) / 2) + ', ' + (myHeight - h) + ');">' + 
		'<table id="tblMarges" border="0" cellpadding="0" cellspacing="0"' + 
		'width="100%" height="100%"><tr height="' + h + '" valign="top"><td>');
	 // INHOUD PAGINA
	raampje.document.write('<img src="' + pg + '" alt="FOTO:oorspronkelijk formaat" class="gnmarge" />');
	 // HTML: SLUITEN
	raampje.document.write('</td></tr></body></html>');
	raampje.document.close();
}

// ------------------------------------------------------------------------------------------

function new_win(get, wi, he){
		 
	    mywindow = window.open(get,'voorbeeld','width='+ wi +',height=' + he + ',scrollbars=no,toolbar=no');
		
		 mywindow.moveTo(2,230);
		 return false;
	 
	 }
