<!--
function lockedPopups(oWin, alertar) {
	if (oWin==null || typeof(oWin)=="undefined") {
		if (alertar) alert("Para el correcto funcionamiento de la aplicación, desactive el bloqueo de popups.");
		return true;
	}
	return false;
}

function simplePreload()
{
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

function hilight( obj ) { if (!document.layers) {
    obj.style.background = '#F1F4F5';
	return true;
 }
}
function fade( obj ) { if (!document.layers) {
    obj.style.background = '#FFFFFF';
    return true;
 }
}

function numeros(objEvent) 
{
  var caracter;  	
  caracter = objEvent.keyCode;			
  if(caracter>=48 && caracter<=57) return true;
  return false;
}

function changeImages() {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
	}
}

function changeImages2() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function busquedas(opcion){
	if (opcion=="otras") {
		otras.style.visibility = "visible";
		otras.style.display = "block";
		callejero.style.display = "none";
		callejero.style.visibility = "hidden";
		fincas.style.visibility = "hidden";
		fincas.style.display = "none";
 		oServicios.focus();
	} else if (opcion=="callejero"){
		otras.style.visibility = "hidden";
		otras.style.display = "none";
		callejero.style.visibility = "visible";
		callejero.style.display = "block";
		fincas.style.visibility = "hidden";
		fincas.style.display = "none";
		if (oIslas.value<0) oIslas.focus();
		else if (oMunicipios.value<0) oMunicipios.focus();
		else oCalle.focus();
	} else if (opcion=="fincas"){
		otras.style.visibility = "hidden";
		otras.style.display = "none";
		callejero.style.visibility = "hidden";
		callejero.style.display = "none";		
		fincas.style.visibility = "visible";
		fincas.style.display = "block";
	}
}

function cambiar () {
	var tamanio;
	var ancho=735;
	var alto=632;
	var t = parent.MapFrame;
	//
	++t.iIndexWH;
	if (t.iIndexWH == t.iWidths.length)
		t.iIndexWH = 0;
	t.iWidth = t.iWidths[t.iIndexWH];
	t.iHeight = t.iHeights[t.iIndexWH];
	//
	
	t.ocultarGeometria(true);
	
	if (t.iIndexWH==1){
		tamanio="grande"; 
		ancho=980;
		alto=773;
		parent.vistas.rows = "73,420,*";
		parent.division.cols = "727,262";
		parent.superior.rows = "0,105,*,70";
		parent.frames("barraizquierda").document.getElementById("altura").height="420";
		parent.frames("barraderecha").document.getElementById("altura").height="420";
		parent.frames("barrainferior").document.getElementById("ancho").width="675";
		parent.frames("ToolFrame").document.getElementById("ancho").width="679";
		parent.frames("herramientas").document.getElementById("altura").height="625";
		parent.frames("herramientas").document.getElementById("situacion").style.marginLeft="-1px";
		if (t.Inicio)
			t.theImage.src = t.ImagenIni[t.idxServicio][1];
	}else{
		tamanio="normal";
		parent.vistas.rows = "73,280,*";
		parent.division.cols = "479,262";
		parent.superior.rows = "0,105,*,70";
		parent.frames("barraizquierda").document.getElementById("altura").height="280";
		parent.frames("barraderecha").document.getElementById("altura").height="280";
		parent.frames("barrainferior").document.getElementById("ancho").width="430";
		parent.frames("ToolFrame").document.getElementById("ancho").width="434";
		parent.frames("herramientas").document.getElementById("altura").height="270";
		parent.frames("herramientas").document.getElementById("situacion").style.marginLeft="0px";
		if (t.Inicio)
			t.theImage.src = t.ImagenIni[t.idxServicio][0];
	}
	top.document.getElementById("sitcan").height=alto;
	top.document.getElementById("sitcan").width=ancho;
	// reposicionamos la capa de "cargando mapa"
	var loadBannerLeft = parseInt((parent.MapFrame.iWidth - 123)/2);
	var loadBannerTop = parseInt((parent.MapFrame.iHeight - 33)/2);
	t.LoadMap.style.posLeft = loadBannerLeft;
	t.LoadMap.style.posTop = loadBannerTop;
	// Actualizamos la vista
	t.theImage.width = t.iWidth;
	t.theImage.height = t.iHeight;
	// Actualizamos el clip de la capa
	t.clipLayer2("theMap",0,0,t.iWidth,t.iHeight);
	
	// Ocultamos el rectángulo trazado de la consulta de pedidos (si lo hubiere)
	t.ocultaAreaConsulta();

	if (!t.Inicio) {
		t.sendMapXMLActiveX();
	}
}

