var navactive;
var subnavactive;

var blendeactual;
var winW=0;
var winH=0;
var x=0;
var y=0;
var px="px";


function initEmbed(targetdiv,jpg)
{
 var str='<APPLET name=ptviewer archive="/cms/site/panorama/ptviewer.jar" code="ptviewer.class" width=400 height=300>'
 +'<param name="file" value="'+jpg+'">'
+'<param name=pan value="-177">'
+'<param name=tilt value="4">'
+'<param name=fov value="181">'
+'<param name=fovmin value="40">'
+'<param name=fovmax value="310">'
+'<param name=auto value="0">'
+'</APPLET>';

 document.getElementById(targetdiv).innerHTML=str;
}


function startSearch(error)
{
 if(document.getElementById("search").value=="")
 {
  alert(error);
  document.getElementById("search").focus();
  return false;	
 }
 else document.suche.submit();		
}


function startNewsletter()
{
if(document.getElementById("nlemail").value=="")
 {
  alert("Bitte geben Sie Ihre E-Mail-Adresse ein!");
  document.getElementById("nlemail").focus();
  return false;	
 }
 else nl.submit();			
}


function mousemove(e){
 if(e)   {x=e.pageX?e.pageX:e.clientX?e.clientX:0; y=e.pageY?e.pageY:e.clientY?e.clientY:0;}
 else if(event) {x=event.clientX; y=event.clientY;}
 else {x=0; y=0;}

    x+=document.documentElement.scrollLeft;
    y+=document.documentElement.scrollTop;

 if(blendeactual) showblende();
}



function overinit()
{

}



function blendehide(){
 
 if(blendeactual) 
   blendeactual.style.display="none";
 blendeactual=null;
 
}



function showblende(){

  blendeactual.style.display="block";
  blendeactual.style.left=(((x+260)<winW)?x+12:x-255)+px; 
  blendeactual.style.top=(((y+9)<winH)?y+12:y-9)+px;
}

function overblende(name)
{
   blendeactual=document.getElementById(name);
   winW=(window.innerWidth)? window.innerWidth+window.pageXOffset-16:document.body.offsetWidth-20;
   winH=(window.innerHeight)?window.innerHeight+window.pageYOffset  :document.body.offsetHeight;
   if(x<=0||y<=0){ 
    x=(winW)/2+(window.pageXOffset?window.pageXOffset:0); 
    y=(winH-50)/2+(window.pageYOffset?window.pageYOffset:0); 
   }
   showblende();
}





function getNavActive(nav,subnav)
{ 
  navactive=nav;
  subnavactive=subnav;
  document.getElementById("n"+240).style.background="#17CFAE";   
if(navactive==240)
{  
document.getElementById("subnav"+245).style.background="#B9F1E7";	
document.getElementById("subnav"+246).style.background="#B9F1E7";	
document.getElementById("subnav"+247).style.background="#B9F1E7";	
}
  if(nav>=0)
  {
if(nav==240)document.getElementById("n"+nav).style.background="#17CFAE";   
else document.getElementById("n"+nav).style.background="#F5C780";

  }
  if(subnav>0)getSubNav(subnav);
}

function datensenden(nr)
{
	document.forms[nr].submit();
}


function MainNavOver(nr)
{
	if(navactive!=nr && nr!=240)
	{
		document.getElementById("n"+nr).style.background="#F5C780";
         } 
}



function MainNavOut(nr)
{
	if(navactive!=nr)
	{
		if(nr==240)document.getElementById("n"+nr).style.background="#17CFAE";
		else document.getElementById("n"+nr).style.background="#FFAB27";
         }
}





function SubNavOver(nr)
{
if(navactive==240)
{
if(subnavactive!=nr)document.getElementById("subnav"+nr).style.background="#8EDCCE";	
}
else
{  if(subnavactive!=nr)document.getElementById("subnav"+nr).style.background="#E6D3B6";	}	
}


function SubNavOut(nr)
{
  if(navactive==240)
{
if(subnavactive!=nr)document.getElementById("subnav"+nr).style.background="#B9F1E7";	
}
else
{
if(subnavactive!=nr)document.getElementById("subnav"+nr).style.background="#F9DDB2";	}		
}






function getSubNav(nr)
{

 if(navactive==240)
document.getElementById("subnav"+nr).style.background="#8EDCCE";	

else document.getElementById("subnav"+nr).style.background="#E6D3B6";	
}





function getLink(link)
{
 document.location.href=link;
}


 function fensterauf1(url) {
	win=window.open(url,"infoscreen","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=800,height=630,left=10,top=10");
	}
	
 function fensteraufplayout(url) {
	win=window.open(url,"infoscreen","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=800,height=600,left=10,top=10");
	}	