function removeFromCart(id) {
  $(".cart").html('<div style="text-align:center; margin:10px; height:55px;"><img src="/img/loading.gif" /></div>');
  $.ajaxSetup({dataType:"html", type:"GET"});
  $.ajax({
		url: "/shoppingcarts/ajaxRemoveFromCart/" + id + "/" + new Date().getTime(),
		success: function(data){
			$("#ajaxCart").html(data);
			$("#sc_new").animate({ backgroundColor: "#666" }, 500).animate({ backgroundColor: "#333" }, 1000);
  		}
  });
}


/* JUKEBOX REFERENCING CODE */

function openMediaPlayer(){
  if( !jukebox_handle || jukebox_handle.closed || jukebox_handle == window ){
	jukebox_handle = window.open('/jukeboxitems/show/','jukebox','width=340,height=340,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no');
  }else{
	jukebox_handle.focus();
  }
}

function closeMediaPlayer(){
  if( jukebox_handle == window || jukebox_handle == undefined ){
	jukebox_handle = window.open('','jukebox');
  }
  jukebox_handle.close();
}

function queueInMediaPlayer(assetid){
  if (typeof assetid == "undefined") {
    assetid = "";
  }
  
  if( !jukebox_handle || jukebox_handle.closed ){
	jukebox_handle = window.open('/jukeboxitems/show/' + assetid,'jukebox','width=340,height=340,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no');
	setTimeout("jukebox_handle.focus()",3000);
	setTimeout("jukebox_handle.sendEvent('playitem',0)",4000);
  }else{
	jukebox_handle.loadFile({file:'/jukeboxitems/playlist/' + assetid});
	setTimeout("jukebox_handle.focus()",500);
	setTimeout("jukebox_handle.sendEvent('playitem',0)",1000);
  }
  //  jukebox_handle.sendEvent('playitem',0);
}



$(document).ready( function() {

  // automates the form submit button on any page
  $("a[title='submit']").click( function(){
	$(this).parents("form").submit();
  });

});