// coordenadas mínimas recuadro
var minLeft = 0;
var minTop = 0;

function notInTheBorder(panType) {
	var oBox = parent.herramientas.recuadro;
	var maxW = parent.herramientas.imgCanarias.width;
	var maxH = parent.herramientas.imgCanarias.height;

	switch(panType) {
	case 1:
		//west
		return (oBox.style.posLeft>minLeft);
		break;
	case 2:
		// north
		return (oBox.style.posTop>minTop);
		break;
	case 3:
		// east
		return (oBox.style.posLeft+oBox.style.posWidth<maxW);
		break;
	case 4:
		// south
		return (oBox.style.posTop+oBox.style.posHeight<maxH);
		break;
	case 5:
		// southwest
		return (oBox.style.posTop+oBox.style.posHeight<maxH && oBox.style.posLeft>minLeft);
		break;
	case 6:
		// northwest
		return (oBox.style.posTop>minTop && oBox.style.posTop+oBox.style.posHeight<maxH);
		break;
	case 7:
		// northeast
		return (oBox.style.posTop>minTop && oBox.style.posLeft+oBox.style.posWidth<maxW);
		break;
	case 8:
		// southeast
		return (oBox.style.posTop+oBox.style.posHeight<maxH && oBox.style.posLeft+oBox.style.posWidth<maxW);
	default:
		return true;
	}
}

function caja(minx, miny, maxx, maxy) {
	var h = parent.herramientas;
	var t = parent.MapFrame;	
	var oBox = h.recuadro;
	var maxW = h.imgCanarias.width;
	var maxH = h.imgCanarias.height;
	var borderWidth = parseInt(oBox.style.borderWidth);
	
	oBox.style.visibility = "hidden";
	
	if (minx<h.minx1) minx=h.minx1;
	if (maxx>h.maxx1) maxx=h.maxx1;
	
	var ancho = maxW;
	var alto = maxH;
	var altoM = Math.abs(maxy-miny);
	var anchoM = Math.abs(maxx-minx);
	var ratioW = ancho/(h.maxx1-h.minx1);
	var izq;
	var arriba;
	
	izq = Math.ceil((minx-h.minx1)*ratioW);
	ancho = Math.ceil(anchoM*ratioW)-1;
	alto = Math.ceil(altoM*ratioW)-1;				
	arriba = maxH - (Math.ceil((miny-h.miny1)*ratioW) + alto)-1;
	
	oBox.style.posLeft = izq;
	oBox.style.posTop = arriba;
	oBox.style.width = ancho + "px";
	oBox.style.height = alto + "px";
	
	oBox.style.visibility = "visible";
	
	//alert(izq + ", " + arriba + " [" + ancho + "x" + alto + "]");

}

