<!--

// MainNavi
function NavPic(pic,event)	{
var NavContainer = document.getElementById('Nav_'+pic);
if(NavContainer)	{
	if(event=='over')	{
		NavContainer.innerHTML = '&raquo;';
		}
		else	{
		NavContainer.innerHTML = '';
		}
	}
}

// Picture Popups
function CaricaFoto(img){
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
	viewGalleryWin(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}

function viewGalleryWin(img)	{
	Screentop = (parseInt(screen.height/2)-parseInt((foto1.height/2)));
  	Screenleft = (parseInt(screen.width/2)-parseInt((foto1.width/2)));
	var strHTML = "";
		strHTML += "<html>\n";
		strHTML += "<head><title>Galerie</title>\n";
		strHTML += "<script language=\"JavaScript\" type=\"text/javascript\" src=\"scripts/base.js\"></script>\n";
		strHTML += "<style type=\"text/css\">\n";
		strHTML += "<!--\n";
		strHTML += "body	{\n";
		strHTML += "background-attachment: fixed;\n";
		strHTML += "background-image: url(images/loading.gif);\n";
		strHTML += "background-repeat: no-repeat;\n";
		strHTML += "background-position: center center;\n";
		strHTML += "}\n";
		strHTML += "//-->\n";
		strHTML += "</style>\n";
		strHTML += "<scri"+"pt language=\"JavaScript\">\n";
		strHTML += "window.onload = function() {\n";
		strHTML += "//checkGalleryWindowSize();\n";
		strHTML += "self.focus();\n";
		strHTML += "}\n";
		strHTML += "</scri"+"pt>\n";
		strHTML += "</head>\n";
		strHTML += "<body topmargin=\"0\" leftmargin=\"0\">\n";
		strHTML += "<a href=\"javascript:;\" onClick=\"self.close();\">";
		strHTML += "<img src=\""+ img +"\" galleryimg=\"no\" border=\"0\">";
		strHTML += "</a>\n";
		strHTML += "</body>\n";
		strHTML += "</html>";
	var win = window.open('','ThumbWin','width='+foto1.width+',height='+foto1.height+',left='+Screenleft+',top='+Screentop+',ScreenX='+Screentop+',ScreenY='+Screenleft);
	win.document.open();
	win.document.write(strHTML);
	win.document.close();
}



// BG-Highlight -> Termine
function cb(wo,event)	{
	if(event=='over') wo.bgColor = '#E1F4FF';
	if(event=='out') wo.bgColor = '#FFFFFF';
}

// Scripts für Gallery
function 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=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 initArray() {

this.length = initArray.arguments.length;
  for (var i = 0; i < this.length; i++) {
  	this[i] = initArray.arguments[i];
  }
}

function checkIt(val) {
var goodnum = current+val;
if (goodnum < 0) 	{
	//alert("You can't go any further back!");
	goodnum = picz.length-1;
	//alert(goodnum);
	}
else if (goodnum > picz.length-1) 	{
	//alert("You can't go any further forward!"+picz.length+"/"+goodnum);
	goodnum = 0;
	}
//alert(goodnum);
	if(document.jscriptimg.complete==true)	{
		if(picz[goodnum+1])	{
			preloadImages(picz[goodnum+1]);
		}
	document.jscriptimg.src = picz[goodnum];
	document.getElementById("pics").innerHTML = goodnum+1 +" von "+ picz.length;

	current = goodnum;
	}
}

function slideMe(param)	{
	//if(param=='on')	{
	if(param.src.indexOf('btn_play')>0)	{
		mode = window.setInterval('checkIt(1)',5000);
		//param.src = 'images/btn_stop.gif';
		param.src = 'images/loading_2.gif';
		param.setAttribute("title","Stop");
	}
	else	{
		window.clearInterval(mode);
		param.src = 'images/btn_play.gif';
		param.setAttribute("title","Start");
	}
}

function openWin(strFile,strWidth,strHeight,strParams)	{	
	winHeight = strHeight;
	winWidth = strWidth;
	DistLeft = ((parseInt(screen.availWidth)/2)-(parseInt(winWidth)/2));
	DistTop = ((parseInt(screen.availHeight)/2)-(parseInt(winHeight)/2));
	win = window.open(strFile, '','width='+winWidth+', height='+winHeight+',left='+DistLeft+',top='+DistTop+','+ strParams);
	return win;
}


function openWin(url,width,height,options)	{
	var DistLeft = ((parseInt(screen.width)/2)-(parseInt(width)/2));
	var DistTop = ((parseInt(screen.height)/2)-(parseInt(height)/2));
	
	var win = window.open(url,'MyWin','width='+width+',height='+height+',top='+DistTop+',left='+DistLeft+',ScreenX='+DistTop+',ScreenY='+DistLeft+','+ options);
	return win;
}


function checkGalleryWindowSize() {
	var arrWinDimensions = new Array();
		arrWinDimensions = getWindowSize(); // Breite, Höhe
		
		if(arrWinDimensions[1] <document.images[0].height ) {
			var theHeight = (document.images[0].height + (document.images[0].height - arrWinDimensions[1]));
			var theWidth = document.images[0].width;
			
			if (navigator.appName == 'Netscape') {
				theHeight += 50;
				theWidth += 8;
			}
			window.resizeTo(theWidth, theHeight);	
		}
}


function getWindowSize() {
	var myWidth = 0, myHeight = 0;

	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	return [ myWidth, myHeight ];
}

//-->
