Style = {
	apply:function()
	{
		var root = window.location.href.toString().split("/")
		root.pop(); root = root.join("/")+"/";
		
		// activate rollovers
		$$('.rollover').each(function(e){
			var src = e.src;
			var a = src.split("/").pop().split(".");
			
			var new_src = root+"img/"+a[0]+"_on."+a[1];
			
			this.preload(new_src); // preload all rollover states
			
			e.onmouseover = function(){this.src = new_src;}
			e.onmouseout = function(){this.src = src;}
		},this);
	},
	
	preload:function(src)
	{
		var i = new Image();
		i.src = src;
		$('cache').appendChild(i);
	}
};

Sound = {
	src: "02_02_AlwaysWhereI_30Sec_Excerpt.mp3",
	snd:null,
	attached:false,
	
	init:function()
	{
		$('play').onclick = this.play.bind(this,this.src);
		$('stop').onclick = this._stop.bind(this);
		
		this.play(this.src);
	},
	
	play:function(src)
	{
		this._stop();
	
		this.snd = document.createElement("embed");
		this.snd.setAttribute("src", src);	
		this.snd.setAttribute("hidden", true);
		this.snd.setAttribute("autostart", true);
		
		this.attached = true;
		document.body.appendChild(this.snd);	
	},
	
	_stop:function()
	{
		if ( this.snd && this.attached )
		{
			document.body.removeChild(this.snd);
			this.attached = false;
		}
	}
};