$(document).ready(function(){	   
	
	/* para que la barra de scroll siempre sume ancho ------------------------------------- */
	$("html").css({"overflow-y":"scroll","overflow-x":"auto" });
	
	/* aņade target="_black" a enlaces con class="targetBlanck" --------------------------- */
	$("a.js_targetBlank").each(function(){
		var js_targetBlank = $(this);
		var HREF = js_targetBlank.attr("href");
		js_targetBlank.bind("click", function(e){
			window.open(HREF);
			return false;
		});
		js_targetBlank.bind("keypress", function(e){
			if( e.which == 13 ){
				window.open(HREF);
			}
			return false;
		});
	});
	
	/* quita el borde que crea firefox en el onFocus --------------- */
	$("a").css({ "outline":"none"});
	
	
	/* para colorear las filas de las tablas --------------------------------------------- */
	$("table.js_tblComun").each(function(){
		$(this).find("tbody tr:even").each(function(){
			$(this).addClass("js_colorAlterno");
		});
		$(this).find("tbody tr").hover(function(){
			$(this).addClass("js_colorHover");				   
		},
		function(){
			$(this).removeClass("js_colorHover");	
		});
	 });
	
	/* para iniciar colorBox ------------------------------------------------------------ */
	$("a[rel='colorbox_1'] , a[rel='colorbox_2'] , a[rel='colorbox_3']").colorbox({
		transition:"true",
		maxWidth:900,
		maxHeight:( $("body").height() - 20 ),
		opacity:0.50,
		current: "foto: {current} / {total}"
	});
	
	/* para iniciar jrMiniGaleria ---------------------------------------------------------*/
	$("#minigaleria_1 , #minigaleria_2 , #minigaleria_3").jrMiniGaleria({
		autoMovimiento : true,
        retardoEntreFotos : 8000
	});
	
	/* para iniciar datepicker ---------------------------------------------------------*/
	var inputDatePicker = $('input.datePicker');
	
	if( inputDatePicker.length > 0 ){
		//inputDatePicker.each(function(){$(this).attr({"readonly":"readonly"}); $(this).css({"cursor":"default"});});
		inputDatePicker.datePicker({ startDate:'01/01/2006'});
	}
	
	
	/* para iniciar jrMiniGaleria ---------------------------------------------------------*/
	$("#videoBar-bar").jrMiniGaleria({
		autoMovimiento : false,
        retardoEntreFotos : 8000
	});
	
	
	
	$('#galeria_imaxe').cycle({ 
		fx: 'fade', 
		speed: 10000 ,
		timeout:1000,
		random: 1 
	 });			

		$(".enviar").colorbox({
			width:"640px", 
			height:"600px", 
			iframe:true, 
			opacity:0.80
		});


		$(".cbox").colorbox({
		transition:"true",
		maxWidth:900,
		maxHeight:( $("body").height() - 20 ),
		opacity:0.50,
		current: "foto: {current} / {total}"
		});
	
	
	
	


});


	// reproduce un son coma este:
	//<embed src="sons/button-20.wav" autostart=false width=0 height=0 name="son1" enablejavascript="true">
	//onMouseOver="EvalSound('son1')"
	function EvalSound(soundobj) {
		var thissound= eval("document."+soundobj);
		thissound.Stop(); // se xa estaba soando
		thissound.Play();
	}
	

