
			window.recentHash = "#";
			window.scrolloff = 0;
			var scrlct=1;
			var scrl;
			var scrl_step = 10;


			function logo_jump()
			{
				var x,y,i,z,obj_logo,stx,sty,posx,posy;
				var jump_range=600/1440;


				obj_logo=document.getElementById("Logo");
				i=document.jump_i;
				x=document.jump_x;
				y=document.jump_y;

				i=i+4;

				if (i<=1440)
					{
						z=Math.abs(Math.sin(i*Math.PI/180));
						posy=Math.round(y-z*15);

						if (document.jump_way=="up")
						{
							posx=Math.round(x+(i*jump_range));
						}
						else
						{
							posx=Math.round(x-(i*jump_range));
						}

						stx=posx+'px';
						sty=posy+'px';
						obj_logo.style.left=stx;
						obj_logo.style.top=sty;
						document.jump_i=i;
					}
					else
					{
						window.clearInterval(jump_again);
						document.jump_y=obj_logo.offsetTop;
						document.jump_x=obj_logo.offsetLeft;
						document.jump_run=0;
					}
			}

			function logo_run()
			{
				var jump,obj_logo;

				obj_logo=document.getElementById("Logo");
				document.jump_y=obj_logo.offsetTop;
				document.jump_x=obj_logo.offsetLeft;

				if(obj_logo.offsetLeft<=20)
				{
					document.jump_way="up";
					obj_logo.style.zIndex=4;
				}
				else
				{
					document.jump_way="down";
					obj_logo.style.zIndex=2;
				}

				if (document.jump_run!=1)
				{
					document.jump_run=1;
					document.jump_i=0;
					jump_again=window.setInterval("logo_jump()",30);
				}
				else {return;}

			}


			function start_jump()
			{
				var jump,obj_logo;
				jump = window.setInterval("logo_run()", 40000);
			}

/* AJAX Handling*/

			function openTab(skript, target)
			{
   			    if (skript == '') {skript='home.php';}

   			    var xmlhttp = null;
    			// Mozilla
			    if (window.XMLHttpRequest)
			    {
			    	xmlhttp = new XMLHttpRequest();
			    }
    			// IE
			    else if (window.ActiveXObject)
			    {
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				}

				xmlhttp.open("GET", skript , true);
   			    window.location.hash = skript;
   			    window.recentHash = window.location.hash;
			    xmlhttp.onreadystatechange =function ()
			    							{
										    	if(xmlhttp.readyState != 4)
											    {
													document.getElementById(target).innerHTML = 'Seite wird geladen ...';
													window.loading = 1;
								        		}

        										if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
        										{
													var answer = xmlhttp.responseText;
													document.getElementById(target).innerHTML = answer;
													window.loading = 0;

													var scripts = answer.match(/<script.*>(.*)<\/script>/gi);

													if (scripts != null)
													{
														for (i=0; i< scripts.length; i++)
														{
					    									script = new String(scripts[i]);
												    		var run_scr = script.replace(/<\/?script>/gi, '');
 					    									eval(run_scr);
														}
													}
        										}
			    							}
			    xmlhttp.send(null);

			}

			function initFromURL()
			{
    			if ((window.location.hash == window.recentHash) || (window.loading ==1)) {return;}


				var initialTab = window.location.hash;
				if (initialTab.substr(0,1)=='#') {initialTab = initialTab.substr(1);}
			    window.recentHash = window.location.hash;
     			openTab(initialTab, 'content');
			}

		    window.onload = function()
		    {
			    initFromURL();
     			setInterval(initFromURL, 1000);
   			}




