function soundclips() {
	
	this.soundClipsListing = function() {
		if ($('medialoaderselect')) {
			$('medialoaderselect').observe('change', function(e) {
				var medialoaderID = $('medialoaderselect').getValue();
				webkit.playsong(medialoaderID);
			});
		}

		$$('#soundclipslisting ul li a').each(function(o) {
			o.stopObserving('click');
			o.parentNode.observe('mouseover', function(e) {
				cursorLink();
			});
			o.parentNode.observe('mouseout', function(e) {
				cursorClear();
			});
			o.parentNode.observe('click', function(e) {
				e.stop();
				var thisID = o.id.replace(/^clip_/,'');
				new Effect.ScrollTo('mediaplayer', { duration:0.5});
				webkit.playsong(thisID);
				if ($('medialoaderselect')) {
					for (var i=0; i< $('medialoaderselect').options.length; i++){
						if ($('medialoaderselect').options[i].value == thisID) {
							$('medialoaderselect').options[i].selected = true;
						}
						else {
							$('medialoaderselect').options[i].selected = false;
						}
					}
				}
			});
		});
	}
	
	this.mediaLoaderObservers = function(ID) {
		$$('#' + ID + ' ul li a').each(function(o) {
			o.stopObserving('click');
			o.observe('click', function(e) {
				e.stop();			
				var thissong = o.pathname.replace(/^\/?song_/,'');
				new Effect.Pulsate(o, { duration:.3, pulses: 2, afterFinish:function() {					
					webkit.playsong(thissong);
					$$('#' + ID + ' div.wrapper').each(function(o) {
						o.id = "activemenu";
					});
					new Effect.BlindUp('activemenu', { duration: 0.3, afterFinish:function() {
						$('activemenu').id = "";
					}});
					var songname = o.innerHTML;
					$$('#' + ID + ' a.topLink').each(function(o) {
 						o.update(songname);					
					});
				}});
			});
		});
	}
	
	this.pausesong = function() {
		soundclips.getFlashMovie('mediaplayer_global').pauseJSTrigger();
	}
	
	this.updateMediaLoader = function(song) {
		globalY.log("play song: " + song);
		if (webkit.jsondata.medialoaderID) {
			$$('#' + webkit.jsondata.medialoaderID + ' a.topLink').each(function(o) {
				o.update(song);	
				if (typeof updateMediaLoaderCallback !== "undefined") {
					updateMediaLoaderCallback(song);
				}
			})
		}
	}
	
	this.getFlashMovie = function(movieName) {
		if (Prototype.Browser.IE) {
			return window[movieName];
		}
		else {
			return document[movieName];
		}
	}
	
	return true;
}

var soundclips = new soundclips();

function soundClipsListing() {
	soundclips.soundClipsListing();
}