// JavaScript Document
function doRolloverFlash (concejalia)  {
	changeImageFlash(concejalia);
	changeBackgroundMenu(concejalia);
	changeTextConcejalia(concejalia);
}

function doRolloverFlashInner (concejalia)  {
	changeImageFlash(concejalia);
	changeTextConcejalia(concejalia);
}

function doRolloutFlash (concejalia) {
	restoreImageFlash(concejalia);
	restoreBackgroundMenu(concejalia);
	restoreTextConcejalia();
}

function doRolloutFlashInner (concejalia) {
	restoreImageFlash(concejalia);
	restoreTextConcejalia();
}

function changeImageFlash(concejalia) {
	elemento=document.getElementById(concejalia);
	if (concejalia != "la_cala") {
		elemento.src='/imagenes/casas/'+concejalia+'hover.gif';
	}
}

function restoreImageFlash(concejalia) {
	elemento=document.getElementById(concejalia);
	if (concejalia != "la_cala") {
		elemento.src='/imagenes/casas/'+concejalia+'.gif';
	}
}

function changeBackgroundMenu(concejalia) {
	elemento=document.getElementById(concejalia+'menu');
	elemento.className="hover";
}

function restoreBackgroundMenu(concejalia) {
	elemento=document.getElementById(concejalia+'menu');
	elemento.className="";
}

function changeTextConcejalia(concejalia) {
	elemento=document.getElementById("txtlavila");
	switch (concejalia)
	  {
		case "servicios": { texto="Concejal&iacute;a de<br />Servicios T&eacute;cnicos<br />y Aseo Urbano"; break }
		case "juventud": { texto="Concejal&iacute;a de<br />Juventud y<br />Participaci&oacute;n<br />Ciudadana"; break }
		case "asociaciones": { texto="&Aacute;rea de<br />Asociaciones"; break }
		case "hacienda": { texto="Concejal&iacute;a de<br />Hacienda y Deportes<br />y Contrataci&oacute;n<br />y Patrimonio"; break }
		case "educacion": { texto="Concejal&iacute;a de<br />Educaci&oacute;n y<br />Parques y Jardines"; break }
		case "urbanismo": { texto="Concejal&iacute;a de<br />Urbanismo y<br />Casco Hist&oacute;rico"; break }
		case "sanidad": { texto="Concejal&iacute;a de<br />Sanidad y<br />Mujer"; break }
		case "turismo": { texto="Concejal&iacute;a de<br />Turismo y<br />Playas"; break }
		case "comercio": { texto="Concejal&iacute;a de<br />Comercio e<br />Industria"; break }
		case "bienestar": { texto="Concejal&iacute;a de<br />Bienestar Social y<br />Cultura"; break }
		case "seguridad": { texto="Concejal&iacute;a de<br />Seguridad<br />Ciudadana, Tr&aacute;fico<br />y V&iacute;as P&uacute;blicas"; break }
		case "aguas": { texto="Concejal&iacute;a de<br />Aguas, Agricultura<br />y Pesca"; break }
		case "contratacion": { texto="Concejal&iacute;a de<br />Medio Ambiente y<br />Cementerio"; break }
		case "comunicacion": { texto="Concejal&iacute;a de<br />Comunicaci&oacute;n<br />y Fiestas"; break }
		case "flash_turismo": { texto="Zona de Turismo"; break }
		default: { texto=""; break }
	  }
	elemento.innerHTML=texto;
}

function restoreTextConcejalia() {
	elemento=document.getElementById("txtlavila");
	elemento.innerHTML="";
}


<!-- // load htmlarea
_editor_url = "../";                     // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
  document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
  document.write(' language="Javascript1.2"></scr' + 'ipt>');  
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// -->

function openPopup(URL,Name,features) { 
  window.open(URL,Name,features);
}

function popup(imagen,w,h){
    var opciones='toolbar=no,menubar=no,resizable=no,status=no,height='+h+',width='+w;
	window.open("popup.asp?img="+imagen,'popup',opciones);
}

function evento(carpeta, alto, ancho, barra) {
	if (barra=="si") {
		barras_scroll="scrollbars";
	} else {
		barras_scroll="";
	}
	window.open('/eventos/'+carpeta+'/', carpeta, 'width='+ancho+', height='+alto+','+barras_scroll+'');
}

