var returnid;

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;
var temp=returnid.substr(1,1);

document.getElementById(returnid).src="/cms/site/img/nav-"+temp+"-de.png?rel=4";
}

function MM_swapImgRestore3() { //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;
var temp=returnid.substr(2,1);

document.getElementById(returnid).src="/cms/site/img/sb"+temp+"-logo.png";
}

function MM_swapImgRestore2() { //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;
var temp=returnid.substr(1,1);

document.getElementById(returnid).src="/cms/site/img/button-"+temp+"-en.png?rel=4";
}

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.01
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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; 
returnid=a[0];

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 buttonover(id)
{
 document.getElementById("bn"+id).style.color="#EAEAEA";
 document.getElementById("bn"+id).style.background='url(/cms/site/img/buttons-top-black.png)';
}

function buttonout(id)
{
 document.getElementById("bn"+id).style.color="#525252";
 document.getElementById("bn"+id).style.background='url(/cms/site/img/buttons-top.png)';
}


function textover(id)
{
 document.getElementById("tx"+id).style.color="#EAEAEA";
}

function textout(id)
{
 document.getElementById("tx"+id).style.color="#525252";
}

function pageInit()
{
 //var height=document.getElementById("zentriert").style.offsetTop;
 
 //alert(height);
}



var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	if(ddmenuitem!=null)ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{  
	closetimer = window.setTimeout(mclose, timeout);
	
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 


function startSearch(msg)
{
 if(document.getElementById("search").value=="")
 {
  alert(msg);
  document.getElementById("search").focus();
  return false;	
 }
 else document.suche.submit();		
}


function startNewsletter(msg)
{
 if(document.getElementById("nlemail").value=="")
 {
  alert(msg);
  document.getElementById("nlemail").focus();
  return false;	
 }
 else document.nl.submit();		
}


function getUrl(url)
{
 document.location.href=url;
}


function getUrlNew(url)
{
 window.open(url);
}

function openIbexWindow(URL) {
      var widthpos=(screen.width/2)-512;
      var heightpos=(screen.height/2)-400;

      window.open(URL,"webInfoScreen","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=970,height=690,left="+widthpos+",top="+heightpos);
     }


function openWebsite(URL) 
{
      var widthpos=(screen.width/2)-512;
      var heightpos=(screen.height/2)-400;   window.open(URL,"websiteScreen","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=1070,height=900,left="+widthpos+",top="+heightpos);
}

function openMap(URL)
{
      var widthpos=(screen.width/2)-512;
      var heightpos=(screen.height/2)-400;
window.open(URL,"lageplan","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=506,height=443,left="+widthpos+",top="+heightpos);
}

function open360(URL) {
      var widthpos=(screen.width/2)-512;
      var heightpos=(screen.height/2)-400;

window.open(URL,"suisseemex","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=716,height=516,left="+widthpos+",top="+heightpos);
     }
