// LAKE FEVER JavaScript Document

function doMail(user,domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
}
/* MUSIC */
function $$(id) {
	 if ($.browser.msie) {
		return window[id];
	 }
	 else {
		return document[id];
	 }
}

var nowPlaying = 0;

function jsSendAudio(sender) {
	
	var targ = $("#preview"+sender).attr("href");
	targ = targ.replace("_preview/","");
	targ = targ.replace(".mp3","");
	
	if (nowPlaying == sender){
		jsStopAudio();
		nowPlaying = 0;
	} else {
		if (nowPlaying){
			jsStopAudio();
		}
		$$('previewer').sendAudio(targ);
		$("#preview"+sender).addClass("active");

		nowPlaying = sender;
	}
}
function jsStopAudio(){
	$$('previewer').stopAudio();
	$("#preview"+nowPlaying).removeClass("active");
}
function switchPreview(){
	$("#preview"+nowPlaying).removeClass("active");
}