//var audioFolder = "http://home.quicknet.nl/qn/prive/e.schwebke/shinbone/audio/"; 
//var audioFolder = "audio/"; 
//var posterFolder = "http://home.quicknet.nl/qn/prive/e.schwebke/shinbone/i/poster/"; 
var posterFolder = "posters/"; 

function getPosterUrl(posterFile) {
	var posterUrl = posterFolder + posterFile; 
	return posterUrl;
}


function getPosterThumbUrl(posterFile) {
	var posterUrl = posterFolder + "thumbs/" + posterFile; 
	return posterUrl;
}

function loadPoster(image, posterFile)
{
	alert(posterFile);
	alert(image);

	var posterUrl = posterFolder + "thumbs/" + posterFile; 

	image.setSrc="posterUrl";
}

function changePic(newUrl)
{
 elem = document.getElementById("poster");
 elem.src = newUrl;
 
 elem.parentNode.href = newUrl;
}

function changeMP3PU(title, audioFile) {
	player_window=openPlayer();
	
	innerHTML = getMP3PlayerHTML(title, audioFile, '425', '344');
	
	player_window.document.write(innerHTML);
	player_window.document.close();
		
	if (window.focus) {player_window.focus()}
	return false;
}

function changeMp3(title, audioFile)
{
innerHTML =  getMP3PlayerHTML(title, audioFile, '425', '344');
	document.getElementById("mp3player").innerHTML=innerHTML;
}

function getMP3PlayerHTML(title, audioFile, width, height) {
	var audioUrl = audioFile; 
	var innerHTML;
	
	if (BrowserDetect.OS != "Windows" ) {
		innerHTML = ""
		+ '<embed src= "' + audioUrl + '" autoStart="True" </embed>'	
	} else {
		innerHTML = ""
		+ "<object classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' id='mediaPlayer' width='" + width + "' height='" + height + "'> " // Width is the WMP minimum. Height = 45 (WMP controls) + 24 (WMP status bar)
		+ "<param value='" + audioUrl + "' name='URL'/> "	
		+ "<param name='type' value='application/x-mplayer2'> " 
		+ "<param name='autoStart' value='True'> "
		+ "<param value='False' name='transparentatStart'/> "
		+ "<param value='True' name='animationatStart'/> "			
		+ "<param value='False' name='PreviewMode'/> "		
		
		+ "<embed src='" + audioUrl +"'"
		+ "type='application/x-mplayer2' autostart='1' width='" + width + "' height='" + height + "' "
		+ "pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' " 
		+ "showControls='False' previewmode='True' " 
		+ "</embed> "
		+ "</object>";
	}
	
	return innerHTML;
}



function changeMp3_2(title, audioFile)
{
//var audioFolder = "http://home.quicknet.nl/qn/prive/e.schwebke/shinbone/audio/"; 
//var audioUrl = audioFolder + audioFile; 
var audioUrl = audioFile; 
//alert(audioFolder);alert(audioUrl);
document.getElementById("mp3player").innerHTML=""
+ "<object classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' id='mediaPlayer' width='280' height='240'> " // Width is the WMP minimum. Height = 45 (WMP controls) + 24 (WMP status bar)
+ "<param value='" + audioUrl + "' name='URL'/> "	
+ "<param name='autoStart' value='True'> "

+ "<embed src='" + audioUrl +"'"
+ "type='application/x-mplayer2' autostart='1' width='280' height='240' "
+ "pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' " 
+ "showControls='False' previewmode='True' " 
+ "</embed> "
+ "</object>";

}


function changeYouTube(title, videoUrl)
{
	player_window=openPlayer();

	innerHTML = ""
		+ "<object width='425' height='344'> "
		+ "<param name='movie' value='" + videoUrl+ "&autoplay=1' /> "	
		+ "<param name='allowFullScreen' value='true'> " 
	
		+ "<embed src='" + videoUrl +"&autoplay=1'"
		+ "type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='344' "
		+ "</embed> "

		+ "</object> ";

	player_window.document.write(innerHTML);
	player_window.document.close();
		
	if (window.focus) {player_window.focus()}
	return false;
}

function openPlayer() {
		player_window=window.open("media_player.html", 'video','top=50, left=50, width=441px, height=360px, toolbar=no, menubar=no, location=no, scrollbars=no, resizable=no'); 
		return player_window;
}

