//Version 2007 *************************************
function mostrar(nombreCapa){ 
document.getElementById(nombreCapa).style.visibility="visible"; 
} 

function mostrarel(nombreCapa){ 
document.getElementById(nombreCapa).style.position="relative"; 
document.getElementById(nombreCapa).style.visibility="visible"; 
} 

function ocultar(nombreCapa){ 
document.getElementById(nombreCapa).style.position="absolute"; 
document.getElementById(nombreCapa).style.visibility="hidden";
} 

function activapro (){
	
	var capaPro = document.getElementById('pro');
	if (capaPro != null)
	{
		rutaiframe="<iframe src='proximosa.asp' frameborder='0' vspace='0' hspace='0' marginwidth='0' marginheight='0' width='600' height='260' scrolling='no'></iframe>";
		capaPro.innerHTML = rutaiframe;
	}
}
function cambiarContenedor(idCapa, height)
{
	document.getElementById(idCapa).style.height = height;
	//alert("nuevo height=" + document.getElementById(idCapa).style.height );
}
function activaprox (){
rutaiframe="<iframe src='proximosa.asp?' frameborder='0' vspace='0' hspace='0' marginwidth='0' marginheight='0' width='200' height='200' scrolling='no'></iframe>";
document.getElementById('prox').innerHTML = rutaiframe;
}
/*
function activaprox (){
rutaiframe='<iframe src="/proximosa.asp?" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" width="160" height="165" scrolling="no"></iframe>';
document.getElementById('prox').innerHTML = rutaiframe;
}
*/

function menu() {
document.write("<ul class='menu'><li class='paes'><a href='http://amarillas.paginasamarillas.es'>P&aacute;ginas Amarillas</a></li><li class='calle'><a href='http://callejero.paginasamarillas.es'>El Callejero</a></li><li class='rest'><a href='http://www.paginasamarillas.es/home_restaurantes.asp'>Gu&iacute;a de Restaurantes</a></li><li class='aloj'><a href='http://www.paginasamarillas.es/home_hoteles.asp'>Gu&iacute;a de Hoteles</a></li><li class='blan'><a href='http://blancas.paginasamarillas.es'>P&aacute;ginas Blancas</a></li></ul>");
}

function desactivapro (){
contenido='';
parent.document.getElementById('pro').style.display = "inline";
parent.document.getElementById('pro').innerHTML = contenido;
}

function desactivaprox (){
contenido='<p><a href="javascript:activaprox();">Buscar los <strong>Cercanos a</strong>...</a>';
document.getElementById('prox').innerHTML = contenido;
}
/*
function desactivaprox (){
contenido='<fieldset><p>&nbsp;<a href="javascript:activaprox();">Buscar los<strong> Cercanos a</strong>...</a></p></fieldset></div>';
document.getElementById('prox').innerHTML = contenido;
}
*/

function pie() {
document.write("<div class='pie'><div class='repie'><div class='cierre'><a href='#'>Páginas Amarillas Internacionales</a>  -  <a href='#'>Más contenidos en tu web</a>  -  <a href='http://www.11888.com'>Información 11888</a>  -  <a href='#'>Canal Empleo</a>  -  <a href='#'>Canal Inmobiliario</a> - <a href='#'>Información Legal y Técnica</a>  -  <a href='#'>Condiciones Generales de Contratación</a>  -  <a href='#'>Contáctanos</a>  -  <a href='#'>©2007 Yell Publicidad, S.A.</a>  -  <a href='#'>Mapa web</a></div></div></div>");
}

/*
function bannertop () {
//document.write("<a href='#' class='bannertop' ><img src='/images/BANNER_468X60.gif' alt='banner top' /></a>");	
//document.write("<a href='#' class='bannertop' ><div id='fotohome'><script>banner('imagennewhome');</script></div></a>");
document.write("<a class='bannertop' ><script language='javascript' type='text/javascript'>banner('top')</script></a>");	
}
*/

