        
var showEffect;

jQuery.each(jQuery.browser, function(i) {
         if(jQuery.browser.msie){
              showEffect = 'false';
         }
});

var i = 0;//initialize
var cint=0;//Internet Explorer Fix

function showImages()
{
	//jQuery(window).bind("load", function() {//The load event will only fire if the entire page or document is fully loaded
		var cint = setInterval("PreImage(i)",250);//500 is the fade in speed in milliseconds
	//}); 
}

function PreImage() {
	var images = jQuery('.preload').length;//count the number of images on the page
	if (i >= images) {// Loop the images
		clearInterval(cint);//When it reaches the last image the loop ends
		
	}
	//jQuery('.preload:hidden').eq(i).fadeIn(500);//fades in the hidden images one by one
	jQuery('.animated_icon').eq(0).animate({opacity:1},{"duration": 500});
	jQuery('.animated').eq(0).animate({opacity:1},{"duration": 500});
	jQuery('.animated').eq(0).removeClass("animated");
	jQuery('.animated_icon').eq(0).removeClass("animated_icon");
	i++;//add 1 to the count
}	
//pretty photo

function setHomeBoxes() 
{
	var op = { 'type': 'image','overlayColor':'#fff'};
	var path = 'http://elcastillohotel.com.ar/v1/images/talleres/';
	
	//--------------------------------------------------------------------
	
	$(".home #main .su-column-1-3,.home #main .su-column-1-4").hover(function()
	{
		$(this).find("img").css({"opacity":0.8})
		$(this).animate({ backgroundColor: '#ffffff' , color :"#333" }, 150);
	},function()
	{
		$(this).find("img").stop().animate({"opacity":1},200)
		$(this).animate({ backgroundColor: "#F6F6F6", color :"#000"}, 100);
	}).css("cursor","pointer");
	//--------------------------------------------------------------------
	jQuery.each(".box-3,.box-4", function(i) {
		 $(this).click( function() {
			window.location = $(this).find("a").attr("href");
			return false;
		})
	});
	//--------------------------------------------------------------------
	$(".programa-banner").hover(function()
	{
		$(this).find("img").stop().animate({"opacity":0.7},200)
	},
	function()
	{
		$(this).find("img").stop().animate({"opacity":1.0},200)
	});
	//--------------------------------------------------------------------	
	$(".talleres-musica-image-link").parent().parent().click( function() {
		var title = $(this).find('h3').text();
		jQuery.fancybox(
			[
				{ 'href': path + 'musica_01.jpg' , 'title'	: title},
				{ 'href': path + 'musica_02.jpg' , 'title'	: title},
				{ 'href': path + 'musica_03.jpg' , 'title'	: title},
				{ 'href': path + 'artisticas_01.jpg' , 'title' :  title},
				{ 'href': path + 'artisticas_02.jpg' , 'title' :  title},		
				{ 'href': path + 'artisticas_04.jpg' , 'title' :  title},			
			],op
		);
	}).hover(function()
	{
		$(this).find("img").stop().animate({"opacity":0.8},200)
	},
	function()
	{
		$(this).find("img").stop().animate({"opacity":1},200)
	}).css("cursor","pointer");
	//--------------------------------------------------------------------
	$(".talleres-pintura-image-link").parent().parent().click( function() {
		var title = $(this).find('h3').text();
		jQuery.fancybox(
			[
				{ 'href': path + 'pintura_01.jpg' , 'title' : title},
				{ 'href': path + 'pintura_02.jpg' , 'title' : title},
				{ 'href': path + 'pintura_03.jpg' , 'title' : title},			
			],op
		);
	}).css("cursor","pointer");
	//--------------------------------------------------------------------
	$(".talleres-fotografia-image-link").parent().parent().click( function() {
		
		var title = $(this).find('h3').text();
		jQuery.fancybox(
			[
				{ 'href': path + 'fotografia_01.jpg' , 'title' :  title},
				{ 'href': path + 'fotografia_02.jpg' , 'title' :  title},
				{ 'href': path + 'fotografia_03.jpg' , 'title' :  title},			
				{ 'href': path + 'fotografia_04.jpg' , 'title' :  title},			
			],op
		);
		
	}).css("cursor","pointer");
	//--------------------------------------------------------------------
	$(".talleres-danza-image-link").parent().parent().click( function() {
		
		var title = $(this).find('h3').text();
		jQuery.fancybox(
			[
				{ 'href': path + 'danzas_01.jpg' , 'title' :  title},
				{ 'href': path + 'danzas_02.jpg' , 'title' :  title},
				{ 'href': path + 'danzas_03.jpg' , 'title' :  title},			
				{ 'href': path + 'danzas_04.jpg' , 'title' :  title},	
				{ 'href': path + 'artisticas_03.jpg' , 'title' :  title},			
			],op
		);
	}).css("cursor","pointer");
	//--------------------------------------------------------------------
	$(".talleres-deportivos-image-link").parent().parent().click( function() {
		
		var title = $(this).find('h3').text();
		jQuery.fancybox(
			[
				{ 'href': path + 'deportes_01.jpg' , 'title' :  title},
				{ 'href': path + 'deportes_02.jpg' , 'title' :  title},
				{ 'href': path + 'deportes_03.jpg' , 'title' :  title},			
				{ 'href': path + 'deportes_04.jpg' , 'title' :  title},			
			],op
		);
		
	}).css("cursor","pointer");
	//--------------------------------------------------------------------
	$(".talleres-cocina-image-link").parent().parent().click( function() {
		
		var title = $(this).find('h3').text();
		jQuery.fancybox(
			[
				{ 'href': path + 'cocina_01.jpg' , 'title' :  title},
				{ 'href': path + 'cocina_02.jpg' , 'title' :  title},
				{ 'href': path + 'cocina_03.jpg' , 'title' :  title},			
				{ 'href': path + 'cocina_04.jpg' , 'title' :  title},			
				{ 'href': path + 'cocina_05.jpg' , 'title' :  title},			
			],op
		);
	}).css("cursor","pointer");
	//--------------------------------------------------------------------
	$(".producciones-escenicas-image-link").parent().parent().click( function() {
		
		var title = $(this).find('h3').text();
		jQuery.fancybox(
			[
				{ 'href': path + 'escenicas_01.jpg' , 'title' :  title},
				{ 'href': path + 'escenicas_02.jpg' , 'title' :  title},
				{ 'href': path + 'escenicas_03.jpg' , 'title' :  title},			
				{ 'href': path + 'escenicas_04.jpg' , 'title' :  title},			
			],op
		);
	});
	$(".producciones-escenicas-image-link").parent().parent().hover(function()
	{
		$(this).find("img").stop().animate({"opacity":0.8},200)
	},
	function()
	{
		$(this).find("img").stop().animate({"opacity":1},200)
	}).css("cursor","pointer");
	//--------------------------------------------------------------------
	/*$(".producciones-artisticas-image-link").parent().parent().click( function() {
		
		var title = $(this).find('h3').text();
		jQuery.fancybox(
			[
				{ 'href': path + 'artisticas_01.jpg' , 'title' :  title},
				{ 'href': path + 'artisticas_02.jpg' , 'title' :  title},
				{ 'href': path + 'artisticas_03.jpg' , 'title' :  title},			
				{ 'href': path + 'artisticas_04.jpg' , 'title' :  title},			
			],op
		);
		
	}).css("cursor","pointer");*/
	//--------------------------------------------------------------------
	$(".producciones-artisticas-image-link").parent().parent().click( function() {
		
		var title = $(this).find('h3').text();
		jQuery.fancybox(
			[
				{ 'href': path + 'artisticas_01.jpg' , 'title' :  title},
				{ 'href': path + 'artisticas_02.jpg' , 'title' :  title},		
				{ 'href': path + 'artisticas_04.jpg' , 'title' :  title},			
			],op
		);
	}).css("cursor","pointer");
	//--------------------------------------------------------------------
	$(".talleres-diseno-image-link").parent().parent().click( function() {
		
		var title = $(this).find('h3').text();
		jQuery.fancybox(
			[
				{ 'href': path + 'diseno_01.jpg' , 'title' :  title},
				{ 'href': path + 'diseno_02.jpg' , 'title' :  title},					
			],op
		);
	}).css("cursor","pointer");
	//--------------------------------------------------------------------
	$(".talleres-seminarios-image-link").parent().parent().click( function() {
		
		window.location = $(this).find("a").attr("href");
		return false;
	}).css("cursor","pointer");
	
}

 
//preloading 
jQuery(function () {
	//jQuery('.preload').hide();//hide all the images on the page
	jQuery('.play,.magnifier').css({opacity:0});
	jQuery('.preload').css({opacity:0});
	jQuery('.preload').addClass("animated");
	jQuery('.play,.magnifier').addClass("animated_icon");
});



