var blokkey = false;
function tecla(){
	if (blokkey){
		return false;
	} else {
		return true;
	}
}

function cambiarmail(){
	obj=document.getElementById('topemail');
	if(obj.value=='' || obj.value=='Nick'){
		obj.className='entrada';
		obj.value='';
	}
}

function cambiarmailed(){
	obj=document.getElementById('topemail');
	if(obj.value=='' || obj.value=='Nick'){
		obj.value='Nick';
		obj.className='entrada-off';
	}
}


function changeInputType(
  oldElm, // a reference to the input element
  iType, // value of the type property: 'text' or 'password'
  iValue, // the default value, set to 'password' in the demo
  blankValue, // true if the value should be empty, false otherwise
  noFocus
  ) {  // set to true if the element should not be given focus
 
  if(!oldElm || !oldElm.parentNode || (iType.length<4) || !document.getElementById || !document.createElement) return;
  var newElm = document.createElement('input');
  newElm.type = iType;
  if(oldElm.name) newElm.name = oldElm.name;
  if(oldElm.id) newElm.id = oldElm.id;
  //if(oldElm.className) newElm.className = oldElm.className;
  if(oldElm.className=='entrada-off'){newElm.className='entrada';} else {newElm.className='entrada-off';};
  if(oldElm.size) newElm.size = oldElm.size;
  if(oldElm.tabIndex) newElm.tabIndex = oldElm.tabIndex;
  if(oldElm.accessKey) newElm.accessKey = oldElm.accessKey;
  newElm.onfocus = function(){return function(){
    if(this.hasFocus) return;
     var newElm = changeInputType(this,'password',iValue, (this.value.toLowerCase()==iValue.toLowerCase())?true:false);
	if(newElm) newElm.hasFocus=true;
  }}();
  newElm.onblur = function(){return function(){
    if(this.hasFocus)
    if(this.value=='' || (this.value.toLowerCase()==iValue.toLowerCase())) {
	  changeInputType(this,'text','Clave',false,true);
    }
  }}();
 // hasFocus is to prevent a loop where onfocus is triggered over and over again
  newElm.hasFocus=false;
  oldElm.parentNode.replaceChild(newElm,oldElm);
  if(!blankValue) newElm.value = iValue;
  if(!noFocus || typeof(noFocus)=='undefined') {
    window.tempElm = newElm;
    setTimeout("tempElm.hasFocus=true;tempElm.focus();",1);
  }
  return newElm;
}

function buscadorchat(clase){
	obj=document.getElementById('botbuscador');
	obj.className=clase;
	/*if(obj.className=='' || obj.value=='Nick'){
		obj.className='entrada';
		obj.value='';
	}*/
}

function activartodos(id,num,value){
	var i;
	for (i=1;i<=num;i++) {
		document.getElementById('checks'+id+'-'+i).disabled = value;
		document.getElementById('checks'+id+'-'+i).checked = value;
	} 
}

function activartodosmensajes(num,tipo,value){
	if (tipo==1){
		var i;
		for (i=1;i<=num;i++) {
			document.getElementById('checks-'+i).checked = value;
		}
	} else {
		if (!value){
			document.getElementById('checktodos').checked = value;
		} else {
			var y;
			var active = true;
			for (y=1;y<=num;y++) {
				if (!document.getElementById('checks-'+y).checked){
					active = false;
				}
			}
			document.getElementById('checktodos').checked = active;
		}
	}
}

function abrirgreybox(nombre,url,anchura,altura){
	return GB_showCenter(nombre,url,altura,anchura);	
}

function actualizapadre(){
	window.top.location.reload();
}

function cambiofotogrande(foto){
	document.getElementById('foto-grande-usuario').src = foto;
}

