preload_image = new Image(141,25); 
preload_image.src="imagenes/Cargando.gif"; 

function url_data(content,text,size){
//       document.getElementById('test').style.visibility = 'visible';
//       document.getElementById('test').style.display = 'table';
         document.getElementById(content).innerHTML="<table width='400' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td align='center'><img src='imagenes/Cargando.gif' width='141' height='25'></td></tr></table>";
//       setTimeout('document.'+form+'.submit();',1250);
}

function sub_page(url){
	url_data('sub_page_content','Generación de Contenido ... Por Favor Espere','250');
	top.location = url
}

function refresh_image(image){
tmp = new Date();
tmp = "?"+tmp.getTime() 
document.images["imagen_verificadora"].src = image+tmp
}

function check_availability(){
		if (document.regi_.login.value == ""){
		alert('Por favor,introdusca un Nombre.');
		return false;
		}
		
		window.open("check-"+document.regi_.login.value+".html","win2","status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=400,height=150,left=200,top=200,directories=no,location=no");

}

function check_availability2(){
		if (document.regi_.email.value == ""){
		alert('Por favor,introdusca su EMAIL.');
		return false;
		}
		
		window.open("Email-"+document.regi_.email.value+".html","win2","status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=400,height=150,left=200,top=200,directories=no,location=no");

}

///Registro

function registro_form(){
if ( document.regi_.login.value == "")
{
alert("Por favor, introduzca si ID.");
return false;}

if ( document.regi_.name.value == ""){
alert("Por favor, introduzca su Nombre.");
return false;}

if ( document.regi_.pw.value == ""){
alert("Por favor, introduzca su Password.")
return false;}

if ( document.regi_.cpw.value == ""){
alert("Por favor, introduzca su Repiticion de Password.");
return false;}

if ( document.regi_.cpw.value !== document.regi_.pw.value ){
alert("Sus Password No Concuerdan.");
return false;}

if ( document.regi_.email.value == ""){
alert("Por favor, introduzca su Email.");
return false;}

if ( document.regi_.email.value !== document.regi_.email1.value){
alert("Sus Email No Concuerdan.");
return false;}

if ( document.regi_.Pais.value == "null"){
alert("Por favor, introduzca su Pais.");
return false;}

if ( document.regi_.idnumb.value == ""){
alert("Por favor, introduzca su Numero Secreto.");
return false;}

if ( document.regi_.extcode1.value == ""){
alert("Por favor, introduzca el Codigos de Verificacion.");
return false;}

if ( document.regi_.extcode.value == ""){
alert("Por favor, introduzca el Codigos de Verificacion.");
return false;}

if ( document.regi_.pregunta.value == ""){
alert("Por favor, introduzca su Pregunta Secreta.");
return false;}

if ( document.regi_.repuesta.value == ""){
alert("Por favor, introduzca la Respuesta de la Pregunta Secreta.");
return false;}

document.registro_.submit();}

//MODULOS
function modulos_form(){

if ( document.modulos_.name.value == "")
{
alert("Por favor, introduzca el Nombre del Personaje.");
return false;}

if ( document.modulos_.clave.value == "")
{
alert("Por favor, introduzca su Clave.");
return false;}

if ( document.modulos_.newpwd.value == "")
{
alert("Por favor, introduzca su Nueva Clave.");
return false;}

if ( document.modulos_.newpwd1.value == "")
{
alert("Por favor, introduzca su Nueva Clave.");
return false;}

if ( document.modulos_.mapa.value == "")
{
alert("PorFavor Seleccione un Mapa.");
return false;
}

if ( document.modulos_.buscar.value == "")
{
alert("Por favor, introduzca algunas palabras.");
return false;}

if ( document.modulos_.newpwd1.value !== document.modulos_.newpwd.value )
{
alert("Tus Claves no Concuerdan.");
return false;}

document.modulos_.submit();
//return false;
}

function modulos2_form()
{
if ( document.modulos_.buscar.value == "")
{
alert("Por favor, introduzca una Letras .");
return false;
}
document.modulos_.submit();
}

function modulos3_form()
{
if ( document.modulos.Correo.value == "")
{
alert("Por favor, introduzca su Email.");
return false;
}

if ( document.modulos.codigo.value == "")
{
alert("Por favor, introduzca el Codigo.");
return false;
}
document.modulos_.submit();
//return false;
}


function login_form()
{
if ( document.login_.login.value == "")
{
alert("Por favor, introduzca su ID.");
return false;
}

if ( document.login_.clave.value == "")
{
alert("Por favor, introduzca Su Clave.");
return false;
}
document.login_.submit();
//return false;
}

var input = {
	login : function(el){
		el.className = "";
		el.onblur = function(){
			if(el.value=="") el.className = "on";
		}
	}
};

var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")


// IE Evitar seleccion de texto
document.onselectstart=function(){
if (event.srcElement.type != "text" && event.srcElement.type != "textarea" && event.srcElement.type != "password")
return false
else return true;
};
// FIREFOX Evitar seleccion de texto
if (window.sidebar){
document.onmousedown=function(e){
var obj=e.target;
if (obj.tagName.toUpperCase() == "INPUT" || obj.tagName.toUpperCase() == "TEXTAREA" || obj.tagName.toUpperCase() == "PASSWORD")
return true;
/*else if (obj.tagName=="BUTTON"){
return true;
}*/
else
return false;
}
}