$(document).ready(function(){

//taxidancer
$('#taxidancersCuadro').mouseover(function(){
			$(this).addClass('over');
});
$('#taxidancersCuadro').mouseout(function(){
			$(this).removeClass('over');
});

//home
$('#homeNoticias').jqFancyTransitions({ 
	effect: 'curtain', // wave, zipper, curtain
	width: 770, 
	height: 350, 
	strips: 12, // number of strips
	delay: 5000, 
	stripDelay: 50, 
	titleOpacity: 0.8, 
	titleSpeed: 1000, // speed of title appereance in ms
	position: 'top', // top, bottom, alternate, curtain
	direction: 'right' // left, right, alternate, random, fountain, fountainAlternate
});


// CALENDARIO
	$(".calendarioBtnPrxMes").click(function () { 
      
	  var mes = $(this).attr("rel");
	  
	  
	  if(mes){
		  
		  	$("#calendario").html('');
			
			$("#calendario").append('<img src="imagenes/loading-mini.gif" />');
	 		
			$.ajax({
				type: "POST",
				url: "ajaxCalendario.php",
				data: "mes="+mes,
				cache: false,
				dataType: "json",
				success: function(data){
								
								$("#calnombmes").html(data.mesNombre);
								$("#ant").attr("rel",data.mesAnt);
								$("#pro").attr("rel",data.mesProx);
								$("#calendario").html(data.calendario);
								
						}
			});
		
		}
	 
		return false;
	  
    });


//ampliar
$('#academiasListado li').toggle(
			function() {
				$(this).find(".datosOcultos").show('blind',{},500);
			},
			function() {
				$(this).find(".datosOcultos").hide('blind',{},500);
			}
		);
$('#milongasListado li').toggle(
			function() {
				$(this).find(".datosOcultos").show('blind',{},500);
			},
			function() {
				$(this).find(".datosOcultos").hide('blind',{},500);
			}
		);
$('#showsListado li').toggle(
			function() {
				$(this).find(".datosOcultos").show('blind',{},500);
			},
			function() {
				$(this).find(".datosOcultos").hide('blind',{},500);
			}
		);

// ENLACES
$('a[rel="external"]').click( function() {
			window.open( $(this).attr('href') );
			return false;
		});

// MAPAS

//Ubicacion
$('.mapaUbicacion').click(function () { 
    
	var href = $(this).attr("href");
			
	$('#dialog').dialog({
						bgiframe: true,
						resizable: false,
						closeOnEscape: false,
						draggable: false,
						modal: true, 
						position: ['center','center'], 
						width: 545, 
						minHeight: 445
					});
		
	$('#dialog').dialog('option', 'title', 'Ubicación');
	$('#dialog').dialog('option', 'buttons', { "Cerrar": function() { $(this).dialog("close") } });
	$('#dialog').html('<iframe width="520" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="mapa.php?'+href+'"></iframe>');
	$('#dialog').dialog('open');
	
	return false;
	
});


//Formularios

//Filtros


//Contacto
$('#fContacto').ketchup({
	
		errorContainer: $('<p>', {
			'class': 'ketchup-error-container-alt-s',
			html: '<ol></ol>'
		}),
		initialPositionContainer: function(errorContainer, field) {
			//errorContainer = the error-container with all childs
			//field = the field that needs to get validated
		},
		positionContainer: function(errorContainer, field) {},
		  showContainer: function(errorContainer) {
			errorContainer.slideDown('fast');
		},
		hideContainer: function(errorContainer) {
			errorContainer.slideUp('fast');
		}
	
});

//Publicar
$('#fPublicar').ketchup({
	
		errorContainer: $('<p>', {
			'class': 'ketchup-error-container-alt-s',
			html: '<ol></ol>'
		}),
		initialPositionContainer: function(errorContainer, field) {
			//errorContainer = the error-container with all childs
			//field = the field that needs to get validated
		},
		positionContainer: function(errorContainer, field) {},
		  showContainer: function(errorContainer) {
			errorContainer.slideDown('fast');
		},
		hideContainer: function(errorContainer) {
			errorContainer.slideUp('fast');
		}
	
});

//Publicidad
$('#fPublicidad').ketchup({
	
		errorContainer: $('<p>', {
			'class': 'ketchup-error-container-alt-s',
			html: '<ol></ol>'
		}),
		initialPositionContainer: function(errorContainer, field) {
			//errorContainer = the error-container with all childs
			//field = the field that needs to get validated
		},
		positionContainer: function(errorContainer, field) {},
		  showContainer: function(errorContainer) {
			errorContainer.slideDown('fast');
		},
		hideContainer: function(errorContainer) {
			errorContainer.slideUp('fast');
		}
	
});

//Newsletter
$('#fNewsletter').ketchup({
	
		errorContainer: $('<p>', {
			'class': 'ketchup-error-container-alt-s',
			html: '<ol></ol>'
		}),
		initialPositionContainer: function(errorContainer, field) {
			//errorContainer = the error-container with all childs
			//field = the field that needs to get validated
		},
		positionContainer: function(errorContainer, field) {},
		  showContainer: function(errorContainer) {
			errorContainer.slideDown('fast');
		},
		hideContainer: function(errorContainer) {
			errorContainer.slideUp('fast');
		}
	
});


});

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