function validarcuenta(){
	var errores = '';
	var obj=document.form_cuenta;
	var resultado = true;
	
	var filter=/^([\w\.-ñÑ-]{2,150})@([\w-ñÑ]{2,64})\.[a-zñÑ]{2,6}(\.[a-z]{2,6})?$/;
	if (!filter.test(obj.f_mail.value)){
		resultado = false;
		errores += 'c2|';
	}
	
	if((obj.f_clave.value=='') || (obj.f_clave_r.value=='') || (obj.f_clave.value!=obj.f_clave_r.value)){
		resultado = false;
		errores += 'c3|';
	}
		
	if(resultado==false){
		//obj.botonform.blur();
		//abrirgreybox('Mensaje','../../resultados.php?tipo=alerta&r='+errores,420,200);
		popup('alertas varias',errores);
	}
	
	return resultado;
}

function validarhomeregistro(){
	var errores = '';
	var obj=document.registrarse;
	var resultado = true;
	
	if(obj.r_nombre.value==''){
		resultado = false;
		errores += 'c1|';
	}
	
	if(obj.errornombre.value=='si'){
		resultado = false;
		errores += 'c1b|';
	}
	
	var filter=/^([\w\.-ñÑ-]{2,150})@([\w-ñÑ]{2,64})\.[a-zñÑ]{2,6}(\.[a-z]{2,6})?$/;
	if (!filter.test(obj.r_mail.value)){
		resultado = false;
		errores += 'c2|';
	}
	
	if(obj.errormail.value=='si'){
		resultado = false;
		errores += 'c2b|';
	}
	
	if((obj.r_clave.value=='') || (obj.r_clave_r.value=='') || (obj.r_clave.value!=obj.r_clave_r.value)){
		resultado = false;
		errores += 'c3|';
	}
	
	if(!obj.r_condiciones.checked){
		resultado = false;
		errores += '10|';
	}
	
	if(resultado==false){
		//obj.botonform.blur();
		//abrirgreybox('Mensaje','../../resultados.php?tipo=alerta&r='+errores,420,200);
		popup('alertas varias',errores);
	}
	
	return resultado;
}

function validarhomeinvitado(){
	var obj=document.invitado;
	var resultado = true;
	
	if(!obj.r_condiciones.checked){
		resultado = false;
	}
	
	if(resultado==false){
		//obj.botonform.blur();
		//abrirgreybox('Mensaje','../../resultados.php?tipo=alerta&r=10',420,200);
		popup('alertas varias','10');
	}
	
	return resultado;
}

function activarguardar(usuario){
	
	document.getElementById('guardar-'+usuario).style.display = 'inline';	
	
}

function IsNumber(e) {
 tecla = (document.all) ? e.keyCode : e.which;
 if (tecla==8) return true; //TECLA DE BORRAR (RETROCESO)
 if (tecla==0) return true; //TECLAS ESPECIALES COMO CURSORES, SUPRIMIR, TABULADOR ...
  patron = /\d/; // Solo acepta números
  te = String.fromCharCode(tecla);
 return patron.test(te);
}

function IsNick(e) {
 tecla = (document.all) ? e.keyCode : e.which;
 if (tecla==8) return true; //TECLA DE BORRAR (RETROCESO)
 if (tecla==0) return true; //TECLAS ESPECIALES COMO CURSORES, SUPRIMIR, TABULADOR ...
  patron = /\w/; // Solo acepta números
  te = String.fromCharCode(tecla);
 return patron.test(te);
}

function IsSimbol(e) {
 tecla = (document.all) ? e.keyCode : e.which;
 if (tecla==8) return true; //TECLA DE BORRAR (RETROCESO)
 if (tecla==0) return true; //TECLAS ESPECIALES COMO CURSORES, SUPRIMIR, TABULADOR ...
  patron = /[<>]/; // Solo acepta números
  te = String.fromCharCode(tecla);
 return !patron.test(te);
}

function IsNumberDecimal(e) {
 tecla = (document.all) ? e.keyCode : e.which;
 if (tecla==8) return true; //TECLA DE BORRAR (RETROCESO)
 if (tecla==0) return true; //TECLAS ESPECIALES COMO CURSORES, SUPRIMIR, TABULADOR ...
 if (tecla==44) return true; //COMA
 if (tecla==46) return true; //COMA
  patron = /\d/; // Solo acepta números
  te = String.fromCharCode(tecla);
 return patron.test(te);
}

