﻿loadstatus = "<center><img src='images/loading.gif'></center>";

function ajaxLoad(url,id)
   {
       if (document.getElementById) {
           var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
           }
           if (x)
               {
           x.onreadystatechange = function()
                   {
                       el = document.getElementById(id);
                      <!--  el.innerHTML = loadstatustext; -->
						  el.innerHTML = loadstatus;
						 

               if (x.readyState == 4 && x.status == 200)
                       {
                       el.innerHTML = x.responseText;
                   }
                   }
               x.open("GET", url, true);
               x.send(null);
               }



				// url = window.location.href; //link hie^.n ta.i, ví du.: http://domain.com/#php
				//c_url = url.split('#');
				//id = c_url[1]; //tác url và la^'y giá tri. phía sau #, tu+'c là php
       }



function wait(){
document.getElementById('loading').style.display='none';		
}
function reload()
{
var url = window.location.href;
if(url.indexOf('#')!=-1) 
{c_url = url.split('#');
id = c_url?c_url[1]:'#';
ajaxLoad('noidung.php?id='+id,'hostingblock');}
}