function window_o(link,v_w,v_h,scroll, v_l, v_t) {
	if (!v_w) {
		v_w = 640;
	}
	if (!v_h) {
		v_h = 530;
	}
	if (!scroll) {
		scroll = 'yes'
	}
	if (!v_l) {
		v_l = 100;
	}
	if (!v_t) {
		v_t = 100;
	}

	if (link != "") {
		window.open('' + base_href + link + '','','width=' + v_w + ' ,height=' + v_h + ' ,scrollbars=' + scroll + ' ,left=' + v_l + ' ,top=' + v_t + ' ,screenX=' + v_l + ' ,screenY=' + v_t);
	}
}

function img_resize(max_width){
	if (max_width == undefined) max_width = 500;

	var i = 0;
	while (document.images.length > i) {
		
		var img = document.images[i]
		if (img.width > max_width && !img.src.match(/(img\/c\/s.gif)/) && !img.src.match(/(img\/logo_header.jpg)/)) {
			
			img.width = max_width; img.height = Math.floor(img.height/(img.width/max_width));
			img.style.borderStyle = "dashed"; img.style.borderWidth = "2"; img.style.borderColor = "#0088FF"; img.style.cursor = "pointer";
			img.alt = "Deze afbeelding is verkleind.\nKlik op de afbeelding om te vergroten.";
			if (img.parentNode.tagName.toLowerCase() != "a")	img.onclick = img_open;
						
		}		
		i++;
	}
}

function img_open() {
	
	window.open(this.src);
	
}

function m_o(layer) {
	if (document.getElementById(layer)) {
		dds_toggle("hide");
		document.getElementById(layer).style.visibility = "visible";
	}
}

function m_c(layer) {
	if (document.getElementById(layer)) {
		dds_toggle("show");
		document.getElementById(layer).style.visibility = "hidden";
	}
}

function d_o(layer) {
	if (document.getElementById(layer)) {
		document.getElementById(layer).style.display = "inline";
	}
}

function d_c(layer) {
	if (document.getElementById(layer)) {
		document.getElementById(layer).style.display = "none";
	}
}

function getWindowWidth() {
	var w
	if (self.innerHeight) {
		w = self.innerWidth;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		w = document.documentElement.clientWidth;
	} else if (document.body) {
		w = document.body.clientWidth;
	}
	return w;
}

function getWindowHeight() {
	var h
	if (self.innerHeight) {
		h = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		h = document.documentElement.clientHeight;
	} else if (document.body) {
		h = document.body.clientHeight;
	}
	return h;
}

function toggleNode(CatID) {
 
	state = document.getElementById('tracker_subcats_' + CatID).className;
	
	if (state == 'opened') {
		document.getElementById('tracker_subcats_' + CatID).className = 'closed';
		document.getElementById('catnode_' + CatID).src = 'img/_img_menu/b_p.gif';
	} else {
		document.getElementById('tracker_subcats_' + CatID).className = 'opened';
		document.getElementById('catnode_' + CatID).src = 'img/_img_menu/b_m.gif';
	}
	
}

function BrowserCheck() {
	var b = navigator.appName;
	if (b=="Netscape") this.b = "ns";
	else if (b=="Microsoft Internet Explorer") this.b = "ie";
	else this.b = b;
	
	this.v = parseInt(navigator.appVersion);
	
	this.ns = (this.b=="ns" && this.v>=4);
	this.ns4 = (this.b=="ns" && this.v==4);
	this.ns5 = (this.b=="ns" && this.v==5);
	this.ie = (this.b=="ie" && this.v>=4);
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0);
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0);
	if (this.ie5) this.v = 5;
	
	this.min = (this.ns||this.ie);
}

is = new BrowserCheck();

function trim(to_trim) {
	return to_trim.replace(/^\s+|\s+$/g,"");
}
function ltrim(to_trim) {
	return to_trim.replace(/^\s+/,"");
}
function rtrim(to_trim) {
	return to_trim.replace(/\s+$/,"");
}
