$(document).ready(
	function() {

		$(".axLink").click(
			function () {
				$(".axLink").removeClass("ativo");
				$(this).addClass("ativo");
				
				var tmpContent = $(this).attr("rel");
				var tmpUrl = "";
				
				switch(tmpContent) {
					case "destaques": 	tmpUrl = "/includes/inc_HomeSlideshow.asp"; $('#destaque').cycle('resume'); break;
					case "fotos": 		tmpUrl = "/includes/inc_HomeGalerias.asp"; $('#destaque').cycle('pause'); break;
					case "videos": 		tmpUrl = "/includes/inc_HomeAudiosVideos.asp"; $('#destaque').cycle('pause'); break;
					case "noticias": 	tmpUrl = "/includes/inc_HomeNoticias.asp"; $('#destaque').cycle('pause'); break;
				};
				
				$.ajax({
					url: tmpUrl,
					//dataType: "html",
					beforeSend: function() {
						// enquanto a função esta sendo processada, você
						$('#ContentAjax').html("<div style=\"width:723px; height:375px;\"><p style=\"margin:0; text-align:center; padding-top:171px\"><img src=\"/images/loading.gif\" width=\"32\" height=\"32\"><br><strong>Loading...</strong></p></div>");
					},
					success: function(data) {
						$("#ContentAjax").html(data);
						//alert('Load was performed.');
					},
					error: function(txt) {
						// em caso de erro você pode dar um alert('erro');
						alert(txt)
						$('#ContentAjax').html("<div style=\"width:723px; height:375px;\"><p style=\"margin:10px; font-size:16px; font-weight:bold; color:#FFFFFF\">Houve um problema interno. Tente novamente mais tarde.</p></div>");
					}
				});
			}
		);
		
		$(".ajxLink").click(
			function () {
				$(".ajxLink").removeClass("ativo");
				$(this).addClass("ativo");
				
				var tmpContent = $(this).attr("rel");
				var tmpUrl = "";
				
				switch(tmpContent) {
					case "ultimas": 	tmpUrl = "/includes/inc_HomeNews.asp"; break;
					case "jornais": 	tmpUrl = "/includes/inc_HomeJornal.asp"; break;
					case "enquetes": 	tmpUrl = "/includes/inc_HomeEnquete.asp"; break;
					case "boloes":		tmpUrl = "/includes/inc_HomeBolao.asp"; break;
				};
				
				$.ajax({
					url: tmpUrl,
					//dataType: "html",
					beforeSend: function() {
						// enquanto a função esta sendo processada, você
						$('#MoreAjax').html("<div style=\"width:504px; height:191px;\"><p style=\"margin:0; text-align:center; padding-top:79px\"><img src=\"/images/loading.gif\" width=\"32\" height=\"32\"><br><strong>Loading...</strong></p></div>");
					},
					success: function(data) {
						$("#MoreAjax").html(data);
						//alert('Load was performed.');
					},
					error: function(txt) {
						// em caso de erro você pode dar um alert('erro');
						$('#MoreAjax').html("<div style=\"width:504px; height:191px;\"><p style=\"margin:10px; font-size:14px; font-weight:bold; color:#FFFFFF\">Houve um problema interno. Tente novamente mais tarde.</p></div>");
					}
				});
			}
		);
		
		if($('#AllVideos') != null) {
			$('#AllVideos').cycle({
				fx: 'fade',
				startingSlide: 0,
				timeout: 0,
				speed:    1000,
				prev:    '.video_anterior',
				next:	 '.proximo_video'
			});
		}
		
		
	}
)