var aDOM = 0;
var nsDOM = 0;
var stdDOM = document.getElementById;
if (stdDOM) 
	aDOM = 1; 
else {
	var nsDOM = ((navigator.appName.indexOf('Netscape') != -1) && (parseInt(navigator.appVersion) == 4));
if (nsDOM) 
	aDOM = 1;
} 
function xDOM(objectId, wS) {

if (stdDOM) 
	return wS ? document.getElementById(objectId).style : document.getElementById(objectId);
if (nsDOM) 
	return document.layers[objectId];
} 


window.onload = page_init;

function page_init() {

	//get workarea
	if (document.body.clientWidth) {
		width_available  = document.body.clientWidth;
		height_available = document.body.clientHeight;
	} else {
		width_available  = window.innerWidth;
		height_available = window.innerHeight;
	}

	if (document.getElementById('flash')) {	
		var obj		= xDOM('flash',0);
		var objs	= xDOM('flash',1); 

		if (BrowserDetect.browser == "Explorer" || 
		    BrowserDetect.browser == "Opera") {
			objs.width = "2280px";
		}
		x = (2280 - width_available) / 2;		
	
		if (obj.offsetLeft != null) {
			var l = obj.offsetLeft; 
			objs.left = l-x; 
		} else if (objs.pixelLeft != null) {
			objs.pixelLeft -= x; 
		}	
	}


	anchor_arr = document.getElementsByTagName('a');
	for (i = 0; i < anchor_arr.length; i++) {
		if (anchor_arr[i].parentNode.id == 'topmenu' ||
                    anchor_arr[i].parentNode.className == 'menu_item' ||
		    anchor_arr[i].parentNode.className == 'gp_menu_item' ||
		    anchor_arr[i].parentNode.parentNode.parentNode.parentNode.id == 'header_menu') {
			anchor_arr[i].onmouseover	= anchor_mouseover;
			anchor_arr[i].onmouseout	= anchor_mouseout;
		}
		if (anchor_arr[i].parentNode.parentNode.id == 'submenu_external' ||
                    anchor_arr[i].parentNode.className == 'media_link') {
			anchor_arr[i].target		= '_blank';
		}
	}
	if (document.getElementById('wlm_title')) {
		wlm_title_obj			= document.getElementById('wlm_title');
		wlm_title_obj.onfocus		= set_clear;

		wlm_image_obj			= document.getElementById('wlm_image');
		wlm_image_obj.onfocus		= set_clear;

		wlm_text_obj			= document.getElementById('wlm_text')		
		wlm_text_obj.onfocus		= set_clear;
	}
	if (document.getElementById('submit_check')) {
		remove_btn			= document.getElementById('submit_check');
		remove_btn.onclick		= alert_remove;
	}
	if (document.getElementById('flash')) {
		var so = new SWFObject('library.swf', 'back', '100%', '100%', '7', '#FFFFFF');

		so.write('flash');
	}
	
Videobox.open('http://www.youtube.com/watch?v=q3btChT2KJo','Welkom bij Wientjes','vidbox 580 360');
}

function anchor_mouseover () {
	image_arr		= this.getElementsByTagName('img');
	image_obj		= image_arr[0];	

        if (image_obj.id.substr(13, 7) != "_active" && image_obj.id.substr((image_obj.id.length - 6), 6) != "_hover") {
		image_obj.src		= 'images/' + image_obj.id + '_hover.png';
	}
}

function anchor_mouseout () {
	image_arr		= this.getElementsByTagName('img');
	image_obj		= image_arr[0];	
        if (image_obj.id.substr(13, 7) != "_active") {
		image_obj.src		= 'images/' + image_obj.id + '.png';
	}
}
function set_clear () {
	if (this.value == "Titel..." ||
            this.value == "afbeelding..." ||
            this.value == "tekst...") {
		this.value = "";
	}
}
function alert_remove () {
	if (!confirm ('weet u zeker dat u deze record wilt verwijderen ?')) {
		return false;
	}
}
