
//Browsersniffer, liefert anbieter, version und betriebssystem in einem string, bsp M5W für Microsoft,5er,Windows und den zusatz, ob flash drin ist (0|1) am ende
//Ausgaben M4W,M5W,N4W,N5W,M4M,N4M,OW


function fR_init(fRid)
{
if (bN.substr(0,2)=='N4') fR_anker = new gAP('a_flexreiter_'+fRid);
else fR_anker = new gAP('px_flexreiter_'+fRid);
for (i=1;i<=eval('fR_menge_'+fRid);i++){
	fR_sty=fL('fRlay'+fRid+i);
	(bN.substr(0,2)=='N4') ? fR_sty.top=fR_anker.y : fR_sty.top=fR_anker.y+'px';
	if (bN.substr(0,3)=='M4M') fR_sty.left=(parseInt(fR_sty.left)+3)+'px';
}
fR_sty=fL('fRlay'+fRid+'1');
fR_sty.visibility='visible';

}

function fR(fRid,o)
{
for (i=1;i<=fR_menge_1;i++){
	fR_sty=fL('fRlay'+fRid+i);
	(i!=o) ? fR_sty.visibility='hidden' : fR_sty.visibility='visible';
	old_ext = eval('document.fR1'+i).src.split("_");
	(i==o) ? ext='on.gif' : ext='off.gif';
	cI(eval('document.fR1'+i),eval('document.fR1'+i).src.substr(0,(eval('document.fR1'+i).src.length- old_ext[old_ext.length-1].length ))+ext);
	
	}
}

if (navigator.appName.substr(0,1)=='M') //Internet Explorer
{
v=0
if (window.clipboardData) v=1;
bN='M'+(parseFloat(navigator.appVersion)+v); 
(!window.opera) ? null : bN='O';
} else if (navigator.appName.substr(0,1)=='N') //Netscape
{
v=parseFloat(navigator.appVersion)+""
v=v.substr(0,1);
bN='N'+v 
} else { bN='0'}
bN=bN+navigator.platform.substr(0,1);
//Netscape Flash-Abfrage
ver=0;
if (navigator.plugins && navigator.plugins['Shockwave Flash']) 
{
   var words = navigator.plugins["Shockwave Flash"].description.split(" ");
   for (var a = 0; a < words.length; ++a){
		if (isNaN(parseInt(words[a])))
		continue;
		ver = parseInt(words[a]);
    }
} 
(ver>=5) ? bN+=5 : bN+=0;

//Internet Explorer FlashAbfrage
if (bN=='M5W0' || bN=='M4W0')
{
document.write(''+
'<s'+'cript language="VBScript">\nOn error resume next\n'+
'ver=0\n'+
'For i=5 to 3 step -1\n'+
'Set x = CreateObject("ShockwaveFlash.ShockwaveFlash." & i)\n'+
'v = IsObject(x)\n'+
'if v then \n'+
'ver=i\n'+
'Exit For\n'+
'End If\n'+
'next\n'+
'</scrip'+'t>')
bN=bN.substr(0,3)+ver;
}
// allgemeine funktionen
function NEresize()
{
if (bN.substr(0,2)=='N4') 
{
wsssty=fL('wsslay')
wsssty.visibility='hidden'
self.location=self.location
}
}
(bN.substr(3,4)=='5')? flash=true : flash=false;

//alert(flash);
//alert(bN);

//layerfunction
function fL(objekt) //mit namen anquatschen liefert den bearbeitbaren layerstyle zurueck
{
	switch(bN.substr(0,2))
	{
		case "N4":
		laystyle=eval(document.eval(objekt));
		break;
		case "M4":
		laystyle=document.all[objekt].style;
		break;
		default:
		laystyle=document.getElementById(objekt).style;
		break;
	}
return laystyle
}


//Bildwechsel
function cI(o,srca)
{
o.oldsrc=o.src
o.src=srca
}
function cIb(o)
{
o.src=o.oldsrc
}

//Popup
function pU(url,name,breite,hoehe,parameter,extern)
{
	((parameter.indexOf("scrollbars=no")>=0)||(parameter.indexOf("scrollbars=0")>=0)) ? k=0 : k=17;
	p="width="+(parseInt(breite)+k)+",height="+hoehe+","+parameter;
	ext = url.split(".");
	((ext[ext.length-1]=='gif')||(ext[ext.length-1]=='jpg')) ? ext='&type=pic' : ((ext[ext.length-1]=='swf') ? ext='&type=swf' : ext='');
	if (name=='neu') name='a'+Math.round(Math.random()*10000);

	if (extern==1)	win=window.open(url,name,p);
	else win=window.open('/popup.asp?url='+escape(url)+ext+'&breite='+breite+'&hoehe='+hoehe,name,p);
	win.focus();
}

