function addToMailingList() {
	var email = document.getElementById('mailing_list').value;
	var url = "http://baroquerecords.co.uk/add_to_mailing_list.php";
//	url += "?email="+email;
	var dataString = 'email='+ email;
	$.ajax({  
		type: "POST",  
		url: "/add_to_mailing_list.php",  
		data: dataString,  
		success: function() { 
			document.getElementById('mailing_list').value = '';
			alert("You have been added to our mailing list!");
		}
	});
/*	
	new Ajax.Request(url, { method:'get',
		onSuccess: function(transport) {
			document.getElementById('mailing_list').value = '';
			alert("You have been added to our mailing list!");
	  	},
		
	  	onFailure: function(transport) {
		}		  
	});
*/}

function addToMailingList2() {
	var email = document.getElementById('mailing_list').value;
	
	// Add
	if (document.getElementById('radio_subscribe').checked) {
		var url = "/add_to_mailing_list.php";
		url += "?email=" + email;
		
		new Ajax.Request(url, {
			method: 'get',
			onSuccess: function(transport){
				document.getElementById('mailing_list').value = '';
				alert("You have been added to our mailing list!");
			},
			
			onFailure: function(transport){
				alert("Failed to add to mailing list. Please try again!");
			}
		});
	// Remove
	} else {
		var url = "/remove_from_mailing_list.php";
		url += "?email=" + email;
		
		new Ajax.Request(url, {
			method: 'get',
			onSuccess: function(transport){
				document.getElementById('mailing_list').value = '';
				alert("You have been removed from our mailing list!");
			},
			
			onFailure: function(transport){
				alert("Failed to remove from mailing list. Please try again!");
			}
		});
	}
}

function playFeaturedRelease(releaseId) {
	document.getElementById('iFrame').src = "http://lms.criticalrhythm.com/views/promotion/promo_player.php?r="+releaseId;
}

function playRelease(releaseId, width, height) {
	document.getElementById('iFrame').src = "http://lms.criticalrhythm.com/views/promotion/promo_player.php?h="+height+"&w="+width+"&r="+releaseId;
}