function printpage(frm, imagen1, imagen2, x1, y1, x2, y2, escala, orto, titulo, alto, ancho) {
	var html = frm.document.body.innerHTML
	var printhtml = ""

	// Inicio
	var margenLeft = 10
	printhtml = "<html>"
	printhtml += "<head>"
	printhtml += "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />"
	printhtml += "<title>Decanato Territorial de Santa Cruz de Tenerife</title>"
	printhtml += "<link media='screen' href='../estilos/screen.css' rel='stylesheet' type='text/css'>"
	printhtml += "<link media='print' href='../estilos/print.css' rel='stylesheet' type='text/css'>"
	printhtml += "</head>"
	printhtml += "<body style='margin-left:" + margenLeft + "px;margin-right:0px'>"

	// Título
	var fontSize = (ancho>parent.MapFrame.iWidths[0])?"20":"16"
	printhtml += "<div class='TitulosVentanas' style='top:10px;font-size:" + fontSize + "px;font-weight:bold;text-align:center;width:" + ancho + "px'>" + titulo + "</div>"
	
	// Imagen
	var topImagen = 50
	var content = "<img src='../../images/pixel.gif' width=1 height=1>"
	printhtml += "<div style='top:" + topImagen + "px;width:" + ancho + "px;height:" + alto + "px'>"
	printhtml += "<div style='left:3px;top:-3px'>x:&nbsp;" + x1 + "<br/>y:&nbsp;" + y1 + "</div>"
	// Cruz esquina superior izquierda
		printhtml += "<div style='background-color:#000000;overflow:hidden;left:-5px;top:23px;width:10px;height:1px;z-index:1;visibility:visible;'>" + content + "</div>"
		printhtml += "<div style='background-color:#000000;overflow:hidden;left:0px;top:18px;width:1px;height:10px;z-index:1;visibility:visible;'>" + content + "</div>"
	if (imagen2!="")
		printhtml += "<div style='left:0px;top:23px;border:1px solid' align=center><img src='" + imagen2 + "'></div>"
	printhtml += "<div style='left:0px;top:23px;border:1px solid' align=center><img src='" + imagen1 + "'></div>"
	// Cruz esquina inferior derecha
		printhtml += "<div style='background-color:#000000;overflow:hidden;left:" + (ancho-3) + "px;top:" + (alto+27-3) + "px;width:10px;height:1px;z-index:1;visibility:visible;'>" + content + "</div>"
		printhtml += "<div style='background-color:#000000;overflow:hidden;left:" + (ancho+1) + "px;top:" + (alto+27-7) + "px;width:1px;height:10px;z-index:1;visibility:visible;'>" + content + "</div>"
	printhtml += "<div style='left:0px;top:" + (alto+27) + "px;width:" + ancho + "px;text-align:right'>x:&nbsp;" + x2 + "<br/>y:&nbsp;" + y2 + "</div>"
	printhtml += "</div>"
	
	// Pie
	var topPie = topImagen + alto + 60
	var altoPie = (ancho>parent.MapFrame.iWidths[0])?95:92
	var varAncho = (ancho>parent.MapFrame.iWidths[0])?190:122
	fontSize = (ancho>parent.MapFrame.iWidths[0])?"6":"5"
	var fecha = new Date().getDate() + "-" + (new Date().getMonth()+1) + "-" + new Date().getYear()
	printhtml += "<div style='top:" + topPie + "px;width:" + (ancho+2) + "px'>"
	printhtml += "<table cellspacing='0' cellpadding='2' style='width:" + (ancho+2) + "px;margin:0px;height:" + altoPie + "px'>"
	printhtml += "  <tr>"
	printhtml += "    <td class='celdaIzq' width='139' align='center'><div style='position:relative;width:139px'><img src='../media/gobcan.gif' /><br/>"
	printhtml += "    <img src='../media/grafcan.gif' align='right'/></div>"
	printhtml += "    </td>"
	printhtml += "    <td width='" + varAncho + "px' class='celdaIzq' valign='middle' style='height:" + altoPie + "px;font-size:" + fontSize + "pt'><strong>Informaci&oacute;n T&eacute;cnica</strong><br/><br/>"
	printhtml += "      &middot;Sistema de Referencia ITRF93<br />"
	printhtml += "      &middot;Elipsoide WGS84:<br />"
	printhtml += "      &nbsp;&nbsp;-&nbsp;semieje mayor: a=6.378.137<br />"
	printhtml += "      &nbsp;&nbsp;-&nbsp;aplanamiento: f=298,257223563<br />"
	printhtml += "      &middot;Red geod&eacute;sica REGCAN95<br />"
	printhtml += "      &middot;Sistema cartogr&aacute;fico de representaci&oacute;n UTM<br />&middot;Huso 28"
	printhtml += "	  </td>"
	printhtml += "    <td class='celdaDer' valign='top' style='height:" + altoPie + "px'>"
	printhtml += "		<table width='100%' cellspacing='0' cellpadding='0' class='texto' style='margin:0px;height:" + altoPie + "px;font-size:7pt'>"
	printhtml += "			<tr>"	
	printhtml += "				<td valign='top' align='center'><span style='font-weight:bold;font-size:12px'>" + orto + "</span><br/><br/>Escala&nbsp;" + escala + "</td>"
	printhtml += "			</tr>"
	printhtml += "			<tr>"
	printhtml += "				<td valign='bottom'><span class='texto' style='font-size:6pt'>Fecha de impresi&oacute;n:&nbsp;" + fecha + "</span></td>"
	printhtml += "			</tr>"
	printhtml += "		</table>"
	printhtml += "	</td>"
	printhtml += "  </tr>"
	printhtml += "</table>"
	printhtml += "</div>"

	// Ayuda
	var topAyuda = topPie+altoPie+20
	var anchoAyuda = parseInt(ancho/1.5)
	var textoAyuda = "Para una correcta impresi&oacute;n:<br/><br/>"
                   + "&nbsp;&nbsp;&nbsp;- Haga uso de la opci&oacute;n de men&uacute; <em>Archivo</em>-><em>Imprimir</em>. Tambi&eacute;n puede hacer clic en la p&aacute;gina con el bot&oacute;n derecho del rat&oacute;n (no encima de la propia imagen) y seleccione <em>Imprimir</em>.<br/>"
                   + "&nbsp;&nbsp;&nbsp;- Para que la imagen no aparezca cortada, puede que tenga que modificar los m&aacute;rgenes izquierdo y/o derecho de la p&aacute;gina en la opci&oacute;n de men&uacute; <em>Archivo->Configurar p&aacute;gina</em>."
                   + "<br/><br/>(Este texto de ayuda no aparecer&aacute; en la impresi&oacute;n)"
	var ayudahtml = "<div id='ayudaPrint' style='text-align:left;left:" + parseInt(ancho/2-anchoAyuda/2+margenLeft) + "px;top:" + topAyuda + "px;width:" + anchoAyuda + "px;height:75px'>"
	ayudahtml += textoAyuda
	ayudahtml += "</div>"
	printhtml += ayudahtml

	printhtml += "</body>"
	printhtml += "</html>"
	// Fin

	/*frm.document.body.innerHTML = "";
	frm.document.write(printhtml);
	frm.focus();
	alert(frm.name);
	window.print();*/
	//
	var args = ""
	var win = window.open("", "preView", "directories=no,location=no,menubar=yes,status=no,toolbar=yes,scrollbars=yes,width=" + (parent.MapFrame.iWidth+40))
	win.document.write(printhtml)
	win.focus()
	//
	frm.document.body.innerHTML = html
}
/*
Función genérica
*/
function fmtInfo(v, infoEle, incluirContenidoVacio)
{
	var tmp=""
	if (incluirContenidoVacio || v[1]!="")
	{
		tmp = v[1] // valor
		// valor del campo
		var re = /#VALOR#/g
		tmp = infoEle.replace(re, tmp)
		// descriptor del campo
		re = /#CAMPO#/g
		tmp = tmp.replace(re, v[0])
	}
	return tmp
}
function printPlaneamiento(frm, imagen1, imagen2, x1, y1, x2, y2, escala, vista, titulo, alto, ancho, info) {
	var html = frm.document.body.innerHTML
	var printhtml = ""

	// Inicio
	var margenLeft = 10
	printhtml = "<html>"
	printhtml += "<head>"
	printhtml += "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />"
	printhtml += "<title>Decanato Territorial de Santa Cruz de Tenerife</title>"
	printhtml += "<link media='screen' href='../estilos/screen.css' rel='stylesheet' type='text/css'>"
	printhtml += "<link media='print' href='../estilos/print.css' rel='stylesheet' type='text/css'>"
	printhtml += "</head>"
	printhtml += "<body style='margin-left:" + margenLeft + "px;margin-right:0px'>"

	// Título
	var fontSize = (ancho>parent.MapFrame.iWidths[0])?"20":"16"
	printhtml += "<div class='TitulosVentanas' style='top:10px;font-size:" + fontSize + "px;font-weight:bold;text-align:center;width:" + ancho + "px'>" + titulo + "</div>"
	
	// Info de la capa
	var infoHtml = "", tmp = ""
	var cols = 2
	var nCol = 1
	var iniGrp = "<table border=0 width='100%' cellpadding=0 cellspacing=0>"
	var finGrp = "</table>"
	var infoGrp = "<tr><td style='padding-left:2px' valign='bottom' width='" + parseInt(100/cols) + "%'><span class='info' style='font-size:11px'><strong>#GRUPO#</strong></span></td></tr>"
	var infoEle = "<tr><td style='padding-left:2px' valign='bottom' width='" + parseInt(100/cols) + "%'><span class='info' style='font-size:10px'><em>#CAMPO#</em>:&nbsp;#VALOR#</span></td></tr>"
	var idEle = ""
	var capaEle = parent.MapFrame.TieneInfo[parent.MapFrame.idxServicio][0]
	var c = 0 // índice del campo en el array info
	// parejas campo"@"valor, separadas por ","
	/*
	GENERAL
		Tramite
		fAprob
		m2
		Ha
		MUNI
	*/
	var htmlGeneral = ""
	var v = info[c++].split("@") // MUNI
	htmlGeneral += fmtInfo(v, infoEle)
	v = info[c++].split("@") // Tramite
	htmlGeneral += fmtInfo(v, infoEle)
	v = info[c++].split("@") // fAprob
	htmlGeneral += fmtInfo(v, infoEle)
	v = info[c++].split("@") // m2
	htmlGeneral += fmtInfo(v, infoEle)
	v = info[c++].split("@") // Ha
	htmlGeneral += fmtInfo(v, infoEle)
	if (htmlGeneral!="") htmlGeneral = iniGrp + infoGrp.replace("#GRUPO#", "General") + htmlGeneral + finGrp
	/*
	SUSPENSIÓN
		tHUELLA
		txtSUSP
	*/
	var htmlSusp = ""
	v = info[c++].split("@") // tHUELLA
	htmlSusp += fmtInfo(v, infoEle)
	v = info[c++].split("@") // txtSUSP
	htmlSusp += fmtInfo(v, infoEle)
	if (htmlSusp!="") htmlSusp = iniGrp + infoGrp.replace("#GRUPO#", "Suspensi&oacute;n") + htmlSusp + finGrp
	/*
	CLASIFICACIÓN Y CATEGORIZACIÓN DEL SUELO
		TxtCLA
	*/
	var htmlCla = ""
	v = info[c++].split("@") // TxtCLA
	htmlCla += fmtInfo(v, infoEle)
	if (htmlCla!="") htmlCla = iniGrp + infoGrp.replace("#GRUPO#", "Clasificaci&oacute;n y categorizaci&oacute;n del suelo") + htmlCla + finGrp
	/*
	ELEMENTOS ESTRUCTURANTES
		TxtEST
		Denominac
	*/
	var htmlEst = ""
	v = info[c++].split("@") // TxtEST
	htmlEst += fmtInfo(v, infoEle)
	v = info[c++].split("@") // Denominac
	htmlEst += fmtInfo(v, infoEle)
	if (htmlEst!="") htmlEst = iniGrp + infoGrp.replace("#GRUPO#", "Elementos estructurantes") + htmlEst + finGrp
	/*
	DETERMINACIONES REGULADORAS DE LA PARCELA URBANÍSTICA
		NomEDIF
		SupMin
		LongMin
		FonMin
	*/
	var htmlParc = ""
	v = info[c++].split("@") // NomEDIF
	htmlParc += fmtInfo(v, infoEle)
	v = info[c++].split("@") // SupMin
	htmlParc += fmtInfo(v, infoEle)
	v = info[c++].split("@") // LongMin
	htmlParc += fmtInfo(v, infoEle)
	v = info[c++].split("@") // FonMin
	htmlParc += fmtInfo(v, infoEle)
	if (htmlParc!="") htmlParc = iniGrp + infoGrp.replace("#GRUPO#", "Determinaciones reguladoras de la parcela urban&iacute;stica") + htmlParc + finGrp
	/*
	DETERMINACIONES REGULADORAS DE LA EDIFICACIÓN
		DispObl
		SepMinFr
		SepMinPs
		SepMinLt
		FonMaxEd
		SepMnEdf
		EdifMax
		AltMaxPl
	*/
	var htmlEdif = ""
	v = info[c++].split("@") // DispObl
	htmlEdif += fmtInfo(v, infoEle)
	v = info[c++].split("@") // SepMinFr
	htmlEdif += fmtInfo(v, infoEle)
	v = info[c++].split("@") // SepMinPs
	htmlEdif += fmtInfo(v, infoEle)
	v = info[c++].split("@") // SepMinLt
	htmlEdif += fmtInfo(v, infoEle)
	v = info[c++].split("@") // FonMaxEd
	htmlEdif += fmtInfo(v, infoEle)
	v = info[c++].split("@") // SepMnEdf
	htmlEdif += fmtInfo(v, infoEle)
	v = info[c++].split("@") // EdifMax
	htmlEdif += fmtInfo(v, infoEle)
	v = info[c++].split("@") // AltMaxPl
	htmlEdif += fmtInfo(v, infoEle)
	if (htmlEdif!="") htmlEdif = iniGrp + infoGrp.replace("#GRUPO#", "Determinaciones reguladoras de la edificaci&oacute;n") + htmlEdif + finGrp
	/*
	DETERMINACIONES REGULADORAS DE LOS USOS PORMENORIZADOS
		txtZUSO
		UsoPpal
		ObsCarac
	*/
	var htmlZuso = ""
	v = info[c++].split("@") // txtZUSO
	htmlZuso += fmtInfo(v, infoEle)
	v = info[c++].split("@") // UspPpal
	htmlZuso += fmtInfo(v, infoEle)
	v = info[c++].split("@") // ObsCarac
	htmlZuso += fmtInfo(v, infoEle)
	if (htmlZuso!="") htmlZuso = iniGrp + infoGrp.replace("#GRUPO#", "Determinaciones reguladoras de los usos pormenorizados") + htmlZuso + finGrp
	/*
	DETERMINACIONES URBANÍSTICAS DE GESTIÓN
		NomGES
		TxtGES
	*/
	var htmlGes = ""
	v = info[c++].split("@") // NomGES
	htmlGes += fmtInfo(v, infoEle)
	v = info[c++].split("@") // TxtGES
	htmlGes += fmtInfo(v, infoEle)
	if (htmlGes!="") htmlGes = iniGrp + infoGrp.replace("#GRUPO#", "Determinaciones de gesti&oacute;n urban&iacute;stica") + htmlGes + finGrp
	/*
	DETERMINACIONES URBANÍSTICAS DE DESARROLLO
		NomDES
		TxtDES
		InstPlan
		UsoGlobal
		SupEdRes
	*/
	var htmlDes = ""
	v = info[c++].split("@") // NomDES
	htmlDes += fmtInfo(v, infoEle)
	v = info[c++].split("@") // TxtDES
	htmlDes += fmtInfo(v, infoEle)
	v = info[c++].split("@") // InstPlan
	htmlDes += fmtInfo(v, infoEle)
	v = info[c++].split("@") // UsoGlobal
	htmlDes += fmtInfo(v, infoEle)
	v = info[c++].split("@") // SupEdRes
	htmlDes += fmtInfo(v, infoEle)
	if (htmlDes!="") htmlDes = iniGrp + infoGrp.replace("#GRUPO#", "Determinaciones de planeamiento de desarrollo urban&iacute;stico") + htmlDes + finGrp
	/*
	DETERMINACIONES REGULADORAS DE LOS ELEMENTOS DE PROTECCIÓN
		TxtCAT
	*/
	var htmlCat = ""
	v = info[c++].split("@") // TxtCAT
	htmlCat += fmtInfo(v, infoEle)
	if (htmlCat!="") htmlCat = iniGrp + infoGrp.replace("#GRUPO#", "Determinaciones reguladoras de los elementos de protecci&oacute;n") + htmlCat + finGrp
	/*
	FID
	*/
	v = info[info.length-1].split("@")
	idEle = v[1]
	// Fin campos planeamiento
	infoHtml += "<tr><td width='50%' valign='top' style='border-right:1px solid black'>" + htmlGeneral + htmlSusp + htmlCla + htmlEst + htmlParc + "</td>"
	infoHtml += "<td width='50%' valign='top'>" + htmlEdif + htmlZuso + htmlGes + htmlDes + htmlCat + "</td></tr>"
	// Imagen
	var topImagen = 50
	var content = "<img src='../../images/pixel.gif' width=1 height=1>"
	printhtml += "<div style='top:" + topImagen + "px;width:" + ancho + "px;height:" + alto + "px'>"
	printhtml += "<div style='left:3px;top:-3px'>x:&nbsp;" + x1 + "<br/>y:&nbsp;" + y1 + "</div>"
	// Cruz esquina superior izquierda
		printhtml += "<div style='background-color:#000000;overflow:hidden;left:-5px;top:23px;width:10px;height:1px;z-index:1;visibility:visible;'>" + content + "</div>"
		printhtml += "<div style='background-color:#000000;overflow:hidden;left:0px;top:18px;width:1px;height:10px;z-index:1;visibility:visible;'>" + content + "</div>"
	if (imagen2!="")
		printhtml += "<div style='left:0px;top:23px;border:1px solid' align=center><img src='" + imagen2 + "'></div>"
	// Modificamos la petición al ArcIMS para seleccionar el elemento del que se pidió info
	if (idEle!="" && capaEle!="" && imagen1.indexOf("Mapa.asp")>=0)
	{
		imagen1 += "&idEle=" + idEle + "&capaEle=" + capaEle
	}
	printhtml += "<div style='left:0px;top:23px;border:1px solid' align=center><img src='" + imagen1 + "'></div>"
	// Cruz esquina inferior derecha
		printhtml += "<div style='background-color:#000000;overflow:hidden;left:" + (ancho-3) + "px;top:" + (alto+27-3) + "px;width:10px;height:1px;z-index:1;visibility:visible;'>" + content + "</div>"
		printhtml += "<div style='background-color:#000000;overflow:hidden;left:" + (ancho+1) + "px;top:" + (alto+27-7) + "px;width:1px;height:10px;z-index:1;visibility:visible;'>" + content + "</div>"
	printhtml += "<div style='left:0px;top:" + (alto+27) + "px;width:" + ancho + "px;text-align:right'>x:&nbsp;" + x2 + "<br/>y:&nbsp;" + y2 + "</div>"
	printhtml += "</div>"
	
	// Info
	var topInfo = topImagen + alto + 40
	var altoInfo = 385
	fontSize = (ancho>parent.MapFrame.iWidths[0])?"6":"5"
	printhtml += "<div style='top:" + topInfo + "px;width:" + (ancho+2) + "px'>"
	printhtml += "<font size=2><strong>" + parent.MapFrame.TieneInfo[parent.MapFrame.idxServicio][5] + "</strong></font>"
	printhtml += "<table cellspacing='0' cellpadding='0' style='width:" + (ancho+2) + "px;height:" + altoInfo + "px;margin:0px'>"
	printhtml += "	<tr>"
	printhtml += "		<td valign=top style='height:" + altoInfo + "px;border-left:solid 1px black;border-right:solid 1px black;border-top:solid 1px black;border-bottom:solid 1px black'>"
	printhtml += "			<table border=0 width='100%' cellpadding=0 cellspacing=0 style='height:" + altoInfo + "px'>"
	printhtml += "				" + infoHtml
	printhtml += "			</table>"
	printhtml += "		</td>"
	printhtml += "	</tr>"
	printhtml += "</table>"
	// Pie
	var varAncho = (ancho>parent.MapFrame.iWidths[0])?190:122
	var altoPie = (ancho>parent.MapFrame.iWidths[0])?95:92
	var anchoCeldaLogos = 139
	var fecha = new Date().getDate() + "-" + (new Date().getMonth()+1) + "-" + new Date().getYear()
	printhtml += "<table cellspacing='0' cellpadding='0' style='width:" + (ancho+2) + "px;margin:0px'>"
	printhtml += "  <tr>"
	printhtml += "		<td style='padding:1px' style='border-left:solid 1px black;border-right:solid 1px black' colspan=3>"
	printhtml += "		<p class='info' style='font-size:8px;text-align:justify'>El presente documento es el resultado de un proceso autom&aacute;tico de selecci&oacute;n de informaci&oacute;n en una base de datos gr&aacute;fica y alfanum&eacute;rica. Esta base de datos se ha construido por interpretaci&oacute;n de los documentos legales de planeamiento con objeto de dar informaci&oacute;n acerca de los contenidos del planeamiento vigente. Su valor es exclusivamente informativo y en caso de requerirse informe t&eacute;cnico deber&aacute; acudirse a las oficinas municipales competentes.</p>"
	printhtml += "		</td>"
	printhtml += "  </tr>"
	printhtml += "</table>"
	printhtml += "<table cellspacing='0' cellpadding='0' style='width:" + (ancho+2) + "px;margin:0px'>"
	printhtml += "  <tr>"
	printhtml += "		<td class='celdaIzq' width='" + anchoCeldaLogos + "px' align='center'><div style='position:relative;width:139px'><img src='../media/gobcan.gif' /><br/>"
	printhtml += "			<img src='../media/grafcan.gif' align='right'/></div>"
	printhtml += "		</td>"
	printhtml += "		<td width='" + varAncho + "px' class='celdaIzq' valign='middle' style='padding-left:1px;height:" + altoPie + "px;font-size:" + fontSize + "pt'><strong>Informaci&oacute;n T&eacute;cnica</strong><br/><br/>"
	printhtml += "      &middot;Sistema de Referencia ITRF93<br />"
	printhtml += "      &middot;Elipsoide WGS84:<br />"
	printhtml += "      &nbsp;&nbsp;-&nbsp;semieje mayor: a=6.378.137<br />"
	printhtml += "      &nbsp;&nbsp;-&nbsp;aplanamiento: f=298,257223563<br />"
	printhtml += "      &middot;Red geod&eacute;sica REGCAN95<br />"
	printhtml += "      &middot;Sistema cartogr&aacute;fico de representaci&oacute;n UTM<br />&middot;Huso 28"
	printhtml += "		</td>"
	printhtml += "		<td class='celdaDer' valign='top' style='width:50%;height:" + altoPie + "px'>"
	printhtml += "		<table width='100%' cellspacing='0' cellpadding='0' class='texto' style='margin:0px;height:" + altoPie + "px;font-size:7pt'>"
	printhtml += "			<tr>"	
	printhtml += "				<td valign='top' align='center'><span style='font-weight:bold;font-size:12px'>" + vista + "</span><br/><br/>Escala&nbsp;" + escala + "</td>"
	printhtml += "			</tr>"
	printhtml += "			<tr>"
	printhtml += "				<td valign='bottom'><span class='texto' style='font-size:6pt'>Fecha de impresi&oacute;n:&nbsp;" + fecha + "</span></td>"
	printhtml += "			</tr>"
	printhtml += "		</table>"
	printhtml += "		</td>"
	printhtml += "	</tr>"
	printhtml += "</table>"

	// Ayuda
	var anchoAyuda = parseInt(ancho/1.5)
	var textoAyuda = "Para una correcta impresi&oacute;n:<br/><br/>"
                   + "&nbsp;&nbsp;&nbsp;- Haga uso de la opci&oacute;n de men&uacute; <em>Archivo</em>-><em>Imprimir</em>. Tambi&eacute;n puede hacer clic en la p&aacute;gina con el bot&oacute;n derecho del rat&oacute;n (no encima de la propia imagen) y seleccione <em>Imprimir</em>.<br/>"
                   + "&nbsp;&nbsp;&nbsp;- Para que la imagen no aparezca cortada, puede que tenga que modificar los m&aacute;rgenes izquierdo y/o derecho de la p&aacute;gina en la opci&oacute;n de men&uacute; <em>Archivo->Configurar p&aacute;gina</em>."
                   + "<br/><br/>(Este texto de ayuda no aparecer&aacute; en la impresi&oacute;n)"
	//var ayudahtml = "<div id='ayudaPrint' style='text-align:left;left:" + parseInt(ancho/2-anchoAyuda/2+margenLeft) + "px;top:" + topAyuda + "px;width:" + anchoAyuda + "px;height:75px'>"
	var ayudahtml = "<div id='ayudaPrint' style='margin-top:10px;text-align:left;left:" + parseInt(ancho/2-anchoAyuda/2+margenLeft) + "px;width:" + anchoAyuda + "px;height:75px'>"
	ayudahtml += textoAyuda
	ayudahtml += "</div>"
	printhtml += ayudahtml

	printhtml += "</div>"
	
	printhtml += "</body>"
	printhtml += "</html>"
	// Fin
	//
	var args = ""
	var win = window.open("", "preView", "directories=no,location=no,menubar=yes,status=no,toolbar=yes,scrollbars=yes,width=" + (parent.MapFrame.iWidth+40))
	win.document.write(printhtml)
	win.focus()
	//
	frm.document.body.innerHTML = html
}

// -->


