// <![CDATA[
	// opacity
    //var mouseX;
    //var mouseY;
	function opacity(element, value) {
		var value_noie = value / 100;
		$(element).css('filter', 'alpha(opacity=' + value + ')');
		$(element).css('-moz-opacity', value_noie);
		$(element).css('-khtml-opacity', value_noie);
		$(element).css('opacity',value_noie);
	}

	// center horizontally
	function centerHoriz(lo_que) {
		var x = parseFloat($(window).width()) / 2 - parseFloat($(lo_que).width()) / 2;
		var y = $(window).scrollTop() + $(window).height() / 2 - parseFloat($(lo_que).height()) / 2;
		x = x + 'px';
		y = y + 'px';
		$(lo_que).css({'left': x, 'top': y});
	}

	// center vertically
	function centerVert(lo_que) {
		var y = $(window).scrollTop() + $(window).height() / 2 - parseFloat($(lo_que).height()) / 2;
		$(lo_que).css({'top': y});
	}

	// image load
	function loadImg(sID, sURL) {
		$(sID).unbind("load");
		$(sID).bind("load", function() { $(this).fadeIn(); } )
		$(sID).stop(true, true).fadeOut("normal", function () { $(sID).attr('src', sURL); } );
	}

	$(document).ready(
		function() {

		  //magia obras
          /*$(".obra").mouseenter(
            function(){
                $(this).css({'background-color':'#EEE', 'z-index':'4000'});
                $(this).animate({width: '+=5px', height: '+=10px', marginTop:'-=10px',marginBottom:'0',marginRight:'-=5px', marginLeft:'-=5px', paddingLeft:'+=5px', paddingTop:'+=5px'}, "fast");
                $("#popitUp"+$(this).children().children('img').attr(('rel'))).show();
                
                $(this).mousemove(function(e){
                mouseX=(e.pageX+10)+"px";
                mouseY=(e.pageY+10)+"px";
                $("#popitUp"+$(this).children().children('img').attr(('rel'))).css({'left' : mouseX, 'top' : mouseY});
          });      
            }
          );
          $(".obra").mouseleave(
            function(){
                $(this).css({'background-color':'#CCC'});
                $(this).animate({width: '-=5px', height: '-=10px', marginTop:'+=10px', marginBottom:'10px',marginRight:'+=5px', marginLeft:'+=5px', paddingLeft:'-=5px', paddingTop:'-=5px'}, "fast");
                $("#popitUp"+$(this).children().children('img').attr(('rel'))).hide();
                
              //  $(this).remove($("#popUp"+$(this).attr(('rel'))));
            }
          );*/
          $(".diapositiva").mouseenter(
            function(){
                $(this).css('background-color','#EEE');
                $("#popUp"+$(this).attr(('rel'))).show();
                
                $(this).mousemove(function(e){
                mouseX=(e.pageX+10)+"px";
                mouseY=(e.pageY+10)+"px";
                $("#popUp"+$(this).attr(('rel'))).css({'left' : mouseX, 'top' : mouseY});
          });      
            }
          );
          $(".diapositiva").mouseleave(
            function(){
                $(this).css('background-color','#CCC');
                $("#popUp"+$(this).attr(('rel'))).hide();
                
              //  $(this).remove($("#popUp"+$(this).attr(('rel'))));
            }
          );

		/*
		$('input[type=text], textarea').each(function(){
		 // tomamos el valor actual del input
		 var currentValue = $(this).val();
		 // en el focus() comparamos si es el mismo por defecto, y si es asi lo vaciamos
		 $(this).focus(function(){
				if( $(this).val() == currentValue ) {
					 $(this).val('');
				};
		 });
		 // en el blur, si el usuario dejo el value vacio, lo volvemos a restablecer
		 $(this).blur(function(){
				if( $(this).val() == '' ) {
					 $(this).val(currentValue);
				};
			 });
			});
		*/
			// Language
			$('#language ul li a.item').mouseenter(
				function() {
					$('.sublanguage').hide();
					if ($(this).parent().find('.sublanguage').length > 0) {
					    $(this).parent().find('.sublanguage').show();
					}
				}
			)
			$('#language ul').mouseleave(
				function() {
					$('.sublanguage').hide();
				}
			)

			/*var subMn = $('.menuStyle1 #mainMenu ul li').parent().find('ul.submainMenu');
			if (subMn.length > 0) {
				$('.menuStyle1 #mainMenu ul li ul').parent().addClass('activeclose');
			}*/

			// Main Menu Inicio Vertical
			$('.menuStyle1 #mainMenu ul li a.item').click(
				function() {
					var subMn = $(this).parent().find('ul.submainMenu');

					$('.menuStyle1 #mainMenu ul li a.item').parent().removeClass('open');

					if(subMn.is(':animated') || subMn.is(':visible')) {
						$(this).parent().addClass('open active');
						return false;
					}
					$('ul.submainMenu').slideUp(1000);
					if (subMn.length > 0) {
						subMn.slideDown(1000);
						$(this).parent().addClass('open active');
						return false;
						}
					}
				)
			// $('#premios_konex').hide();
			 $('#premios_konex').show();
			 $('#premios_konex').parent().addClass('open active');
			// Menu Horizontal
			$('.menuStyle2 #mainMenu ul li a.item').mouseenter(
				function() {
					$('.submainMenu').hide();
					if ($(this).parent().find('.submainMenu').length > 0) {
					    $(this).parent().find('.submainMenu').show();
					}
				}
			)
			$('.menuStyle2 #mainMenu').mouseleave(
				function() {
					$('.submainMenu').hide();
				}
			)

			$('#mainMenu ul li ul').addClass('trns');


			// Menu Vertical
			$('.menuStyle2 #verticalMenu ul li a').click(
				function() {
					var subMn = $(this).parent().find('ul.verticalSubMenu');
					if(subMn.is(':animated') || subMn.is(':visible')) {
						return false;
					}
					$('ul.verticalSubMenu').slideUp(1000);
					if (subMn.length > 0) {
						subMn.slideDown(1000);

						return false;
						}
					}
				)
		// END DEFAULT //
		$('#banner2').jqGalScroll({
			/*		ease: null,
				speed: 2500,
				height: 624,
				width: 140,
				direction : 'vertical',
				autoplay: true,
				autoplaySpeed: 7000,
				titleOpacity : 0
				*/
				ease: null,
				speed: 4000,
                /* speed: 3000, */
				height: 624,
				width: 140,
				direction : 'vertical',
				autoplay: true,
				autoplaySpeed: 6500,
				titleOpacity : 0
			});

			$('#banner2').mouseover(function() {
	carrusel_control=0;
});
$('#banner2').mouseout(function() {
	carrusel_control=1;
});
		}
	);
var carrusel_control=1;



			// ]]>
