//------------------------------------------------------------------------
//JSPlayer made by Stanislav Zorjan Copyright 2008 - All Rights Reserved
//zstasa@yahoo.com
//------------------------------------------------------------------------
document.write('<script src="/javascripts/swfobject.js" type="text/javascript" language="JavaScript"></script>');
function JSPlayer(){
	
	this.holder;
	this.element;
	this.images = new Array();
	this.images[0] = '/images/play.jpg';
	this.images[1] = '/images/stop.jpg';
	this.images[2] = '/images/rollPlay.jpg';
	this.images[3] = '/images/rollStop.jpg';
	
	this.play = function (songPath,id){
		var so = new SWFObject("/swf/player.swf", "myplayer", "400", "20", "8");
   		so.addVariable("mp3Path", songPath);
   		so.addParam("wmode", "transparent");
   		so.write("swfplayer");
	}

	this.id = function(id){
		try{
			this.holder.src = this.images[0];
		}catch(e){
		}
		if(id != "flash"){
			this.element = document.getElementById(id);
		}
		if(this.holder == this.element){
			this.holder.src = this.images[2];
			this.holder = "";
			this.play("");
			return;
		}else if(id == "flash"){
			this.holder.src = this.images[0];
			this.holder = "";
			this.play("");
			return;
		}else{
			this.holder = this.element;
			this.element.src = this.images[3];
			return;
		}
	}
	
	this.changeImage = function(id){
		this.img = document.getElementById(id);
		this.element = "/images/" + this.img.src.substr(this.img.src.lastIndexOf("/")+1);
		if(this.element == this.images[0]){
			this.img.src = this.images[2];
		}else if(this.element == this.images[1]){
			this.img.src = this.images[3];
		}else if(this.element == this.images[2]){
			this.img.src = this.images[0];
		}else if(this.element == this.images[3]){
			this.img.src = this.images[1];
		}
	}
}
var player = new JSPlayer();