/* PREVIEW Funktionen */

			function get_scroll()
			{
				var nct;

				if (window.location.hash.substr(1,8)!='home.php') {return;}
				if (typeof document.getElementById('PrevPic1') == "undefined") return;

				else if (window.scrolloff == 1) {return;}

				for (var ct=1; ct<=5; ct++)
				{

					if (document.getElementById('PrevPic'+ct).offsetLeft < 645)
					{
						pic = 'PrevPic'+ct;
						nct = ct + 1;
						if (!document.getElementById('PrevPic'+nct))
						{
							nct = 1;
						}
						break;
					}
				}

				npic = "PrevPic" + nct;
				window.pic = pic;
				window.npic = npic;
				pic_pos = 305-(document.getElementById(npic).width/2);
				window.scrl_am = 645-pic_pos;

				scroll_pic();
			}

   			function scroll_pic()
			{
				pic = window.pic;
				npic = window.npic;


				if (document.getElementById(pic) && document.getElementById(npic))
				{


					if (scrlct <= (window.scrl_am/scrl_step))
					{
							new_left = document.getElementById(pic).offsetLeft-scrl_step;
							document.getElementById(pic).style.left=new_left;
							new_left = document.getElementById(npic).offsetLeft-scrl_step;
							document.getElementById(npic).style.left=new_left;
							scrlct++;
							scrl = window.setTimeout("scroll_pic()", 10);
					}

					else
					{

						document.getElementById(npic).style.left=645-window.scrl_am;
						document.getElementById(pic).style.left=645;
						scrlct=1;
						window.clearTimeout(scrl);
						oldinfo = "PrevInfo"+pic.substr(pic.length-1,1);
						document.getElementById(oldinfo).style.visibility = "hidden";
						newinfo = "PrevInfo"+npic.substr(npic.length-1,1);
						document.getElementById(newinfo).style.visibility = "visible";
						return;
					}
				}
			}

			function start_scroll()
			{
				var scroll;
				scroll = window.setInterval("get_scroll()", 15000);
			}



			var mx=0,my=0;
			function getMousePosition(e)
			{
				return e.pageX ? {'mx':e.pageX, 'my':e.pageY} : {'mx':e.clientX + document.documentElement.scrollLeft + document.body.scrollLeft, 'my':e.clientY + document.documentElement.scrollTop + document.body.scrollTop};
			}

			function popPic(Pic,e)
			{
				myObj = document.getElementById("PopUp");
				mp = getMousePosition(e);
				myObj.style.top=mp.my-200;
				myObj.innerHTML = '<img src="./flyer/'+Pic+'.jpg" width="100">';
			}

			function popDPic()
			{
				myObj = document.getElementById("PopUp");
				myObj.innerHTML ="";
			}

 /* QUICKTIME */

 	var stopplayer;


    /* define function that executes when movie loading is complete */

       function movieLoaded()
       {
   			stopplayer = window.setTimeout('document.Sneak_Club.Stop()', 295000);
       }

       function movieStop()
       {
			document.Sneak_Club.Stop();
   			clearTimeout(stopplayer);
       }


    /* define function that adds another function as a DOM event listener */

         function myAddListener(obj, evt, handler, captures)

        {

        if ( document.addEventListener )

            obj.addEventListener(evt, handler, captures);

        else

            // IE

            obj.attachEvent('on' + evt, handler);

       }



   /* define functions that register each listener */

    function RegisterListener(eventName, objID, embedID, listenerFcn)

    {

        var obj = document.getElementById(objID);

        if ( !obj )

            obj = document.getElementById(embedID);

        if ( obj )

            myAddListener(obj, eventName, listenerFcn, false);

    }
	  /* define a single function that registers all listeners to call onload */

    function RegisterListeners()

    {
       RegisterListener('qt_play', 'Sneak_Club', 'Sneak_Club', movieLoaded);
       RegisterListener('qt_pause', 'Sneak_Club', 'Sneak_Club', movieStop);
    }

/* SNEAKSTREAMS Plugin-Weiche */

	function detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCR '+'IPT>\n'); if (result) return name+','; else return ''; }
	function detectNS(ClassID,name) { n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n; }

	function chk_plugins()
	{
/*		var el, k;
		for(k=0; k<navigator.plugins.length; k++)
		{
		  el = navigator.plugins[k].name;

		  if (el.match(/Flash/))
		  {
		  	openTab('sneak_stream.php?task=flash','content');
		  	return;
		  }
		  if (el.match(/Quicktime/))
		  {
		  	openTab('sneak_stream.php?task=qtime','content');
		  	return;
		  }
		}
		openTab('stream_noply.php','content'); */

		//This script detects the following:
			//Flash
			//Windows Media Player
			//Java
			//Shockwave
			//RealPlayer
			//QuickTime
			//Acrobat Reader
			//SVG Viewer


		var agt=navigator.userAgent.toLowerCase();
		var ie  = (agt.indexOf("msie") != -1);
		var ns  = (navigator.appName.indexOf("Netscape") != -1);
		var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
		var mac = (agt.indexOf("mac")!=-1);

		if (ie && win)
		{
			pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + detectIE("PDF.PdfCtrl.5","Acrobat Reader");
		}
		if (ns || !win)
		{
			nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
			pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
		}

		pluginlist += navigator.javaEnabled() ? "Java," : "";
		if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);

		if (pluginlist.indexOf("Flash")!=-1)
		{
		  	openTab('sneak_stream.php?task=flash','content');
		  	return;
		}
		if (pluginlist.indexOf("QuickTime")!=-1)
		{
		  	openTab('sneak_stream.php?task=qtime','content');
		  	return;
		}
		openTab('stream_noply.php','content');


	}

/*Flash Player Setup */

		function setup(loc)
		{
			if (loc == 'Club')
			{
				jwplayer("club_stream").setup({
				file: "http://www.mahatma-online.de:60000/;.mp3",
				provider:'sound',
				height: 426,
				width: 250,
				duration: 295,
				controlbar: "bottom",
				image: "./stream_img/str_club_pic.png?"+Math.random (1000000),
				title: "Mahatma Sneak Stream: Club Floor",
				players: [
					{ type: "html5" },
					{ type: "flash", src: "./jwplayer/player.swf" }]
				});
			}
			else if (loc == 'Kult')
			{
				jwplayer("kult_stream").setup({
				file: "http://www.mahatma-online.de:60100/;.mp3",
				provider:'sound',
				height: 426,
				width: 250,
				duration: 295,
				controlbar: "bottom",
				image: "./stream_img/str_kult_pic.png?"+Math.random (1000000) ,
				title: "Mahatma Sneak Stream: Kult Floor",
				players: [
					{ type: "html5" },
					{ type: "flash", src: "./jwplayer/player.swf" }]
				});
			}


		}

