﻿/************************************************************************************************
Click!
Desarrollos Multimedia
www.clickmultimedia.net
2011
************************************************************************************************/

// ----------------------------------------------------------------------------------------------
$(document).ready(function(){
	$("#containerBlog").pngFix(); //png

	$("#container h1 a").fadeEnalce("#FFF","#435841");
	$("#migaPan a").fadeEnalce("#FFF","#435841");
	$("#final a").fadeEnalce("#FFF","#435841");
	$(".cms a").fadeEnalce("#FFF","#000000");
	$(".cms h1 a").fadeEnalce("#FFF","#435841");
	$(".menInf ul li a").fadeEnalce("#000","#999");
	$("#footerInfo a").fadeEnalce("#008131","#000");

	$(".showcaseTexts p a").fadeEnalce("#FFF","#000");
/*	$("#containerNoti li a").fadeEnalce("#FFF","#000");*/
	$("#slideshow div a").fadeEnalce("#75A21B","#FFF");
	$("a.dw").fadeEnalce("#FFF","#75A21B");
	$(".videos a.canal").fadeEnalce("#FFF","#000");

	/*
	$("#container h1 a").fadeLink("#FFF","#435841");
	$("#migaPan a").fadeLink("#FFF","#435841");
	$("#final a").fadeLink("#FFF","#435841");
	$(".cms a").fadeLink("#FFF","#000000");
	$(".cms h1 a").fadeLink("#FFF","#435841");
	
	//$("#bar_gal a").fadeLink("#75A21B","#FFF"); 435841
	//$("#containerNoti ul li a").fadeLink("#FFF","#000");
	//$("#slideshow a").fadeLink("#75A21B","#FFF");

	//$("#pikame").PikaChoose();
	
	/*
	$(".buttons a").hover(function(){ $("#m_proy").fadeIn("fast"); });
	$(".buttons a").mouseout(function(){ $("#m_proy").fadeOut("fast"); });
	*/
});



// ----------------------------------------------------------------------------------------------
//fade
// ----------------------------------------------------------------------------------------------
(function($){  
	$.fn.fadeEnalce = function(col_over,col_out){
		$(this)
			.mouseover(function(){
				$(this).animate({ color: col_over }, 250);
			})
			.mouseout(function(){
				$(this).animate({ color: col_out }, 300);
			})
	};  
})(jQuery);

$(function(){
	$(".clientes_in li a").hover(function(){
		$(this).stop().animate({backgroundColor: "#FFF"}, 250)
	},
	function(){
		$(this).animate({backgroundColor: "#435841"}, 300);		      
	})
})

/*
(function($){  
	$.fn.fadeLink = function(col_over,col_out) {
		//alert( $(this) );
		$(this)
			.mouseover(function(){
				$(this).animate({ color: col_over }, 250);
			})
			.mouseout(function(){
				$(this).animate({ color: col_out }, 300);
			})
	};  
})(jQuery);
*/
// ----------------------------------------------------------------------------------------------
//slideshow
// ----------------------------------------------------------------------------------------------
function slideSwitch(orden) {
    var $active = $('#slideshow DIV.active');

    if ( $active.length == 0 ) $active = $('#slideshow DIV:last');

	//decide si es adelante o hacia atras
	if (orden == 1) {
		var $paso =  $active.next().length ? $active.next()
			: $('#slideshow DIV:first');
	}
	else {
		var $paso =  $active.prev().length ? $active.prev()
			: $('#slideshow DIV:last');
	}


    $active.addClass('last-active');

    $paso.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
   setInterval( "slideSwitch(1)", 7000 );
});


// ----------------------------------------------------------------------------------------------
//popup
// ----------------------------------------------------------------------------------------------
function sobre(){
	$('#activacion').modal();
}


// ----------------------------------------------------------------------------------------------
//ajax
// ----------------------------------------------------------------------------------------------
function ver_gal(name,url){
	//alert("url: "+url);
	$.ajax({
		type: "POST",
		url: "ck_galMuestra.php",
		data: "name="+name+"&url="+url,
		success: function(resultado){
			$("#resultado").html(resultado);
			centerPopup(document.documentElement.clientWidth);
			loadPopup();
		}
	});
}


// ----------------------------------------------------------------------------------------------
//videos
// ----------------------------------------------------------------------------------------------
$(function() {
	$("ul.list_videos").ytplaylist({
		holderId: 'ver_videos',
		playerWidth: '450',
		playerHeight: '296',
		addThumbs: true,
		autoPlay: false,
		thumbSize: 'small',
		showInline: false,
		allowFullScreen: true
	});
});	



// ----------------------------------------------------------------------------------------------
// PRECARGA
// ----------------------------------------------------------------------------------------------
$.fn.preload = function(){ 
	this.each(function(){ 
		$('<img/>')[0].src = this; 
	}); 
} 


