////////////////////////
/// (c) 2003 winston ///
////////////////////////

var agt=navigator.userAgent.toLowerCase();
ie = (    (document.all) && (window.offscreenBuffering) ) ? true : false;
nn = (    (document.captureEvents) && (!document.getElementById)  ) ? true : false;
mz = (    (document.getElementById) && (!document.all) && (document.documentElement)  ) ? true : false;
op = (    (document.getElementById) && (navigator.userAgent.indexOf('Opera') != -1) ) ? true :false;
is_mac = (agt.indexOf("mac")!=-1);

if (nn) document.write('<link REL="stylesheet" TYPE="text/css" HREF="public/style/style_nn.css">');
else    document.write('<link REL="stylesheet" TYPE="text/css" HREF="public/style/style_ie.css">');

// Aufzaehlung mit Link - Grafiken
igreen = new Image(); igreen.src = "public/images/green.gif";
ired = new Image(); ired.src = "public/images/red.gif";
var ascount = 0;
// hinzugefügt am 24.09.2003 durch Hubert - Grund -> Commando PopUp greift auf dieses Skript zu
function openPopUp(seite) {
var teil1 = "index.php?site_id=";
var url = teil1+seite;
screenw = window.screen.width;
screenh = window.screen.height;
var sp = new Object();
sp.name = 'Eigentum_und_Wohnen';
sp.location = 0;
sp.top = 'center';
sp.left = 'center';
sp.width = 240;
sp.height = 600;
sp.width_iemac = -1;
sp.height_iemac = -1;
sp.width_ie = -1;
sp.height_ie = -1;
sp.width_kon = -1;
sp.height_kon = -1;
sp.width_nn = -1;
sp.height_nn = -1;
sp.width_mz = -1;
sp.height_mz = -1;
sp.menubar = 0;
sp.status = 0;
sp.directories 	= 0;
sp.scrollbars = 0;
sp.resizable = 0;
for(i=1; i<window.openPopUp.arguments.length; i++) {
var a = window.openPopUp.arguments[i];
split = a.indexOf("=");
if (split != -1) {
v=a.substring(split+1,a.length);
k=a.substring(0,split);
eval("sp."+k.replace(/ /g,"")+"='"+v.replace(/ /g,"")+"'");
}
}
if(nn && sp.width_nn != -1) 	sp.width=sp.width_nn;
if(nn && sp.height_nn != -1) sp.height=sp.height_nn;
if(mz && sp.width_mz != -1) 	sp.width=sp.width_mz;
if(mz && sp.height_mz != -1) sp.height=sp.height_mz;
if(ie && sp.width_ie != -1) 	sp.width=sp.width_ie;
if(ie && sp.height_ie != -1) sp.height=sp.height_ie;
if(is_mac && sp.width_iemac != -1) sp.width=sp.width_iemac;
if(is_mac && sp.height_iemac != -1) sp.height=sp.height_iemac;
if(sp.top=="center") sp.top=Math.round((screenh-sp.height)/2);
if(sp.left=="center") sp.left=Math.round((screenw-sp.width)/2);
n=sp.name;
sp.name=-1;
sp.width_nn=-1;
sp.height_nn=-1; 
sp.width_mz=-1; 
sp.height_mz=-1;
sp.width_ie=-1;
sp.height_ie=-1;
sp.width_iemac=-1;
sp.height_iemac=-1;
a="";
for(p in sp){if(sp[p]!=-1)a+=p+"="+sp[p]+",";}
a=a.substring(0, a.length-1);
top[n]=window.open(url,n,a);
top[n].focus();
if(!top[n].opener) top[n].opener = window;
}
// Ende hinzugefügt 24.09.2003 

function hiLite(imgID,imgObjName) {document.images[imgID].src = eval(imgObjName + ".src")}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  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=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function icon(datei)
{
var abschnitt = datei.lastIndexOf (".");
var endung = datei.substring (abschnitt+1,abschnitt+4);
window.document.writeln("<img src='public/images/icons/",endung,".gif' border='0' width='16' height='16' align='absmiddle'>");
}

function aspop(URLStr, left, top,width,height){
  if (ie) wheight = height-20;
  else wheight = height;	
  popUpWin = open('','pup','toolbar=no,location=no,status=no,menubar=yes,scrollbars=auto,width='+width+',height='+wheight+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
  popUpWin.document.clear();
  popUpWin.document.open('text/html');
  popUpWin.document.write ('<html><head><title>Eigentum & Wohnen</title></head>');
  popUpWin.document.write ('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
  popUpWin.document.write ('<img src="'+URLStr+'" width="'+width+'" height="'+height+'"></body></html>');
  popUpWin.document.close();
  popUpWin.focus();
}
