function urlencode(str) {
	return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
}

function player_for_song(ele, fil, tit, art){
	var flashvars = {};
	fil = fil.replace("http://www.violamusicclub.com", "");
	fil = fil.replace("http://violamusicclub.com", "");
	
	flashvars.skin 		= '/audioplayer/skins/basic_silver/skin.xml';
	//flashvars.playlist 	= '<track><location>' + urlencode(fil) + '</location><creator>' + urlencode(art) + '</creator><title>' + urlencode(tit) + '</title></track>';
	flashvars.playlist = '/audioplayer/playlist.php?fil=' + fil + '&tit=' + tit + '&art=' + art;
	flashvars.autoplay 	= 'false';
	flashvars.volume 	= '80';
	flashvars.shuffle 	= 'false';
	flashvars.wmode		= 'transparent';
	flashvars.key 		= '70FR35RWF09R9HRIXUHI';

//if(console) console.info(flashvars.playlist);
	
	
	var params = {};
	params.allowScriptAccess = 'always';
	
	var attributes = {};
	attributes.id = 'play_' + fil.replace(/^.*\//, '');
	
	swfobject.embedSWF(
		'/audioplayer/ep_player2.swf', 			// the location of the swf file
		ele, 			// the id of the div to print the player in 
		'400', '24', 				// the width and height of the player
		'10.0.0',					// the required flash version 
		false,						// we've disabled express-install to keep it simple
		flashvars,
		params,
		attributes
	);
	
}


function player_for_playlist(ele, list){
	var flashvars = {};
	flashvars.skin 		= '/audioplayer/skins/basic_silver/skin.xml';
	flashvars.playlist 	= list;
	flashvars.autoplay 	= 'false';
	flashvars.volume 	= '80';
	flashvars.shuffle 	= 'false';
	flashvars.wmode		= 'transparent';
	flashvars.key 		= '70FR35RWF09R9HRIXUHI';

//if(console) console.info(flashvars.playlist);
	
	
	var params = {};
	params.allowScriptAccess = 'always';
	
	var attributes = {};
	attributes.id = 'play_' + list.replace(/^.*\//, '');
	
	swfobject.embedSWF(
		'/audioplayer/ep_player2.swf', 			// the location of the swf file
		ele, 			// the id of the div to print the player in 
		'400', '24', 				// the width and height of the player
		'10.0.0',					// the required flash version 
		false,						// we've disabled express-install to keep it simple
		flashvars,
		params,
		attributes
	);
	
}
