// Bilder Zoom #####################################################################

function ImgEnlarge(position,modus) {

	var ImgDivIDStdname = 'AI_';
	var ImgDivID_kl = ImgDivIDStdname + '1';
	var ImgDivID_gr = 'AIXL_' + position;

	if (document.getElementById(ImgDivID_kl) != null && document.getElementById(ImgDivID_gr) != null) {

		if (modus == 'on') {
			if (document.getElementById(ImgDivID_kl).style.display != 'none') {
				document.getElementById(ImgDivID_kl).style.display = 'none';
			}
			document.getElementById(ImgDivID_gr).style.display = 'block';
			if (document.getElementById("AIContainer") != null) {
				document.getElementById("AIContainer").style.cssFloat = 'none';
			}
			if (document.getElementById("ArtikelThumbs") != null) {
				document.getElementById("ArtikelThumbs").style.display = 'none';
			}
		} else if (modus == 'off') {
			document.getElementById(ImgDivID_kl).style.display = 'block';
			document.getElementById(ImgDivID_gr).style.display = 'none';
			if (document.getElementById("ArtikelThumbs") != null) {
				document.getElementById("ArtikelThumbs").style.display = 'block';
			}
			if (document.getElementById("AIContainer") != null) {
				document.getElementById("AIContainer").style.cssFloat = 'left';
			}
		}
	}
}

// Subnavigation Flyouts #####################################################################

var timerRunsNaviOn = false;
var timerRunsNaviOff = false;

function checkTimerNaviOff(){
  if (timerRunsNaviOff){
	 clearTimeout(timerRunsNaviOff);
	 timerRunsNaviOff = false;
  }
}

function checkTimerNaviOn(){
  if (timerRunsNaviOn){
	 clearTimeout(timerRunsNaviOn);
	 timerRunsNaviOn = false;
  }
}

function switch_subnav(num) {
	checkTimerNaviOff();
	timerRunsNaviOn = window.setTimeout('switch_subnav2('+num+')', 100);
}
function close_subnav(num) {	
	checkTimerNaviOn();
	timerRunsNaviOff = window.setTimeout('close_subnav2('+num+')', 800);
}

function switch_subnav2(num) {
	close_subnav_all();
	document.getElementById('ulist_'+num).style.display = 'block';
	document.getElementById('hmp_'+num).style.backgroundImage = 'url(/yaml/navigation/images/arrow_up.gif)';
	document.getElementById('hmp_'+num).style.backgroundRepeat = 'no-repeat';
	document.getElementById('hmp_'+num).style.backgroundPosition = 'bottom center';
}

function close_subnav2(num) {	
	document.getElementById('ulist_'+num).style.display = 'none';
	document.getElementById('hmp_'+num).style.backgroundImage = 'none';
}

function close_subnav_all() {	
	document.getElementById('ulist_11').style.display = 'none';
	document.getElementById('ulist_12').style.display = 'none';
	document.getElementById('ulist_13').style.display = 'none';
	document.getElementById('ulist_15').style.display = 'none';
	document.getElementById('ulist_16').style.display = 'none';
	document.getElementById('ulist_17').style.display = 'none';
	document.getElementById('hmp_8').style.backgroundImage = 'none';
	document.getElementById('hmp_11').style.backgroundImage = 'none';
	document.getElementById('hmp_12').style.backgroundImage = 'none';
	document.getElementById('hmp_13').style.backgroundImage = 'none';
	document.getElementById('hmp_15').style.backgroundImage = 'none';
	document.getElementById('hmp_16').style.backgroundImage = 'none';
	document.getElementById('hmp_17').style.backgroundImage = 'none';
}


// Elemente einblenden/ausblenden #####################################################################

function drop1(id) {
	  if (document.getElementById) {
		  document.getElementById(id).style.display="block";
		} else if (document.all) {
		  document.all[id].style.display="block";
		} else if (document.layers) {
		  document.layers[id].display="block";
		} } 

function drop0(id) {
	  if (document.getElementById) {
		  document.getElementById(id).style.display="none";
		} else if (document.all) {
		  document.all[id].style.display="none";
		} else if (document.layers) {
		  document.layers[id].display="none";
		} }

// Elemente fetten #####################################################################

function bold1(id) {
	  if (document.getElementById) {
		  document.getElementById(id).style.fontWeight="bold";
		} else if (document.all) {
		  document.all[id].style.fontWeight="bold";
		} else if (document.layers) {
		  document.layers[id].fontWeight="bold";
		} } 

function bold0(id) {
	  if (document.getElementById) {
		  document.getElementById(id).style.fontWeight="normal";
		} else if (document.all) {
		  document.all[id].style.fontWeight="normal";
		} else if (document.layers) {
		  document.layers[id].fontWeight="normal";
		} }

// Schriftgrössen ändern #####################################################################

function changeFontSize(diff)
{
	var fs = document.getElementById("BODY").style.fontSize;
	alert(fs);
	var size = parseInt(fs);
	if (size <= 8 && diff < 0) return;
	size += diff;
	var newSize = size + "%";
	document.getElementById("BODY").style.fontSize = newSize;
}

// Videoplayer #####################################################################

var currentFile;
var currentSkin;

function deletePlayer(theWrapper, thePlaceholder, thePlayerId) { 
	swfobject.removeSWF(thePlayerId);
	var tmp=document.getElementById(theWrapper);
	if (tmp) { tmp.innerHTML = "<div id='" + thePlaceholder + "'></div>"; }
}

function createPlayer(theFile, theSkin, theAutostart) {
	var flashvars = {
			file:theFile, 
			autostart:theAutostart, 
			skin:theSkin
	}
	var params = {
			allowfullscreen:"true", 
			allowscriptaccess:"always",
			wmode:"transparent"
	}
	var attributes = {
			id:"player1",  
			name:"player1"
	}
	swfobject.embedSWF("/js/flashplayer4.1/player.swf", "placeholder1", "420", "315", "9.0.115", false, flashvars, params, attributes);
}

function initPlayer(theFile, theSkin, theAutostart) {
	currentFile = theFile;
	currentSkin = theSkin;
	deletePlayer('wrapper', 'placeholder1', 'player1');
	createPlayer(theFile, theSkin, theAutostart);
}

