function popup(url, width, height, name){
	if (location.href.indexOf("edit=1")>=0) {
		if (name == null) {
			name = url;
		}
    	baukastenTop().displayLink(3, name);
  	} else {
	    var w = 566;
	    var h = 400;
	    if (width != null){
	        w = parseInt(width);
	    }
	    if(height != null){
	        h = parseInt(height);
	    }
	    // make sure we have sane values (e.g. when parseInt fails)
	    if (!w) w = 566;
	    if (!h) h = 400;
	    var l = (screen.availWidth-10 - w) / 2;
	    var t = (screen.availHeight-20 - h) / 2;
	    // append a '/popup' to url if it starts with a '/'
	    // which most likely means that it points
	    // to an internal document
	    if (url.charAt(0) == '/') {
	        url = url + '/popup';
	    }
	    var features = "width="+w+",height="+h+",";
	    var name = "popup";
	    name += String(Math.round(Math.random()*10000));
	    features += "left="+l+",top="+t+",screenX="+l+",screenY="+l+",";
	    features += "scrollbars=no,resizable=yes";
	    popwin = window.open(url,name,features);
	    popwin.focus();
	}
}

function popupInfotour(){
  	if (location.href.indexOf("edit=1")>=0) {
	    baukastenTop().displayLink( 0, 'http://www.dvag.com/infotour' );
	} else {
	    var w = 791;
	    var h = 573;
	    var l = (screen.availWidth-10 - w) / 2;
	    var t = (screen.availHeight-20 - h) / 2;
	    var features = "width="+w+",height="+h+",";
	    features += "left="+l+",top="+t+",screenX="+l+",screenY="+l+",";
	    features += "scrollbars=no";
	    popwin = window.open('http://www.dvag.com/infotour','popupInfotour',features);
	    popwin.focus();
	}
}
function popupMagazin(){
    var w = 800;
    var h = 600;
    var l = (screen.availWidth-10 - w) / 2;
    var t = (screen.availHeight-20 - h) / 2;
    var features = "width="+w+",height="+h+",";
    features += "left=0,top=0,screenX=0,screenY=0,";
    features += "scrollbars=yes,location=yes,menubar=yes,status=yes";
    popwin = window.open('http://www.vermoegensberater-magazin.de/','VBMagazin',features);
    popwin.focus();
}
