function checkEmail() {
	var pass1 = document.getElementById("email1").value;
	var pass2 = document.getElementById("email2").value;
	
	if (pass1 != pass2) {
	document.getElementById("statuspass").innerHTML  = '<span style="color:#FF9900;">Please enter the same email twice.<\/span>';
	//change_class('pass2', 'red_alert'); 
	}
	else {
	document.getElementById("statuspass").innerHTML  = 'ok';
	//change_class('pass2', 'text');	
	}
	if ( pass1 == '' || pass1 == ' ' ) {
	document.getElementById("statuspass").innerHTML  = "Please type the same email twice.";
	//change_class('pass1', 'red_alert');
	}
	//else change_class('pass1', 'text');
}

  function submitForm(){

        document.loginform.submit();

    }


function ClearInput(value, id){
	var input = document.getElementById(id); 
	input.value = value; 
}

function SendRequest(address, container) {
    var req = mint.Request().Set('evalScripts', 'true');
   // req.Set(evalScripts, true);
	
    req.OnSuccess = function() {
        $(container).innerHTML = this.responseText;
    }
    
    req.Send(address, container);
}  

function vote(song_id, container){
	var address = 'http://www.africa.com/radio/vote.php?song_id='+song_id;
	SendRequest(address, container)
}

function login(){
	var email1 = document.getElementById("email1").value;
	var email2 = document.getElementById("email2").value;
	var recaptcha_response_field = document.getElementById("recaptcha_response_field").value;
	var recaptcha_challenge_field = document.getElementById("recaptcha_challenge_field").value;
	
		
	var address = 'http://www.africa.com/radio/login.php?recaptcha_challenge_field='+recaptcha_challenge_field+'&email1='+email1+'&email2='+email2+'&recaptcha_response_field='+recaptcha_response_field;
	SendRequest(address, 'login')
	
}

function logout(){
	SendRequest('http://www.africa.com/radio/login.php?logout=1', 'login')
		
}

function suggest(){
	var song_sugest = document.getElementById("song_sugest").value;
	SendRequest('http://www.africa.com/radio/suggest.php?song_sugest='+song_sugest, 'tell_us')
		
}

