var ticker = '';
var swf_sound = 1;


function hoverCell(id, lev, action) {
	if (document.getElementById) {
		if (action=='in') {
			document.getElementById(id).className='navihover' + lev;
		}
		else {
			document.getElementById(id).className='navi' + lev;
		}
	}
}

function pageInit() {
	//showTicker(100); //deaktiviert
	//Printable Version:
	if (location.search.indexOf('print=yes')>0) {
		window.print();
	}
}

//flash
function getCookie()
	{
	if(document.cookie)
		if(document.cookie.indexOf('sound=')>=0) {
		swf_sound = document.cookie;
		var index = swf_sound.indexOf('=');
		swf_sound = swf_sound.substring(index+1, index+2);
		document.cookie = "swfsound="+swf_sound;
		}  
		else
			{
			setCookie();
			}
 	else
  		{
  		setCookie();
		}
	}
function setCookie() {
		var ablauf = new Date();
		var duration = ablauf.getTime() + (12 * 60 * 60 * 1000); //days
		ablauf.setTime(duration);
		swf_sound = '1';
		document.cookie = "swfsound=1; expires=" + ablauf.toGMTString();
}
	
//flash
function set_swfSound(ss_swf_sound)
	{
	swf_sound = ss_swf_sound;
	if(document.cookie)
		{
		document.cookie = "swfsound=" + swf_sound;
		}
	else
		{
		alert("Bitte Cookies aktivieren!!");
		}
	}


function openPrintableVersion(theUrl) {
	var w,h;
	w = 716;
	h = 1000;
	if (h>screen.availHeight-30) {
		h = screen.availHeight-30;
	}
	if (w>screen.availWidth-30) {
		w = screen.availWidth-30;
	}
	f1 = open(theUrl,'print','width=' + w + ',height=' + h + ',scrollbars=yes,toolbar=no,navbar=no,resizable=no,status=no'); 
	f1.moveTo(0,0);
	f1.focus();
	
}

function fullsizeImage(theUrl) {
	var w,h;
	h = screen.availHeight-30;
	w = screen.availWidth-10;
	f1 = open('../artikel/fullsizeImage.aspx?url=' + theUrl,'print','width=' + w + ',height=' + h + ',scrollbars=yes,toolbar=no,navbar=no,resizable=no,status=no'); 
	f1.moveTo(0,0);
	f1.focus();
	
}

function recommendArticle(path) {
	f1 = open('../artikel/artikelEmpfehlen.aspx?url=' + path,'recommend','scrollbars=yes,toolbar=no,navbar=no,resizable=no,status=no');
	
}

function newWindow (url, windowName, width, height) {
	f1 = open(url,windowName,'width=' + width + ',height=' + height + ',scrollbars=yes,toolbar=no,navbar=no,resizable=yes,status=yes'); 
}
/* -- Ticker --*/
function showTicker(speed) {
	var msg=ticker;
	var out = " ";
	var c   = 1;
	
	if (speed > 100) {
		speed--;
		cmd="showTicker("+speed+")";
		timerTwo=window.setTimeout(cmd,100);
	}
	else if (speed <= 100 && speed > 0) {
		for (c=0 ; c < speed ; c++) {
			out+=" ";
		}
		out+=msg;
		speed--;
		window.status=out;
		cmd="showTicker("+speed+")";
		timerTwo=window.setTimeout(cmd,100);
	}
	else if (speed <= 0) {
		if (-speed < msg.length) {
			out+=msg.substring(-speed,msg.length);
			speed--;
			window.status=out;
			cmd="showTicker("+speed+")";
			timerTwo=window.setTimeout(cmd,100);
		}
		else {
			window.status=" ";
			timerTwo=window.setTimeout("showTicker(100)",75);
		}
	}
}
