/*Exea Comunicación*/
//resultados por página
		<!--
		function MM_jumpMenu(targ,selObj,restore){ //v3.0
		  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		  if (restore) selObj.selectedIndex=0;
		}
		//-->
		
$(document).ready(function(){
	
		
		$("a[rel^='prettyPhoto']").prettyPhoto({
				animationSpeed: 'fast', /* fast/slow/normal */
				padding: 40, /* padding for each side of the picture */
				opacity: 0.8, /* Value betwee 0 and 1 */
				showTitle: true, /* true/false */
				theme: 'dark_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
				callback: function(){}
			});
		
		$(".jcart-button-add").hover(function(){
		  $(this).addClass("jcart-button-add-hover");
		},function(){
		  $(this).removeClass("jcart-button-add-hover");
		});
		//reemplazando los botones de radio
		//$(":radio").radio_button();
		
		//focus para los campos del form busquedas
		$("#frmmarcas input:text, #frmcodigo input:text").focus(function () {
				$(this).addClass("cajahover_bsc");
		});
		$("#frmmarcas input:text, #frmcodigo input:text").blur(function () {
				$(this).removeClass("cajahover_bsc");
		});
		//eliminamos el texto de los campos de búsqueda 
		$("#frmmarcas input:text, #frmcodigo input:text").click(function() {
					$(this).attr("value","");																			 
		});
		
		//Colores de filas para las tablas
		$(".listado tr").mouseover(function() {
			$(this).addClass("over");
			}).mouseout(function() {
			$(this).removeClass("over");
			});
		$(".listado tr:even, ul.listapdf li:even, ul.lista li:even, ul.listaprov_rd li:even").addClass("alt"); 
		
		  					
	
		
		//focus para los campos del form login y registro
		$("#frmlogin input:text, #frmregistro input:text").focus(function () {
				$(this).addClass("cajahover_nrm");
		});
		$("#frmlogin input:text, #frmregistro input:text").blur(function () {
				$(this).removeClass("cajahover_nrm");
		});
		
		
		//Autocompletar form marcas
            $("#marca").autocomplete("inc/autocmp_marcas.php", {
            width: 226,
            scroll: true,
            autoFill: true,
            scrollHeight: 300,
            selectFirst: true
            });
			
            $("#marca").result(function(event, data, formatted) {
                if (data)
                $("#idmarca").val(data[1]);
                var idmarca = $('#idmarca').attr('value');
                var loading = "<div class='load'><img src='img/loading.gif' alt='Cargando' /></div>";
                $("#divgrupo").html(loading).load('busquedas/catalogo_grupos.inc.php', {idmarca: idmarca});
            });

		
		//Autocompletar form marcas
			/*$("#marca").autocomplete("inc/autocmp_marcas.php", {
			width: 236,
			scroll: true,
			autoFill: true,
			scrollHeight: 300,
			selectFirst: true
			});
			$("#marca").result(function(event, data, formatted) {
				if (data)
				$("#idmarca").val(data[1]);
			});*/

		/* hover menu de búsquedas */
		var tipoBusqueda = $.cookie('tipoBusqueda');
		if (tipoBusqueda == null) {
			tipoBusqueda = 'marca';
			}
    	if (tipoBusqueda == 'marca') {
			$('#divmarcas').css("display","block");
			$('#divcodigo').css("display","none");
			$("#btn_bsc2").removeClass("activo");
			$("#btn_bsc1").addClass("activo");
			} 
			else if (tipoBusqueda == 'codigo') {
			$('#divmarcas').css("display","none");
			$('#divcodigo').css("display","block");
			$("#btn_bsc1").removeClass("activo");
			$("#btn_bsc2").addClass("activo");
    		};
		
		//Mostrar/ocultar formularios de búsqueda
		$("#btn_bsc1").click(function () {
			  $("#divcodigo").slideUp("normal");
			  $("#divmarcas").slideDown("normal");
			  $.cookie("tipoBusqueda", "marca");
			  $("#btn_bsc2").removeClass("activo");
			  $(this).addClass("activo");
		 });
		 $("#btn_bsc2").click(function () { 
			  $("#divcodigo").slideDown("normal");
			  $("#divmarcas").slideUp("normal");
			  $.cookie("tipoBusqueda", "codigo");
			  $("#btn_bsc1").removeClass("activo");
			  $(this).addClass("activo");
		 });
});

/* Módulos right desplegables */
ddaccordion.init({
	headerclass: "r_modulo_t", //Shared CSS class name of headers group
	contentclass: "r_modulo_b", //Shared CSS class name of contents group
	revealtype: "click", //Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: false, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [0,1,2,3,4], //index of content(s) open by default [index1, index2, etc] [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["abierto", ""], //header when it's collapsed and expanded, ["class1", "class2"]
	togglehtml: ["", "", ""], //Additional HTML added to the header respectively  ["position", "html1", "html2"]
	animatespeed: "normal", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})