function verificarfecha(f)
{
	
	re=/^[0-9][0-9]\,[0-9][0-9]\,[0-9][0-9][0-9][0-9]$/
	if(f.length==0 || !re.exec(f))
	{
		//alert("La fecha no tiene formato correcto.")
		return false
	}

	var d = new Date()
	d.setFullYear(f.substring(6,10), 
		f.substring(3,5)-1,
			f.substring(0,2))

	if(d.getMonth() != f.substring(3,5)-1 
		|| d.getDate() != f.substring(0,2))
	{
		//alert("Fecha no válida.")
		return false
	}
	
	return true
	//alert("La fecha está en formato correcto y además es válida!")
}


function mayor18(f1,f2,f3){
fecha = new Date();
//hoy = new Date(fecha.getDate(),fecha.getMonth(),fecha.getFullYear());

// Reemplazar (2001,01,29) por la fecha de inicio de tu sitio (aaaa,mm,dd)
inicio = new Date(parseInt(f1),(parseInt(f2)-1),parseInt(f3));
//alert (fecha+'|||||'+f1+f2+f3+'|||||'+inicio);
resta = fecha.getTime() - ((inicio.getTime())+(1000*60*60*24));
resultado = Math.floor(resta/(1000*60*60*24*365.25));
if(resultado>=18){
	return true;
} else {
	return false;
}
}

function IsChk(chkName){
	var found = false;
	var chk = document.getElementsByName(chkName+'[]');
	for (var i=0 ; i < chk.length ; i++){
		found = chk[i].checked ? true : found;
	}
	return found;
}

