
	
var NS=document.all;
function centerWindow() { 
	if(!NS){self.moveTo((self.screen.width - self.outerWidth) / 2, (self.screen.height - self.outerHeight) / 2);}
	else{self.moveTo((self.screen.width-document.body.clientWidth) / 2, (self.screen.height-document.body.clientHeight) / 2);}
	self.focus()
}

function popup(popupName,pageURL,pageWidth,pageHeight) {
	//alert("popup")
	try{popfnwin.close()}
	catch(e){};
	popfnwin=window.open(pageURL, popupName, 'scrollbars=1,resizable=1,status=1,width='+pageWidth+',height='+pageHeight+',left='+(((screen.width-10)/2)-(pageWidth/2))+',top='+(((screen.height-30)/2)-(pageHeight/2)))
}


function popupBestek(pageURL,pageWidth,pageHeight) { 
	try{popfnwin.close()}
	catch(e){};
	popfnwin=window.open(pageURL, "popup", "resizable=1,status=1,WIDTH="+pageWidth+",HEIGHT="+pageHeight)
}

function reloadPage(queryString){
	thisURL = this.location.href
	if (thisURL.lastIndexOf("?")!=-1){
		thisURL = thisURL.substring(0, thisURL.lastIndexOf("?"))
	}
	if (thisURL.lastIndexOf("#")!=-1){
		thisURL = thisURL.substring(0, thisURL.lastIndexOf("#"))
	}
	if (queryString!=''){
		thisURL = thisURL + "?" + queryString
	}
	this.location.href=thisURL; 
}



// kopieer bestek
	this.kopieerSTABU=function(divid){
		// browser detect
		var detect = navigator.userAgent.toLowerCase();
		var thestring;
			
		function checkIt(string) {
			place = detect.indexOf(string) + 1;
			thestring = string;
			return place;
		}
		
		//kopier bestek
		var elm = document.getElementById(divid)
		if(elm){
			if (checkIt('msie')) {
				elm.focus()
				elm.select()
				document.execCommand("Copy")
				alert("De bestektekst is naar het klembord gekopieerd en kan in uw bestekverwerker worden geplakt (Ctrl+V).")						
			} else {
				elm.focus();
				elm.select()
				alert("De bestektekst is geselecteerd.\nU kunt de bestektekst in uw bestekverwerker plakken (Ctrl+V) nadat u het heeft gekopieerd (Ctrl+C).")
			}
		}
	}
	
	this.kopieerNeutraal=function(divid){
		// browser detect
		var detect = navigator.userAgent.toLowerCase();
		var thestring;
			
		function checkIt(string) {
			place = detect.indexOf(string) + 1;
			thestring = string;
			return place;
		}
		
		//kopieerNeutraal
		var elm = document.getElementById(divid)
		if(elm){
			if (checkIt('msie')) {
				elm.focus()
				elm.select()
				document.execCommand("Copy")
				alert("De tekst is naar het klembord gekopieerd en kan in uw tekstverwerker worden geplakt (Ctrl+V).")						
			} else {
				elm.focus();
				elm.select()
				alert("De tekst is geselecteerd.\nU kunt de tekst in uw tekstverwerker plakken (Ctrl+V) nadat u het heeft gekopieerd (Ctrl+C).")
			}
		}
	}

