/* Funktionen für Navigation */
/* ********************************************************************************************************************************************* */	

		var myimages=new Array();
		function preloadimages()
		{
			for (i=0;i<preloadimages.arguments.length;i++)
			{
				myimages[i]=new Image()
				myimages[i].src=preloadimages.arguments[i]
			}
		}


		function wechsel(id, url) 
		{
			
			if(id == 'infosvideo')
			{
				window.document.getElementById(id).src = url;
				window.document.getElementById("neuevideos").src = '/img/flashplayer/btn_neuevideos_off.gif';
				window.document.getElementById("archiv").src = '/img/flashplayer/btn_archiv_off.gif';
				window.document.getElementById("forum").src = '/img/flashplayer/btn_forum_off.gif';
				window.document.getElementById("suche").src = '/img/flashplayer/btn_suche_off.gif';
				window.document.getElementById("einstellungen").src = '/img/flashplayer/btn_einstellungen_off.gif';		
			}

			else if(id == 'neuevideos')
			{
				window.document.getElementById(id).src = url;
				window.document.getElementById("infosvideo").src = '/img/flashplayer/btn_infosvideo_off.gif';
				window.document.getElementById("archiv").src = '/img/flashplayer/btn_archiv_off.gif';
				window.document.getElementById("forum").src = '/img/flashplayer/btn_forum_off.gif';
				window.document.getElementById("suche").src = '/img/flashplayer/btn_suche_off.gif';
				window.document.getElementById("einstellungen").src = '/img/flashplayer/btn_einstellungen_off.gif';		
			}

			else if(id == 'archiv')
			{
				window.document.getElementById(id).src = url;
				window.document.getElementById("infosvideo").src = '/img/flashplayer/btn_infosvideo_off.gif';
				window.document.getElementById("neuevideos").src = '/img/flashplayer/btn_neuevideos_off.gif';
				window.document.getElementById("forum").src = '/img/flashplayer/btn_forum_off.gif';
				window.document.getElementById("suche").src = '/img/flashplayer/btn_suche_off.gif';
				window.document.getElementById("einstellungen").src = '/img/flashplayer/btn_einstellungen_off.gif';		
			}

			else if(id == 'forum')
			{
				window.document.getElementById(id).src = url;
				window.document.getElementById("infosvideo").src = '/img/flashplayer/btn_infosvideo_off.gif';
				window.document.getElementById("neuevideos").src = '/img/flashplayer/btn_neuevideos_off.gif';
				window.document.getElementById("archiv").src = '/img/flashplayer/btn_archiv_off.gif';
				window.document.getElementById("suche").src = '/img/flashplayer/btn_suche_off.gif';
				window.document.getElementById("einstellungen").src = '/img/flashplayer/btn_einstellungen_off.gif';		
			}

			else if(id == 'suche')
			{
				window.document.getElementById(id).src = url;
				window.document.getElementById("infosvideo").src = '/img/flashplayer/btn_infosvideo_off.gif';
				window.document.getElementById("neuevideos").src = '/img/flashplayer/btn_neuevideos_off.gif';
				window.document.getElementById("archiv").src = '/img/flashplayer/btn_archiv_off.gif';
				window.document.getElementById("forum").src = '/img/flashplayer/btn_forum_off.gif';
				window.document.getElementById("einstellungen").src = '/img/flashplayer/btn_einstellungen_off.gif';		
			}

			else if(id == 'einstellungen')
			{
				window.document.getElementById(id).src = url;
				window.document.getElementById("infosvideo").src = '/img/flashplayer/btn_infosvideo_off.gif';
				window.document.getElementById("neuevideos").src = '/img/flashplayer/btn_neuevideos_off.gif';
				window.document.getElementById("archiv").src = '/img/flashplayer/btn_archiv_off.gif';
				window.document.getElementById("forum").src = '/img/flashplayer/btn_forum_off.gif';
				window.document.getElementById("suche").src = '/img/flashplayer/btn_suche_off.gif';		
			}

			else
			{
				window.document.getElementById("infosvideo").src = '/img/flashplayer/btn_infosvideo_off.gif';
				window.document.getElementById("neuevideos").src = '/img/flashplayer/btn_neuevideos_off.gif';
				window.document.getElementById("archiv").src = '/img/flashplayer/btn_archiv_off.gif';
				window.document.getElementById("forum").src = '/img/flashplayer/btn_forum_off.gif';
				window.document.getElementById("suche").src = '/img/flashplayer/btn_suche_off.gif';
				window.document.getElementById("einstellungen").src = '/img/flashplayer/btn_einstellungen_off.gif';		
			}
		}



/* Aufruf nach Werbevideo */
/* ********************************************************************************************************************************************* */	
		
		function onComplete(args)
		{
			
			//document.cookie     = "ADVIDEO=1";
			var tmpcontrols     = "false";  
			var tmpfunction     = "onVideoComplete";
			var tmpfile         = tmpvideofile;
			var tmpbandwith     = "null";	
			
			/*Titel des aktuellen Videos ausgeben*/
			document.flashform.flashtitle.value = tmpfiletitle;
			
			showvideo(tmpmode,tmpbandwith,tmpfile,tmpcontrols,tmpfunction,tmpargument);
			resize(0);
		}


