//alert('\341\351\355\363\372 - \361');

/* Start Clear Default Seccion */
/* End Clear Default Seccion */	

/* Start Misc Function */	
	
	function fadeMains(){
		$(".main").fadeOut('slow').fadeTo(550, 1)
	}
	function fadeLinks(){
		$("#tab ul li a").removeClass('current');
		$("#tabDigital ul li a").removeClass('current');
	}
	function focusLink(link){
		$(link).addClass('current');
	}
	
	function showPage(page){
		$(this).dequeue();
		fadeMains();
		$(page).fadeIn('slow');
	}
	function showPanel(link, page){
		$(this).dequeue();
		fadeMains();
		fadeLinks();
		focusLink(link);
		$(page).fadeIn('slow');
	}
	
	function toggleButtonStatus(status) {
		$("input[type=button]").each(function(button) {
			if (status == true)	 $(this).attr('disabled', 'disabled');
			else	$(this).removeAttr('disabled');
		});
		$("a").each(function(a) {
			if (status == true)	 $(this).attr('disabled', 'disabled');
			else	$(this).removeAttr('disabled');
		});	
	}
	
	function clearDefault(el){
		if(el.defaultValue==el.value)el.value = "";
	}
	function makeDefault(el){
		if(el.value=="")el.value = el.defaultValue;
	}
	
	function showBigLoading(divId){
		$(divId).fadeIn("slow").html("<div id='ajaxLoading' class='inner'><img src='../img/default/ajaxLoader.gif' /><span>Espere...</span></div>");
		$(divId+' .inner').wrap('<div class="outer"></div>').corner("round 5px")
			.parent().css('padding', '1px').corner("round 5px");
	}
	function showLittleLoading(divId){
		$(divId).fadeIn("slow").html("<div id='ajaxLoading2' class='inner2'><img src='../img/default/ajaxLoader.gif' /></div>");
		$(divId+' .inner2').wrap('<div class="outer2"></div>').corner("round 5px").
				parent().css('padding', '1px').corner("round 5px");
	}
	function showAjaxLoading(divToShow){
		$(divToShow).html("<div id='ajaxLoading'><img src='../img/default/ajaxLoader.gif' /></div>").show();
	}
	function showMessage(divToAppend, message, clase){
		$("."+clase).each(function(mess){ $(this).remove(); });	
		$(divToAppend).after('<div class="'+clase+'">'+message+'</div>');
	}
	
/* End Misc Function */

$(window).bind('load', function(){
	
	showPanel('#tarifaTab', '#tarifaContent');
	
	$('#tarifaTab').click(function(){
		showPanel('#tarifaTab', '#tarifaContent');
	});
	$('#horarioTab').click(function(){
		showPanel('#horarioTab', '#horarioContent');
	});		
	$('#normaTab').click(function(){
		showPanel('#normaTab', '#normaContent');
	});
	/*$('#avisoTab').click(function(){
		showPanel('#avisoTab', '#avisoContent');
	});*/

});

$(document).ready(function(){
	$(document).pngFix();
	
	$(".pest_avisoesp").click(function() {
		$.fancybox({
				'href'              : '../swf/flip_comercial.swf', 
				'padding'			: 0,
				'autoScale'			: true,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'title'				: this.title,
				'width'				: 650,
				'height'			: 500,
				/*'href'				: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),*/
				'type'				: 'swf',
				'wmode'				: 'transparent',
				'allowfullscreen'	: 'true',
				'autoDimensions'	: true,
				'overlayShow' 		: true,
				'overlayOpacity'	: 0.9,
				'overlayShow'		: true
			});

		return false;
	});
});

