// JavaScript Document
//<![CDATA[
/* Replacement calls. Please see readme.txt for more information. */
if(typeof sIFR == "function"){
	sIFR.replaceElement("#titulo", "media/es_cond.swf", "#dd0000",  null, null, null, 0, 0, 0, 0);
};
//]]>


cambioLetraEpigrafe=false
function cargarEpigrafes(){
	cambioLetraEpigrafe=true;
	var comboBox=window.document.buscador.actividades
	var letra=comboBox.options[comboBox.selectedIndex].value
	window.location.href="epigrafes.shtml?gTxt_Letra="+letra+"&amp;"+Math.round(Math.random()*123456789)
}



function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function cambiarLocalidad(combo){
	id=combo.options[combo.selectedIndex].value;
	window.location.href="anunciantes.shtml?gTxt_ID=<!--4DVAR gTxt_ID-->&gTxt_Localidad="+id+"&"+Math.round(Math.random()*123456789)
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function ControlDatosSMS(alertNombre,alertTelefono,alta)
{
	f=window.document.forms[0]

	if(f.gTxt_Nombre.value=="")
	{
		alert(alertNombre)
		return
	}

	if(f.gTxt_Telefono.value=="")
	{
		alert(alertTelefono)
		return
	}
	f.gTxt_Alta.value=alta
	f.submit()
}

function ControlDatosConsulta(alertEmail,alertConsulta)
{
	f=window.document.forms[0]

	if(f.gTxt_EMail.value=="")
	{
		alert(alertEmail)
		return
	}

	if(f.gTxt_Comentarios.value=="")
	{
		alert(alertConsulta)
		return
	}
	f.submit()
}

function ControlDatosContacta(alertComentarios)
{
	f=window.document.forms[0]

	if(f.gTxt_Comentarios.value=="")
	{
		alert(alertComentarios)
		return
	}
	f.submit()
}

function abrir_Multimedia(URL)
{
	if(VentanaMultimedia!=null)
	{
		VentanaMultimedia.close
	}
	
	var VentanaMultimedia = window.open("","","height=200,width=300,status=no,menubar=no");
	if (VentanaMultimedia != null) {
	
		var newContent = "<HTML><HEAD><TITLE>"
		newContent += "</TITLE></HEAD>"
		newContent += "<BODY LEFTMARGIN=0 TOPMARGIN=0><embed SRC="+URL+'></embed>'
		newContent += "</BODY></HTML>"
		VentanaMultimedia.document.write (newContent)
		
		VentanaMultimedia.document.close()
	}
}
newWindow=null
function Ventana(Titulo,Path)
{
	if(newWindow!=null)
	{
		newWindow.close
	}
	
	newWindow = window.open(Path,'','status=no,statusbar=no,menubar=no,resizable=no,toolbar=no,titlebar=no,top=0px,left=0px,width=1024px,height=768px');
	if (newWindow != null) {
	
		var newContent = "<HTML><HEAD><TITLE>"
		newContent += Titulo
		newContent += "</TITLE></HEAD>"

		AnchoMas=0
		AltoMas=0
		if(EsNavegador("opera","win")){
			AnchoMas=10
			AltoMas=36
		}else if(EsNavegador("msie","win",";sv")){
			AnchoMas=12
			AltoMas=45
		}else if(EsNavegador("msie","win")){
			AnchoMas=12
			AltoMas=45
		}else if(EsNavegador("firefox","win")){
			AnchoMas=7
			AltoMas=55
		}else if(EsNavegador("mozilla","win")){
			AnchoMas=7
			AltoMas=42
		}else if(EsNavegador("opera","mac")){
			AltoMas=20
		}else if(EsNavegador("msie","mac"))	{
			AltoMas=0
		}else if(EsNavegador("safari","mac")){
			AltoMas=20
		}else if(EsNavegador("firefox","mac")){
			AltoMas=8
		}else if(EsNavegador("mozilla","mac")){
			AltoMas=10
		}
		swLeft=window.screen.availWidth/2
		swTop=window.screen.availHeight/2
		
		eventoOnLoad='window.resizeTo(this.width+'+AnchoMas+',this.height+'+AltoMas+');'
		/*eventoOnLoad +="window.left="+swLeft+"-(this.width/2);"
		eventoOnLoad +="window.top="+swTop+"-(this.height/2);"*/
		eventoOnLoad +="window.moveTo(ajustar("+swLeft+"-(this.width/2)),ajustar("+swTop+"-(this.height/2)))"
		//alert(eventoOnLoad)
		newContent += "<script>function ajustar(tamano){if(tamano>0){return(tamano)}else{return(1)}}"
		newContent += "</script><BODY LEFTMARGIN=0 TOPMARGIN=0>"
		enlace=false
		if(arguments.length>2){
			if(arguments[2]!=""){
				enlace=true;
				newContent +='<a href="http://'+arguments[2]+'" target="_blank">'
			}
		}
		newContent +="<IMG SRC="+Path+' onLoad="'+eventoOnLoad+'" border=0>'
		if(enlace){
			newContent += "</a>"
		}

		newContent += "</BODY></HTML>"
		newWindow.document.write (newContent)
		/*	
		IMG=newWindow.document.images[0]
		i=0
		do
		{
			i++
		}
		while(IMG.height<=0)

		newWindow.resizeTo(IMG.width+10,IMG.height+30)*/
		
		newWindow.document.close()
	}
}

function EsNavegador()
{
	user = navigator.userAgent;
	user=user.toLowerCase()
	tope=arguments.length
	gBoo_Navegador=true

	for(var i=0;i<tope;i++)
	{
		if(user.indexOf(arguments[i]) == -1 ){
			gBoo_Navegador=false
		}
	}
	
	/*if(nav)
	{
		for(var i=0;i<arguments.length;i++)
		{
			alert(arguments[i])
		}
	}*/
	return(gBoo_Navegador)

}

function Paginar(url,cajaTexto,regPorPagina,totalPaginas,nomVariable,alerta)
{
	pag=new Number(cajaTexto.value)
	
	if(pag<=0 || pag>totalPaginas || isNaN(pag))
	{
		alerta=alerta+' "'+cajaTexto.value+'"'
		alert(alerta)
	}
	else
	{
		registro=(pag*regPorPagina)-regPorPagina+1
		url=url+nomVariable+"="+registro+"&"+Math.round(Math.random()*123456789)
		window.location.href=url
	}
}

function PaginarRetorno(url,cajaTexto,regPorPagina,totalPaginas,nomVariable,alerta,evento)
{
	if(evento.keyCode==13)
	{
		Paginar(url,cajaTexto,regPorPagina,totalPaginas,nomVariable,alerta)
	}
}
/* =================================================================================================
* NiceTitles
* 21st January 2004
* http://neo.dzygn.com/code/nicetitles
*
* NiceTitles turns your boring (X)HTML tags into a dynamic experience
*
* Copyright (c) 2003 - 2004 Stuart Langridge, Paul McLanahan, Peter Janes, Brad Choate, Dunstan Orchard, Ethan Marcotte, Mark Wubben
*
* Licensed under MIT - http://www.opensource.org/licenses/mit-license.php
==================================================================================================*/

function NiceTitles(sTemplate, nDelay, nStringMaxLength, nMarginX, nMarginY, sContainerID, sClassName){
	var oTimer;
	var isActive = false;
	var sNameSpaceURI = "http://www.w3.org/1999/xhtml";
	
	if(!sTemplate){ sTemplate = "attr(nicetitle)";}
	if(!nDelay || nDelay <= 0){ nDelay = false;}
	if(!nStringMaxLength){ nStringMaxLength = 500; }
	if(!nMarginX){ nMarginX = 15; }
	if(!nMarginY){ nMarginY = 15; }
	if(!sContainerID){ sContainerID = "nicetitlecontainer";}
	if(!sClassName){ sClassName = "nicetitle";}

	var oContainer = document.getElementById(sContainerID);
	if(!oContainer){
		oContainer = document.createElementNS ? document.createElementNS(sNameSpaceURI, "div") : document.createElement("div");
		oContainer.setAttribute("id", sContainerID);
		oContainer.className = sClassName;
		oContainer.style.display = "none";
		document.getElementsByTagName("body").item(0).appendChild(oContainer);
	}
	
	//=====================================================================
	// Method addElements (Public)
	//=====================================================================
	this.addElements = function addElements(collNodes, sAttribute){
		var currentNode, sTitle;
		
		for(var i = 0; i < collNodes.length; i++){
			currentNode = collNodes[i];
		
			sTitle = currentNode.getAttribute(sAttribute);
			if(sTitle){
				currentNode.setAttribute("nicetitle", sTitle);
				currentNode.removeAttribute(sAttribute);
				addEvent(currentNode, 'mouseover', show);
				addEvent(currentNode, 'mouseout', hide);
				addEvent(currentNode, 'focus', show);
				addEvent(currentNode, 'blur', hide);
			}
		}

	}
	
	//=====================================================================
	// Other Methods (All Private)
	//=====================================================================
	function show(e){
		if(isActive){ hide(); }

		var oNode = window.event ? window.event.srcElement : e.currentTarget;
		if(!oNode.getAttribute("nicetitle")){ 
			while(oNode.parentNode){
				oNode = oNode.parentNode; // immediately goes to the parent, thus we can only have element nodes
				if(oNode.getAttribute("nicetitle")){ break;	}
			}
		}

		var sOutput = parseTemplate(oNode);
		setContainerContent(sOutput);
		var oPosition = getPosition(e, oNode);
		oContainer.style.left = oPosition.x;
		oContainer.style.top = oPosition.y;

		if(nDelay){	
			oTimer = setTimeout(function(){oContainer.style.display = "block";}, nDelay);
		} else {
			oContainer.style.display = "block";
		}

		isActive = true;		
		// Let's put this event to a halt before it starts messing things up
		window.event ? window.event.cancelBubble = true : e.stopPropagation();
	}
	
	function hide(){
		clearTimeout(oTimer);
		oContainer.style.display = "none";
		removeContainerContent();
		isActive = false;
	}

	function setContainerContent(sOutput){
		sOutput = sOutput.replace(/&/g, "&amp;");
		if(document.createElementNS && window.DOMParser){
			var oXMLDoc = (new DOMParser()).parseFromString("<root xmlns=\""+sNameSpaceURI+"\">"+sOutput+"</root>", "text/xml");
			var oOutputNode = document.importNode(oXMLDoc.documentElement, true);
			var oChild = oOutputNode.firstChild;
			var nextChild;
			while(oChild){
				nextChild = oChild.nextSibling; // One's the child is appended, the nextSibling reference is gone
				oContainer.appendChild(oChild);
				oChild = nextChild;
			}
		} else {
			oContainer.innerHTML = sOutput;
		}
	}
	
	function removeContainerContent(){
		var oChild = oContainer.firstChild;
		var nextChild;

		if(!oChild){ return; }
		while(oChild){
			nextChild = oChild.nextSibling;
			oContainer.removeChild(oChild);
			oChild =  nextChild;
		}
	}
	
	function getPosition(e, oNode){
		var oViewport = getViewport();
		var oCoords;
		var commonEventInterface = window.event ? window.event : e;

		if(commonEventInterface.type == "focus"){
			oCoords = getNodePosition(oNode);	
			oCoords.x += nMarginX;
			oCoords.y += nMarginY;			
		} else {
			oCoords = { x : commonEventInterface.clientX + oViewport.x + nMarginX, y : commonEventInterface.clientY + oViewport.y + nMarginY};
		}

		oContainer.style.visiblity = "hidden"; // oContainer needs to be displayed before width and height can be retrieved
		oContainer.style.display =  "block";
		var containerWidth = oContainer.offsetWidth;
		var containerHeight = oContainer.offsetHeight;
		oContainer.style.display = "none"; // hide it again
		oContainer.style.visiblity = "visible";

		if(oCoords.x + containerWidth + 10 >= oViewport.width + oViewport.x){
			oCoords.x = oViewport.width + oViewport.x - containerWidth - 10;
		}
		if(oCoords.y + containerHeight + 10 >= oViewport.height + oViewport.y){
			oCoords.y = oViewport.height + oViewport.y - containerHeight - oNode.offsetHeight - 10;
		}

		oCoords.x += "px";
		oCoords.y += "px";

		return oCoords;
	}

	function parseTemplate(oNode){
		var sAttribute, collOptionalAttributes;
		var oFound = {};
		var sResult = sTemplate;
		
		if(sResult.match(/content\(\)/)){
			sResult = sResult.replace(/content\(\)/g, getContentOfNode(oNode));
		}
		
		var collSearch = sResult.split(/attr\(/);
		for(var i = 1; i < collSearch.length; i++){
			sAttribute = collSearch[i].split(")")[0];
			oFound[sAttribute] = oNode.getAttribute(sAttribute);
			if(oFound[sAttribute] && oFound[sAttribute].length > nStringMaxLength){
				oFound[sAttribute] = oFound[sAttribute].substring(0, nStringMaxLength) + "...";
			}
		}
		
		var collOptional = sResult.split("?")
		for(var i = 1; i < collOptional.length; i += 2){
			collOptionalAttributes = collOptional[i].split("attr(");
			for(var j = 1; j < collOptionalAttributes.length; j++){
				sAttribute = collOptionalAttributes[j].split(")")[0];

				if(!oFound[sAttribute]){ sResult = sResult.replace(new RegExp("\\?[^\\?]*attr\\("+sAttribute+"\\)[^\\?]*\\?", "g"), "");	}
			}
		}
		sResult = sResult.replace(/\?/g, "");
		
		for(sAttribute in oFound){
			sResult = sResult.replace("attr\("+sAttribute+"\)", oFound[sAttribute]);
		}
		
		return sResult;
	}	
		
	function getContentOfNode(oNode){
		var sContent = "";
		var oSearch = oNode.firstChild;

		while(oSearch){
			if(oSearch.nodeType == 3){
				sContent += oSearch.nodeValue;
			} else if(oSearch.nodeType == 1 && oSearch.hasChildNodes){
				sContent += getContentOfNode(oSearch);
			}
			oSearch = oSearch.nextSibling
		}

		return sContent;
	}
	
	function getNodePosition(oNode){
		var x = 0;
		var y = 0;

		do {
			if(oNode.offsetLeft){ x += oNode.offsetLeft }
			if(oNode.offsetTop){ y += oNode.offsetTop }
		}	while((oNode = oNode.offsetParent) && !document.all) // IE gets the offset 'right' from the start

		return {x : x, y : y}
	}
	
	// Idea from 13thParallel: http://13thparallel.net/?issue=2002.06&title=viewport
	function getViewport(){
		var width = 0;
		var height = 0;
		var x = 0;
		var y = 0;
		
		if(document.documentElement && document.documentElement.clientWidth){
			width = document.documentElement.clientWidth;
			height = document.documentElement.clientHeight;
			x = document.documentElement.scrollLeft;
			y = document.documentElement.scrollTop;
		} else if(document.body && document.body.clientWidth){
			width = document.body.clientWidth;
			height = document.body.clientHeight;
			x = document.body.scrollLeft;
			y = document.body.scrollTop;
		}
		// we don't use an else if here, since Opera 7 tends to get the height on the documentElement wrong
		if(window.innerWidth){ 
			width = window.innerWidth - 18;
			height = window.innerHeight - 18;
		}
		
		if(window.pageXOffset){
			x = window.pageXOffset;
			y = window.pageYOffset;
		} else if(window.scrollX){
			x = window.scrollX;
			y = window.scrollY;
		}
		
		return {width : width, height : height, x : x, y : y };		
	}
}

//=====================================================================
// Event Listener
// by Scott Andrew - http://scottandrew.com
// edited by Mark Wubben, <useCapture> is now set to false
//=====================================================================
function addEvent(obj, evType, fn){
	if(obj.addEventListener){
		obj.addEventListener(evType, fn, false); 
		return true;
	} else if (obj.attachEvent){
		var r = obj.attachEvent('on'+evType, fn);
		return r;
	} else {
		return false;
	}
}

//=====================================================================
// Time Since
// by Mark Wubben - http://neo.dzygn.com
//=====================================================================
Date.prototype.toTimeSinceString = function(nLimit, sBetween, sLastBetween){
	if(!nLimit){ nLimit = 2; }
	if(!sBetween){ sBetween = ", "; }
	if(!sLastBetween){ sLastBetween = " and "; }
	if(!Date.prototype.toTimeSinceString._collStructs){
		Date.prototype.toTimeSinceString._collStructs = new Array(
			{seconds: 60 * 60 * 24 * 365, name: "year"},
			{seconds: 60 * 60 * 24 * 30, name: "month"},
			{seconds: 60 * 60 * 24 * 7, name: "week"},
			{seconds: 60 * 60 * 24, name: "day"},
			{seconds: 60 * 60, name: "hour"},
			{seconds: 60, name: "minute"}
		);
	}

	var collStructs = Date.prototype.toTimeSinceString._collStructs;
	var nSecondsRemain = ((new Date).valueOf() - this.valueOf()) / 1000;
	var sReturn = "";
	var nCount = 0;
	var nFloored;

	for(var i = 0; i < collStructs.length && nCount < nLimit; i++){
		nFloored = Math.floor(nSecondsRemain / collStructs[i].seconds);
		if(nFloored > 0){
			if(sReturn.length > 0){
				if(nCount == nLimit - 1 || i == collStructs.length - 1){
					sReturn += sLastBetween;
				} else if(nCount < nLimit && i < collStructs.length){
					sReturn += sBetween;
				}
			}
			sReturn += nFloored + " " + collStructs[i].name;
			if(nFloored > 1){
				sReturn += "s";
			}
			nSecondsRemain -= nFloored * collStructs[i].seconds;
			nCount++;
		}
	}

	return sReturn;
}

//=====================================================================
// Here the default nice titles are created
//=====================================================================
NiceTitles.autoCreation = function(){
	if(!document.getElementsByTagName){ return; }

	function rewriteDateTime(collNodes){
		var nMonth, nDay, nHours, nMinutes, nSeconds, sDateTime, oDate;
		for(var i = 0; i < collNodes.length; i++){
			sDateTime = collNodes[i].getAttribute("datetime");
			if(sDateTime != null || sDateTime != ""){
				nYear = Number(sDateTime.substring(0,4));
				nMonth = Number(sDateTime.substring(5,7)) - 1;
				nDay = Number(sDateTime.substring(8,10));
				nHours = Number(sDateTime.substring(11, 13));
				nMinutes = Number(sDateTime.substring(14,16));
				nSeconds = Number(sDateTime.substring(17,19));
				oDate = new Date(nYear, nMonth, nDay, nHours, nMinutes, nSeconds);
				collNodes[i].setAttribute("nicetime", oDate.toTimeSinceString());
				collNodes[i].setAttribute("gmttime", oDate.toGMTString());
			}
		}

		return collNodes;
	}

	NiceTitles.autoCreated = new Object();

	NiceTitles.autoCreated.anchors = new NiceTitles("<p class=\"titletext\">attr(nicetitle)? <span class=\"accesskey\">[attr(accesskey)]</span>?</p><p class=\"destination\">attr(href)</p>", 600);
	NiceTitles.autoCreated.inserts = new NiceTitles("<p class=\"titletext\">Added attr(nicetitle) ago</p><p class=\"destination\">Complete timestamp: attr(gmttime)</p>?<p class=\"destination\">Reason: attr(cite)</p>?", 600);
	NiceTitles.autoCreated.deletions = new NiceTitles("<p class=\"titletext\">Deleted attr(nicetitle) ago</p><p class=\"destination\">Complete timestamp: attr(gmttime)</p>?<p class=\"destination\">Reason: attr(cite)</p>?", 600);
	NiceTitles.autoCreated.acronyms = new NiceTitles("<p class=\"titletext\">content(): attr(nicetitle)</p>", 600);	
	NiceTitles.autoCreated.abbreviations = new NiceTitles("<p class=\"titletext\">content(): attr(nicetitle)</p>", 600);	
	
	NiceTitles.autoCreated.anchors.addElements(document.getElementsByTagName("a"), "title");
	NiceTitles.autoCreated.inserts.addElements(rewriteDateTime(document.getElementsByTagName("ins")), "nicetime");
	NiceTitles.autoCreated.deletions.addElements(rewriteDateTime(document.getElementsByTagName("del")), "nicetime");
	NiceTitles.autoCreated.acronyms.addElements(document.getElementsByTagName("acronym"), "title");
	NiceTitles.autoCreated.acronyms.addElements(document.getElementsByTagName("abbr"), "title");	
}

addEvent(window, "load", NiceTitles.autoCreation);

function buscar(){
	campoBusca="2"
	busca=window.document.buscador.gTxt_TextoBusca.value
	busca=busca.replace("&","******______*******")
	url="anunciantes.shtml?gTxt_TextoBusca="+busca+"&gTxt_TipoBusqueda="+campoBusca+"&"+Math.round(Math.random()*123456789)
	window.location.href=url
}

function cambiarLocalidad(combo,id){
	idLocalidad=combo.options[combo.selectedIndex].value;
	campoBusca="2"
	busca=window.document.buscador.gTxt_TextoBusca.value
	
	window.location.href="anunciantes.shtml?gTxt_ID="+id+"&gTxt_TipoBusqueda="+campoBusca+"&gTxt_TextoBusca="+busca+"&gTxt_Localidad="+idLocalidad+"&"+Math.round(Math.random()*123456789)
}

function enviarInformacion(){
	with(window.document.formContacta){
		if(gTxt_EMPRESA.value==""){
			alert("Introduzca el nombre de su empresa.")
			gTxt_EMPRESA.focus();
			return false
		}
	}
}

function keyUpBuscar(evento)
{
	if(evento.keyCode==13)
	{
		buscar();
	}
}

function buscadorAvanzado(){
	if(!cambioLetraEpigrafe){
		formu=window.document.buscador
		textoAlfa=formu.gTxt_TextoAlfabetizacion.value;
		textoAlfa=textoAlfa.replace("&","******______*******")
		direccion=formu.gTxt_Direccion.value;
		localidad=formu.gTxt_LocalidadBUS.options[formu.gTxt_LocalidadBUS.selectedIndex].value;
		codigoPostal=formu.gTxt_CodigoPostal.value;
		actividad=formu.gTxt_Actividad.value;
		//tipoVia=formu.gTxt_TipoVia.options[formu.gTxt_TipoVia.selectedIndex].value
		url="anunciantes.shtml?"
		url=url+"gTxt_TextoAlfabetizacion="+textoAlfa+"&"
		url=url+"gTxt_Direccion="+direccion+"&"
		url=url+"gTxt_LocalidadBUS="+localidad+"&"
		url=url+"gTxt_CodigoPostal="+codigoPostal+"&"
		url=url+"gTxt_Actividad="+actividad+"&"
		//url=url+"gTxt_TipoVia="+tipoVia+"&"
		url=url+Math.round(Math.random()*123456789)
		window.location.href=url
	}
}

function keyUpBuscarAvanzado(evento)
{
	if(evento.keyCode==13)
	{
		buscadorAvanzado();
	}
}
function acotarEspacio(cajaTexto){
	
	if(document.getElementById("capaComprobacionInput")){
		capaComprobacion=document.getElementById("capaComprobacionInput")
	}else{
		capaComprobacion=window.document.createElement("div")
		capaComprobacion.id="capaComprobacionInput"
		capaComprobacion.className=cajaTexto.className
		capaComprobacion.style.width="auto";
		capaComprobacion.style.visibility="hidden"
		document.body.appendChild(capaComprobacion)
	}
	capaComprobacion.innerHTML=cajaTexto.value
	//debug(capa)
	if(capaComprobacion.offsetWidth>(cajaTexto.offsetWidth-10)){
		//alert(cajaTexto.value.substring(0,cajaTexto.value.length-2))
		cajaTexto.value=cajaTexto.value.substring(0,cajaTexto.value.length-1)
		
	}
	
}

function enviarContacta(){
	formulario=window.document.formContacta
	if(formulario.gTxt_TELEFONO.value=="" && formulario.gTxt_EMAIL.value==""){
		alert("Introduzca su teléfono o dirección de correo electrónico.")
	}else{
		formulario.submit()
	}
	
}