function show_element(idElement){
    if(document.getElementById(idElement) != null) {
        document.getElementById(idElement).style.display = 'block';
    }
    return false;
}
function hide_element(idElement){
    if(document.getElementById(idElement) != null) {
        document.getElementById(idElement).style.display = 'none';
    }
    return false;
}
function select_element(idElement){
    if(document.getElementById(idElement) != null) {
        document.getElementById(idElement).focus();
    }
    return false;
}
var totalConfirm = 0;
var isDownloading = false;

function validatePanoramas(){
	if(isDownloading==false){
		if(!document.getElementById('email').value){
			alert('Please enter your email address');
			document.getElementById('email').focus();
			return false;
		}
		var params = '';
		if(document.getElementById('email')!=null) params+= '&email=' + document.getElementById('email').value +'&lang=' + language;
		isDownloading = true;
		new Ajax.Request('/ajax/validate_panoramas.php', {
	        asynchronous: true,
	        method: 'post',
	        postBody: params,
	        evalScripts: false,
	        onSuccess: function(t) {
	        	var regExSplit = new RegExp("[|]","g"); 
	        	var tab=t.responseText.split(regExSplit);
	        	if(tab.length==2 && tab[0]=='200'){
	   				alert(tab[1]);
	   				refreshSteps();
	        	}else{
	        		alert(tab[1]);
	        		//alert('An error occured while validating. Please contact our Support Team if the problem persists');
	        	}	
	        	isDownloading = false;        	
			}
	    });
	}
}

