function abrirComerciales(Tipo){
	window.open("CentrosComerciales.asp?tipo=" + Tipo,"CentrosComerciales","scrollbars=Yes,menubar=no,location=no,top=20,left=20,width=540,height=500");
};

function abrirEmpresa(Id){
	window.open("MostrarWho.asp?Id1=" + Id,"Empresa","scrollbars=Yes,menubar=no,location=no,top=20,left=20,width=520,height=450");
};

function abrirEmpresaFeria(Id,Id1,Id2){
	window.open("MostrarEmpresa.asp?Id=" + Id + "&Id1=" + Id1 + "&Id2=" + Id2,"Empresa","scrollbars=Yes,menubar=no,location=no,top=20,left=20,width=550,height=430");
};

function abrirNoticia(Id){
	window.open("ImprimirNoticia.asp?Id=" + Id,"Noticia","scrollbars=Yes,menubar=no,location=no,top=20,left=20,width=650,height=500");
};

function abrirRevista(){
	window.open("RevistaImpresa.asp","RevistaImpresa","scrollbars=Yes,menubar=no,location=no,top=20,left=20,width=650,height=500");
};

function borrar1(Id){
	if (confirm('¿Desea eliminar el administrador?')){
		this.location.href='prgAdministrador.asp?A=E&Id=' + Id;
	};
};

function borrar2(Id){
	if (confirm('¿Desea eliminar la promoción?')){
		this.location.href='prgPromocion.asp?A=E&Id=' + Id;
	};
};

function borrar3(Id,Modo){
	if (confirm('¿Desea eliminar el boletín?')){
		this.location.href='prgBoletines.asp?A=E&M=' + Modo + '&Id=' + Id;
	};
};

function borrar4(Id,Id1,Modo){
	if (Modo=='L'){
		if (confirm('¿Desea eliminar el logotipo?')){
			this.location.href='prgBanner.asp?A=E&M=' + Modo + '&Id=' + Id + '&Id1=' + Id1;
		};
	}else{
		if (confirm('¿Desea eliminar el banner?')){
			this.location.href='prgBanner.asp?A=E&M=' + Modo + '&Id=' + Id + '&Id1=' + Id1;
		};
	};
};

function borrar5(Id,Id1,Modo){
	if (confirm('¿Desea eliminar el link?')){
		this.location.href='prgNoticia.asp?A=E&M=' + Modo + '&Id=' + Id + '&Id1=' + Id1;
	};
};

function borrar51(Id,Id1,Id2,Modo){
	if (confirm('¿Desea eliminar la noticia?')){
		this.location.href='prgNoticia.asp?A=E&M=' + Modo + '&Id=' + Id + '&Id1=' + Id1 + '&Id2=' + Id2;
	};
};

function borrar6(Id,Id1,Id2,Id3,Modo,H){
	if (confirm('¿Desea eliminar el párrafo?')){
		if (H=='1'){
			this.location.href='prgParrafo.asp?A=E&M=' + Modo + '&Id=' + Id + '&Id1=' + Id1 + '&Id2=' + Id2 + '&Id3=' + Id3 + '&H=' + H;
		}else{
			this.location.href='prgParrafo.asp?A=E&M=' + Modo + '&Id=' + Id + '&Id1=' + Id1 + '&Id2=' + Id2 + '&Id3=' + Id3;
		};
	};
};

function borrar7(Id,Id1,Modo){
	if (confirm('¿Desea eliminar la categoria?')){
		this.location.href='prgCategoria.asp?A=E&M=' + Modo + '&Id=' + Id + '&Id1=' + Id1;
	};
};

function borrar8(Id,Id1,Id2,Id3,Modo,H){
	if (confirm('¿Desea eliminar la palabra clave?')){
		if (H=='1'){
			this.location.href='prgClave.asp?A=E&M=' + Modo + '&Id=' + Id + '&Id1=' + Id1 + '&Id2=' + Id2 + '&Id3=' + Id3 + '&H=1';
		}else{
			this.location.href='prgClave.asp?A=E&M=' + Modo + '&Id=' + Id + '&Id1=' + Id1 + '&Id2=' + Id2 + '&Id3=' + Id3;
		};
	};
};