function bannerright () {
document.write("<p style='text-align:center'><a href='#'><img src='/images/BANNER_RIGHT.gif' /></a><br/><br/><a href='#'><img src='/images/BANNER_RIGHT.gif' /></a></p>");
}
/*
function func (eliframe) {
document.write("<p class='func'><a href='#'>Ver <strong>Web</strong></a> - <a class='tel' href=\"javascript:void(0);\" onClick=\"telefono(this,'" + eliframe + "');\">Ver teléfono</a> - <a href='#'><img src='images/llama_gratis.gif' alt='Llama GRATIS' align='absmiddle' /></a> - <a href=\"javascript:void(0);\" onClick=\"direccion(this,'" + eliframe + "');\"><strong>Direcciones / mapa</strong></a> - <a href=\"javascript:void(0);\" onClick=\"sms(this,'" + eliframe + "');\">Recibir <strong>SMS</strong></a></p><iframe id='" + eliframe + "' class='iframefunc' frameborder='0'>Cerrar</iframe>");
}
*/
function func (eliframe) {
document.write("<p class='func'><a href='#'>Ver <strong>Web</strong></a> - <a class='tel' href=\"javascript:void(0);\" onClick=\"telefono(this,'" + eliframe + "');\">Ver tel&eacute;fono</a> - <a href=\"javascript:void(0);\" onClick=\"llamagratis(this,'" + eliframe + "');\"><img src='images/llama_gratis.gif' alt='Llama GRATIS' align='absmiddle' /></a> - <a href=\"javascript:void(0);\" onClick=\"direccion(this,'" + eliframe + "');\"><strong>Direcciones / mapa</strong></a> - <a href=\"javascript:void(0);\" onClick=\"sms(this,'" + eliframe + "');\">Recibir <strong>SMS</strong></a></p><iframe id='" + eliframe + "' class='iframefunc' frameborder='0'>Cerrar</iframe>");
}

function funcIg (eliframe) {
document.write("<p class='func'><a class='tel' href=\"javascript:void(0);\" onClick=\"telefono(this,'" + eliframe + "');\">Ver teléfono</a> - <a href=\"javascript:void(0);\" onClick=\"direccion(this,'" + eliframe + "');\">Ver <strong>mapa</strong></a> - <a href=\"javascript:void(0);\" onClick=\"sms(this,'" + eliframe + "');\">Recibir <strong>SMS</strong></a></p><iframe id='" + eliframe + "' class='iframefunc' frameborder='0'>Cerrar</iframe>");
}

function reserva () {
document.write("<p><a href='#' class='tel'>Ver Teléfono</a> <a href='#'><img src='images/llama_gratis.gif' alt='Llama GRATIS' align='absmiddle' /></a> <a href='#'><img src='images/reserva_online.gif' alt='Reserva online' align='absmiddle' /></a></p>");
}

function direcciones () {
document.write("<span class='dir'><a href='#'>Ver mapa</a> - <a href='#'>Otras direcciones</a></span>");
}

function sms () {
document.write("<p class='sms'>Envía <strong>BCDFG</strong> al <strong>7188</strong> y recibirás un SMS con los datos de este resultado. TARIFA: 0,30 € + IVA</p>");
}

function buscadorh (provincia) {
document.write("<form action='resultados.asp'><fieldset><label class='ancho1'>Actividad/Producto/Marca<input name='actividad' type='text' /></label><label class='ancho1'>Nombre de Empresa<input type='text' name='nombre'/></label><label class='ancho2'>Provincia<select name='provincia'><option value='' selected='selected'>" + provincia + "</option><option value=''>Alicante</option><option value=''>etc</option></select></label><label class='ancho2'>Localidad<input type='text' name='localidad'/></label><button><div><div>Encontrar</div></div></button></fieldset></form>");
}


// falsos popups resultados

function is_all_ws( nod )
{
// Use ECMA-262 Edition 3 String and RegExp features
return !(/[^\t\n\r ]/.test(nod.data));
}

function telefono(objeto, miframe)
{
document.getElementById(miframe).style.height = "100px";
document.getElementById(miframe).style.visibility = "visible";	
objetoReferenciado=objeto.parentNode.nextSibling;
objetoReferenciado.setAttribute("src","telefono.asp");
}

function direccion(objeto, miframe)
{
document.getElementById(miframe).style.height = "100px";
document.getElementById(miframe).style.visibility = "visible";	
objetoReferenciado=objeto.parentNode.nextSibling;
objetoReferenciado.setAttribute("src","direcciones.asp");
}

function llamagratis(objeto, miframe)
{
document.getElementById(miframe).style.height = "100px";
document.getElementById(miframe).style.visibility = "visible";	
objetoReferenciado=objeto.parentNode.nextSibling;
objetoReferenciado.setAttribute("src","llamar_gratis.asp");
}

function sms(objeto, miframe)
{
document.getElementById(miframe).style.height = "100px";
document.getElementById(miframe).style.visibility = "visible";	
objetoReferenciado=objeto.parentNode.nextSibling;
objetoReferenciado.setAttribute("src","sms.asp");
}

function meCierro(objeto)
{
alert(objeto)
objeto.style.display="none"
}

function fotohome () {
//esto debera llamar al addserver para obtener la imagen de fondo y el enlace
//SOLO PARA MAQUETA: RANDOM PARA ROTAR FOTOS Y SIMULAR ADDSERVER
var numero= Math.floor(Math.random()*8);
var foto='"url(/images/fotos_home/foto_' + numero + '.jpg)"';
//document.getElementById('bannerhome').style.background = eval(foto); 
document.getElementById('fotohome').style.background = eval(foto); 
}


