$(document).ready(function() {
	/* Round Corner */
	$(".panel").corner("cc:#E7E6E0 tl tr");
	$(".panel").corner("cc:#E0E2DE bl br");
	$(".news_content").corner("cc:#B8D9EC bl br");
	
		
	/* Fade Banner Home */
	//$('#banner_home').innerfade({
	//	speed: 1000,
	//	timeout: 5000,
	//	type: 'sequence',
	//	containerheight: '331px'
	//}); 
	
	/* Hover MEDS Home */
	$("#btn_container li a img").hover(
		function(){
			src = $(this).attr('src');
			src2 = src.split(".");
			src3 = src2[0] + "2.png";
			$(this).attr("src", src3);		
		}, 
		function () {
			$(this).attr("src", src);		
		}
	);
	

	
	/* Panels Home */
	$("#five_panels_home h3").hover(		
		function(){		
			$(this).css("color", "#EEE3FF");
		}, 
		function () {			
			$(this).css("color", "#FFFFFF");
		}	
	);
	
	/* Menu News */
	$("#news_menu li").hover(		
		function(){		
			$(this).css("background", "url(/img/news_menu_bg_li.jpg)");	
		}, 
		function () {			
			$(this).css("background", "transparent");
			
		}	
	);
	
	/* Hover Read-More */
	$(".read-more img").hover(
		function(){		
			$(this).attr("src", "/img/read-more2.jpg");
		}, 
		function () {
			$(this).attr("src", "/img/read-more.jpg");		
		}
	);
	
	
	showBanner();
	//showNews();
	

	
	
	$(".items_submenu:last").css("border","none");
	$("#items_submenu_blue li:last").css("border","none");    
	    
});

function showNews(){
	var div = new Array("news", "articles", "patients"); 	
	for (t=0;t<=2;t++){
		section = div[t];
		$.ajax({
			type: "POST",
			async: false,
			url: "/news/list_home_news/" + (t+1),			
			success: function(msg){
				$("#"+section+"_list_home").html(msg)			
			}
		});
	}
	
	
}

function showBanner(){
	$.ajax({
		type: "POST",
		url: "/banners/show_home/",
		async: false,
		success: function(msg){			
			$("#banner_home").html(msg)
		}
	});
}