$(document).ready( function() {

	// MAIN MENU
	// oculta el panel de opciones
	$('#main-navigation ul li').hover( function() {
		// muestro el submenu
		$('ul', this).show();
	}, function() {
		$('ul', this).hide();
	});
	
	// DOWNLOADS MENU (by dd)
	// Muestra las descargas de la categoria cdo se clickea.
    $('div.toHide').addClass('hide');  //oculto primero todos con js y no con css, por las dudas de q alguien venga sin javascript
    
    //si me redireccionan del home, este no lo oculto
    $('.act img').attr("src","/img/btn_less_01.jpg");
    $('.act img').attr("alt","-");
    $('.act img').attr("title","-");
    $('.act').css({'background-color' : '#E6F2F6'});
    $(".div-act").toggle();
    
	$('.down .down-tit a').click(function() {
        if($('img', this).attr("src") == "/img/btn_less_01.jpg") {
             $('img', this).attr("src","/img/btn_more_01.jpg");
             $('img', this).attr("alt","+");
             $('img', this).attr("title","+");
             $('#down-tit_'+$(this).attr("id")).css({'background-color' : '#EFEFEF'});                    
        }else {
            $('img', this).attr("src","/img/btn_less_01.jpg");
            $('img', this).attr("alt","-");
             $('img', this).attr("title","-");
            $('#down-tit_'+$(this).attr("id")).css({'background-color' : '#E6F2F6'});
        }
		$("#div_" + $(this).attr("id")).toggle(); return false;

	});
	
	// ORDERS SUBMENU (PRODUCTS)
	// Muestra los productos asociados a la orden cdo se clickea "ver detalle".
	
	$('a.order-show').click(function() {
	   if($(this).text() == "ocultar detalle") {   
	       $(this).text("ver detalle >") ;
       }else {    
           $(this).text("ocultar detalle") ; 
       }
	   $("#div_" + $(this).attr("id")).toggle(); return false;
	});

	
	

	// CARGA SIFR

	if( typeof sIFR == "function" ) {

		// This is the preferred "named argument" syntax
		sIFR.replaceElement(named({sSelector:"h2.sifr-h2-a", sFlashSrc:"/flash/Frutiger_LT_55.swf", sColor:"#2268A3", sLinkColor:"#2268A3", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", sWmode:"transparent" }));
		sIFR.replaceElement(named({sSelector:"h2.sifr-h2-b", sFlashSrc:"/flash/Frutiger_LT_55.swf", sColor:"#2268A3", sLinkColor:"#2268A3", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", sWmode:"transparent" }));
		sIFR.replaceElement(named({sSelector:"h2.sifr-h2-c", sFlashSrc:"/flash/Frutiger_LT_55.swf", sColor:"#FF6600", sLinkColor:"#FF6600", sBgColor:"#FF6600", sHoverColor:"#CCCCCC", sWmode:"transparent" }));
		sIFR.replaceElement(named({sSelector:"h2.sifr-h2-d", sFlashSrc:"/flash/Frutiger_LT_55.swf", sColor:"#216BA5", sLinkColor:"#216BA5", sBgColor:"#216BA5", sHoverColor:"#CCCCCC", sWmode:"transparent" }));
		sIFR.replaceElement(named({sSelector:"h3.sifr-h3-a", sFlashSrc:"/flash/Frutiger_LT_55.swf", sColor:"#2268A3", sLinkColor:"#2268A3", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", sWmode:"transparent" }));
		sIFR.replaceElement(named({sSelector:"h3.sifr-h3-b", sFlashSrc:"/flash/Frutiger_LT_55.swf", sColor:"#333333", sLinkColor:"#333333", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", sWmode:"transparent" }));
		sIFR.replaceElement(named({sSelector:"h3.prod-sifr-h3", sFlashSrc:"/flash/Frutiger_LT_55.swf", sColor:"#333333", sLinkColor:"#333333", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", sWmode:"transparent" }));
		//sIFR.replaceElement(named({sSelector:"h3.down-sifr-h3", sFlashSrc:"/flash/Frutiger_LT_55.swf", sColor:"#333333", sLinkColor:"#333333", sBgColor:"#FFFFFF",  sWmode:"transparent" }));
		
        sIFR.replaceElement(named({sSelector:"h4.sifr-h4-a", sFlashSrc:"/flash/Frutiger_LT_55.swf", sColor:"#333333", sLinkColor:"#333333", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", sWmode:"transparent" }));
		sIFR.replaceElement(named({sSelector:"h5.sifr-h5-a", sFlashSrc:"/flash/Frutiger_LT_55.swf", sColor:"#333333", sLinkColor:"#333333", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", sWmode:"transparent" }));
		sIFR.replaceElement(named({sSelector:"h6.sifr-h6-a", sFlashSrc:"/flash/Frutiger_LT_55.swf", sColor:"#333333", sLinkColor:"#333333", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", sWmode:"transparent" }));

	}



});