function validarperfil(){
	var errores = '';
	var obj=document.perfil;
	var resultado = true;
	
	if(obj.f_pais.value=='0'){
		resultado = false;	
		errores += 'pe1|';
	}
	
	if(obj.f_pais.value=='1' && obj.f_region.value=='0'){
		resultado = false;	
		errores += 'pe1-2|';
	}
	
	if(obj.f_pais.value=='1' && obj.f_region.value!='0' && obj.f_provincia.value=='0'){
		resultado = false;	
		errores += 'pe1-3|';
	}
	
	if(obj.f_mobilidad.value=='0'){
		resultado = false;	
		errores += 'pe2|';
	}
	
	if(obj.haychico.value=='si'){
		
		if(obj.f_el_ano.value<=1901){
			resultado = false;	
			errores += 'p2edad|';	
		}
		
		fecha_el = obj.f_el_dia.value+','+obj.f_el_mes.value+','+obj.f_el_ano.value;
		if(verificarfecha(fecha_el)){
			//fecha_el = obj.f_el_ano.value+','+obj.f_el_mes.value+','+obj.f_el_dia.value;
			if(!mayor18(obj.f_el_ano.value,obj.f_el_mes.value,obj.f_el_dia.value)){
				resultado = false;
				errores += 'p1|';
			}
		} else {
			resultado = false;	
			errores += 'p2|';
		}
		
		if(obj.f_el_ojos.value=='0'){
			resultado = false;	
			errores += 'pe3|';
		}
		
		if(obj.f_el_pelo.value=='0'){
			resultado = false;	
			errores += 'pe4|';
		}
		
		if((obj.f_el_altura.value=='0') || (obj.f_el_altura.value=='') || (obj.f_el_altura.value=='00')){
			resultado = false;	
			errores += 'pe5|';
		}
		
		if((obj.f_el_peso.value=='0') || (obj.f_el_peso.value=='') || (obj.f_el_peso.value=='00')){
			resultado = false;	
			errores += 'pe6|';
		}
		
		if(obj.f_el_profesion.value=='0'){
			resultado = false;	
			errores += 'pe7|';
		}
		
		if(obj.f_el_zodiaco.value=='0'){
			resultado = false;	
			errores += 'pe8|';
		}
		
		if(obj.f_el_fumador.value=='0'){
			resultado = false;	
			errores += 'pe9|';
		}
		
		if(obj.f_el_fisonomia.value=='0'){
			resultado = false;	
			errores += 'pe10|';
		}
	}
	
	if(obj.haychica.value=='si'){
		
		if(obj.f_ella_ano.value<=1901){
			resultado = false;	
			errores += 'p4edad|';	
		}
		
		fecha_ella = obj.f_ella_dia.value+','+obj.f_ella_mes.value+','+obj.f_ella_ano.value;
		if(verificarfecha(fecha_ella)){
			//fecha_ella = obj.f_ella_mes.value+','+obj.f_ella_dia.value+','+obj.f_ella_ano.value;
			//if(!mayor18(fecha_ella)){
			if(!mayor18(obj.f_ella_ano.value,obj.f_ella_mes.value,obj.f_ella_dia.value)){
				resultado = false;	
				errores += 'p3|';
			}
		} else {
			resultado = false;
			errores += 'p4|';
		}
		
		if(obj.f_ella_ojos.value=='0'){
			resultado = false;	
			errores += 'pe11|';
		}
		
		if(obj.f_ella_pelo.value=='0'){
			resultado = false;	
			errores += 'pe12|';
		}
		
		if((obj.f_ella_altura.value=='0') || (obj.f_ella_altura.value=='') || (obj.f_ella_altura.value=='00')){
			resultado = false;	
			errores += 'pe13|';
		}
		
		if((obj.f_ella_peso.value=='0') || (obj.f_ella_peso.value=='') || (obj.f_ella_altura.value=='00')){
			resultado = false;	
			errores += 'pe14|';
		}
		
		if(obj.f_ella_profesion.value=='0'){
			resultado = false;	
			errores += 'pe15|';
		}
		
		if(obj.f_ella_zodiaco.value=='0'){
			resultado = false;	
			errores += 'pe16|';
		}
		
		if(obj.f_ella_fumador.value=='0'){
			resultado = false;	
			errores += 'pe17|';
		}
		
		if(obj.f_ella_fisonomia.value=='0'){
			resultado = false;	
			errores += 'pe18|';
		}
	}
	
	if(obj.f_experiencia.value=='0'){
		resultado = false;	
		errores += 'pe19|';
	}
	
	if (!IsChk('f_disponibilidad')){
		resultado = false;	
		errores += 'pe20|';
	}
	
	if (!IsChk('f_intercambio')){
		resultado = false;	
		errores += 'pe21|';
	}
	
	if (!IsChk('f_busco')){
		resultado = false;	
		errores += 'pe22|';
	}
	
	if((obj.f_anuncio.value.length<50) || (obj.f_anuncio.value.length>1500)){
		resultado = false;	
		errores += 'p5|';
	}
	
	/*if(obj.f_anuncio.value.length>300){
		resultado = false;
		errores += '6|';
	}*/
		
	if(resultado==false){
		obj.botonform.blur();
		//abrirgreybox('Mensaje','../../resultados.php?tipo=alerta&r='+errores,420,200);
		popup('validar perfil',errores);
	}
	
	return resultado;
}

function cambiaseccionficha(seccion){
	if (seccion==2){
		document.getElementById('seccionficha1').style.display = 'none';
		document.getElementById('seccionficha2').style.display = 'block';
		document.getElementById('seccionficha3').style.display = 'none';
	} else {
		
		if (seccion==3){
		document.getElementById('seccionficha1').style.display = 'none';
		document.getElementById('seccionficha2').style.display = 'none';
		document.getElementById('seccionficha3').style.display = 'block';
		} else {
			document.getElementById('seccionficha1').style.display = 'block';
			document.getElementById('seccionficha2').style.display = 'none';
			document.getElementById('seccionficha3').style.display = 'none';
		}
	}
}

function actualizarcontador(){
		document.perfil.f_contadorchar.value = document.perfil.f_anuncio.value.length;
}
function actualizarcontadorf(){
		document.fiesta.f_contadorchar.value = document.fiesta.f_anuncio.value.length;
}

/*function openChatWindow(uid) {
window.open('chat/index.php?uid='+uid,'chat','width=725,height=480,resizable=no, scrollbars=no, toolbar=no, location=no, directories=no, status=no, menubar=no,copyhistory=no');
}*/

var win = null;

