/************************************************/
/******* generelle JavaScript-Funktionen ********/
/************************************************/

// Browsercheck
function cm_bwcheck(){
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent.toLowerCase()
	this.dom=document.getElementById?1:0
	this.op5=(this.agent.indexOf("opera 5")>-1 || this.agent.indexOf("opera/5")>-1) && window.opera 
  	this.op6=(this.agent.indexOf("opera 6")>-1 || this.agent.indexOf("opera/6")>-1) && window.opera   
  	this.ie5 = (this.agent.indexOf("msie 5")>-1 && !this.op5 && !this.op6)
  	this.ie55 = (this.ie5 && this.agent.indexOf("msie 5.5")>-1)
 	this.ie6 = (this.agent.indexOf("msie 6")>-1 && !this.op5 && !this.op6)
	this.ie4=(this.agent.indexOf("msie")>-1 && document.all &&!this.op5 &&!this.op6 &&!this.ie5&&!this.ie6)
 	this.ie = (this.ie4 || this.ie5 || this.ie6)
	this.mac=(this.agent.indexOf("mac")>-1)
	//this.aol=(this.agent.indexOf("aol")>-1)
	this.tonline=(this.agent.indexOf("t-online")>-1)
	this.ns6=(this.agent.indexOf("gecko")>-1 || window.sidebar)
	this.ns4=(!this.dom && document.layers)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.op5 || this.op6)
  	this.usedom= this.ns6//Use dom creation
  	this.reuse = this.ie||this.usedom //Reuse layers
  	this.px=this.dom&&!this.op5?"px":""
	return this
}

// Browserobjekt wird erzeugt
var bw=new cm_bwcheck();

var nn_mauspos_x=0;
var nn_mauspos_y=0;

function clean_stat() {
	window.status="Dolberg Immobilien";
	}
	
function startseite() {
	location.href="start1.php";
	}

function blanklink(url,fen) {
	if (fen=="") {
		fen="blank";
		}
	if (fen=="self") {
		/*location.href=url;*/
		location.href="seite2.php";
		}
	else {
		if (fen=="login") {
			sleft=(screen.width-600)*.5;
			//stop=(screen.height-300)*.5;
			stop=0;
			//alert(stop+" "+screen.width+" "+sleft+" "+screen.height);
			var fenster1=eval("window.open(url, fen, 'dependent=yes,scrollbars=yes,resizable=yes,menubar=no,location=no,height=300,width=600,top="+stop+",left="+sleft+"')");
			fenster1.focus();
			}
		else {
			sleft=(screen.width-530)*.5;
			stop=(screen.height-600)*.5;
			//alert(stop+" "+screen.width+" "+sleft+" "+screen.height);
			var fenster2=eval("window.open(url, fen, 'dependent=yes,scrollbars=yes,resizable=yes,menubar=no,location=no,height=600,width=530,top="+stop+",left="+sleft+"')");
			fenster2.focus();
			}
		}
	}
	
function selflink(url) {
	location.href=url;
	}

function menu(rub,typ) {
	document.forms.seite.rubrik.value=rub;
	document.forms.seite.seitentyp.value=typ;
	document.forms.seite.action="start.php";
	document.forms.seite.target="_self";
	document.forms.seite.submit();
	}
	
function sprachwahl(lang) {
	document.forms.seite.rubrik.value="";
	document.forms.seite.seitentyp.value="";
	document.forms.seite.sprache.value=lang;
	document.forms.seite.action="start.php";
	document.forms.seite.target="_self";
	document.forms.seite.submit();
	}

function voten() {
	if (document.forms.seite.auswahl.value!="") {
		document.forms.seite.action="start.php";
		document.forms.seite.target="_self";
		document.forms.seite.submit();
		}
	}
	
function kontStandard() {
		document.forms.seite.action="../user/kontStandard.php";
		document.forms.seite.method="get";
		document.forms.seite.target="_self";
		document.forms.seite.submit();
	}
	
