//check frameset
if (!parent.head_fr) location.replace("index.php?url="+location.href);

/*
function toHome() {	
	if (top.location.href.indexOf("mid=") != -1) {
		top.location.href = top.location.href;
		//alert("test");
	} else {
		top.location.href = "index.php";
	}
}
*/

function toHome() {
	if (top.location.pathname == "/" || top.location.pathname == "/index.php") {
		top.location.href = "index.php";
	} else {
		top.location.href = top.location.href;
	}
	//alert(top.location.href);
}
//check browservaardigheid
var agent = window.navigator.userAgent; var i = agent.indexOf("MSIE ")+5;
isIE4plus = ( parseInt(agent.substr(i)) >= 4 );
isIE5plus = ( parseInt(agent.substr(i)) >= 5 && agent.indexOf("5.0b1") < 0 );
isNN6plus = (agent.indexOf("Netscape") > 0 && parseInt(navigator.appVersion)>=5);

back_img = new Image(); back_img_f = new Image(); 
back_img.src = "images/b_back.gif"; back_img_f.src ="images/b_back_f.gif";

home_img = new Image(); home_img_f = new Image(); 
home_img.src = "images/b_home.gif"; home_img_f.src ="images/b_home_f.gif";

mail_img = new Image(); mail_img_f = new Image(); 
mail_img.src = "images/b_mail.gif"; mail_img_f.src ="images/b_mail_f.gif";

print_img = new Image(); print_img_f = new Image(); 
print_img.src = "images/b_print.gif"; print_img_f.src ="images/b_print_f.gif";

forw_img = new Image(); forw_img_f = new Image(); 
forw_img.src = "images/b_forw.gif"; forw_img_f.src ="images/b_forw_f.gif";

top_img = new Image(); top_img_f = new Image(); 
top_img.src = "images/b_top.gif"; top_img_f.src ="images/b_top_f.gif";

function get_obj(id) {
	return (document.all) ? document.all[id] : document.getElementById(id);
}

function go_back() {
	history.back();
}

function go_forward() {
	history.forward();
}

function email() {
	location.href = "mailto:info@dho.nl";
}

function print_frame() {
	top.content_fr.print();
}

function up() {
	self.scroll(0,0);	
}

function write_dyn_buttons(taal) {
	if (taal == "eng") {
		alt_print_txt = "Print this page";
		alt_up_txt = "To top of page";
	} else {
		alt_print_txt = "Print deze pagina";
		alt_up_txt = "Ga naar top van pagina";
	}	
	
	str_temp = 	'<div id="buttons" style="position: absolute; left: 519px; top: 0px; width: 21px; visibility: hidden">' +
					'<a href="javascript:print_frame()" onmouseover="status=\'' + alt_print_txt + '\'; dyn_print.src=print_img_f.src;" onmouseout="status=\'\'; dyn_print.src=print_img.src;">' +	
						'<img src="images/b_print.gif" vspace="10" width="21" height="21" alt="' + alt_print_txt + '" title="' + alt_print_txt + '" border="0" name="dyn_print">' +
					'</a><br>' +
					'<a href="javascript:up()" onmouseover="status=\'' + alt_up_txt + '\'; to_top.src=top_img_f.src; " onmouseout="status=\'\';to_top.src=top_img.src;">' +
						'<img src="images/b_top.gif" width="21" height="21" alt="' + alt_up_txt + '" title="' + alt_up_txt + '" border="0" name="to_top">' +
					'</a>' +
				'</div>';
	
	document.write(str_temp);
	
	if (document.all) {
		window.onscroll = position_buttons;
	} else {
		window.onmousemove = position_buttons;	
	}
}

function write_stat_buttons () {
	str_temp = '' +
		'<a href="javascript:go_forward()" onmouseover="forw.src=forw_img_f.src" onmouseout="forw.src=forw_img.src"><img src="images/b_forw.gif" width="21" height="21" alt="forward" border="0" align=right hspace=5 class="button-small" name="forw"></a>' +
		'<a href="javascript:email()" onmouseover="mail.src=mail_img_f.src" onmouseout="mail.src=mail_img.src"><img src="images/b_mail.gif" width="21" height="21" alt="mail" border="0" align=right hspace=5 class="button-small" name="mail"></a>' +
		'<a href="javascript:print_frame()" onmouseover="print.src=print_img_f.src" onmouseout="print.src=print_img.src"><img src="images/b_print.gif" width="21" height="21" alt="print" border="0" align=right hspace=5 class="button-small" name="print"></a>' +
		'<a href="#" onmouseover="home.src=home_img_f.src" onmouseout="home.src=home_img.src" onclick="toHome();" return false;"><img src="images/b_home.gif" width="21" height="21" alt="home" border="0" align=right hspace=5 class="button-small" name="home"></a>' +
		'<a href="javascript:go_back()" onmouseover="back.src=back_img_f.src" onmouseout="back.src=back_img.src"><img src="images/b_back.gif" width="21" height="21" alt="back" border="0" align=right hspace=5 class="button-small" name="back"></a>'
	document.write(str_temp);
}



// old way of going home
// onclick="window.top.location.reload(); return false;"
// <a href="index.php" target="_top" onmouseover="home.src=home_img_f.src" onmouseout="home.src=home_img.src" onclick="top.location.href="index.php"; return false;"><img src="images/b_home.gif" width="21" height="21" alt="home" border="0" align=right hspace=5 class="button-small" name="home"></a>' +

function position_buttons() {
	var y_margin = 42;
	if (document.all) {
		if (document.body.scrollTop < y_margin) {
	 		get_obj("buttons").style.visibility = 'hidden';
		} else {
			get_obj("buttons").style.top = (document.body.scrollTop)+"px";
			get_obj("buttons").style.visibility = 'visible';
		}
	} else {
		if (window.scrollY < y_margin) {
			get_obj("buttons").style.visibility = 'hidden';
		} else {
			get_obj("buttons").style.top = (window.scrollY)+"px";
			get_obj("buttons").style.visibility = 'visible';
		}
	}
}

function showHottip(hottext, evt) {
	htObj = (document.all) ? document.all.hottip : document.getElementById("hottip");
	htObj.innerHTML = hottext;
	htObj.style.left = (evt.clientX+10)+"px";
	htObj.style.top = (evt.clientY-10)+"px";
	htObj.style.visibility = "visible";
}

function hideHottip() {
	htObj = (document.all) ? document.all.hottip : document.getElementById("hottip");
	htObj.style.visibility = "hidden";
}

if (document.all) document.write("<style>ul {margin-left: 25px;}</style>");
if (parent.dhoStyle) document.write("<link rel=stylesheet type=text/css href=css/content_style"+ parent.dhoStyle +".css>");
function write_buttons_bg() {
	if (parent.dhoStyle && parent.dhoStyle!="0" && document.getElementById) {
		var oBtnBg = document.getElementById("buttonbg");
		oBtnBg.style.backgroundImage = "url(images/style"+ parent.dhoStyle +"/bg_buttons2.gif)";
	}
}