function openChatWindow(uid) {
	w=920;
	h=500;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable=no, toolbar=no, location=no, directories=no, status=no, menubar=no,copyhistory=no';
	win = window.open('chat/index.php','chat',settings);
}

var win2 = null;

function openFichaWindow(uid) {
	w=760;
	h=600;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=no, toolbar=no, location=no, directories=no, status=no, menubar=no,copyhistory=no';
	win2 = window.open('usuarios-ficha-s.php?u='+uid,'Ficha',settings);
}
function openFichaWindowid(uid) {
	w=760;
	h=600;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=no, toolbar=no, location=no, directories=no, status=no, menubar=no,copyhistory=no';
	win2 = window.open('usuarios-ficha-s.php?uid='+uid,'Ficha',settings);
}


function compruebapais(){
	if (document.getElementById('pais_combo').value==0) {
		//abrirgreybox('Mensaje','../../resultados.php?tipo=alerta&r=14',420,200);
		popup('alertas varias','14');
		return false;
	} else {
		return true;
	}
}

var win = null;
var win2 = null;
    function openChatWindowLista(uid) {
    w=760;
    h=500;
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no';
    win = window.open('../chat/index.php?uid='+uid,'chat',settings);
}

function openFichaWindowLista(uid) {
	w=760;
	h=600;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=no, toolbar=no, location=no, directories=no, status=no, menubar=no,copyhistory=no';
	win2 = window.open('../usuarios-ficha-s.php?u='+uid,'Ficha',settings);
}

function popup(accion,p1) {
	
	var url='';
	
	switch (accion){
		
		case 'banner libert':
		
			w=520;
			h=655;
			url='banners/sabado-al-desnudo.jpg';
		
		break;
		
		case 'recomendar':
		
			w=420;
			h=450;
			url='recomendar.php';
		
		break;
		
		case 'agregar a contactos':
		
			w=420;
			h=200;
			url='actions.php?act=fav&u='+p1;
		
		break;
		
		case 'editar contacto':
		
			w=420;
			h=420;
			url='contactos.php?act=upd&u='+p1;
		
		break;
		
		case 'eliminar contacto':
		
			w=420;
			h=200;
			url='contactos.php?act=del&u='+p1;
		
		break;
		
		case 'bloquear usuario':
		
			w=420;
			h=200;
			url='actions.php?act=block&u='+p1;
		
		break;
		
		case 'aprobar amigo':
		
			w=420;
			h=200;
			url='actions.php?act=friend&u='+p1;
		
		break;
		
		case 'no aprobar amigo':
		
			w=420;
			h=200;
			url='actions.php?act=nofriend&u='+p1;
		
		break;
		
		case 'agregar amigo':
		
			w=520;
			h=250;
			url='amigo-nuevo.php?u='+p1;
		
		break;
		
		case 'eliminar amigo':
		
			w=520;
			h=300;
			url='amigos.php?act=del&i='+p1;
		
		break;
		
		case 'agregar foto':
		
			w=420;
			h=300;
			url='fotos.php?act=add&i='+p1;
		
		break;
		
		case 'eliminar foto':
		
			w=420;
			h=300;
			url='fotos.php?act=del&i='+p1;
		
		break;
		
		case 'mensaje nuevo':
		
			w=520;
			h=300;
			url='mensaje-nuevo.php?u='+p1;
		
		break;
		
		case 'nuevo testimonio':
		
			w=520;
			h=250;
			url='testimonio-nuevo.php?u='+p1;
		
		break;
		
		case 'alerta webmaster':
		
			w=650;
			h=500;
			url='alarma.php?u='+p1;
		
		break;
		
		case 'validar perfil':
		
			w=420;
			h=200;
			url='resultados.php?tipo=alerta&r='+p1;
		
		break;
		
		case 'validar fiesta':
		
			w=420;
			h=400;
			url='resultados.php?tipo=alerta&r='+p1;
		
		break;
		
		case 'eliminar mensajes entrantes':
		
			w=420;
			h=200;
			url='mensajes.php?act=inbox&m='+p1;
		
		break;
		
		case 'eliminar mensajes salientes':
		
			w=420;
			h=200;
			url='mensajes.php?act=sent&m='+p1;
		
		break;
		
		case 'publicar testimonio':
		
			w=520;
			h=300;
			url='testimonios.php?act=pub&i='+p1;
		
		break;
		
		case 'no publicar testimonio':
		
			w=520;
			h=300;
			url='testimonios.php?i='+p1;
		
		break;
		
		case 'eliminar testimonio':
		
			w=520;
			h=300;
			url='testimonios.php?act=del&i='+p1;
		
		break;
		
		case 'eliminar cuenta':
		
			w=480;
			h=250;
			url='cuenta.php?del='+p1;
		
		break;
		
		case 'eliminar cuenta error':
		
			w=420;
			h=200;
			url='resultados.php?tipo=alerta&r='+p1;
		
		break;
		
		case 'chat desconectado':
		
			w=420;
			h=200;
			url='resultados.php?tipo=alerta&r='+p1;
		
		break;
		
		case 'alertas varias':
		
			w=420;
			h=200;
			url='resultados.php?tipo=alerta&r='+p1;
		
		break;
		
		case 'alertas varias hecho':
		
			w=420;
			h=200;
			url='resultados.php?tipo=hecho&r='+p1;
		
		break;
		
		case 'recordar clave':
		
			w=420;
			h=200;
			url='recordar-clave.php';
		
		break;
		
		case 'usuariodesconectado':
		
			w=420;
			h=200;
			url='../resultados.php?tipo=alerta&r=chat1&u='+p1;
		
		break;
		
		case 'solicitudchat':
		
			w=420;
			h=250;
			url='../solicitudchat.php?u='+p1;
		
		break;
		
	}
	if(url!=''){
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable=no, toolbar=no, location=no, directories=no, status=no, menubar=no, copyhistory=no';
		win2 = window.open(url,'Popup'+Math.floor(Math.random()*1001),settings);
	}
}

