// <![CDATA[

//////////////////////////
// NAV
//////////////////////////

function toggle(DivID) {
	var ToggleObj = document.getElementById(DivID);
	if (ToggleObj.style.display == 'block') {
		ToggleObj.style.display = "none";
		//document.getElementById(DivID + '_icon').className = 'BoxToggleIconOn';
	} else {
		ToggleObj.style.display = "block";
		//document.getElementById(DivID + '_icon').className = 'BoxToggleIconOff';
	}
}



/////////////////////////
// PRELOAD VON BILDERN
/////////////////////////

var imagedir="img/";
var myimages=new Array();
function preloadimages(){
	for (i=0;i<preloadimages.arguments.length;i++){
	myimages[i]=new Image()
	myimages[i].src=imagedir + preloadimages.arguments[i]
	}
}
preloadimages(
);


//////////////////////////
// EINFACHER HTML POPUP
//////////////////////////

function popHTML(id,pwidth,pheight) {
var id = id;
var pwidth = pwidth;
var pheight = pheight+10;
var left = (screen.width/2)-(pwidth/2);
var top = (screen.height/2)-(pheight/2);
NewWin=window.open('detail.php?id=' + id + '','NewWin','width=' + pwidth + ',height=' + pheight + ',resizable=1,top=' + top + ',left=' + left + '');
}

////////////////////////
// GALERIE HTML POPUP
////////////////////////

function galerie(c) {
var pwidth = 642;
var pheight = 480+10;
var left = (screen.width/2)-(pwidth/2);
var top = (screen.height/2)-(pheight/2);
NewWin=window.open('galerie.php?c=' + c + '','NewWin','width=' + pwidth + ',height=' + pheight + ',resizable=1,top=' + top + ',left=' + left + '');
}

//////////////////////////
// MICROSITE HTML POPUP
//////////////////////////

function checkOS() {
  if(navigator.userAgent.indexOf('Linux') != -1){
     var OpSys = "Linux";
  }
  else{
     if((navigator.userAgent.indexOf('Win') != -1) &&
          (navigator.userAgent.indexOf('95') != -1)){
        var OpSys = "Win";
     }
     else{
        if((navigator.userAgent.indexOf('Win') != -1) &&
          (navigator.userAgent.indexOf('98') != -1)){
        var OpSys = "Win";
        }
        else{
           if(navigator.userAgent.indexOf('Win') != -1){
              var OpSys = "Win";
           }
           else{
              if(navigator.userAgent.indexOf('Mac') != -1){
                 var OpSys = "Macintosh";
              }
              else{
                 var OpSys = "Other";
              }
           }
        }
     }
  }
  return OpSys;
}
var OpSys = checkOS();
function popMIC(name,id,pwidth,pheight) {
var id = id;
	if (OpSys=="Macintosh"){
	var pwidth = pwidth;
	var pheight = pheight+1;
	}else{
	var pwidth = pwidth;
	var pheight = pheight;
	}
var left = (screen.width/2)-(pwidth/2);
var top = (screen.height/2)-(pheight/2);
NewWin=window.open(name + '/index.php?id=' + id + '','NewWin','width=' + pwidth + ',height=' + pheight + ',resizable=1,top=' + top + ',left=' + left + '');
}

//////////////////////////
// EINFACHER BILD POPUP
//////////////////////////

var newwindow;
var wheight = 0, wwidth = 0;
function popup(url, title, iwidth, iheight, colour) {
var pwidth, pheight;
// SCREEN MITTE
links = (screen.width/2)-(iwidth/2);
oben = (screen.height/2)-(iheight/2);
if ( !newwindow || newwindow.closed ) {
pwidth=iwidth+30;
pheight=iheight+30;
newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top='+oben+',left='+links);
wheight=iheight;
wwidth=iwidth;
}
if (wheight!=iheight || wwidth!=iwidth ) {
pwidth=iwidth+30;
pheight=iheight+60;
newwindow.resizeTo(pwidth, pheight);
wheight=iheight;
wwidth=iwidth;
}
newwindow.document.clear();
newwindow.focus();
newwindow.document.writeln('<html>');
newwindow.document.writeln('<head>');
newwindow.document.writeln('<title>' + title + '<\/title>');
newwindow.document.writeln('<\/head>');
newwindow.document.writeln('<body bgcolor= \"' + colour + '\">');
newwindow.document.writeln('<table border=\"0\" width=\"100%\" height=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"100%\" align=\"center\">');
newwindow.document.writeln('<a href=\"javascript:window.close()\">');
newwindow.document.writeln('<img src=' + url + ' border=\"0\" alt=\"Fenster schließen\">');
newwindow.document.writeln('<\/a>');
newwindow.document.writeln('<\/td><\/tr><\/table>');
newwindow.document.writeln('<\/body>');
newwindow.document.writeln('<\/html>');
newwindow.document.close();
newwindow.focus();
}
function tidy5() {
if (newwindow && !newwindow.closed) { newwindow.close(); }
}




// ]]>