//voor openen redirect onderhoudswindow in admin
function redirect() {
	popup('/admin/redirect/index.php', 'nhredirect',600,500);
}

function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
var popupscherm=0;

function vergroting (fileName){
	filename=fileName.replace("/\/","/").split("/");
	popup('/popupimage.php?clientpopup=true&image=import::afbeeldingen::vergroting::' + filename[filename.length-1]);
}

function popup(filename, fileid, width, height, scrollbars, resizable, menubar, toolbar, status, location) {
	if (popupscherm && ! popupscherm.closed)	popupscherm.close();
	if (!filename || filename=="")				filename="http://www.buttonboss.nl";
	if (!fileid || fileid=="")					fileid="formulier";
	if (!width || width=="")					width="430";
	if (!height || height=="")					height="540";
	if (!scrollbars || scrollbars=="")			scrollbars="no";
	if (!resizable || resizable=="")			resizable="no";
	if (!menubar || menubar=="")				menubar="no";
	if (!toolbar || toolbar=="")				toolbar="no";
	if (!status || status=="")					status="no";
	if (!location || location=="")				location="no";
	popupscherm=0;
	var args = "height=" + height + ", width=" + width + ", scrollbars=" + scrollbars + ", resizable=" + resizable +  ", menubar=" + menubar + ", toolbar=" +toolbar + ", status=" + status + " ,location=" + location;
	popupscherm = open(filename, fileid, args);
	if (!InternetExplorer) {
		popupscherm.focus();
	}
}

function afbeeldingPopup(filename, fileid, width, height, scrollbars, resizable, menubar, toolbar, status, location) {

	var rege = new RegExp (/\.png$/i);
	var rege2 = new RegExp (/\//gi);
	
	if (popupscherm && ! popupscherm.closed)	popupscherm.close();
	if (!filename || filename=="") {
		filename="http://www.buttonboss.nl";
	} else {
		filename = '/popup/afbeelding.php?image='+filename.replace (rege, '.png').replace("/\/","/").replace (rege2, '::');
		//filename = '/popup/afbeelding.php?image='+filename.replace (rege, '_popup.png').replace("/\/","/").replace (rege2, '::');
		//                                                                      ^^ geen _popup.png aanwezig
	}
	if (!fileid || fileid=="")					fileid="Buttonboss";
	if (!width || width=="")					width="215";
	if (!height || height=="")					height="215";
	if (!scrollbars || scrollbars=="")			scrollbars="no";
	if (!resizable || resizable=="")			resizable="no";
	if (!menubar || menubar=="")				menubar="no";
	if (!toolbar || toolbar=="")				toolbar="no";
	if (!status || status=="")					status="no";
	if (!location || location=="")				location="no";
	popupscherm=0;
	var args = "height=" + height + ", width=" + width + ", scrollbars=" + scrollbars + ", resizable=" + resizable +  ", menubar=" + menubar + ", toolbar=" +toolbar + ", status=" + status + " ,location=" + location;
	popupscherm = open(filename, fileid, args);
	
	if (!InternetExplorer) {
		popupscherm.focus();
	}
	popupscherm.moveTo(10, 10);
	popupscherm.focus();
}

function InvulveldChecken() {
	if (document.zoekformulier.search_for.value.length>0) {
		document.zoekformulier.submit();
	} else {
		alert ('U moet iets invullen in het veld "Zoeken op".');
		document.zoekformulier.search_for.focus();
	}
}


// ---------------------------------------------------------- subnavigatie ------------------------------------------------------------------
var table = false;
var hiddenspan = false;
var navdiv = false;
var innertable =false;
var innertabletd =false;

var hoofdnavover = function (el,nr) {

	if (/\/admin\//.test(document.location))
		return false;
	
	var hiddendiv = nodes.childNodeBy (el, 'nodeName=DIV');
	if (!hiddendiv)
		return false

	if (hiddendiv.hasChildNodes()) {
		hiddendiv.style.display = 'block';
		hiddendiv.style.width = 192;
	}
}

var hidemenu = function () {
	table = false;
	hiddenspan = false;
	navdiv = false;
	var navdiv = document.getElementById('navdiv0');
	if (navdiv) 
		navdiv.style.display = 'none';

}

var hoofdnavout = function (el, nr) {
	var hiddendiv = nodes.childNodeBy (el, 'nodeName=DIV');
	if (hiddendiv)
		hiddendiv.style.display = 'none';
}

var subnavdivover  = function (el) {
	el.style.color = 'white';
	window.status = el.innerHTML.replace(/^\&nbsp;/,'');
}

var  subnavdivout  = function (el) {
	el.style.color = '#2061AB';
	window.status = '';
	
}

var subnavclick = function (url) {
	document.location ='/p3.php' + url;
	if (window.event)
		window.event.cancelBubble = true;
}

