﻿/************************************************************************/
/* Funciones para insertar un Flash y que pase la validacion de XHTML 1 */
/************************************************************************/
function CreateControl(container, objectParamsTag, paramsIn, embedParamsTag) {
    var objContainer = document.getElementById(container);

    var sHtml = "<object " + objectParamsTag + ">\n";

    var embedParamsIn = "";
    for (i in paramsIn) {
        var param_name = paramsIn[i][0];
        var param_value = paramsIn[i][1];

        sHtml += "<param name=\"" + param_name + "\" value=\"" + param_value + "\">\n";
        embedParamsIn += param_name + "=\"" + param_value + "\" ";
    }

    sHtml += "<embed " + embedParamsTag + " " + embedParamsIn + "></embed>";
    sHtml += "</object>\n";

    objContainer.innerHTML = sHtml;
}

function CreateFlash(container, objId, swf, w, h, params) {
    var defaultParams = [["wmode", "transparent"],
						["bgcolor", "#ffffff"],
						["allowScriptAccess", "sameDomain"],
						["quality", "high"]];

    if (!params)
        params = new Array();

    params[params.length] = ["movie", swf];

    var objectParamsTag = "classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\"" +
						  " width=\"" + w + "\"" +
						  " height=\"" + h + "\"" +
						  " align=\"middle\"" +
						  " id=\"" + objId + "\"" +
						  " VIEWASTEXT";

    var embedParamsTag = "type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"" +
						" src=\"" + swf + "\"" +
						 " width=\"" + w + "\"" +
						 " height=\"" + h + "\"" +
						 " name=\"" + objId + "\"" +
						 " align=\"middle\"";

    params = DefaultParamsAdd(params, defaultParams);

    CreateControl(container, objectParamsTag, params, embedParamsTag);
}

function DefaultParamsAdd(params, defaultParams) {
    for (i in defaultParams) {
        var param_name = defaultParams[i][0];
        var param_value = defaultParams[i][1];

        var encontrado = false;
        var j = 0;

        while (!encontrado && j < params.length) {
            if (param_name == params[j][0])
                encontrado = true;
            j++;
        }
        if (!encontrado)
            params[params.length] = [param_name, param_value];
    }
    return (params);
}