function expandir(div) {
	document.getElementById('clippings').style.height='auto';
	document.getElementById('clippings').style.overflow='visible';
}

function contraer(div) {
	document.getElementById('clippings').style.height='20px';
	document.getElementById('clippings').style.overflow='hidden';
}

function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
	anchor.target = "_blank"; 
 } 
} 

function markMenu() {
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("p"); 
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.className == "animacion") {
			anchor.style.cursor = "pointer";
			anchor.onmouseover = colorizeMenu;
			anchor.onmouseout = decolorizeMenu;
		}
	}
}

function colorizeMenu() {
	var menuItems = document.getElementsByTagName("li"); 
	for (var i=0; i<menuItems.length; i++) { 
		var menuItem = menuItems[i]; 
		if (menuItem.className == "triggered") {
			menuItem.firstChild.className = "activated";
		}
	}
}

function decolorizeMenu() {
	var menuItems = document.getElementsByTagName("li"); 
	for (var i=0; i<menuItems.length; i++) { 
		var menuItem = menuItems[i]; 
		if (menuItem.className == "triggered") {
			menuItem.firstChild.className = "";
		}
	}
}

function h3Headers() {
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("h3"); 
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.className == "trigger") {	
			anchor.style.cursor = "pointer";
			hideH3Content();
			anchor.title = "Pinche para desplegar el contenido";
			anchor.onclick = triggerDescription;
		}
	}
}

function triggerDescription() {
	try {
		if (this.parentNode.childNodes[3].style.display == "none") {
			this.parentNode.childNodes[3].style.display = ""
		} else {
			this.parentNode.childNodes[3].style.display = "none"
		} // end if
	}
	catch(e) {
		try {
			if (this.parentNode.childNodes[1].style.display == "none") {
				this.parentNode.childNodes[1].style.display = ""
			} else {
				this.parentNode.childNodes[1].style.display = "none"
			} // end if
		} 
		catch(e) {
			if (this.parentNode.childNodes[2].style.display == "none") {
				this.parentNode.childNodes[2].style.display = ""
			} else {
				this.parentNode.childNodes[2].style.display = "none"
			} // end if
		}
	}
	/*
	if (this.parentNode.childNodes[1].nodeType == 1) {
		if (this.parentNode.childNodes[1].style.display == "none") {
			this.parentNode.childNodes[1].style.display = ""
		} else {
			this.parentNode.childNodes[1].style.display = "none"
		} // end if
	} else {
		if (this.parentNode.childNodes[3].style.display == "none") {
			this.parentNode.childNodes[3].style.display = ""
		} else {
			this.parentNode.childNodes[3].style.display = "none"
		} // end if
	} 
	*/
}

function hideH3Content() {
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("p"); 
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.className == "triggerData") {	
			anchor.style.display = "none";
		}
	}
}

/*
Funciones para ordenacion estructural y pormenorizada
*/
function doOver(obj) {
	if (obj.className != "rollover_map_hover") {
		obj.className = "rollover_map_hover";
	}
	else {
		obj.className = "rollover_map";
	}
}

function mapSwap(id, obj) {
	if (obj == 1) {
		document.getElementById(id).src= "../imagenes/pormenor/"+id+"b.gif";
	} else {
		document.getElementById(id).src= "../imagenes/pormenor/"+id+".gif";
	}
	//alert(id);
}

function mapSwap1(id, obj, strFolder) {
	if (obj == 1) {
		document.getElementById(id).src= "../imagenes/pormenor/"+strFolder+id+"b.gif";
	} else {
		document.getElementById(id).src= "../imagenes/pormenor/"+strFolder+id+".gif";
	}
	//alert(id);
}

function openPicturePopup(_image, _pathImage, _pathPopup, _width, _height) {	
	//window.open( _pathPopup +"?image=" + _image+"&pathImage="+_pathImage, '','width='+_width+',height='+_height);
	window.open( _pathPopup +"?image=" + _image+"&pathImage="+_pathImage, '','width='+_height+',height='+_width);
}

function openFlashPicturePopup(_image, _width, _height) {	
	_pathPopup = "/popup.php";
	_pathImage = "/documentos/imagenes/";

	window.open( _pathPopup +"?image=" + _image+"&pathImage="+_pathImage, '','width='+_width+',height='+_height);
}

function loadFlash (){
}

window.onload = function (){
	loadFlash();
	externalLinks();
}