var flash;

window.onload = function() {
  if(navigator.appName.indexOf("Microsoft") != -1) {
    flash = window.document.playsound;
	//this should be flash = window.playsound - but sometimes i get errors with this.. and have to make window.document as well

  }else {
    flash = window.document.playsound;
  }
}


function playTrack(track_url) {
	window.document.playsound.playerPlay(track_url);
}

function stopTrack() {
 	 window.document.playsound.playerStop(); 
}

function recieveCompleteFromFlash(){
	 $(document).ready(function(){
			$('div.assigned').removeClass('assigned');
			});
	 }

$(document).ready(function(){
   	$("span.play a").live("mouseover mouseout",
		 function (event) {
     		 if (event.type == "mouseover") $(this).addClass("hover");
     		 else $(this).removeClass("hover");
 		});
	
	$('span.play a').live('click', function(e) {
			$(this).removeClass('hover'); 
			$('div.assigned').removeClass('assigned');
			$(this).parent().parent().addClass('assigned');
 			}); 
	 $("span.stop a").live("mouseover mouseout",
		 function (event) {
     		 if (event.type == "mouseover") $(this).addClass("hover");
     		 else $(this).removeClass("hover");
 		});
	 $('span.stop a').live('click', function(e) {
	 		$(this).parent().parent().removeClass('assigned');
			$(this).parent().parent().siblings('div').removeClass('assigned');
 		}); 
   
});
