function openLocation(form)
{
	window.location=(form.artists.options[form.artists.selectedIndex].value);
}

// If a use has to delete something then this will check
function confirmDelete()
{
    var agree=confirm("Are you sure you wish to delete?");
    if (agree)
        return true;
    else
        return false;
}
function DisableUpdateButton(b)
{
      b.disabled = true;
      b.value = 'Updating';
      b.form.submit();
}

function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=400');");
}

function checkCheckBoxes(theForm) {
	if (
	theForm.terms.checked == false) 
	{
		alert ('You need to agree to the terms & conditions');
		return false;
	} else { 	
		return true;
	}
}

function callback(id,name)
	{
		$('p_id').value = id;
		$('amg_name').value = name;
		$('amg_artist_name').innerHTML = name;
		$('amg_artist_id').innerHTML = id;
	}
function setPromotionCode()
{	
	var promotion_code = $('#promotion_code').val();
		
	$('#st_promotion_code').val(promotion_code);
	
	// Paypal stuff - buid the cutom variable to be "user_id,promotion_code"
	var user_id = $('#pp_promotion_code').val();
	var new_code = user_id + ',' + promotion_code;
	
	$('#pp_promotion_code').val(new_code);
}
	