//Default browsercheck, added to all scripts!
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5);
	return this;
}
bw=new checkBrowser()

function showHide(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 
	if(obj.visibility=='visible' || obj.visibility=='show') obj.visibility='hidden';
	else obj.visibility='visible';
}
//Shows the div
function show(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 
	obj.visibility='visible';
}
//Hides the div
function hide(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 
	obj.visibility='hidden';
}

function openclosetip(eID,totaal) {
	if (document.getElementById("tip"+eID).style.display == "block") {
		document.getElementById("tip"+eID).style.display = "none";
		
	}
	else {
		var rows = totaal;
		closeAlltip(rows);
		document.getElementById("tip"+eID).style.display = "block";
	}
}
function closeAlltip(nr) {
	for (i=1; i<= nr; i++) {
		document.getElementById("tip"+i).style.display = "none";
	}
}

function closeAllrubriek(nr) {
	for (i=1; i<= nr; i++) {
		document.getElementById("rubriek"+i).style.display = "none";
	}
}
function opencloserubriek(eID,totaal) {
	if (document.getElementById("rubriek"+eID).style.display == "block") {
		document.getElementById("rubriek"+eID).style.display = "none";
	}
	else {
		var rows = totaal;
		closeAllrubriek(rows);
		document.getElementById("rubriek"+eID).style.display = "block";
	}
}


function opencloseintro(eID,totaal) {
	if (document.getElementById("intro"+eID).style.display == "block") {
		document.getElementById("intro"+eID).style.display = "none";
		document.getElementById("introtitle"+eID).style.display = "block";
	}
	else {
		var rows = totaal;
		closeAllrubriek(rows);
		document.getElementById("intro"+eID).style.display = "block";
		document.getElementById("introtitle"+eID).style.display = "none";
	}
}

function toggleTISKader(id) {
	$("rubriek"+id).toggle();
}

function showTISKader(code,id,land,rgo) {
	if ($('rubriek'+id).innerHTML == "") {
		params = "id="+id+"&land="+land+"&rgo="+rgo+"&code="+code;
		new Ajax.Request("/content/landing/aj_tisinfoblock.php", { onSuccess: returnShowTISKader, method: "post", parameters: params });
	}
	else {
		toggleTISKader(id);
	}
}

function returnShowTISKader(data) {
	var obj = data.responseJSON;
	dest = "rubriek"+obj.dest;
	$(dest).update(obj.html);
	$(dest).show();
}

function showMapsPopup(src,height,width) {
	window.open(src,'','width='+width+',height='+height+',resizable=yes');
}
function redirParent(src) {
	window.opener.location.href = src;
}
function showMedia(huiscode,mediatype,height) {
	window.open("/content/multimedia/popup.php?huiscode="+huiscode+"&mediatype="+mediatype,'','height='+height+',width=566,location=false,resizable=false,directories=false,toolbar=false,status=false,menubar=false');
}
function resetOptionPlaatsTitle(title) {
	//gebruikt om option bij wintersport/plaats ... te vervangen door de title
	document.huisForm.skpl.options[0] = new Option(title,"alleskiplaatsen");
}
function submitSearchForm(frm, searchaction) {
	hideFormElements();
	if (searchaction != "normal") {
		frm.searchact.value = searchaction;
	}
	frm.submit();
}
function submitSearchFormFlash() {
	hideFormElements();
	document.huisForm.submit();
}
function searchFromTis(frm, searchaction) {
	hideFormElements();
	frm.action = searchaction;
	frm.submit();
}
function hideFormElements() {
	document.getElementById("huisform_1").style.display = "none";
	document.getElementById("wait_div").style.display = "block";
}
function clipboard(nummr) {
	var x = document.getElementById('devmssg'+nummr).innerText;
	window.clipboardData.setData('Text',x);
}