/*Funcion para abrir una pagina con javascript*/
function showpage(pagina){
    document.location.href=pagina;
}

function chekdata(nombre,email,telefono,mensaje,producto){
    /********************************************************************/
    if(!nombre){
	Sexy.error('<h1>Secodein dice: </h1><p>Introduzca su nombre, porfavor</p>',{onComplete: function(returnvalue)
	           {
	        	document.getElementById('nombre').focus();
	           }
	        }
	      );
    
    return false;
    }
    /********************************************************************/
    if(!email){
	Sexy.error('<h1>Secodein dice: </h1><p>Introduzca su email (correo electronico) , porfavor</p>',{onComplete: function(returnvalue)
	           {
	        	document.getElementById('email').focus();
	           }
	        }
	      );
    return false;
    }
    /********************************************************************/
    var filter=/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/;
    if (email.length == 0 ){
    }
    if (filter.test(email)){
    }
    else{
	Sexy.error('<h1>Secodein dice: </h1><p>Ingrese una direccion de correo valida, por favor.</p>',{onComplete: function(returnvalue)
	           {
	        	document.getElementById('email').focus();
	           }
	        }
	      );
	
	return false;
        }
    /********************************************************************/
    if(!telefono){
	Sexy.error('<h1>Secodein dice: </h1><p>Introduzca su telefono, por favor.</p>',{onComplete: function(returnvalue)
	           {
	        	document.getElementById('telefono').focus();
	           }
	        }
	      );
	
	return false;
    }
    
    /********************************************************************/
    if(isNaN(telefono)){
	Sexy.error('<h1>Secodein dice: </h1><p>Introduzca un telefono valido, por favor.<br /> Solo se admiten numeros 0-9 </p>',{onComplete: function(returnvalue)
	           {
	        	document.getElementById('telefono').focus();
	           }
	        }
	      );
	
	return false;
    }
    /********************************************************************/
    if(!mensaje){
	Sexy.error('<h1>Secodein dice: </h1><p>Introduzca su mensaje o petici\xf3n, por favor.</p>',{onComplete: function(returnvalue)
	           {
	        	document.getElementById('mensaje').focus();
	           }
	        }
	      );
	
	return false;
    }

    /********************************************************************/
    fecha = new Date();
    dia = fecha.getDate();
    mes = fecha.getMonth() + 1;
    if(mes <= 9){
	mes = "0"+mes;
    }
    anio = fecha.getFullYear();
    today = anio+"-"+mes+"-"+dia;   
    //guardo el mesanje XD
    xajax_guarda_mensaje(nombre,telefono,email,mensaje,producto,today)
    
}