function kontTerminwunsch() {
		document.forms.seite.action="../user/kontTermin.php";
		document.forms.seite.method="get";
		document.forms.seite.target="_self";
		document.forms.seite.submit();
	}
/*	
function login() {
	//document.forms.seite.action="http://selfedit.w-plus.de/version_2/indexp.php";
	document.forms.seite.action="statistik_login.php";
	document.forms.seite.target="_blank";
	document.forms.seite.submit();
	}	
*/
/* Glossar-Infolayer */
function glossar_in(nr,hoehe) {
	doclayer=(bw.ie4?"all.glossarleger"+nr+".style":(bw.ns4?"layers.glossarleger"+nr:"getElementById('glossarleger"+nr+"').style"));
	eval("var schonda=(document."+doclayer+".visibility=='visible'?'ja':'nein')");
	if (schonda=="nein") {
		eval("document."+doclayer+".visibility='visible'");
		topwert=bw.ns4?nn_mauspos_y-hoehe-15:window.event.clientY-hoehe-15+document.body.scrollTop;
		//window.status=topwert+"/"+hoehe;
		if (topwert<210) {
			topwert=(bw.ns4?nn_mauspos_y:window.event.clientY)-hoehe/2+(bw.ns4?0:document.body.scrollTop);
			topwert=(topwert<210?210:topwert);
			}
		leftwert=bw.ns4?nn_mauspos_x+40:window.event.clientX+40;
		if (bw.ns4) {
			//topwert+=topwert+window.pageYOffset;
			}
		eval("document."+doclayer+".top="+topwert);
		eval("document."+doclayer+".left="+leftwert);
		}
	}
function glossar_out(nr) {
	doclayer=(bw.ie4?"all.glossarleger"+nr+".style":(bw.ns4?"layers.glossarleger"+nr:"getElementById('glossarleger"+nr+"').style"));
 	eval("document."+doclayer+".visibility='hidden'");
	}

/* Mausposition für NN für Glossar-Infolayer */
if (bw.ns4) {
	window.captureEvents(Event.MOUSEMOVE);
	window.onMouseMove = setpos;
	}
function setpos(ev){
	if (bw.ns4) {
		nn_mauspos_x=ev.pageX;
		nn_mauspos_y=ev.pageY;
		}
	}
function drucken(was) {
	eval ("window.open('drucken.php?rubrik="+was+"','drucken','width=500,height=600,location=no,toolbar=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes')");
	}
function verschicken(was) {
	eval ("window.open('versenden.php?rubrik="+was+"','versenden','width=500,height=500,location=no,toolbar=no,directories=no,scrollbars=yes,resizable=yes')");
	}
/*
function ansehen(bildnr,breite,hoehe) {
	var fenster;
	breite=(parseInt(breite)+40)>600?(parseInt(breite)+40):600;
	hoehe=(parseInt(hoehe)+80)>350?(parseInt(hoehe)+80):350;
	eval("fenster=window.open('../start/ecard_prototyp?pid="+bildnr+"&breite="+breite+"&hoehe="+hoehe+"','fenster','width="+breite+",height="+hoehe+",left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes')");
	fenster.resizeTo(breite,hoehe);
	fenster.focus();
	}
function machnix() {
	;
	}
*/
function shop() {
	var efenster=window.open("http://selfedit.w-plus.de/shop/dolberg","fenster","width=800,height=600,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	efenster.focus();
	}
function fenster(seite,breite,hoehe) {
	eval("fenster=window.open('"+seite+"','fenster','width="+breite+",height="+hoehe+",left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes')");
	document.forms.seite.submit();
	}
function formular(rubrik) {
	document.forms.seite.action="start.php";
	document.forms.seite.seitentyp.value="absenden";
	document.forms.seite.rubrik.value=rubrik;
	document.forms.seite.method="get";
	document.forms.seite.target="_self";
	document.forms.seite.submit();
	}
