var flashvars = {};
flashvars.height = "234";
flashvars.width = "195";
flashvars.showstop = "true";
flashvars.allowScriptAccess = "always";
flashvars.allowNetworking = "all";

var params = {};
params.menu = "false";
params.allowfullscreen = "true";
params.allowscriptaccess = "always";
params.allownetworking = "internal";
params.wmode = "transparent";
var attributes = {};

$(document).ready(function() {
						   				   
	$(".Link_boletines").toggle(function(){
		x=$(this.parentNode).hasClass("boletin_act");
		y=$(this.parentNode).hasClass("boletin");
		if(x==true){$(this.parentNode).removeClass("boletin_act");$(this.parentNode).addClass("boletin");}
		if(y==true){$(this.parentNode).removeClass("boletin");$(this.parentNode).addClass("boletin_act");}
		},function(){
		x=$(this.parentNode).hasClass("boletin_act");	
		y=$(this.parentNode).hasClass("boletin");
		if(x==true){$(this.parentNode).removeClass("boletin_act");$(this.parentNode).addClass("boletin");}
		if(y==true){$(this.parentNode).removeClass("boletin");$(this.parentNode).addClass("boletin_act");}
	});	
  
  /*accordion*/
  if($('#accordion_01').length>0 ){    jQuery('#accordion_01').accordion({      header: 'a.head',      alwaysOpen: false,      autoheight: false    });  }
	
	/*carousel*/
	if($('#mycarousel').length>0 ){		
    jQuery('#mycarousel').jcarousel({    scroll:1, auto:10,    visible:1, animation: 2000, wrap: 'both',        initCallback: mycarousel_initCallback  });
    $('#carousel').hover(
      function (){
        $('.jcarousel-skin-01 .jcarousel-next-horizontal, .jcarousel-skin-01 .jcarousel-prev-horizontal').css("visibility", "visible");
      },
      function (){
        $('.jcarousel-skin-01 .jcarousel-next-horizontal, .jcarousel-skin-01 .jcarousel-prev-horizontal').css("visibility", "hidden");
      }
    );
  }
  
  $('.jcarousel-skin-01 .jcarousel-next-horizontal, .jcarousel-skin-01 .jcarousel-prev-horizontal').pngfix();
	
	/*tabs*/
	$.tabs("tab_01");
	
	// Andres
	if($('#acc_archivo').length>0 ){		jQuery('#acc_archivo').accordion({			header: 'a.head',			alwaysOpen: false,			autoheight: false		});	}
  
  var navref = window.location.href.split('#s')[1];
  if(navref){
    $(".tab_skin_01 > div").hide();
    
    if(navref == '02'){      
      $(".tabs_links li").removeClass("on");
      $(".tabs_links .tab01_op2").parent().addClass("on");
    }
    if(navref == 'e02'){      
      $(".tabs_links_eng li").removeClass("on");
      $(".tabs_links_eng .tab01_op2").parent().addClass("on");
    }
    if((navref == '02') || (navref == 'e02')){
      $(".tab_skin_01 #tab_01-2").show();
    }
    if(navref == '03'){      
      $(".tabs_links li").removeClass("on");
      $(".tabs_links .tab01_op4").parent().addClass("on");
    }
    if(navref == 'e03'){      
      $(".tabs_links_eng li").removeClass("on");
      $(".tabs_links_eng .tab01_op4").parent().addClass("on");
    }
    if((navref == '03') || (navref == 'e03')){
      $(".tab_skin_01 #tab_01-3").show();
    }
    if(navref == '04'){      
      $(".tabs_links li").removeClass("on");
      $(".tabs_links .tab01_op3").parent().addClass("on");
    }
    if(navref == 'e04'){      
      $(".tabs_links_eng li").removeClass("on");
      $(".tabs_links_eng .tab01_op3").parent().addClass("on");
    }
    if((navref == '04') || (navref == 'e04')){
      $(".tab_skin_01 #tab_01-4").show();
    }
    if(navref == '05'){      
      $(".tabs_links li").removeClass("on");
      $(".tabs_links .tab01_op5").parent().addClass("on");
    }
    if(navref == 'e05'){      
      $(".tabs_links_eng li").removeClass("on");
      $(".tabs_links_eng .tab01_op5").parent().addClass("on");
    }
    if((navref == '05') || (navref == 'e05')){
      $(".tab_skin_01 #tab_01-5").show();
    }
  }


});

function mycarousel_initCallback(carousel)
{
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
  
};

Shadowbox.init({
    language: 'es',
    players:  ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv', 'mp3']
});