//image effects 

	
jQuery(document).ready(function(){
    /*
	$('.home .box').click(function(){
		window.location = $(this).find("a").attr("href");
		return false;
	});
	
	
	$('.box.products').hover(function()
	{
		var edit = $(this).find(".edit");
		var more = $(this).find(".more-info");
		edit.stop().animate({opacity:1},200);
		more.stop().animate({opacity:1},200);
	},
	function()
	{
		var edit = $(this).find(".edit");
		var more = $(this).find(".more-info");
		edit.stop().animate({opacity:0},200);
		more.stop().animate({opacity:0},200);
	});
	*/
});

function setUpTypographies() 
{
	if(Cufon) Cufon.replace('h1,h2,h3,h4,h5,h6,caption, .dropcap, .su-service-title, .portfolio_title, p.recent_post-title,li.menu-item a, #footer h3, .su-divider3 span, .breadcrumbs', {hover: true});
}



//pretty photo

function init() 
{
	initiated = true;
	$("#footer").fadeIn(500);
	showImages();
	setHomeBoxes();
	try{
		if(initialize) initialize();
	} catch(err) { /*Handle errors here*/ }
}

jQuery(document).ready(function()
{
	if(jQuery.browser.msie){
		//alert(jQuery.browser.version);
		if( jQuery.browser.version == "6.0" ) alert("Lo sentimos. Su navegador no es compatible con este site. We are sorry. Your browser is not compatible with this site.")
	}else{
		//$('#wrapper').hide();
	}
	if(Cufon) Cufon.now(); //This method should reduce or remove the Cufon flickering.
	
	
});

jQuery(function () {
	if (showEffect!="false"){		
		$('#navigation-block').delay(500, function(){
			$(this).fadeIn(200, function(){
				$('#wrapper').fadeIn(200, function(){
					if(initiated)return;
					init();
				});
			});
		});
	}else{
		init();
	}
});

var initiated;

setUpTypographies();


 

