var ie = (document.all) ? true : false;

function makeOfficeButton(w,img,title,func) {
	document.write("<td width="+w+" height=25 align=center onClick=\""+func+";\">");
	document.write("<table cellpadding=1><tr><td onmouseover=\"button_over(this);\" onmouseout=\"button_out(this);\" onmousedown=\"button_down(this);\" width="+ (w-5) +" height=22 align=center style=\"cursor:hand;\">");
	document.write("<img src=\"/lib/images/"+ img +"\" border=0 align=absmiddle>&nbsp;"+title+"</td></tr></table></td>");
}

function setClass(obj, classname) {
	obj.className = classname;
}

function toggleMenu(id){
	if(document.getElementById("menu_"+id)){
		if (currentMenu != "") {
			if (document.getElementById("menu_"+currentMenu)) {
				document.getElementById("menu_"+currentMenu).style.display="none";
				document.getElementById("button_"+currentMenu).src="/lib/images/button_off.gif";
			}
		}
		currentMenu = id;
		document.getElementById("menu_"+currentMenu).style.display="";
		document.getElementById("button_"+currentMenu).src="/lib/images/button_on.gif";
	}
}

function init(){
	toggleMenu(currentMenu);
	initRollover();
}

function open_jv() {
	window1 = window.open('/jaarverslag/html/content.htm','window1','menubar=0,location=0,toolbar=0,status=0,scrollbars=0,resizable=0');
}

function printWindow(u){
	var leftPos = (screen.availWidth-700) / 2
	var topPos = (screen.availHeight-400) / 2 
	var printWindow = window.open(u,'printWindow', 'scrollbars=yes,resizable=yes,status=yes,toolbar=no,width=700,height=400,top=' + topPos + ',left=' + leftPos);
	printWindow.focus();
}

function printPage(){
	url = document.location + ((document.location.search) ? "&print=true" : "?print=true")
	printWindow(url);
}

function showSearchObj(show) {
	if (ie) {
		document.all['zoeken'].style.top = 10;
		document.all['zoeken'].style.left = document.body.offsetWidth-160;
		document.all['zoeken'].style.display = show;
		if (show != 'none') {document.zoekpopup.query.value='';document.zoekpopup.query.focus();}
	} else {
		document.location = '/zoeken';
	}
}
	
function download(id) {
	document.location = '/download.asp?id='+id;
}

function emailPage(pagina){
	var url = escape(document.location);
	var leftPos = (screen.availWidth-500) / 2
	var topPos = (screen.availHeight-380) / 2 
	var uploadWindow = window.open('/maillink.asp?url='+url+'&pagina='+escape(pagina),'myWindow', 'scrollbars=no,resizable=yes,status=yes,toolbar=no,width=500,height=380,top=' + topPos + ',left=' + leftPos);
	uploadWindow.focus();
}

function setHomepage(kid) {
	if (confirm("Weet u zeker dat u dit kantoor wilt instellen als 'Mijn notaris'?")) {
		document.location = "/setCookie.asp?kid="+kid;
	}
}

function visitHomepage(kid) {
	document.location = "/kantoor/default.asp?kid="+kid;
}


function deleteCookie(kid) {
	if (confirm("Weet u zeker dat u 'Mijn kantoor' wilt verwijderen?")){
		document.location = "deleteCookie.asp?kid="+kid;
	}
}

function showMap(straat, plaats, marker) {
	newWindow = window.open("http://tools.locatienet.com/location/map.asp?config_id=1493&street="+straat+"&zipcode=&city="+plaats+"&country=NL&zoom=2&markertext="+escape(marker)+"&css=http://accon.clients.businessmedia.nl/lib/css/style.css&logo=http://accon.clients.businessmedia.nl/lib/images/logo_wit.gif&language=dutch", "MAP", 'scrollbars=yes,status=yes,resizable=yes,toolbar=yes,width=650,height=500');
}

function winpopup(urlname, boxname, boxresize, boxscrollbar, boxwidth, boxheight) {
	thefile = urlname;
	var boxleft = (screen.availWidth-boxwidth) / 2
	var boxtop = (screen.availHeight-boxheight) / 2 
   	var popup = window.open(thefile, boxname,"dependent=yes,toolbar=no,location=no,directories=0,status=0,menubar=no,scrollbars=" + boxscrollbar + ",width=" + boxwidth + ",height=" + boxheight +",resizable=" + boxresize + ",top=" + boxtop + ",left=" + boxleft);
	popup.location=thefile;
	popup.focus();
}
	
function viewPicture(pic) {
	PicWin = window.open('/image_view.asp?pic='+pic,'PicWin','scrollbars=no,width=400,height=275');
	PicWin.focus();
}

Xoffset = 0;    // modify these values to ...
Yoffset = 13;    // change the popup position.

var old,skn,iex = (document.all),yyy=-1000;
var ns4 = document.layers;
var ns6 = document.getElementById&&!document.all;
var ie4 = document.all;

function initRollover() {
	if (ns4)
		skn=document.dek
	else if (ns6)
		skn=document.getElementById("dek").style
	else if (ie4)
		skn=document.all.dek.style
	if(ns4)document.captureEvents(Event.MOUSEMOVE);
	else{
		skn.visibility="visible"
		skn.display="none"
	}
	document.onmousemove=get_mouse;
}

function popup(msg){
	var content="<table cellspacing=0 class=rollover width=300><tr><td>"+msg+"</td></tr></table>";
	yyy=Yoffset;
	if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}
	if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''}
	if(ie4){document.all("dek").innerHTML=content;skn.display=''}
}

function get_mouse(e){
	var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
	skn.left=x+Xoffset;
	var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
	skn.top=y+yyy;
}

function kill(){
	yyy=-1000;
	if(ns4){skn.visibility="hidden";}
	else if (ns6||ie4)
	skn.display="none"
}

String.prototype.trim = _String_trim; 

function _String_trim(){ 
	var tstr = this.toString(); 

	while(tstr.charAt(0) == " ") 
		tstr = tstr.substring(1); 
	while(tstr.charAt(tstr.length - 1) == " ") 
		tstr = tstr.substring(0,tstr.length-2); 
	
	return tstr; 
}
function openSwf() {
	sList = window.open("lib/swf/panorama.swf", "list", "scrollbars=no,resizable=no,toolbar=no,width=520,height=290");
	sList.focus()
}

function ViewImage(id){
	var leftPos = (screen.availWidth-600) / 2;
	var topPos = (screen.availHeight-475) / 2;
	WindowInfo = window.open('/image_view.asp?pic='+id,'Image','scrollbars=no,width=600,height=475,top='+topPos+',left='+leftPos);
	WindowInfo.focus();
}
