$j(document).ready(function()
{
    $j("#menu_left img, #leftcol_buscador a img, input.submit_img, .home_bottom_element_left .img_link a img, .summary_element_left_link a img, .ficha_right_bg .linkright img, .ficha_right_bg .linkleft img")
    .mouseover(function () {
      var tmp = $j(this).attr("src").substring(0,$j(this).attr("src").length-4);
      tmp = tmp + "_over.jpg";
      $j(this).attr({
          src: tmp
        });
    })
    .mouseout(function () {
      var tmp = $j(this).attr("src").substring(0,$j(this).attr("src").length-9);
      tmp = tmp + ".jpg";
      $j(this).attr({
          src: tmp
        });
    });

    $j(".ficha_bottomletters_link1")
    .click(function () {

        var id = $j(".ficha_bottomletters_link_id").attr("id").substring(5,$j(".ficha_bottomletters_link_id").attr("id").length);
        window.location='/opinions/index/'+id+'#opinions_bg';
    });

    $j(".ficha_bottomletters_link2")
    .click(function () {

        var id = $j(".ficha_bottomletters_link_id").attr("id").substring(5,$j(".ficha_bottomletters_link_id").attr("id").length);
        window.location='/opinions/index/'+id+'#opinion_form';
    });

    //EXCURSIONS VIEW SLIDESHOW

    var img_number=0;

    $j(".ficha_right_bg .image[id='img"+img_number+"']").fadeIn('fastest');

    $j(".linkright")
    .click(function () {
        $j(".ficha_right_bg .image[id='img"+img_number+"']").fadeOut('fast');
        if(img_number<img_count-1)
        {            img_number++;
        }
        else
        {            img_number=0;        }
        setTimeout("img_show('"+img_number+"');", 400);
    });

    $j(".linkleft")
    .click(function () {
        $j(".ficha_right_bg .image[id='img"+img_number+"']").fadeOut('fast');
        if(img_number>0)
        {
            img_number--;
        }
        else
        {
            img_number=img_count-1;
        }
        setTimeout("img_show('"+img_number+"');", 400);
    });

});

function img_show(img_number)
{
    $j(".ficha_right_bg .image[id='img"+img_number+"']").fadeIn('fast');
}

