/*
Media Player CFconsultancy 1.0
*/
var multimediaplayer_url = 'http://www.jazzrecords.nl/mediaplayer' // http address for the media folder (no trailing slash).
var accepted_domains=new Array("kantoor.cfconsultancy.nl","jazzrecords.nl") 	// OPTIONAL - Restrict script use to your domains. Add root domain name (minus 'http' or 'www') in quotes, add extra domains in quotes and separated by comma.

// MP3 Flash player options
var mp3downloadLink = 'none'	// Download for mp3 links: One of 'none' (to turn downloading off) or 'inline' to display the link.
var viddownloadLink = 'none'	// Download link for flv and wmv links: One of 'none' (to turn downloading off) or 'inline' to display the link. ***Use $qtkiosk for qt***.

// Hex colours for the MP3 Flash Player (minus the #)
var playerbg ='DEE4E8'	// Background colour
var mp3width = '100' 	// Width
var mp3height = '20'	// Height

// Flash video player options
var flvwidth = '280' 	// Width of the flv player
var flvheight = '219'	// Height of the flv player (allow 20px for controller)
var flvbgcolor = '#A7A3A0'

// CSS styles
var mp3playerstyle = 'vertical-align:bottom; margin:10px 0 2px 0px;'	// Flash mp3 player css style

/* --------------------- Domain Check ----------------------- */
//Lite protection only, you can also use .htaccss if you're paranoid - see http://evolt.org/node/60180
var domaincheck=document.location.href //retrieve the current URL of user browser
var accepted_ok=false //set acess to false by default

if (domaincheck.indexOf("http")!=-1){ //if this is a http request
for (r=0;r<accepted_domains.length;r++){
if (domaincheck.indexOf(accepted_domains[r])!=-1){ //if a match is found
accepted_ok=true //set access to true, and break out of loop
break
}
}
}
else
accepted_ok=true

if (!accepted_ok){
alert("You\'re not allowed to directly link to this .js file on our server!")
history.back(-1)
}

/* --------------------- Flash MP3 audio player ----------------------- */
if(typeof(Multimediaplayer) == 'undefined') Multimediaplayer = {}
Multimediaplayer.Mp3 = {

go: function() {
    var all = document.getElementsByTagName('a')
    for (var i = 0, o; o = all[i]; i++) {
        if(o.href.match(/\.mp3$/i) && o.className!="amplink") {
            o.style.display = mp3downloadLink
            url = o.href
            var Mp3player = document.createElement('span')
        Mp3player.innerHTML = '<object title="Klik hier om te luisteren" style="'+mp3playerstyle+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"' +
        'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"' +
        'width="'+mp3width+'" height="'+mp3height+'" id="player" align="middle">' +
        '<param name="wmode" value="transparent" />' +
        '<param name="allowScriptAccess" value="sameDomain" />' +
        '<param name="flashVars" value="myfilm1='+url+'&amp;mytext1=&amp;automode=0&amp;stretch=0&amp;thumbsbg=0x'+playerbg+'" />' +
        '<param name="movie" value="'+multimediaplayer_url+'/player2.swf" /><param name="quality" value="high" />' +
        '<embed title="Klik hier om te luisteren" style="'+mp3playerstyle+'" src="'+multimediaplayer_url+'/player2.swf" flashVars="myfilm1='+url+'&amp;mytext1=&amp;automode=0&amp;stretch=0&amp;thumbsbg=0x'+playerbg+'" '+
        'quality="high" wmode="transparent" width="'+mp3width+'" height="'+mp3height+'" name="player"' +
        'align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"' +
        ' pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>'
        o.parentNode.insertBefore(Mp3player, o)
}}}}

if(typeof(Multimediaplayer) == 'undefined') Multimediaplayer = {}
Multimediaplayer.FLV = {
	go: function() {
		var all = document.getElementsByTagName('a')
		for (var i = 0, o; o = all[i]; i++) {
			if(o.href.match(/\.flv$/i) && o.className!="amplink") {
			o.style.display = viddownloadLink
			url = o.href
			var flvplayer = document.createElement('span')
			flvplayer.innerHTML = '<object type="application/x-shockwave-flash" wmode="Opaque" data="'+multimediaplayer_url+'/flvplayer.swf?click='+multimediaplayer_url+'/images/click.png&file='+url+'&clickAlpha=90&showTime=true&showTotalTime=true&previewTime=0.2" height="'+flvheight+'" width="'+flvwidth+'">' +
			'<param name="movie" value="'+multimediaplayer_url+'/flvplayer.swf?click='+multimediaplayer_url+'/images/click.png&file='+url+'&clickAlpha=90&showTime=true&showTotalTime=true&previewTime=0.2" /> <param name="wmode" value="Opaque" /><param name="bgcolor" value="'+flvbgcolor+'" />' +
			'<embed src="'+multimediaplayer_url+'/flvplayer.swf?file='+url+'&click='+multimediaplayer_url+'/images/click.png&clickAlpha=90&showTime=true&showTotalTime=true&previewTime=0.2" ' +
			'width="'+flvwidth+'" height="'+flvheight+'" name="flvplayer" align="middle" ' +
			'play="true" loop="false" quality="high" allowScriptAccess="sameDomain" ' +
			'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">' +
			'</embed></object><br />'
			o.parentNode.insertBefore(flvplayer, o)
	}}}}


Multimediaplayer.addLoadEvent = function(f) { var old = window.onload
	if (typeof old != 'function') window.onload = f
	else { window.onload = function() { old(); f() }}
}
//We gebruiken hier fastinit
//Multimediaplayer.addLoadEvent(Multimediaplayer.Mp3.go)
//Multimediaplayer.addLoadEvent(Multimediaplayer.FLV.go)