function popup2(accion,p1,p2) {
	
	var url='';
	
	switch (accion){
	
		case 'mensaje enviado':
		
			w=420;
			h=200;
			url='resultados.php?tipo=hecho&r='+p1+'&u='+p2;
		
		break;
		
		case 'mensaje enviado error':
		
			w=420;
			h=200;
			url='resultados.php?tipo=alerta&r='+p1+'&u='+p2;
		
		break;
		
		case 'poner guino':
		
			w=420;
			h=200;
			url='guinos.php?act=addguino&u='+p1+'&l='+p2;
		
		break;
		
		case 'quitar guino':
		
			w=420;
			h=200;
			url='guinos.php?act=delguino&u='+p1+'&l='+p2;
		
		break;
		
		case 'asistir fiesta':
		
			w=420;
			h=200;
			url='guinos.php?act=addguinof&u='+p1+'&f='+p2;
		
		break;
		
		case 'no asistir fiesta':
		
			w=420;
			h=200;
			url='guinos.php?act=delguinof&u='+p1+'&f='+p2;
		
		break;
	
	}
	
	if(url!=''){
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable=no, toolbar=no, location=no, directories=no, status=no, menubar=no, copyhistory=no';
		win2 = window.open(url,'Popup'+Math.floor(Math.random()*1001),settings);
	}
}

function comprobarchatconectado(a,b){
	xajax_comprobarchatconectadoout(a,b);
}

function cerrarpopup(){
	window.close();
}

function actualizapadrepopup(){
	window.opener.location.reload();
}

function redireccionapadrepopup(url){
	window.opener.location.href = url;
}

function actualizadocumento(){
	document.location.reload();
}

/*function openAvisoMensaje() {
	w=200;
	h=150;
	LeftPosition = (screen.width) ? (screen.width-w) : 0;
	TopPosition = (screen.height) ? (screen.height-h) : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable=no, toolbar=no, location=no, directories=no, status=no, menubar=no,copyhistory=no';
	win3 = window.open('alerta.php','avisomensaje',settings);
}*/

//Asociamos la función al evento onmousemove

function forzar_top()
{
  if (top.location != location) {
    top.location.href = document.location.href ;
  }
}
