
function mostrarBanner() {
	var node = document.getElementsByTagName("body").item(0);
  new Insertion.Before(node,'<div id="banner"></div>');

	var myAjax = new Ajax.Request(
			"/ssi/banners/"+bannerDicoruna, 
			{
				method: 'get', 
				parameters: '', 
				onComplete: function(originalRequest) {
					$("banner").innerHTML = originalRequest.responseText;
				}
			});		
}

Event.observe(window, 'load', mostrarBanner, true);

pathImagenes = "/ssi/banners/images/";

arImageSrc = new Array (
        "diputacion",
        "servicios",
        "municipios",
        "europa",
        "cultura",
        "turismo",
    "directorio",
    "noticias",
    "help",
    "lupa",
    "sobre"
        )

versionUp3 = (parseInt(navigator.appVersion)>=4);

arImageListOn = new Array ();
arImageListOff = new Array ();

function indiceDe( arreglo, objeto) {

        i = 0;
        while (i<arreglo.length) {
                if (arreglo[i]==objeto) return i;
                i++;
                }
        return -1;

}



if (versionUp3) for (i=0; i<arImageSrc.length;i++) {
        //alert(arImageSrc[counter]);
        arImageListOn[i] = new Image();
    arImageListOn[i].src = pathImagenes + arImageSrc[i] + "-on.gif";
        arImageListOff[i] = new Image();
    arImageListOff[i].src = pathImagenes + arImageSrc[i] + "-off.gif";
    }


function rollon(imgName)
{
  if (versionUp3) document[imgName].src = arImageListOn[indiceDe(arImageSrc,imgName)].src;
}

function rolloff(imgName) {
  if (versionUp3) document[imgName].src = arImageListOff[indiceDe(arImageSrc,imgName)].src;
}


function cambioIdioma() {
        if (document.location.hostname== 'www.dicoruna.es') {
                document.location.href=document.location.protocol+'//www1.dicoruna.es'+document.location.pathname+document.location.hash+document.location.search;
        }
        if (document.location.hostname=='www1.dicoruna.es') {
                document.location.href=document.location.protocol+'//www.dicoruna.es'+document.location.pathname+document.location.hash+document.location.search;
        }
}

function irAhttp(path) {
  document.location = "http://" + document.location.host +  path;
}
