// Javascript Functions

var flashvars = {};
var params = {};
params.allowscriptaccess = "always";
params.wmode = "transparent";
var attributes = {};
attributes.id = "player";
attributes.name = "player";
swfobject.embedSWF("flash/mp3player467.swf", "myAlternativeContent", "172", "73", "9.0.0", false, flashvars, params, attributes);


function play(track, artist, title, mix) {
	var movie = window.document.player;
	movie.SetVariable("playthis", track);
	movie.SetVariable("artist", artist);
	movie.SetVariable("title", title);
	movie.SetVariable("mix", mix);				
	movie.song_play();
}

function trim(theField) {
    theField.value = theField.value.replace(/^\s+|\s+$/g, '');
}

function trim_left(theField) {
    theField.value = theField.value.replace(/^\s+/g, '');
}

function trim_right(theField) {
   theField.value = theField.value.replace(/\s+$/g, '');
}

function formatEmail(theField) {
	if (theField.value != '') {
		isValid = !(!theField.value.match(/^\w+([.\+\-]\w+)*@\w+([.\-]\w+)+$/));
		if (isValid == false) {
			alert('Please enter a valid email address.');		
			theField.select();
			theField.focus();
			return false;
		}
	}
}