function pU_Login(FormName,WinName,breite,hoehe,parameter,extern){
pU('/leer.htm',WinName,breite,hoehe,parameter,extern);
setTimeout("document."+FormName+".submit()",100);
}


function gAP(o)
{
	if (bN.substr(0,2)=='N4') {
		this.x=document.anchors[o].x;
		this.y=document.anchors[o].y;
	}
	else
	{
	if (bN.substr(0,2)=='N5') this.a=document.eval(o);
	else this.a=eval(o);
	this.x=this.a.offsetLeft;
	this.y=this.a.offsetTop;
	while((this.a = this.a.offsetParent) != null)
		{
			this.x += this.a.offsetLeft;
			this.y += this.a.offsetTop;
		}
	}
}



function getElement(el) {
  if (document.getElementById) return document.getElementById(el);
  if (document.all) return document.all[el];
  if (document.layers) return document.layers[el];
}

function dropdowninput(idcheckbox,idelement) {
	if(getElement(idcheckbox).checked) 
		dropdowninputshowhide(idelement,'');
	else
		dropdowninputshowhide(idelement,'none');
}
function dropdowninputshowhide(idelement,state) {
	getElement(idelement).style.display=state;
}
function initPage() {
	k=1;
		while (getElement(k+"add")) {
		 if (document.layers) return document.layers[el];
		dropdowninputshowhide(k,'none');
		getElement(k+"add").checked=false;
	k++;
	}
}



function writeFlash(swf,width,height,name,align,AltenativImg,AlphaMode,imglink,n){

display=true;
if ((n==true)&&(bN.substr(0,1)=='N')) {display=false}

if (flash&&display){
if(name==null) swf.substr(0,(swf.length-4));
towrite='<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+
' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"'+
' WIDTH=' + width +
' HEIGHT=' +height +
' ID='+name+'>'+
'<PARAM NAME=movie VALUE="'+swf+'">'+
'<PARAM NAME=quality VALUE=high>'+
'<PARAM NAME=menu VALUE=false>'
if(AlphaMode!=null) towrite = towrite + '<PARAM NAME=wmode VALUE=transparent>'
towrite = towrite + '<EMBED src="'+swf+'" quality=high '
if(AlphaMode!=null) towrite = towrite + 'wmode=transparent '
towrite = towrite + 'WIDTH='+ width  +' HEIGHT='+ height  +' TYPE="application/x-shockwave-flash" NAME="'+ name +'" ID="'+ name +'" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swliveconnect="true" menu="false"></EMBED></OBJECT>';
}else if (AltenativImg != ""){
towrite='<img src="/img/' + AltenativImg + '" width="'+width+'" height="'+height+'" border="0" alt="">'
if (imglink){ towrite='<a href="' + imglink + '" target="_blank">' + towrite + '</a>' }
}else{
towrite='<table width="'+width+'" height="'+height+'" border="0" cellspacing="0" cellpadding="1" bgcolor="40886F">'+
'<tr>'+
'<td>'+
'<table width="'+width+'" height="'+height+'" border="0" cellspacing="0" cellpadding="5" bgcolor="#FFFFFF">'+
'<tr>'+
'<td align="center">'+
'<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=German&P5_Language=German" target="_blank"><img src="/img/flash_icon.gif" width="30" height="36" border="0"></a><br>'+
'Zum Betrachten der Grafik benötigen Sie das <br />'+
'<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=German&P5_Language=German" target="_blank"><img src="/img/anker_pfeil_rechts.gif" width="11" height="11" border="0" hspace="0" /><img src="/img/clear.gif" width="3" height="1" border="0" />Flash-5-Plugin</a> von Macromedia.<br><br></br></br>'+
'Nach erfolgreicher Installation klicken Sie bitte <nobr><a href="javascript:location.reload();"><img src="/img/anker_pfeil_rechts.gif" width="11" height="11" border="0" hspace="0" /><img src="/img/clear.gif" width="3" height="1" border="0" />hier</a></nobr> '+
'</td>'+
'</tr>'+
'</table>'+
'</td>'+
'</tr>'+
'</table>'
}

document.write(towrite);
}
//alert(bN);

// ******************************************** Business Shop *************************************************
// ==> Blendet Tabellenzeilen aus / ein und sieht Element mit der Nummer 1 als Abstand 
//     an bzw. belendet diese entgegengestezt ein

