	// Image highlights 
	function move_in(img_name,img_src) {
		if (document.images) { document.images[img_name].src=img_src }
	}
	function move_out(img_name,img_src) {
		if (document.images) { document.images[img_name].src=img_src }
	}
	// Floater plain
	function floater(width,height,url) {
		floaterWin = window.open(url,'floaterDoc','height='+height+',width='+width+',left=0,top=0,dependent=yes,resizable=yes,scrollbars=no');
		window.floaterWin.focus();
	}
	// Floater with scrollbars       
	function floaterScroll(width,height,url) {
		scrollfloaterWin = window.open(url,'floaterScrollDoc','height='+height+',width='+width+',left=0,top=0,dependent=yes,resizable=yes,scrollbars=yes');
		window.scrollfloaterWin.focus();
	}
	// Popup
	function openWindow(width, height, name, url) {
		SepWindow = window.open(url, name, 'height='+height+', width='+width+', left=0, top=0, dependent=yes, resizable=yes, scrollbars=yes');
		window.SepWindow.focus();
	}

	// Zoom
	function openZoom(media,href,width,height) {
		if (width<468) { width=468; }
		width += 13; height += 159;
		zoomWin = window.open('/memberzone/postcard/view.php?media='+escape(media)+'&'+'href='+escape(href)+'&frames=0','zoomDoc','width='+width+',height='+height+',toolbar=no,resizable=yes,scrollbars=no');
		window.zoomWin.focus();
	}

	// Video
	function openVideo(file,width,height) {
		if (!width) { width = 192; }
		if (!height) { height = 132; }
		winWidth = width + 32;
		winHeight = height + 160;
		if (winWidth<490) { winWidth=490; }
		videoWin = window.open('/tool/video.php?file='+escape(file)+'&width='+width+'&height='+height,'videoDoc','width='+winWidth+',height='+winHeight+',toolbar=no,resizable=yes,scrollbars=no');
		window.videoWin.focus();
	}
	// Trailer
	function openTrailer(movie_id, format, lang) {
		if (format) { format = '&format='+format } else { format = '' }
		trailerWin = window.open('http://www.cineman.ch/tool/trailer.php?movie_id='+movie_id+format+'&lang='+lang,'trailerDoc','width=550,height=450,dependent=yes,toolbar=no,status=no,menubar=no,resizable=yes,scrollbars=no');
		window.trailerWin.focus();
	}
	function openInterviewTrailer(movie_id, id_interview) {
		trailerWin = window.open('/tool/trailer_interview.php?movie_id='+movie_id+'&id_interview='+id_interview,'trailerDoc','width=550,height=400,dependent=yes,toolbar=no,status=no,menubar=no,resizable=yes,scrollbars=no');
		window.trailerWin.focus();
	}
	function openVideoreview(movie_id) {
		trailerWin = window.open('/tool/trailer_videoreview.php?movie_id='+movie_id, 'trailerDoc' ,'width=550,height=400,dependent=yes,toolbar=no,status=no,menubar=no,resizable=yes,scrollbars=no');
		window.trailerWin.focus();
	}

	// Artikel drucken/senden
	function openAction(url,name,features) {
		quelle = window.document.location.href;
		window.open(url+'?file='+quelle,name,features);
	}

	// Artikel drucken/senden neu mit encodierter Quelle (01.09.2005)
	function openActionNew(url,name,features) {
		quelle = window.document.location.href;
		while(quelle.indexOf("&") != -1){
			quelle = quelle.replace(/&/, "kfmnn");
		}
		while(quelle.indexOf("+") != -1){
			quelle = quelle.replace(/\+/, "plssgn");
		}
		window.open(url+'?file='+quelle,name,features);
	}

	function ausklapp(zellennr) {
		var zelle_klein = 'beitrag_klein_' + zellennr;
		var zelle_gross = 'beitrag_gross_' + zellennr;
		document.getElementById(zelle_klein).style.display = 'none';
		document.getElementById(zelle_gross).style.display = 'inline';
	}
	function einklapp(zellennr) {
		var zelle_klein = 'beitrag_klein_' + zellennr;
		var zelle_gross = 'beitrag_gross_' + zellennr;
		document.getElementById(zelle_klein).style.display = 'inline';
		document.getElementById(zelle_gross).style.display = 'none';
	}

	// Funktionen fuer die rotierenden Teaser
	boxArray = new Array();
	var boxzeiger = 0;
	var timeout = 0;
	var timeout_step = 3000;
	//var timeout_step = 1000;
	var autoTeaserOn = true;

	function teaserSwitch(boxname, switchnr) {
		// Ich blende alle vorhandenen Elemente aus
		var x = 0;
		var teaser_thumb_alle = boxname + '_thumb_' + x;
		var teaser_text_alle = boxname + '_text_' + x;
		var teaser_rect_alle = boxname + '_rect_' + x++;
		while(document.getElementById(teaser_text_alle)) {
			if (document.getElementById(teaser_thumb_alle)) { // Nicht alle haben einen Thumb
				document.getElementById(teaser_thumb_alle).style.display = 'none';
			}
			document.getElementById(teaser_text_alle).style.display = 'none';
			document.getElementById(teaser_rect_alle).style.backgroundColor = '#c0c0c0';
			var teaser_thumb_alle = boxname + '_thumb_' + x;
			var teaser_text_alle = boxname + '_text_' + x;
			var teaser_rect_alle = boxname + '_rect_' + x++;
		}
		// Ich schalte die aktiven Elemente ein
		var teaser_thumb = boxname + '_thumb_' + switchnr;
		var teaser_text  = boxname + '_text_' + switchnr;
		var teaser_rect  = boxname + '_rect_' + switchnr;
		if (document.getElementById(teaser_thumb)) { // Nicht alle haben einen Thumb
			document.getElementById(teaser_thumb).style.display = 'inline';
		}
		document.getElementById(teaser_text).style.display = 'inline';
		document.getElementById(teaser_rect).style.backgroundColor = '';
	}

	function autoTeaserSwitch(boxname_arg) {
		if (autoTeaserOn) {
			if (boxname_arg != '') {
				boxArray2 = new Array();
				boxArray2.push(boxname_arg);
				boxArray2.push(1);
				boxArray.push(boxArray2);
				timeout += timeout_step;
			}
			else {
				teaserSwitch(boxArray[boxzeiger][0], boxArray[boxzeiger][1]);
				boxArray[boxzeiger][1]++;
				var teaser_text = boxArray[boxzeiger][0] + '_text_' + boxArray[boxzeiger][1];
				if (!document.getElementById(teaser_text)) {
				//if (boxArray[boxzeiger][1] > 6) {
					boxArray[boxzeiger][1] = 0;
				}
				boxzeiger++;
				if (boxzeiger >= boxArray.length) {
					boxzeiger = 0;
				}
			}
		}
		window.setTimeout("autoTeaserSwitch('')", timeout);
	}

	function autoTeaserSwitchSchalter(boolwert, box) {
		autoTeaserOn = boolwert;
		var rectString = box + '_nav';
		if (!boolwert) {
			document.getElementById(rectString).style.backgroundColor = '#ff0000';
		}
		else {
			document.getElementById(rectString).style.backgroundColor = '#535250';
		}
	}
	
	/* tooltips */
	wmtt = null;
	document.onmousemove = updateWMTT;

	function updateWMTT(e) {
		x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
		y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
		if(wmtt != null) {
			wmtt.style.left = (x + 20) + "px";
			wmtt.style.top 	= (y + 20) + "px";
		}
	}

	function showWMTT(id) {
		wmtt = document.getElementById(id);
		wmtt.style.display = "block"
	}

	function hideWMTT() {
		wmtt.style.display = "none";
	}
	
	/* kommunkiation mit flash für rating */
	function rating_from_flash(rating_value){		//flash ruft diese funktion auf mit dem wert als übergabe
		document.getElementById('flash_rating').value=rating_value;
	}
			
	function getFlashElement(elem) {				//instanzierung flash element (ff und ie unterschiedlich)
		var app = navigator.appName.toLowerCase();
		var nav = navigator.userAgent.toLowerCase();
		if((app.indexOf("microsoft") != -1 || nav.indexOf("microsoft") != -1) && !Boolean(window["opera"])) {
			return document.all[elem];
		}else {
			return document[elem];
		}
	}
	
	function send_data_to_flash() {					//brauchts nur im falle eines sende-html-daten-zu-flash buttons zB: <input type="button" value="send" onclick="send_data_to_flash();" />
		var myswf = getFlashElement("rating");		//hier wird beim laden der seite ein get-parameter dem flashfilm übergeben
		myswf.JS2Flash(3);
	}
	
	/*popup window für send_link.php*/
	function pop_window(file, request_uri, width, height) {
		features = "width="+width+", height="+height+", toolbar=no, location=no, directories=no, menubar=no, scrollbars=no, copyhistory=no, resizable=no"; 
		adresse = file + "?link=" + request_uri;
		MeinFenster = window.open(adresse, "TeleboyTV", features); //Beim Fensternamen darf kein Punkt und kein Leerzeichen stehen, sonst öffnet der IE das PopUp nicht
		MeinFenster.focus();
	}
			
	/*aufklapp/zuklapp funktionen*/
	function zuklapp_main(listing_id){
		document.getElementById("img_minus_"+listing_id).style.display = "none";
		document.getElementById("img_plus_"+listing_id).style.display = "inline";
		document.getElementById(listing_id+"_main").style.display = "none";
		SetCookie(listing_id+"_main", false, "");
	}
	function aufklapp_more(listing_id){
		document.getElementById(listing_id+"_main").style.display = "inline";
		document.getElementById(listing_id+"_more").style.display = "inline";
		document.getElementById("img_minus_"+listing_id).style.display = "inline";
		document.getElementById("img_plus_"+listing_id).style.display = "none";
		SetCookie(listing_id+"_more", true, "");
		SetCookie(listing_id+"_main", true, "");
	}
	function zuklapp_more(listing_id){
		document.getElementById(listing_id+"_more").style.display = "none";
		document.getElementById("img_minus_"+listing_id).style.display = "none";
		document.getElementById("img_plus_"+listing_id).style.display = "inline";
		SetCookie(listing_id+"_more", false, "");
	}
	function aufklapp_feature(show_feature_id){
		document.getElementById(show_feature_id).style.display = "inline";
		document.getElementById("img_minus_"+show_feature_id).style.display = "inline";
		document.getElementById("img_plus_"+show_feature_id).style.display = "none";
	}
	function zuklapp_feature(show_feature_id){
		document.getElementById(show_feature_id).style.display = "none";
		document.getElementById("img_minus_"+show_feature_id).style.display = "none";
		document.getElementById("img_plus_"+show_feature_id).style.display = "inline";
	}
	
	function SetCookie(cookieName, cookieValue, nDays) {
 		var today = new Date();
 		var expire = new Date();
 		if (nDays==null || nDays==0){ nDays=30; }
 		expire.setTime(today.getTime() + 3600000*24*nDays);
 		document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString() + ";path=/";
	}

	function readCookie(cooname) {
		var nameEQ = cooname + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0){ return c.substring(nameEQ.length,c.length); }
		}
		return '';
	}