function borrar9(Id,Modo){
	if (Modo=='A'){
		if (confirm('¿Desea eliminar la actividad?')){
			this.location.href='prgDatosWho.asp?A=E&M=' + Modo + '&Id=' + Id;
		};
	};
	if (Modo=='P'){
		if (confirm('¿Desea eliminar el producto?')){
			this.location.href='prgDatosWho.asp?A=E&M=' + Modo + '&Id=' + Id;
		};
	};

	if (Modo=='I'){
		if (confirm('¿Desea eliminar el índice?')){
			this.location.href='prgDatosWho.asp?A=E&M=' + Modo + '&Id=' + Id;
		};
	};
};

function borrar10(Id){
	if (confirm('¿Desea eliminar la empresa?')){
		this.location.href='prgWhoisWho.asp?A=E&Id=' + Id;
	};
};

function borrar11(Id,Id1){
	if (confirm('¿Desea eliminar el nivel?')){
		this.location.href='prgNivel.asp?A=E&Id=' + Id + '&Id1=' + Id1;
	};
};

function borrar12(Id,Id1,Id2,Id3){
	if (confirm('¿Desea eliminar la empresa?')){
		this.location.href='prgEmpresa.asp?A=E&Id=' + Id + '&Id1=' + Id1 + '&Id2=' + Id2 + '&Id3=' + Id3;
	};
};

function borrar13(Id){
	if (confirm('¿Desea eliminar el documento?')){
		this.location.href='prgDocumento.asp?A=E&Id=' + Id;
	};
};

function Desconectar(){
	if (confirm('¿Desea desconectarse de la sesión?')){
		this.location.href='prgDesconectar.asp';
	};
};

function editarWhoisWho(Id){
	if ((window.opener)&&(!window.opener.closed)){
		window.opener.location.href='EditarWhoisWho.asp?Id=' + Id;
	};
	window.close();
};

function home(A,Modo,Tipo,Listado,Id,Id1) {
	var Mensaje;
	Mensaje='';
	
	if (A=='A') {
		if (Tipo=='d') {Mensaje='destacada';};
		if (Tipo=='t') {Mensaje='titular';};
		if (confirm ('¿Desea añadir la noticia como ' + Mensaje + ' a la página de inicio?')) {
			this.location.href='prgHome.asp?A=A&M=' + Modo + '&tipo=' + Tipo + '&list=' + Listado + '&Id=' + Id + '&Id1=' + Id1;
		};
	};
	if (A=='E'){
		if (confirm ('¿Desea eliminar la noticia de la página de inicio?')) {
			this.location.href='prgHome.asp?A=E&M=' + Modo + '&tipo=' + Tipo + '&list=' + Listado + '&Id=' + Id + '&Id1=' + Id1;
		};
	};
};

function home2(A,Id) {
	if (A=='A') {
		if (confirm ('¿Desea añadir la noticia como destacada global a la página de inicio?')) {
			this.location.href='prgHome.asp?A=AG&Id=' + Id;
		};
	};
	if (A=='E'){
		if (confirm ('¿Desea eliminar la noticia de la página de inicio?')) {
			this.location.href='prgHome.asp?A=EG&Id=' + Id;
		};
	};
};

function selSeccion(object){
	var Param;
	Param='';
	
	if (object.desde.value!=''){Param=Param + '&desde=' + object.desde.value};
	if (object.hasta.value!=''){Param=Param + '&hasta=' + object.hasta.value};
	if (object.Titulo.value!=''){Param=Param + '&tit=' + object.Titulo.value};
	if (object.Contenido.value!=''){Param=Param + '&contenido=' + object.Contenido.value};
	if (object.EHist.checked){Param=Param + '&hist=1'};
	
	this.location.href='Buscar.asp?seccion=' + object.sSeccion.value + Param;
};

function vacios1(object){
	var error;
	error=0;
	
	
	if ((object.nombre.value=='')&&(error==0)){
		error=1;
		alert('Debe escribir el nombre');
		object.nombre.focus();
	};
	
	if ((object.apellidos.value=='')&&(error==0)){
		error=1;
		alert('Debe escribir los apellidos');
		object.apellidos.focus();
	};
	
	if ((object.login.value=='')&&(error==0)){
		error=1;
		alert('Debe escribir el login');
		object.login.focus();
	};
	if ((object.password.value=='')&&(error==0)){
		error=1;
		alert('Debe escribir la contraseña');
		object.password.focus();
	};
	if (error==0){object.submit();};
};

