$(document).ready(function(){
						   
	// Menu
   	$('#menu li:has(ul)').hover( 
      function(e) 
      { 
         $(this).find('ul').fadeIn();
		 $(this).addClass('activo');
      }, 
      function(e) 
      { 
         $(this).find('ul').fadeOut('fast'); 
		 $(this).removeClass('activo');
      } 
   	);
	
	// Opacity img
	$(function() {
		$(".descargas-carousel img").css('opacity','0.70');
		// on mouse over
		$(".descargas-carousel img").hover(function () {
			$(this).stop().animate({opacity: 1}, "normal");
		},
		// on mouse out
		function () {
			$(this).stop().animate({opacity: 0.70}, "normal");
		});
	});			   	
	$(".info-marca").hover(function() {
		$(this).stop().animate({ opacity: 1 }, 300);
	},function(){
		$(this).stop().animate({ opacity: 0 }, 300);
	});		
});


// Carouseles
$(document).ready(function() {
    $('#productos-menu').jcarousel({scroll: 7, easing: 'easeInOutBack', animation: 1500});
	$('.descargas-carousel').jcarousel({scroll: 3, easing: 'easeOutBounce', animation: 1500});
});

// COLORBOX
$(document).ready(function(){
	$('.colorbox').colorbox({transition:'fade', opacity:0.85, maxWidth:'80%', maxHeight:'80%', initialWidth: '200px', initialHeight: '200px',  current: "imagen {current} de {total}"});
});


// SLIDER HOME
function formatText(index, panel) { return index + ""; }
$(function () {
	$('.anythingSlider').anythingSlider({
		easing: "easeInOutBack",        // Anything other than "linear" or "swing" requires the easing plugin
		autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
		delay: 3000,                    // How long between slide transitions in AutoPlay mode
		startStopped: false,            // If autoPlay is on, this can force it to start stopped
		animationTime: 700,            // How long the slide transition takes
		hashTags: true,                 // Should links change the hashtag in the URL?
		buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: 'Go',                // Start text
		stopText: 'Stop',               // Stop text
		navigationFormatter: formatText // Details at the top of the file on this use (advanced use)
	});		
});

$(".org-negocio a").click(function(e){
    $('.anythingSlider').anythingSlider(1);
    e.preventDefault();
});
$(".asi-monitoreo a").click(function(e){
    $('.anythingSlider').anythingSlider(2);
    e.preventDefault();
});
$(".loc-vehiculos a").click(function(e){
    $('.anythingSlider').anythingSlider(3);
    e.preventDefault();
});

// INPUTS
function eFocus(field){if (field.value == field.defaultValue){field.value ='';}}
function eBlur(field){if (field.value == ''){field.value = field.defaultValue;}}


// REFRESCA EL CAPTCHA;
function captchaRefresh(){
	rand = $.random(99999);
	$('#captcha_container').attr('src', 'captcha.php?'+rand);
}

$(document).ready(function(){
	//$("#desplegable-detalle h3:first").addClass("active");
	$("#acordion div").hide();
	$("#acordion h4").click(function(){
	$(this).next("div").slideToggle("normal")
	.siblings("div:visible").slideUp("fast");
	$(this).toggleClass("activo");
	$(this).siblings("h4").removeClass("activo");
	});
});

$(document).ready(function(){
	$("#acordion-bes h4:first").addClass("activo");
	$("#acordion-bes div").hide();
	$("#acordion-bes div:first").show();
	$("#acordion-bes h4").click(function(){
	$(this).next("div").slideToggle("normal")
	.siblings("div:visible").slideUp("fast");
	$(this).toggleClass("activo");
	$(this).siblings("h4").removeClass("activo");
	});
});

$(document).ready(function(){
	$(".idioma-current a").click(function(){
	$(".idioma-desplegable").slideToggle("fast")
	});
});
