// este script se va a encargar de poner a las manitos de los mapas en el lugar correspondiente de cada ciudad
function armarMapa(x,y,url,nombre,derecha){
    var mapa = $('mapa_destinos');
    var my_anchor = new Element('a',{
        'href':url
    });

    my_anchor.inject(mapa);
    switch (derecha){
        case '1':
             var img = new Element('img',{
        'src': 'images/general/mano_der_cartel.png',
        'alt':'destino'
    });
            img.inject(my_anchor);
            my_anchor.style.top = y + 13 + 'px';
            my_anchor.style.left = x + 28 + 'px';
            my_anchor.style.position = 'absolute';
            img.style.top =  -13 +'px';
            img.style.left = (-28) + 'px';
			img.style.position = "absolute";
            my_anchor.appendText(nombre);
            break;
        case '0':
             var img = new Element('img',{
        'src': 'images/general/manoizq_cartel.png',
        'alt':'destino'
    });
            my_anchor.className = 'izq_mano';
            my_anchor.appendText(nombre);
            var ancho = my_anchor.offsetWidth;
            //img.inject(my_anchor);
            my_anchor.style.top = y + 13 +'px';
            my_anchor.style.left = x  +  - (ancho) + 'px';
            my_anchor.style.position = 'absolute';
            img.inject(my_anchor);
            img.style.top =  -13 +'px';
            img.style.left =  ancho + 'px';
            img.style.position = 'absolute';
            break;
    }
    //img.inject(mapa);
   /*
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    *
    * FUNCION MAPA CHICO
    */
//alert('posicion del mapa - x: ' + x_map + ' - y: ' + y_map);
}

function armarMapaChico(x,y,url,nombre,derecha){
    var mapa = $('mapa_chico_izq');
    var x_map = mapa.offsetTop;
    var y_map = mapa.offsetLeft;
    var my_anchor = new Element('a',{
        'href':url
    });

    my_anchor.inject(mapa);
    switch (derecha){
        case '1':
             var img = new Element('img',{
        'src': '../images/general/mano_der_cartel.png',
        'alt':'destino'
    });
            img.inject(my_anchor);
            my_anchor.style.top = y + 13  + 'px';
            my_anchor.style.left = x + 28 +  'px';
            my_anchor.style.position = 'absolute';
            img.style.top =  -13 +'px';
            img.style.left = (-28) + 'px';
			img.style.position = "absolute";
            my_anchor.appendText(nombre);
            break;
        case '0':
             var img = new Element('img',{
        'src': '../images/general/manoizq_cartel.png',
        'alt':'destino'
    });
            //var pt = new Element ('p',{'class' : 'mapa_izq'});
           // pt.inject(my_anchor);
            //pt.appendText(nombre);
            my_anchor.className = 'izq_mano';

            my_anchor.appendText(nombre);
            img.inject(my_anchor);
            var ancho = my_anchor.offsetWidth;
            //my_anchor.style.top = y  + 13 - 'px';
            my_anchor.style.left = x  + 28 + - (ancho) + 'px';
            my_anchor.style.top = y + 13 + 'px';
            my_anchor.style.position = 'absolute';
            img.style.top =  -13 +'px';
            img.style.left = (-30) + ancho + 'px';
            img.style.position = 'absolute';
            //alert(ancho);
            break;
    }
    //img.inject(mapa);

//alert('posicion del mapa - x: ' + x_map + ' - y: ' + y_map);
}

//con este script voy a hacer que los elementos a se abran en ventanas aparte
function otraVentana(){
    var cont = $('cont_city');
    var anchors = cont.getElements('a');
    var cantidad = anchors.length;
    for (var i=0 ; i<cantidad;i++){
        anchors[i].set('target','_blank');
    }
}


