// JavaScript Document

// JAVASCRIPT ADICIONAL  /////////////////////////////////////////////////////////////////

//	if (Drupal.jsEnabled) {
		$(document).ready(function(){

			/*
			$('a #fechar-video-2009').click(
						function(event){
							//alert('Seja bem vindo ao site');
							$('#fundo-splash').hide();
							$('body').css({'overflow': 'scroll'});	
							event.preventDefault();					
							//return false;
						});	
	
			$('#fundo-splash').hide();
			$('#splash').hide();
	
			if (("<?php print $displayedURL ?>" == "/2009/") || ("<?php print $displayedURL ?>" == "/probelezacuiaba.com.br_2009/")){
				//alert('Seja bem vindo ao site');
				$('#fundo-splash').show();
				$('#splash').show();
				$('body').css({
					'overflow': 'hidden'
					});
			}
			*/
			
			//$("#infos-prob-2010").css("display", "block");			

			
			var esconderJanela = function(elem) {
				$('#fundo-overlay').fadeOut('slow');
				elem.fadeOut('slow');
				return null;
			}
			
			var mostrarJanela = function(elem) {
				$('#fundo-overlay').fadeIn('slow');
				elem.fadeIn('slow');
				return null;
			}			

			$(".janela").center();	
			
			//Se nao tiver mostrado a modal qdo entra no site, mostra-a. Se nao, nao a mostra
			if($('#modal-prob-2010-mostrar').val() == 1){
				//alert('estoy aqui');
				mostrarJanela($('#infos-prob-2010'));
			}			
			
			$(".janela a.fechar-janela").hover(
				function() {
					$(this).css('cursor','pointer');}, 
				function() {
					$(this).css('cursor','auto');
				});
			
			$(".janela a.fechar-janela").click(function(){
				esconderJanela($(this).parent());
				});

			$('#bloco-probeleza-2010').click(function(){
				mostrarJanela($('#infos-prob-2010'));
			});

			//Banner Probeleza 2010
			$('#bloco-probeleza-2010').click(function(){
				$('.ui-dialog').fadeIn('slow');
				$('.ui-dialog-overlay').fadeIn('slow');
				return false;
			});
			
			$('#bloco-probeleza-2010').hover(
				function() {
					$(this).css('cursor','pointer');}, 
				function() {
					$(this).css('cursor','auto');
			});	

			//Janela modal (dialog usando jquery ui) com as infos do Prob 2010
			/*
			var auOpen = true;

			if($('#modal-prob-2010-mostrar').val() == 0){
				//alert('estoy aqui');
				auOpen = false;
			}
			*/
			/*

			$('#infos-prob-2010').dialog({ 
						//autoOpen: auOpen,
						//autoOpen: false,
						title: 'Probeleza 2010',
						overlay: { 
				            opacity: 0.8, 
				            background: "black"}, 
						closeOnEscape: true,
						closeText: 'fechar',
						width: 490,
						height: 540,
						modal: true
					});
			
			$('#infos-prob-2010').dialog('close');
			*/

/*
			$( "#infos-prob-2010" ).bind( "dialogbeforeclose", function(event, ui) {

			  $('.ui-dialog').fadeOut('slow');
			  $('.ui-dialog-overlay').fadeOut('slow');
			  return false;
			});
*/			
		
			
			//$('.ui-dialog').fadeIn('slow');
			//$('.ui-dialog-overlay').fadeIn('slow');			
			
		
		
		});
//	}	 