var adtimer;
var actualbanner=0;

function BannerRotate()
{
 var anzbanner=document.getElementById("anzbanner").value;
 for(m=0;m<anzbanner;m++)
  if(document.getElementById("banner"+m)!=null)
   document.getElementById("banner"+m).style.display="none";
    
 document.getElementById("banner"+actualbanner).style.display="block";
 actualbanner++;
 if(actualbanner>(anzbanner-1))actualbanner=0;
 adtimer=window.setTimeout("BannerRotate()",5000); 
}


function confirmDelete(confirmMsg)
{

    var is_confirmed = confirm(confirmMsg);
    if (is_confirmed) {
        return true;
    }

    return false;
}


function getButtonChange(id)
{
document.getElementById("btn"+id).style.backgroundImage="url(/cms/site/img/search-button-active.png)";
}

function getButtonChangeOut(id)
{
if(id!=actualclicked)
document.getElementById("btn"+id).style.backgroundImage="url(/cms/site/img/search-button.png)";
}


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 openPopUp(URL)
{
      var widthpos=(screen.width/2)-512;
      var heightpos=(screen.height/2)-400;
window.open(URL,"360Tour","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=926,height=763,left="+widthpos+",top="+heightpos);
}


function startSearchDE()
{
document.location.href="/cms/output.php?id=4&keyword="+document.getElementById("keyword").value;
}

function startSearchEN()
{
document.location.href="/cms/output.php?id=14&keyword="+document.getElementById("keyword").value;
}

function startSearchFR()
{
document.location.href="/cms/output.php?id=16&keyword="+document.getElementById("keyword").value;
}
