
var ie = (navigator.appName.indexOf("Explorer") != -1);
var id='contentdiv';
var puri="home";

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

function getElement (id) {
	return document.getElementById?document.getElementById(id):document.all?document.all[id]:document.layers[id];
}


function popup(url, name, feature){
	window.open(url, name, feature);
	void(0);
}

function writeMainDiv() {
	
	var id='contentdiv';
	fileContent=xmlhttpd.responseText;

	if (document.getElementById) {
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = fileContent;
	} else if (document.all) {
		x = document.all[id];
		x.innerHTML = fileContent;
	} else if (document.layers) {
		x = document.layers[id];
		txt = '<P CLASS="testclass">' + fileContent + '</P>';
		x.document.open();
		x.document.write(txt);
		x.document.close();
	}
	

}

function fillDiv(pURL) {
   	if (window.XMLHttpRequest) { // code for Mozilla, Safari, etc 
      xmlhttpd=new XMLHttpRequest();
      xmlhttpd.onreadystatechange=writeMainDiv;
      xmlhttpd.open("GET", pURL, true);
      xmlhttpd.send(null);
    

	} else if (window.ActiveXObject) { //IE 
      xmlhttpd=new ActiveXObject('Microsoft.XMLHTTP'); 
      if (xmlhttpd) {
         xmlhttpd.onreadystatechange=writeMainDiv;
         xmlhttpd.open('GET', pURL, true);
         xmlhttpd.send();
      }
   }
}
function writeSideDiv() {
	
	var id='sidebartopdiv';
	fileContent=xmlhttp.responseText;

	if (document.getElementById) {
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = fileContent;
	} else if (document.all) {
		x = document.all[id];
		x.innerHTML = fileContent;
	} else if (document.layers) {
		x = document.layers[id];
		txt = '<P CLASS="testclass">' + fileContent + '</P>';
		x.document.open();
		x.document.write(txt);
		x.document.close();
	}
	

}

function fillSideDiv(pURL) {
	
	if ( pURL=="includes/empty.php" || ( pURL=="includes/sidebarhedader.php" && puri=="includes/empty.php" ) ) {
		puri = pURL
		if (window.XMLHttpRequest) { // code for Mozilla, Safari, etc 
		  xmlhttp=new XMLHttpRequest();
		  xmlhttp.onreadystatechange=writeSideDiv;
		  xmlhttp.open("GET", pURL, true);
		  xmlhttp.send(null);
		
	
		} else if (window.ActiveXObject) { //IE 
		  xmlhttp=new ActiveXObject('Microsoft.XMLHTTP'); 
		  if (xmlhttp) {
			 xmlhttp.onreadystatechange=writeSideDiv;
			 xmlhttp.open('GET', pURL, true);
			 xmlhttp.send();
		  }
	   }
	}
}