/************************************************/
/*	Seccion: Sala de Prensa						*/
/*	Pagina: Publicaciones						*/
/************************************************/
function AbrirDesplegable(Contenedor, SeccionEnlace, Identificador, Flecha) {
    var contenedor = new Object();
    var desplegable = new Object();
    var flecha = new Object();
    var seccion = new Object();

    contenedor = document.getElementById(Contenedor);
    desplegable = document.getElementById(Identificador);
    flecha = document.getElementById(Flecha);
    seccion = document.getElementById(SeccionEnlace);

    if (desplegable.className == 'SP_PublicacionesSeccionOn') {
        seccion.className = 'SP_PublicacionesSeccionTextoLinkOff';
        flecha.src = '../_img/Flecha[Off].gif';
        desplegable.className = 'SP_PublicacionesSeccionOff';
    }
    else {
        seccion.className = 'SP_PublicacionesSeccionTextoLinkOn';
        flecha.src = '../_img/Flecha[On].gif';
        desplegable.className = 'SP_PublicacionesSeccionOn';
    }
}
/************************************************/
/*	Seccion: Fundacion Adecco					*/
/*	Pagina: Delegaciones						*/
/************************************************/
function DelegacionInfoMostrar(obj, id) 
{
    obj.style.cursor = "pointer";
    document.getElementById("FA_Delegaciones" + id).style.display = "block";
    var Info_obj = document.getElementById("FA_DelegacionesMapaInfo");
    Info_obj.style.display = "inline-block";
    if (id == "Madrid") {
        Info_obj.innerHTML = "<div class=\"FA_DelegacionesItem\"><p class=\"Enter TextoColorDestacado\">" + Delegaciones['Sede'].nombre + "</p><p class=\"Enter\">" + Delegaciones['Sede'].direccion + "</p><p class=\"Enter\">" + Delegaciones['Sede'].cp + "&nbsp;" + Delegaciones['Sede'].ciudad + "</p><p class=\"Enter\">Tel.:" + Delegaciones['Sede'].tel + "</p><p class=\"Enter\">" + "Fax.:" + Delegaciones['Sede'].fax + "</p></div>";
        Info_obj.innerHTML += "<div class=\"FA_DelegacionesItem\"><p class=\"Enter TextoColorDestacado\">" + Delegaciones[id].nombre + "</p><p class=\"Enter\">" + Delegaciones[id].direccion + "</p><p class=\"Enter\">" + Delegaciones[id].cp + "&nbsp;" + Delegaciones[id].ciudad + "</p><p class=\"Enter\">Tel.:" + Delegaciones[id].tel + "</p><p class=\"Enter\">" + "Fax.:" + Delegaciones[id].fax + "</p><div>";
        Info_obj.innerHTML += "<div class=\"FA_DelegacionesItem\"><p class=\"Enter TextoColorDestacado\">" + Delegaciones['Retiro'].nombre + "</p><p class=\"Enter\">" + Delegaciones['Retiro'].direccion + "</p><p class=\"Enter\">" + Delegaciones['Retiro'].cp + "&nbsp;" + Delegaciones['Retiro'].ciudad + "</p><p class=\"Enter\">Tel.:" + Delegaciones['Retiro'].tel + "</p><p class=\"Enter\">" + "Fax.:" + Delegaciones['Retiro'].fax + "</p></div>";
        
    }
    else 
    {
        Info_obj.innerHTML = "<div class=\"FA_DelegacionesItem\"><p class=\"Enter TextoColorDestacado\">" + Delegaciones[id].nombre + "</p><p class=\"Enter\">" + Delegaciones[id].direccion + "</p><p class=\"Enter\">" + Delegaciones[id].cp + "&nbsp;" + Delegaciones[id].ciudad + "</p><p class=\"Enter\">Tel.:" + Delegaciones[id].tel + "</p><p class=\"Enter\">" + "Fax.:" + Delegaciones[id].fax + "</p><div>";
    }

}
function DelegacionInfoEsconder(obj, id) {
    document.getElementById("FA_Delegaciones" + id).style.display = "none";
    var Info_obj = document.getElementById("FA_DelegacionesMapaInfo");
    Info_obj.style.display = "none";
}
function DelegacionItem_Class(id, nombre, direccion, cp, ciudad, tel, fax) {
    this.id = id;
    this.nombre = nombre;
    this.direccion = direccion;
    this.ciudad = ciudad;
    this.cp = cp;
    this.tel = tel;
    this.fax = fax;
}
/************************************************/
/*	Seccion: Todas								*/
/*	Pagina: Todas								*/
/************************************************/
function HerramientasGenerar(pagina, texto) {
    var html = "";
    var objId = "CphPrincipal";

    if (texto) {
        html += "<div id=\"TextoDisminuir\" onclick=\"HnlTextChangeSize('" + objId + "', -1, 10, 12)\" title=\"haz clic aqu&iacute; para disminuir el texto\"></div>";
        html += "<div id=\"TextoAumentar\" onclick=\"HnlTextChangeSize('" + objId + "', 1, 10, 12)\" title=\"haz clic aqu&iacute; para aumentar el texto\"></div>";
    }
    document.write(html);
}
function SubMenuClick(idHref) {
    window.parent.location.href = document.getElementById(idHref).href;
}
function SubMenuRollOver(obj, idHref) {
    obj.style.backgroundColor = '#A9A18C';
    document.getElementById(idHref).style.backgroundColor = '#A9A18C';
}
function SubMenuRollOut(obj, idHref) {
    obj.style.backgroundColor = '';
    document.getElementById(idHref).style.backgroundColor = '';
}

