function set_guided_tour(gt)
{
	setFlashVariables('player','guided_tour='+gt);
}
function play_handling(id,type,playimage)
{
	if(document.getElementById)
	{
		urlsplit = document.getElementById(id).src.split('/');
		
		if(urlsplit[urlsplit.length-1] == playimage && !id.match("^video[0-9]"))
		{
			setFlashVariables('player','node='+id+'&action=3');
		}else
		{
			if(type==2)
				setFlashVariables('player','node='+id+'&action=2');
			else 
				if(type == 5)
				{
					setFlashVariables('player','node='+id+'&action=5');
				}
				else
				{
					setFlashVariables('player','node='+id+'&action=4');
				}
		}
		extId  = 'ext'+id;
		if (document.getElementById(extId))
		{
			//document.getElementById(extId).innerHTML = '&nbsp;&nbsp;&nbsp;<a href="#player" onClick="play_handling(\''+id+'\',\'5\',\'img/play.gif\');return false;"><img src="resources/img/play.gif" width="17" height="17" border="0" name="'+id+'" id="'+id+'"></a>';
			document.getElementById(extId).innerHTML = '&nbsp;&nbsp;&nbsp;<a href="#player"><img src="resources/img/play.gif" width="17" height="17" border="0" name="'+id+'" id="'+id+'"></a>';
			document.getElementById(id).src = 'resources/'+playimage;
		}
		
	}else 
		if (document.all)
		{
			urlsplit=document.all[id].src.split('/');
			if(urlsplit[urlsplit.length-1]==playimage && !id.match("^video[0-9]"))
			{
				setFlashVariables('player','node='+id+'&action=3');
			}else
			{
				setFlashVariables('player','node='+id+'&action=3');
				document.all[id].src='resources/'+playimage;        
			}
		}else
		{
			urlsplit=document.images[id].src.split('/');
			if(urlsplit[urlsplit.length-1]==playimage && !id.match("^video[0-9]"))
			{
				setFlashVariables('player','node='+id+'&action=3');
			}else
			{
				setFlashVariables('player','node='+id+'&action=3');
				document.images[id].src='resources/'+playimage;        
			}
		}
	var node = id;
}


// -----------------------------------------------------------
// Detection snippet from http://www.dithered.com/javascript/browser_detect/index.html
// -----------------------------------------------------------
var ua        = navigator.userAgent.toLowerCase(); 
var is_pc_ie  = ( (ua.indexOf('msie') != -1 ) && ( ua.indexOf('win') != -1 ) && ( ua.indexOf('opera') == -1 ) && ( ua.indexOf('webtv') == -1 ) );



/* -----------------------------------------------------------
function setFlashVariables(movieid, flashquery)

movieid: id of object tag, name of movieid passed in through FlashVars
flashquery: querystring of values to set. example( var1=foo&var2=bar )
----------------------------------------------------------- */
function setFlashVariables(movieid, flashquery)
{
	var i,values;
	if(is_pc_ie)
	{
		var chunk = flashquery.split("&");
		for(i in chunk)
		{
			values = chunk[i].split("=");
			document[movieid].SetVariable(values[0],values[1]);
		}
	}else
	{
		var divcontainer = "flash_setvariables_"+movieid;
		if(!document.getElementById(divcontainer))
		{
			var divholder = document.createElement("div");
			divholder.id = divcontainer;
			document.body.appendChild(divholder);
		}
		document.getElementById(divcontainer).innerHTML = "";
		//----- for sun:10505 -----//
		if (window.location.hostname == "www.dev.oem.at")
		{
			var divinfo = "<embed src='/ept_mediathek/v1/htdocs/gateway.swf' FlashVars='lc="+movieid+"&fq="+escape(flashquery)+"' width='0' height='0' type='application/x-shockwave-flash'></embed>";
		}else
			var divinfo = "<embed src='/htdocs/gateway.swf' FlashVars='lc="+movieid+"&fq="+escape(flashquery)+"' width='0' height='0' type='application/x-shockwave-flash'></embed>";

		//var divinfo = "<embed src='/ept_mediathek/v1/htdocs/gateway.swf' FlashVars='lc="+movieid+"&fq="+escape(flashquery)+"' width='0' height='0' type='application/x-shockwave-flash'></embed>";
		//----- for sun -----//
		//var divinfo = "<embed src='/clients/kronik/v0/htdocs/resources/flash/banner_v1/gateway.swf' FlashVars='lc="+movieid+"&fq="+escape(flashquery)+"' width='0' height='0' type='application/x-shockwave-flash'></embed>";
		document.getElementById(divcontainer).innerHTML = divinfo;
	}
}

function change_image(id, image)
{
	if(document.getElementById)
	{
		document.getElementById(id).src = image;
	}else 
		if(document.all)
		{
			document.all[id].src = image;
		}else
		{
			document.images[id].src = image;
		}
}

function resetImages()
{
	for (i=0;i<=15 ;i++ )
	{
		extId = "extaudio"+i;
		if (document.getElementById(extId))
		{
			document.getElementById(extId).innerHTML = '&nbsp;&nbsp;&nbsp;<a href="#player" onClick="resetImages();play_handling(\'audio'+i+'\',\'0\',\'resources/img/stop.gif\', \'5\');return false;"><img src="resources/img/play.gif" width="17" height="17" border="0" name="audio'+i+'" id="audio'+i+'"></a>';
			id = "audio"+i;
			document.getElementById(id).src = 'resources/img/play.gif';
		}
	}
}
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) 
{
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub player_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call player_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}
function player_DoFSCommand(command, args) 
{
	resetImages();	
}