﻿var onl = "url(images/roundleft.gif)";
var onr = "url(images/roundright.gif)";
var imgoff = "url()";
var off = "#FFFFFF";
var prevtdL = "leftbjtd1";
var prevtdM = "midbjtd1";
var prevtdR = "rightbjtd1";

function LoadContent(leftd, midtd, rightd, pageID){
   document.getElementById(leftd).style.backgroundImage = onl;
   document.getElementById(midtd).className = "selected";
   document.getElementById(rightd).style.backgroundImage = onr;
   
   document.getElementById(prevtdL).style.backgroundImage = imgoff;
   document.getElementById(prevtdM).className = "notselected";
   document.getElementById(prevtdR).style.backgroundImage = imgoff;
   
   prevtdL = leftd;
   prevtdM = midtd;
   prevtdR = rightd;
   
   if(curlefttd ='leftbjtd1'){
   document.getElementById(prevtdL).style.backgroundImage = onl;
   document.getElementById(prevtdM).className = "selected";
   document.getElementById(prevtdR).style.backgroundImage = onr;
   }
   GetPageByID(pageID)
}


function GetPageByID(id){
	 // The variable that makes Ajax possible!
	 var ajaxReq = CreateXmlHttpObj();
	
	
// Create a function that will receive data sent from the server
ajaxReq.onreadystatechange = function(){
	if(ajaxReq.readyState == 4){
	    document.getElementById("divContent").innerHTML = ajaxReq.responseText;
		
	  }
  }
	ajaxReq.open("GET", "getpagebyid.aspx?pageID="+ id, true);
	ajaxReq.send(null); 
}



function CreateXmlHttpObj()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

