function set_guided_tour(gt)
{
	setFlashVariables('playerJournale','guided_tour='+gt);
}

function play_handling(id,type,playimage)
{
	if(document.getElementById)
    	{
        	//urlsplit=document.getElementById(id).src.split('/');
		if (!id.match("^video[0-9]"))
		{//play the audio file
			setFlashVariables('playerJournale','node='+id+'&action=4');
		}else
		{//play video file
		if(type==2)
			setFlashVariables('playerJournale','node='+id+'&action=2');
		}
    	}else if(document.all)
    	{
		if (!id.match("^video[0-9]"))
		{
			setFlashVariables('playerJournale','node='+id+'&action=4');
		}else
		{
			setFlashVariables('playerJournale','node='+id+'&action=2');
		}
     	}else
     	{
      		if(!id.match("^video[0-9]"))
        	{
            		setFlashVariables('playerJournale','node='+id+'&action=4');
       	 	}else
        	{
            		setFlashVariables('playerJournale','node='+id+'&action=2');
            
        	}
     	}
	 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 -----//
		var divinfo = "<embed src='/projects/journale/htdocs/resources/flash/player/gateway.swf?"+Math.random()+"' 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>";
		//alert(movieid);
		document.getElementById(divcontainer).innerHTML = divinfo;
	}
}