






//<script type="text/javascript">
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//------------------------- EVAL FORMS ------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
var ord = '\xBA';
var i   = '\xED';
var o   = '\xF3';
var u   = '\xFA';
//-------------------------------------------------------------------
window.onload = function(){
	if(document.getElementById("imageButton")){document.getElementById("imageButton").disabled = false;}
	if(document.getElementById("nameSubmit")){document.getElementById("nameSubmit").disabled  = false;}
}
//-------------------------------------------------------------------
var needsNameInput = false;
function envLanding(){
	if(document.getElementById("imageButton")){document.getElementById("imageButton").disabled = true;}
	//
	var nameForm = document.forms['formLanding'];
	//
	var error = false;
	var errorAlertMsg = "error";
	//
	if(nameForm.phone && !error){
		var Phone = nameForm.phone.value;
		if(Phone.length != 9 || isNaN(Phone) || Phone.slice(0,1) != 6){
			error = true;
			errorAlertMsg = "Por favor inserte un n"+u+"mero de m"+o+"vil correcto.";
		}
	}
	
//-------------------------------------------------------------------
function RegistrationEvaluationOperators(result){
	if (result == -68) {
		MessageToDisplay = '<style type="text/css">.Operator { width:135px; height:135px; margin:10px; margin-top:220px; } </style>';
        MessageToDisplay += '<div>Seleccione su operador:</div>';
        
        MessageToDisplay += '<input type="image" class="Operator" name="operator1" onclick="SubscriptionParamsConfiguration.operator=this.value;registration();" id="yoigo" src="/es/splash_v3_images/images/yoigoboton.jpg" alt="Yoigo" value="yoigo">';
        
        MessageToDisplay += '<input type="image" class="Operator" name="operator1" onclick="SubscriptionParamsConfiguration.operator=this.value;registration();" id="vodafone-es-rb" src="/es/splash_v3_images/images/vodafone.jpg" alt="Vodafone" value="vodafone-es-rb">';
        
        MessageToDisplay += '<input type="image" class="Operator" name="operator1" onclick="SubscriptionParamsConfiguration.operator=this.value;registration();" id="amena" src="/es/splash_v3_images/images/orange.jpg" alt="Orange" value="amena">';
        
        MessageToDisplay += '<input type="image" class="Operator" name="operator1" onclick="SubscriptionParamsConfiguration.operator=this.value;registration();" id="movistar" src="/es/splash_v3_images/images/movistar.jpg" alt="Movistar" value="movistar">';
        
		DisplayMessage(MessageToDisplay,"info");
	};
};
RegistrationDynamicEvaluation.unshift(RegistrationEvaluationOperators);
//-------------------------------------------------------------------   
function AuthenticationEvaluationOperators(result){
	if (result == -68) {
		MessageToDisplay = '<style type="text/css">.Operator { width:135px; height:135px; margin:10px; margin-top:220px; } </style>';
        
        MessageToDisplay += '<input type="image" class="Operator" name="operator1" onclick="SubscriptionParamsConfiguration.operator=this.value;authentication();" id="yoigo" src="/es/splash_v3_images/images/yoigoboton.jpg" alt="Yoigo" value="yoigo">';
        
        MessageToDisplay += '<input type="image" class="Operator" name="operator1" onclick="SubscriptionParamsConfiguration.operator=this.value;authentication();" id="vodafone-es-rb" src="/es/splash_v3_images/images/vodafone.jpg" alt="Vodafone" value="vodafone-es-rb">';
        
        MessageToDisplay += '<input type="image" class="Operator" name="operator1" onclick="SubscriptionParamsConfiguration.operator=this.value;authentication();" id="amena" src="/es/splash_v3_images/images/orange.jpg" alt="Orange" value="amena">';
        
        MessageToDisplay += '<input type="image" class="Operator" name="operator1" onclick="SubscriptionParamsConfiguration.operator=this.value;authentication();" id="movistar" src="/es/splash_v3_images/images/movistar.jpg" alt="Movistar" value="movistar">';
        
		DisplayMessage(MessageToDisplay,"info");
	};
};
AuthenticationDynamicEvaluation.unshift(AuthenticationEvaluationOperators);
//-------------------------------------------------------------------   
    

	

	

	


	 

	


	if(error){
		//alert("return false");
		if(errorAlertMsg!=""){alert(errorAlertMsg);}
		if(document.getElementById("imageButton")){document.getElementById("imageButton").disabled = false;}
		return false;
	} else {
		//alert("return true");
		return true;
	}
	//
	return false;
}
//-------------------------------------------------------------------
function envPin(){
	if(document.getElementById("imageButton")){document.getElementById("imageButton").disabled = true;}
	//
	var nameForm = document.forms['formPin'];
	var pwd      = nameForm.password.value;
	//
	if(pwd=="" || pwd=='undefined'){
		alert("Introduce tu n"+ord+" PIN que has recibido en tu m"+o+"vil.");
	}else{
		//nameForm.submit();
		return true;
		//return false;
	}
	//
	if(document.getElementById("imageButton")){document.getElementById("imageButton").disabled = false;}
	return false;
}
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//--------------------------- POP UPS -------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
var popUpWin = 0;
//-------------------------------------------------------------------
function popUpWindow(){
  if(popUpWin){
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open('/es/splash_v3_legals/html/privacidad.html', 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=yes,resizable=no,width=490,height=400,left=100,top=50');
}
//-------------------------------------------------------------------
function popUpWindowTerm(){
  if(popUpWin)  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open('/es/splash_v3_legals/html/terminos.html', 'popUpWinTerm', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=yes,resizable=no,width=490,height=400,left=100,top=50');
}
//-------------------------------------------------------------------
function popUpWindowBasesMadrid(){
  if(popUpWin){
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open('/es/splash_v3_legals/html/bases_camiseta_real_madrid.html', 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=yes,resizable=no,width=490,height=400,left=100,top=50');
}
//-------------------------------------------------------------------
function popUpWindowBasesiPhone(){
  if(popUpWin){
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open('/es/splash_v3_legals/html/bases_concurso_iphone.html', 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=yes,resizable=no,width=490,height=400,left=100,top=50');
}
//-------------------------------------------------------------------
function popUpWindowTermChat(){
  if(popUpWin){
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open('/es/splash_v3_legals/html/terminos_chat.html', 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=yes,resizable=no,width=490,height=400,left=100,top=50');
}
//-------------------------------------------------------------------
function popUp(url,width,height){
	properties = "";
	if(popUpWin){
		if(!popUpWin.closed) popUpWin.close();
	}
	if(width){
		properties += "width=" + width + ",";
	}else{
		properties += "width=490,";
	}
	if(height){
		properties += "height=" + height + ",";
	}else{
		properties += "height=400,";
	}
	popUpWin = open(url, "popUpWin", "toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=yes,resizable=no," + properties + "left=100,top=50");
}
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//</script>