function vacios2(object){
	var error;
	error=0;
	
	if ((object.titulo.value=='')&&(error==0)){
		error=1;
		alert('Debe escribir el título');
		object.titulo.focus();
	};
	if ((object.cabecera.value=='')&&(error==0)){
		error=1;
		alert('Debe escribir una cabecera');
		object.cabecera.focus();
	};
	if ((object.fecha.value=='')&&(error==0)){
		error=1;
		alert('Debe escribir la fecha');
		object.fecha.focus();
	};
//	if ((object.descripcion.value=='')&&(error==0)){
//		error=1;
//		alert('Debe escribir el descripción');
//		object.descripcion.focus();
//	};
	
	if (error==0){object.submit();};
	
};

function vacios3(object,Modo){
	var error;
	error=0;
	
	if ((object.titulo.value=='')&&(error==0)){
		error=1;
		alert('Debe escribir el título');
		object.titulo.focus();
	};
	if ((object.fecha.value=='')&&(error==0)){
		error=1;
		alert('Debe escribir la fecha');
		object.fecha.focus();
	};

	if (Modo=='E'){
		if ((object.fechaN.value=='')&&(error==0)){
			error=1;
			alert('Debe escribir la fecha de la noticia');
			object.fechaN.focus();
		};

	//	if ((object.descripcionN.value=='')&&(error==0)){
	//		error=1;
	//		alert('Debe escribir la descripción de la noticia');
	//		object.descripcionN.focus();
	//	};
	};
	
	if (error==0){object.submit();};
	
};

function vacios4(object){
	var error;
	error=0;
	
	if ((object.titulo.value=='')&&(error==0)){
		error=1;
		alert('Debe escribir el título');
		object.titulo.focus();
	};
	if ((object.link.value=='')&&(error==0)){
		error=1;
		alert('Debe escribir el link');
		object.fecha.focus();
	};
	
	if (error==0){object.submit();};
	
};

function vacios5(object, Modo){
	var error;
	error=0;
	
	if (error==0 && object.titulo.value=='' && object.tituloE.value==''){
		error=1;
		alert('Debe escribir algún título');
		object.titulo.focus();
	};
	
	if (Modo!='0'){
		if ((object.fecha.value=='')&&(error==0)){
			error=1;
			alert('Debe escribir la fecha');
			object.fecha.focus();
		};
	};
	if (Modo!='0'){
		if ((object.diasCad.value=='')&&(error==0)){
			error=1;
			alert('Debe indicar los días de caducidad de la noticia');
			object.diasCad.focus();
		};
	};
	if ((Modo=='N')||(Modo=='M')||(Modo=='Y')) {
		if ((object.SCategoria.value=='0')&&(error==0)){
			error=1;
			alert('Debe elegir una categoría');
			object.SCategoria.focus();
		};
	};
	if (Modo=='0') {
		if (object.IdNoticia.value!='0') {
			if ((error=='0')&&(object.tipoR.value=='Vinculo')) {
				if ((error=='0')&&(object.link.value=='')) {
					error=1;
					alert('Debe escribir la dirección del link');
					object.link.focus();
				};
			};
		}else{
			if (object.radio[1].checked) {
				if ((error=='0')&&(object.link.value=='')) {
					error=1;
					alert('Debe escribir la dirección del link');
					object.link.focus();
				};
			};
		};
	};
	
	//if (Modo!='0') {
	//	if ((error==0)&&(object.descripcion.value=='')){
	//		error=1;
	//		alert('Debe escribir la descripción');
	//	};
	//};
	
	if (error==0){object.submit();};
};