function ChangeVisibility(CheckBox, RowPraefix, RowCount){
    var Visible = false;
    if(typeof(CheckBox)=="string") Visible = CheckBox=="true";
    if(CheckBox!=undefined && CheckBox!=null){
        // alle Zeilen Durchlaufen
        for (var i = 1; i <= RowCount; i++){
            RowName = RowPraefix + '_' + i;
            Row = getElement(RowName);
            if(Row!=undefined){
                if(CheckBox.checked==true || Visible){
                    // Abstand ausblenden...
                    if(i==1) Row.style.display='none';
                    // ...restliche Zeilen einblenden
                    if(i>1) Row.style.display='';
                }else{
                    // Abstand einblenden...
                    if(i==1) Row.style.display='';
                    // ...restliche Zeilen ausblenden
                    if(i>1) Row.style.display='none';
                }
            }
        }
    }
}

function SetHiddenFieldValue(Value, HiddenFieldName){
    var HiddenValue = null;
	if(typeof(Value)=="string") HiddenValue = Value;
	if(typeof(Value)=="object"){
		if(Value!=undefined && Value!=null){
			if(CheckBox.checked==true) HiddenValue = "1";
			if(CheckBox.checked==false) HiddenValue = "0";
		}
	}
	// HiddenField ermitteln
	HiddenField = getElement(HiddenFieldName);
	//alert(HiddenField);
    if(HiddenField!=undefined && HiddenValue!=null)HiddenField.value = HiddenValue;
	//alert(HiddenField.value);
}


//KWK IFrame Funktion
function SetIFrameHeight(IFrameName, IFrameHeight) {
	IFrameHeight = IFrameHeight + 25;
    if(document.all){
		document.all[IFrameName].height = IFrameHeight;
		this.scrollTo(0,0);
    }else if(document.getElementById){
		document.getElementById(IFrameName).height = IFrameHeight;
		this.scrollTo(0,0);
    } 
}


function writeNavi(Sprache,Stufe){
	display=true;
	goUrl = "hauseigentuemer/was_bieten/startseite.aspx"
	goUrl = document.URL.replace("http://10.0.0.151/","").replace("http://62.217.37.235/","").replace(".aspx","")
	//alert(goUrl);
	goUrl = goUrl.replace("http://waterkotte.joinmedia.de/","")
	goUrl = goUrl.replace("http://87.106.17.170/","")
	goUrl = goUrl.replace("http://www.waterkotte.de/","")
	goUrl = goUrl.replace("http://www.waterkotte.eu/","")
	goUrl = goUrl.replace("http://www.waterkotte.at/","")
	goUrl = goUrl.replace("http://www.waterkotte.fr/","")
	goUrl = goUrl.replace("http://www.waterkotte.nl/","")
	goUrl = goUrl.replace("http://www.waterkotte.pt/","")
	
	
	if (flash&&display){
		towrite='<OBJECT classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'+
		' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"'+
		' WIDTH=211'+
		' HEIGHT=650'+
		' ID=navi>'+
		'<PARAM NAME=movie VALUE="/navi.swf?go='+goUrl+'&lang='+Sprache+'&notfirsttime=true">'+
		'<PARAM NAME=quality VALUE=high>'+
		'<PARAM NAME=allowScriptAccess VALUE=sameDomain>'+
		'<PARAM NAME=align VALUE=middle>'+
		'<PARAM NAME=menu VALUE=false>'+
		'<PARAM NAME=bgcolor VALUE=#ffffff>'+
		'<param name="salign" value="LT" />';
		towrite = towrite + '<EMBED salign="LT" src="/navi.swf?go='+goUrl+'&lang='+Sprache+'&notfirsttime=true&s='+Stufe+'" quality="high" align="middle" allowScriptAccess="sameDomain"  menu="false"'
		towrite = towrite + 'WIDTH="211" HEIGHT="650" TYPE="application/x-shockwave-flash" NAME=navi ID=navi  PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>';
	}
	document.write(towrite);
	//alert(towrite)
}

function FindObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=FindObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

// Mail Link

function sendEmail(encodedEmail){
  location.href = "mailto:" + decodeEmail(encodedEmail);
}

function decodeEmail(encodedEmail){
  var email = "";
  for (i=0; i < encodedEmail.length;){
    var letter = "";
    letter = encodedEmail.charAt(i) + encodedEmail.charAt(i+1)
    email += String.fromCharCode(parseInt(letter,16));
    i += 2;
  }
  
  return email;
}

function displayStatus(encodedEmail){
  window.status = "mailto:" + decodeEmail(encodedEmail);
}

// .NET

var theForm = document.forms['mainform'];
if (!theForm) {
    theForm = document.mainform;
}

function __doPostBack(eventTarget, eventArgument) {
	if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}