jQuery.fn.jmp3 = function(passedOptions){
	// hard-wired options
	var playerpath = "/_js/music/";					// SET THIS FIRST: path to singlemp3player.swf

	// passable options
	var options = {
		"filepath": "/music/musicbag/",  
		"filename": "",
		"muzik": "",
		"backcolor": "",									  
		"forecolor": "",
		"fontColor": "",
		"butColor": "",
		"width": "",	
		"height": "",					
		"repeat": "no",										// repeat mp3?
		"volume": "100",										// mp3 volume (0-100)
		"autoplay": "true",								// play immediately on page load?
		"showdownload": "false",								// show download button in player
		"showfilename": "false"								// show .mp3 filename after player
	};
	
	// use passed options, if they exist
	if (passedOptions) {
		jQuery.extend(options, passedOptions);
	}
	
	// iterate through each object

		// filename needs to be enclosed in tag (e.g. <span class='mp3'>mysong.mp3</span>)
		var filename = options.filepath + options.filename;
		// do nothing if not an .mp3 file
		//var validfilename = filename.indexOf(".mp3");
		//if (validfilename == -1) { return false; }
		// build the player HTML
		var mp3html = '<div><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
		mp3html += 'width="' + options.width + '" height="' + options.height + '" ';
		mp3html += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">';
		mp3html += '<param name="movie" value="' + playerpath + 't_mp3cal.swf?';
		mp3html += 'showDownload=' + options.showdownload + '&muzik=' + options.muzik + '&file=' + filename + '.mp3&autoStart=' + options.autoplay;
		mp3html += '&backColor=' + options.backcolor + '&frontColor=' + options.forecolor + '&width=' + options.width + '&height=' + options.height ;
		mp3html += '&butColor=' + options.butColor + '&fontColor=' + options.fontColor ;
		mp3html += '&repeatPlay=' + options.repeat + '&songVolume=' + options.volume + '" />';
		mp3html += '<param name="wmode" value="transparent" />';
		mp3html += '<embed wmode="transparent" width="' + options.width + '" height="' + options.height + '" ';
		mp3html += 'src="' + playerpath + 't_mp3cal.swf?';
		mp3html += 'showDownload=' + options.showdownload + '&file=' + filename + '.mp3&autoStart=' + options.autoplay;
		mp3html += '&backColor=' + options.backcolor + '&muzik=' + options.muzik + '&frontColor=' + options.forecolor;
	    mp3html += '&butColor=' + options.butColor + '&fontColor=' + options.fontColor;
		mp3html += '&repeatPlay=' + options.repeat + '&songVolume=' + options.volume + '" ';
		mp3html += 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		mp3html += '</object></div>';
		// don't display filename if option is set
		if (options.showfilename == "false") { jQuery(this).html(""); }
		jQuery(this).prepend(mp3html);
		
		// Eolas workaround for IE (Thanks Kurt!)
		if(jQuery.browser.msie){ this.outerHTML = this.outerHTML; }
		
		

};


function mp3cal(sec,id,music,song_ids, width1, height1, bgc, frc, butc, fontc){
$("div").filter('.mp3players').empty();
$("div").filter('.mp3players').hide();
$("div").filter('.sarkiadi').show()	
$("div").filter('.songname').show()
$("div").filter('.songname_pre').show()
var ids = MYLO(id)			
			
if (!height1) {
height1 = 30;
}			
if (!bgc) {
bgc = "f9f9f9";
}
if (!frc) {
frc = "e5e5e5";
}
if (!butc) {
butc = "0x333333";
}
if (!fontc) {
fontc = "0x00a0c6";
}



$.post("/music/_actionman.php", {action: "dinlenme", song_id : song_ids })
	   
	    // custom options
		$(sec).jmp3({
					
		    filename: ids,
			muzik: music,
			width: width1,
			height: height1,
			backcolor: bgc,
			forecolor: frc,
			butColor: butc,
			fontColor: fontc,
			showdownload: "false"
			
		});
	
	$(sec+'_text').hide()
	$(sec).show()
	

	
		
	
		
		}