// sys haus funktionen

var PosX = 0;
var PosY = 0;
var witchakt = false;

function syshaus(witch) {
 witchakt = witch;
 document.getElementById('sys-haus-'+witch+'-txt').style.visibility ='visible';
 document.getElementById('sysHaus').src = '/img/de/html_design_files/system-07-1/haus_'+witch+'.png';
 document.getElementById('sys-haus-'+witch+'-txt').style.left  = PosX+"px";
 document.getElementById('sys-haus-'+witch+'-txt').style.top   = PosY+"px";
 if(PosY!=0){
  document.getElementById('sys-haus-'+witch+'-txt').style.margin = 0;
  document.getElementById('sys-haus-'+witch+'-txt').style.padding = 0;
 }
 
}

var ie = (document.all) ? true : false;
 
if(!ie) document.captureEvents(Event.MOUSEMOVE);
 
function getPosXY(e) {
 x = (ie) ? event.clientX + document.body.scrollLeft : e.pageX;
 y = (ie) ? event.clientY + document.body.scrollTop : e.pageY;
 if(x < 0) { x = 0; }
 if(y < 0) { y = 0; } 
 PosX = x+15;
 PosY = y-50;
 if(witchakt!=false){
  document.getElementById('sys-haus-'+witchakt+'-txt').style.left  = PosX+"px";
  document.getElementById('sys-haus-'+witchakt+'-txt').style.top   = PosY+"px";
 }
}

document.onmousemove = getPosXY;

function syshausout(witch) {
 document.getElementById('sys-haus-'+witch+'-txt').style.visibility ='hidden';	
 document.getElementById('sysHaus').src = '/img/de/html_design_files/system-07-1/house_plain.png';
 witchakt = false;
}

var Pictures        = new Array (
	"/img/de/html_design_files/system-07-1/background_blende.png",
    "/img/de/html_design_files/system-07-1/haus_anschluesse.png",
    "/img/de/html_design_files/system-07-1/haus_innen.png",
    "/img/de/html_design_files/system-07-1/haus_rieselschutz.png",
    "/img/de/html_design_files/system-07-1/haus_sanierung.png",
    "/img/de/html_design_files/system-07-1/haus_winddichtung.png",
	"/img/de/html_design_files/system-07-1/house_plain.png"
);

function syshausPreloader() {
    //document.getElementById(loadBarNameID).width=1;
    if (!document.preImages) 
    {
      
	  preImages = new Array(); 
	  //addition=Math.floor(preloaderLength/Pictures.length);
    }
    loadpics();
}

function loadpics() {
  for (i = 0; i < Pictures.length; i++) 
  {
      preImages[i] = new Image();preImages[i].src = Pictures[i];
	 
  }
  //document.getElementById('sysHaus').src = "/img/de/html_design_files/system-07-1/house_plain.png";
 check(0);
 // alert('Finish');
}

function check(done){
 for (i = 0; i < preImages.length; i++) {
   if (preImages[i].complete) {
    if (done<preImages.length){
     //document.getElementById('sysHaus').src = document.getElementById(loadBarNameID).width+addit ion;
     done++;
	 } else {
      document.getElementById('sysHaus').src = "/img/de/html_design_files/system-07-1/house_plain.png";
      return true;
   }
  }
 }
 setTimeout("check("+done+")",10);
}

// naturefund
function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
