// JavaScript Document
var temp =0;
var curentContent="cont1";
var int;
function TNSanhdieu_active_tab(obj, num){

		var curentTab=obj.id;
		var curentContent_1=curentTab.replace("tab","cont");
		switch(num){
			case 0:
				curentContent=curentTab.replace("tab","cont");
				var tabs=$('#' + curentTab).parent().children();
				var contents=$('#' + curentContent).parent().children();
				window.clearInterval(int)
				int=setInterval("loadPage()",10000);	
				break;
			case 1:
				curentContent_1=curentTab.replace("tab","cont");
				var tabs=$('#' + curentTab).parent().children();
				var contents=$('#' + curentContent_1).parent().children();
				break;	
		}
		
		$(tabs).each( function(){								
				$(this).attr('class','');
		});
		
		$(contents).each( function(){								
				$(this).hide();
		});
		
		$('#' + curentTab).addClass('active');
		switch(num){
			case 0:
				$('#' + curentContent).fadeIn('slow');	
				break;
			case 1:
				$('#' + curentContent_1).fadeIn('slow');	
				break;	
		}		 	
	}
	
	
	function autoChange(curentContent){
		
		var items = $('#' + curentContent).children();
		var mud =temp%2;

		if(mud==0){			
			$(items[temp]).hide();
			temp++;
			$(items[temp]).fadeIn('slow');
		}
		else{
			$(items[temp]).hide();
			temp--;
			$(items[temp]).fadeIn('slow');
			}
	}	

	function read_info(num){
		switch(num){
			case 0:
				window.clearInterval(int)
				break;				
			case 1:
				int=setInterval("loadPage()",10000);
				break;
		}	
	}

	function loadPage(){		
		autoChange(curentContent)
	}