function vacios6(object){
	var error;
	error=0;
	
	if ((object.orden.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar un orden');
		object.orden.focus();
	};
	
	if ((object.descripcion.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar una descripción');
		object.descripcion.focus();
	};
	
	if ((object.contenido.value=='')&&(error==0)){
		error=1;
		alert('Debe escribir algún contenido');
		object.contenido.focus();
	};
		
	if (error==0){object.submit();};
	
};

function vacios7(object){
	var error;
	error=0;
	
	if ((object.nombre.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar un nombre');
		object.orden.focus();
	};

	if (error==0){object.submit();};
};

function vacios8(object){
	var error;
	error=0;
	
	if (object.nombre.value=='' && object.nombreE.value==''){
		error=1;
		alert('Debe indicar alguna descripción');
		object.nombre.focus();
	};
	
	if (error==0){object.submit();};
};

function vacios9(object){
	var error;
	error=0;
	
	if ((object.descripcion.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar una descripción');
		object.descripcion.focus();
	};
	
	if (error==0){object.submit();};
};

function vacios10(object){
	var error;
	error=0;
	
	if ((object.Empresa.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar un nombre para la empresa');
		object.Empresa.focus();
	};
	if ((object.Direccion.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar la dirección');
		object.Direccion.focus();
	};
	if ((object.Numero.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar el número');
		object.Numero.focus();
	};
	if ((object.Cp.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar el C.P.');
		object.Cp.focus();
	};
	if ((object.Localidad.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar la localidad');
		object.Localidad.focus();
	};
	if ((object.Provincia.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar la provincia');
		object.Provincia.focus();
	};
	if ((object.Telefono1.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar un teléfono');
		object.Telefono1.focus();
	};
	
	if (error==0){object.submit();};
};

function vacios11(object){
	var error;
	error=0;
	
	if ((object.descripcion.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar una descripción');
		object.descripcion.focus();
	};
	
	if (error==0){object.submit();};
};

function vacios12(object){
	var error;
	error=0;
	
	if ((object.Nombre.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar un nombre');
		object.Nombre.focus();
	};
	if ((object.SNivel.value=='0')&&(error==0)){
		error=1;
		alert('Debe indicar el nivel de la feria al que pertenece la empresa.\nSi no existe ninguno, deberá crearlo antes de crear la empresa.');
		object.SNivel.focus();
	};
	
	if (error==0){object.submit();};
};

function vacios13(object){
	var error;
	error=0;
	
	if ((object.nombre.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar un nombre para el documento');
		object.nombre.focus();
	};
	
	if ((object.FileRuta.value=='')&&(object.ruta.value=='')&&(error==0)){
		error=1;
		alert('Debe indicar la ruta del documento');
		object.FileRuta.focus();
	};
	
	if (error==0){object.submit();};
};

function vacios14(object){
	var Idioma;
	var error;
	Idioma=object.Idioma.value;
	error=0;
	
	if ((object.Modo.value=='P')&&(object.Meses.value=='')&&(error==0)){
		error=1;
		if (Idioma=='C'){alert('Debe indicar todos los datos');};
		if (Idioma=='E'){alert('You have to write all the data');};
	};
	if ((error=='0')&&((object.Nombre.value=='')||(object.Empresa.value=='')||(object.Actividad.value=='')||
		(object.Cif.value=='')||(object.Calle.value=='')||(object.Cp.value=='')||(object.Ciudad.value=='')||
		(object.Provincia.value=='')||(object.Pais.value=='')||(object.Email.value=='')||
		(object.Telefono.value=='')||(object.Fax.value==''))){
		error=1;
		if (Idioma=='C'){alert('Debe indicar todos los datos');};
		if (Idioma=='E'){alert('You have to write all the data');};
	};
	
	if (error==0){object.submit();};
};

function vacios15(object){
	var Idioma;
	var error;
	Idioma=object.Idioma.value;
	error=0;
	
	if ((object.Nombre.value=='')||(object.Empresa.value=='')||(object.Actividad.value=='')||
		(object.CIF.value=='')||(object.Direccion.value=='')||(object.CP.value=='')||
		(object.Ciudad.value=='')||(object.Provincia.value=='')||(object.Pais.value=='')||
		(object.Telefono.value=='')||(object.Fax.value=='')||(object.Email.value=='')){
		error=1;
		if (Idioma=='C'){alert('Debe indicar todos los datos');};
		if (Idioma=='E'){alert('You have to write all the data');};
	};
	if (error==0){object.submit();};
};