
function showPic(whichpic)
{
	var bu		= $('#placeholdertxt');
	var image	= $('#placeholder');
	
	image.attr('src', whichpic.href);
	bu.html(whichpic.title);

	return false;
}


function abobestellung(page)
{
	abownd		= window.open("abobestellung/"+page+".htm", "abobestellung", "width=500, height=550, status=no, toolbar=no, scrollbars=yes, resizable=yes");
}


function ticketonline(link)
{
	townd		= window.open(link, "ticketonline", "width=650, height=550, status=no, toolbar=no, scrollbars=yes, resizable=yes");
}


  
 	
	var bild="kb";
	var divtag="kopfbanner";
	var imgpath = "swappic";
	var showImgNr = 0;
	
 


	function banner(chosen) 
	{
/*	
		var tmp_fullname = imgpath+"/"+banners[chosen][1];
		// based on the path to the sponsors folder (previously defined) and the "banners" element refered to by the random number "chosen" a fullname path to a sponsor is created 
		if (document.images) 
		{
			if (document.layers && divtag!=null) 
			{	
				// for netscape browsers
				eval('document.'+divtag+'.document.images["'+bild+'"].src = '+tmp_fullname)
			} 
			else 
			{
				// for other browser - internet explorer
				document.images[bild].src = tmp_fullname;
			}
			// image in webpage is set to relevant sponsor
		}
		url = banners[chosen][0];
		// url is set to respective sponsor url
*/
	}

	function firstBannerLoop(pick) 
	{
		var tmp_fname = imgpath+"/"+toArray[pick][1];
		if (document.images) 
		{
			if (document.layers && divtag!=null) 
			{	
				// for netscape browsers
				eval('document.'+divtag+'.document.images["'+bild+'"].src = '+tmp_fname); 
			} 
			else 
			{
				// for other browser - internet explorer
				document.images[bild].src = tmp_fname;
			}
			
			// image in webpage is set to relevant sponsor
		}
		url = toArray[pick][0];
		// url is set to respective sponsor url
	}

	function jump()
	{
		// opens a new webpage with the following properties and the url of the respective sponsor
	 	
	 	if (url)
 		new_window=window.open("http://"+url,"new_win","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=740,height=580");
	}

	function rotate(time)
	{	 

		if(toArray.length>0)
		{
			// :: Zufall
			//	rand=(toArray.length-1)*Math.random();
			//	pick=Math.round(rand);
			
			// :: reihenfolge
			showImgNr++;
			if(showImgNr >= toArray.length)
				showImgNr	= 0;
				
			pick = showImgNr;
			
			
			firstBannerLoop(pick);
			toArray.splice(pick,1);
		}
		else
		{
			// :: Zufall
			//	rand=(banners.length-1)*Math.random();
			//	chosen=Math.round(rand);
			
			// :: reihenfolge
			showImgNr++;
			if(showImgNr >= banners.length)
				showImgNr = 0;
			
			chosen = showImgNr;
			
			
			// based on the length of the "banners" array a mathematically random number is chosen which is between 0 and "banners" length
			// this number is passed to the function banner()
			banner(chosen);
		}
			setTimeout('rotate('+time+')',time);
			// rotates banner, by recalling itself after time set in body tag of webpage has elapsed. rotate() is called from body tag
	}


function video(url)
{
		new_video=window.open("images/"+url,"new_video","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=400,height=300");
}

function dn()
{
	return true;
}
