﻿//Inicializa los elementos en la página
$(document).ready(function() {

    //Control de Publicidad Para Publicidad AB1
    $('.Model0_FotoGalery').cycle({
        fx: 'fade',
        speed: 2500,
        timeout: 10000
        // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    });
    //Control de Publicidad Para Especiales: div_especiales_cicle
    $('#Destacados_Content_PlaceHoder')
		    .after('<div id="nav_destacado">')
		    .cycle({
		        fx: 'fade',
		        speed: 2500,
		        timeout: 10000,
		        pager: '#nav_destacado'
		        // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		    });

		    
	//Control de Publicidad Para Especiales: div_especiales_cicle
	$('#G5_Content_PlaceHolder')
	.after('<div id="nav_G5_PlaceHolder">')
	.cycle({
		fx: 'fade',
		speed: 2500,
		timeout: 10000,
		pager: '#nav_G5_PlaceHolder'
		// choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});

    //Control de Publicidad Para Columnistas: div_columnistas
    $('#div_columnistas')
		    .cycle({
		        fx: 'fade',
		        speed: 500,
		        timeout: 10000,
		        next: '#next2',
		        prev: '#prev2',
		        after: onAfter
		        // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		    });
    //Termino del JavaScript $(document).ready(function() {
});


//Funciones Personalizadas

//OnAfter: Permite ajustar el alto de controles usados en un cycle, automaticamente.
function onAfter(curr, next, opts, fwd) {
    var $ht = $(this).height();
    //set the container's height to that of the current slide
    //Ajusta con Animación $(this).parent().animate({ height: $ht });
    $(this).parent().css("height", $ht);
}

//Funcion para activar/desactivar fondo google search
function boxGooogleSearch(selected,text) {
    var obj2 = "#search_google";

    if (selected != 1) {
        if (text == "") {
            $(obj2).removeClass("google_nosearch");
            $(obj2).addClass("google_search");
        }
        else {
            $(obj2).removeClass("google_search");
            $(obj2).addClass("google_nosearch");
        }
    }
    else {
        $(obj2).removeClass("google_search");
        $(obj2).addClass("google_nosearch");        
    }
}




