// JavaScript Document

// Linh add 1/11/08

//Show or hide DIV element
function show_hide(id,id_off)
	{
		/*document.getElementById(id).style.display = (document.getElementById(id).style.display =='')?"none":"";*/
		LoadingDiv='contentLoading';
		$('div#'+id).show('slow');
		$('div#'+id_off).hide('fast');
		$('div#'+LoadingDiv).fadeOut("slow");
	}

function OpenDiv(id)
	{
		LoadingDiv='contentLoading';
		$('div#'+LoadingDiv).fadeOut("slow");
		/*$('div#'+id).show('slow'); */
		$('div#'+id).slideDown();
		$('div#'+id).focus(); 
		 
	}
function HideDiv(id)
	{
		 
		 $('div#'+id).hide('slow');
		  $('div#'+id).focus();
		 /*$('div#'+id_focus).focus();*/
		 
	}	
function Toggle(id)
	{
		 $('div#'+id).toggle("slow");
		 $('div#'+id).focus();

	}
function CloseDiv(id){
			$('div#'+id).hide('slow'); 
			 $('div#'+id).focus();
		}
// load content from the Url linlk and put in ContentDiv div

//LoadingDiv: contains loading.gif
   function LoadAjaxPage(Url,ContentDiv,LoadingDiv)
   {
     //empty old content
	 var randomnumber=Math.floor(Math.random()*1001);
	 $('div#'+ContentDiv).show(); 
	 //$('div#'+ContentDiv).empty('slow'); 
	 //show loading.gif
	 $('div#'+LoadingDiv).show(); 
	
	 //load contents	
	 Url=Url+"&ajax="+randomnumber;
     $('div#'+ContentDiv).load(Url);
	 
      // fade out the loading div   
     $('div#'+LoadingDiv).fadeOut("slow");
	 $('div#'+ContentDiv).focus(); 
   }
