(function($) {
$.fn.sound = function(file) {
	return false;
    if (file == null) file = '/music/music.mp3';
    
    var c = {
    	it:null,
    	on: null,
    	off: null,
    	state: false
    };
    
    return this.each(function(i,e){
    	c.it = $(this);
    	
    	c.on = c.it.find('.on');
    	c.off = c.it.find('.off');
    	
    	c.on.click(_on);
    	c.off.click(_off);
    	
    	_init_bgsound();
   	});
    
    function _on(){
    	c.on.addClass('active');
    	c.off.removeClass('active');
    	
    	_play_bg_sound(file);
    	
    	return false;
    }
    
    function _off(){
    	c.off.addClass('active');
    	c.on.removeClass('active');
    	
    	_stop_bg_sound();
    	
    	return false;
    }
}})(jQuery);
