function AJAXInteraction(url, callback) {

    var req = init();
    req.onreadystatechange = processRequest;
        
    function init() {
      if (window.XMLHttpRequest) {
        return new XMLHttpRequest();
      } else if (window.ActiveXObject) {
        return new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
	
	
    function processRequest () {
      if (req.readyState == 4) {
        if (req.status == 200) {
          if (callback == "MenuIDMenuBar1"){
		     document.getElementById(callback).innerHTML = req.responseText;
			 
			 var cmMenuBar1 =
			 {
				mainFolderLeft: '',
				mainFolderRight: '',
				mainItemLeft: '',
				mainItemRight: '',
				folderLeft: '',
				folderRight: '',
				itemLeft: '',
				itemRight: '',
				mainSpacing: 0,
				subSpacing: 0,
				delay: 100,
				offsetHMainAdjust: [0, 0],
				offsetSubAdjust: [0, 0]
			 };
			 var cmThemeMenuBar1HSplit = [_cmNoClick, '<td colspan="3" class="ThemeMenuBar1MenuSplit"><div class="ThemeMenuBar1MenuSplit"><\/div><\/td>'];
			 var cmThemeMenuBar1MainHSplit = [_cmNoClick, '<td colspan="3" class="ThemeMenuBar1MenuSplit"><div class="ThemeMenuBar1MenuSplit"><\/div><\/td>'];
			 var cmThemeMenuBar1MainVSplit = [_cmNoClick, '<div class="ThemeMenuBar1MenuVSplit">|<\/div>'];

			 cmDrawFromText('MenuIDMenuBar1', 'hbr', cmMenuBar1, 'ThemeMenuBar1');
		  }else{
		    document.getElementById(callback).innerHTML = req.responseText;
		  }
        }
      }
    }

    this.doGet = function() {
      req.open("GET", url, true);
      req.send(null);
    }
    
    this.doPost = function(body) {
      req.open("POST", url, true);
      req.setRequestHeader("Content-Type",
      "application/x-www-form-urlencoded");
      req.send(body);
    }
}

function displayCopyRight(crLevel) {
  var ai = null;
  if(crLevel == 3){
    ai = new AJAXInteraction("../../php/copyRight.php?copyRight=cpyrght&x=" + Math.random(), "cr");
  }else if(crLevel == 2){
    ai = new AJAXInteraction("../php/copyRight.php?copyRight=cpyrght&x=" + Math.random(), "cr");
  }else{
    ai = new AJAXInteraction("php/copyRight.php?copyRight=cpyrght&x=" + Math.random(), "cr");
  }	  
  ai.doGet(); 
}

function displayMenuBar(menuLevel) {
  var ai = null;
  if(menuLevel == 3){
    ai = new AJAXInteraction("../../php/menuBar.php?menuBar=menubar2&y=" + Math.random(), "MenuIDMenuBar1");
  }else if(menuLevel == 2){
    ai = new AJAXInteraction("../php/menuBar.php?menuBar=menubar2&y=" + Math.random(), "MenuIDMenuBar1");
  }else{
    ai = new AJAXInteraction("php/menuBar.php?menuBar=menubar1&y=" + Math.random(), "MenuIDMenuBar1");
  }	
  ai.doGet(); 
}

function getJobDesc(){
    var ai = new AJAXInteraction("../php/jobDescription.php?jobValue=job1&t=" + Math.random(), "data");
	ai.doGet();
}