/* Aufruf nach normalem Video*/
/* ********************************************************************************************************************************************* */	
		
		function onVideoComplete(args)
		{	
			var tmpcontrols     = "false";  
			var tmpfunction     = "onVideoComplete";
			var tmpfile         = tmpvideofile;
			var tmpbandwith     = "null";
			document.cookie     = "Up=1";
			document.cookie     = "VIDEOUP=1";
			
			/*Titel des aktuellen Videos ausgeben*/
			document.flashform.flashtitle.value = tmpfiletitle;
			
			/*Automatischer Durchlauf*/
			if(args == 0)
			{
			//showvideo(tmpmode,tmpbandwith,tmpfile,tmpcontrols,tmpfunction,tmpargument);
			resize(0);
			}
			else
			{
			resize(0);
			window.setTimeout(loadwindow, 600);
			}
		}


		function loadwindow()
		{
			location.reload();
		}

/* Vollbildmodus */
/* ********************************************************************************************************************************************* */

		function resize(mode)
		{
	
	 		if(mode==1)
			{

				var windowwidth  = screen.height * 1.25;
	  			var windowheight = screen.height;
				windowheight = windowheight - 50;
				windowwidth = windowwidth - 100;
				var windowtop   = -230;
				var windowleft  = -25;
				
				document.getElementById("contentright").style.visibility="hidden";
				document.getElementById("footer").style.visibility="hidden";
				document.getElementById("bannerbottom").style.visibility="hidden";
				
				try
				{
					sizeupvideo(); 
				}
				catch(exception)
				{
					window.setTimeout(sizeupvideo, 200); // Video-Fenster in x msec. vergrößern (Zeit fuer Verarbeitung des Flash-Resizes)

				}
			
				var frame = document.getElementById("flashcontent");
		 			frame.style.height = windowheight + "px";
		 			frame.style.width = windowwidth + "px";
		 			frame.style.top = windowtop + "px";
		 			frame.style.left = windowleft + "px";
		
		 		
				var flash = document.getElementById("flash");
		 			flash.setAttribute("width",windowwidth);
		 			flash.setAttribute("height",windowheight);
		 			flash.setAttribute("top",windowtop);
		 			flash.setAttribute("left",windowleft);

			

		 	}
			else
			{	
				

		  		var windowheight = 290;
	  			var windowwidth = 340; 
				var windowtop   = 0;
				var windowleft  = 0;
				
				document.getElementById("contentright").style.visibility="visible";
				document.getElementById("footer").style.visibility="visible";
				document.getElementById("bannerbottom").style.visibility="visible";
				
				var frame = document.getElementById("flashcontent");
		 			frame.style.height = windowheight + "px";
		 			frame.style.width = windowwidth + "px";
		 			frame.style.top = windowtop + "px";
		 			frame.style.left = windowleft + "px";
		
		 		
				var flash = document.getElementById("flash");
		 			flash.setAttribute("width",windowwidth);
		 			flash.setAttribute("height",windowheight);
		 			flash.setAttribute("top",windowtop);
		 			flash.setAttribute("left",windowleft);
				
				try
				{
					sizedownvideo(); 
				}
				catch(exception)
				{
					window.setTimeout(sizedownvideo, 200); // Video-Fenster in x msec. verkleinern (Zeit fuer Verarbeitung des Flash-Resizes)

				}
			}
	 		
		}



		function sizedownvideo()
		{
			window.moveTo(100,100);
			window.resizeTo(905,720); 
		}

		function sizeupvideo()
		{
			var windowwidth  = screen.height * 1.25;
	  		var windowheight = screen.height;
			windowheight = windowheight - 50;
			windowwidth = windowwidth - 100;

			window.moveTo(0,0);
			window.resizeTo(windowwidth,windowheight);
		}


/* Anzeige Video */
/* ********************************************************************************************************************************************* */		

		function showvideo(smode,sbandwith,sfile,scontrols,sfunction,sargs,videonr,cat,noads,object,adVideoWidth,adVideoHeight,roadblockWidth,roadblockHeight)
		{


			var so = new SWFObject("http://www.idgevents.de/videoplayer/player/preloader.swf", "flash", "340", "289", "8", "#FFFFFF");
			so.addVariable("mode",smode);
			so.addVariable("bandwidth",sbandwith);
			so.addVariable("file", sfile);
			so.addVariable("skinConfig", "http://www.idgevents.de/videoplayer/player/config/config.xml");
			so.addVariable("disableControl", scontrols);
			so.addVariable("playbackCallback", sfunction);
			so.addVariable("playbackCallbackArguments", sargs);
			/* RT 23.05.07 - Dart config Variablen */
			so.addVariable("dartConfig", "http://www.idgevents.de/videoplayer/player/config/dart_config.xml");
			so.addVariable("object", object);
			so.addVariable("videonr", videonr);
			so.addVariable("cat", cat);
			so.addVariable("noads", noads);
			so.addVariable("adVideoWidth", adVideoWidth);
			so.addVariable("adVideoHeight", adVideoHeight);
			so.addVariable("roadblockWidth", roadblockWidth);
			so.addVariable("roadblockHeight", roadblockHeight);
			so.write("flashcontent");
		}
