var currentBg=1;
var maxBg=2;

var dropover=false;
var contentover=false;

function showDropdown(){
	var content=document.getElementById('dropdown_content');
	if(dropover||contentover){ 
		content.style.visibility='visible'; 
		window.status='display';
	} else { 
		content.style.visibility='hidden'; 
		window.status='hide';
	}
	setTimeout('showDropdown()',500);
}

function switchBackground(){
	var bgStyle;
	var bgStyleName;
	currentBg++;

	if(currentBg>maxBg) currentBg=1;

	bgStyle="url(pix/bg_body"+currentBg+".jpg)"
	bgStyleName="Hintergrund "+currentBg;

	document.getElementById("main").style.backgroundImage=bgStyle;
	document.getElementById("switchtext").innerHTML=bgStyleName;
}

function switchOnOff(idx){

	var controlId="switchcontrol_"+idx;
	var topId="switchtop_"+idx;
	var contentId="switchcontent_"+idx;

	var controlStyle=document.getElementById(controlId).style;
	var topStyle=document.getElementById(topId).style;
	var contentStyle=document.getElementById(contentId).style;

	//alert(currentStyle);

	if(contentStyle.display=="none"|| contentStyle.display==""){
		controlStyle.backgroundImage="url('pix/icon_switch_close.gif')";
		contentStyle.display="block";
	}
	else {
		controlStyle.backgroundImage="url('pix/icon_switch_open.gif')";
		contentStyle.display="none";
	}
}

function switchOn(idx){

	var contentId="switchcontent_"+idx;

	var contentStyle=document.getElementById(contentId).style;
	contentStyle.display="block";
}

function popup(url,fenster,width,height,center){
	x=screen.availWidth/2-width/2;
	y=screen.availHeight/2-height/2;
	args='width='+width+',height='+height+',screenX='+x+',screenY='+y+',scrollbars=yes,toolbar=yes';
	fenster = window.open(url,fenster,args);
	if(center) fenster.moveTo(screen.availWidth/2-width/2,screen.availHeight/2-height/2);
	fenster.focus();
}