//Version 2006 *************************************

/*function fotohome(){
//esto debería llamar al addserver para obtener la imagen de fondo y el enlace
//SOLO PARA MAQUETA: RANDOM PARA ROTAR FOTOS Y SIMULAR ADDSERVER
var numero= Math.floor(Math.random()*3);
var foto='"url(/fotos/foto_' + numero + '.jpg)"';
document.getElementById('fotohome').style.background = eval(foto); 
document.write('<a id="clickhome" href="/resul.asp"></a>');
}*/

function bover(ruta){
var resul = "" 
for (i=0;i<ruta.length-4;i++) { resul += ruta.charAt(i) ;} 
resul += "2.gif";
return(resul);
}

function bout(ruta){
var resul = "" 
for (i=0;i<ruta.length-5;i++) { resul += ruta.charAt(i) ;} 
resul += ".gif";
return(resul) ;
}

function funcionalidad (capa, parametros, alto){

	// Si "parametros" ya es una url con parámetros incluidos,
	// añadimos el parámetro "capa" como un parámetro más.
	// Si no, lo añadimos como el único.
	var union = "?";
	if ( parametros.indexOf( "?" ) != -1 ) {
		union = "&"
	}
	
	// NOTA: Capa representa el IFRAME
	var url = "/" + parametros + union + "capa=" + capa;
	var objIframe = document.getElementById(capa);
	objIframe.setAttribute("src", url);	
	objIframe.style.height = alto + "px";
	objIframe.style.visibility = "visible";
	objIframe.style.display = "block";
	objIframe.style.overflow = "hidden";
}

function funcionalidad_busqprox (capa, parametros, alto, tipo){
	// Si "parametros" ya es una url con parámetros incluidos,
	// añadimos el parámetro "capa" como un parámetro más.
	// Si no, lo añadimos como el único.
	var union = "?";
	var iAncho = 0;
	var sEspacios;

	if ( parametros.indexOf( "?" ) != -1 ) {
		union = "&"
	}
	//el parámetro tipo puede ser p (mapa pequeño) o g (mapa grande).
	if ( tipo == "p" )
	{
		iAncho = "418px";
		sEspacios = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
	}
	else
	{
		iAncho = "228px"
		sEspacios = ""
	}
	
	// NOTA: Capa representa el IFRAME
	var url = "/" + parametros + union + "capa=" + capa;
	var objIframe = document.getElementById(capa);
	objIframe.setAttribute("src", url);
	objIframe.style.height = "100px";
	//objIframe.style.width = iAncho;
	objIframe.style.visibility = "visible";	
}

function funcionalidad_el (capa, parametros, alto){
	if (alto) {contenido='<iframe src="/' + parametros + '&capa=' + capa + '" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" width="100%" height="' + alto + '" scrolling="no"></iframe>';}
	else {contenido='<iframe src="/' + parametros + '&capa=' + capa + '" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" width="533" height="145" scrolling="no"></iframe>';}
	document.getElementById(capa).innerHTML = contenido;
}

function funcionalidad_ig (capa, parametros){
	contenido = "<iframe src='" + parametros + "&capa=" + capa + "' class='iframefunc' height='170' frameborder='0'>Cerrar</iframe>";
	document.getElementById(capa).innerHTML = contenido;	
}

function off(idd)
{
	document.getElementById(idd).style.display = "inline";
	document.getElementById(idd).innerHTML ="";
}

function ocultarcapa(idd)
{
	document.getElementById(idd).style.display = "none";
}

function ocultarIframe(iframe)
{
	var objIframe = parent.document.getElementById(iframe);
	objIframe.style.height = "0px";
	objIframe.style.display = "none";
	objIframe.setAttribute("src", "");
}

function calendario(nombre) {
	document.getElementById(nombre).style.visibility="visible";
}

// Para controlar la carga de la imagen personalizada al video

function imgErrorVideo(imagen,rutaimgerror) {
	// Se le asigna una imagen indicando imagen no disponible.
	imagen.src = rutaimgerror;
	return false;
}	

//-----------------------------------------------------
// Para manejar la capa de ultimas busquedas
//-----------------------------------------------------

try {
$(document).ready(function(){

	$("#ultimas").click(function () {
		$("#ultimos").show();
		$("#buscador form fieldset select").hide();
	 });

     $("#cerrarultimas").click(function () {
       $("#ultimos").hide();
         $("#buscador form fieldset select").show();
     });

	$("#papelera").click(function () {
		$("#ultimos").hide();
		$("#buscador form fieldset select").show();
	});
});
}
catch(e) {}