/* Array para seccion Fundacion Adecco => Delegaciones en version estandar */
var Delegaciones = new Array();
Delegaciones["Alicante"] = new DelegacionItem_Class("Alicante", "Fundaci&oacute;n Alicante", "c /Reyes Católicos 50, Entreplanta A.", "03003", "Alicante", "+34 965 98 50 85", "+34 965 12 31 22");
Delegaciones["Barcelona"] = new DelegacionItem_Class("Barcelona", "Fundaci&oacute;n Barcelona", "C/ Bac de Roda, 58. Edifici C", "08019", "Barcelona", "+34 93 255 24 11", "+34 93 255 24 19");
Delegaciones["Guipuzcoa"] = new DelegacionItem_Class("Guipuzcoa", "Fundaci&oacute;n San Sebasti&aacute;n", "c/ Bergara, 23 · 1º centro dcha", "20005", "Donostia - San Sebastián", "+34 943 44 57 80", "+34 943 42 08 13");
Delegaciones["LasPalmas"] = new DelegacionItem_Class("LasPalmas", "Fundaci&oacute;n Las Palmas de Gran Canaria", "C/ General Mas de Gaminde, 8", "35006", "Las Palmas de Gran Canaria", "+34 928 22 55 03", "+34 928 26 17 78");
Delegaciones["Sede"] = new DelegacionItem_Class("Sede", "Fundación Adecco Sede", "Pza. Colón, 2, Ed. Torre Colón, pl.12", "28004", "Madrid", "+34 91 700 18 76", "+34 91 700 18 77");
Delegaciones["Madrid"] = new DelegacionItem_Class("Madrid", "Fundaci&oacute;n Madrid G&eacute;nova", "c/ G&eacute;nova, 18", "28004", "Madrid", "+34 91 700 49 20", "+34 91 319 92 07");
Delegaciones["Retiro"] = new DelegacionItem_Class("Retiro", "Fundaci&oacute;n Madrid Esquerdo", "c/ Doctor Esquerdo, 174", "28007", "Madrid", "+34 91 552 97 58", "+34 91 551 03 10");
Delegaciones["Malaga"] = new DelegacionItem_Class("Malaga", "Fundaci&oacute;n M&aacute;laga", "Avenida Obispo Ángel Herrera Oria, 20", "29007", "M&aacute;laga", "+34 95 206 05 22", "+34 95 207 12 07");
Delegaciones["PalmaMallorca"] = new DelegacionItem_Class("PalmaMallorca", "Fundaci&oacute;n Palma de Mallorca", "C/Ind&uacute;stria, 18, baixos", "07013", "Palma de Mallorca", "+34 971 78 06 76", "+34 971 78 06 72");
Delegaciones["Sevilla"] = new DelegacionItem_Class("Sevilla", "Fundaci&oacute;n Sevilla", "Avda. Ramón Carande, 3", "41013", "Sevilla", "+34 95 428 02 75", "+34 95 428 62 41");
Delegaciones["Tarragona"] = new DelegacionItem_Class("Tarragona", "Fundaci&oacute;n Tarragona", "c/ Pere el Cerimoniós, 8", "43204", "Reus", "+34 977 77 07 76", "+34 977 75 24 31");
Delegaciones["Tenerife"] = new DelegacionItem_Class("Tenerife", "Fundaci&oacute;n Tenerife", "c/ Numancia 35", "38004", "Tenerife", "+34 922 53 20 24", "+34 922 24 62 03");
Delegaciones["Valencia"] = new DelegacionItem_Class("Valencia", "Fundaci&oacute;n Valencia", "Av. Reino de Valencia, 3", "46005", "Valencia", "+34 96 335 63 53", "+34  96 333 47 86");
Delegaciones["Vizcaya"] = new DelegacionItem_Class("Vizcaya", "Fundaci&oacute;n Bilbao", "c/ Berastegui, 5 &middot; 1º izquierda", "48008", "Vizcaya", "+34 94 479 22 70", "+34 94 479 22 41");
Delegaciones["Zaragoza"] = new DelegacionItem_Class("Zaragoza", "Fundaci&oacute;n Zaragoza", "c/ Manuel Lasala, 44 &middot; 1ºC", "50006", "Zaragoza", "+34 976 20 15 80", "+34 976 46 73 66");
Delegaciones["Navarra"] = new DelegacionItem_Class("Navarra", "Fundaci&oacute;n Navarra", "Av. Barañain, 10, 1º Of. C", "31008", "Pamplona", "+34 94 819 93 73", "+34 94 819 82 88");

HnlTextChangeInitialSize(10);

