var xmlhttp = false;

try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}

catch (e){
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}

if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
////////////////////////////////////
function mizz(x){
        if (x.style.display=="none") {
          x1.style.display="none";
          x2.style.display="none";
          x3.style.display="none";
          x4.style.display="none";
          x5.style.display="none";
          x6.style.display="none";
          x7.style.display="none";
          x8.style.display="none";
          x9.style.display="none";
          x10.style.display="none";
          x11.style.display="none";
          x12.style.display="none";
          x13.style.display="none";
          x14.style.display="none";
          x.style.display="inline";
        }else{x.style.display="none"}
}
////////////////////////////////////
function makevisible(cur,which){
strength=(which==0)? 1 : 0.85

if (cur.style.MozOpacity)
cur.style.MozOpacity=strength
else if (cur.filters)
cur.filters.alpha.opacity=strength*100
}

//////////////////////////////////////////////////
function makerequest(serverPage, objID) {
  var obj = document.getElementById(objID);
  //fadeIn();
  xmlhttp.open("get", serverPage);
  var loadstatustext="<img src='images/indicator.gif'>";
  xmlhttp.onreadystatechange = function() {
    document.getElementById('loading_div').innerHTML=loadstatustext;
    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
      document.getElementById(objID).innerHTML = xmlhttp.responseText;
      document.getElementById('loading_div').innerHTML="";
      if (window.XMLHttpRequest) {
      	dhtmlHistory.add(serverPage);
      	document.title = ":::: Magic Color For Advertising ::::" ;
      	}
    }
  }
  xmlhttp.send(null);
}
////////////////////////////////////////////////////////////////////////////
window.onload = initialize;
  function initialize() {
	dhtmlHistory.initialize();
	dhtmlHistory.addListener(handleHistoryChange);
	var initialLocation = dhtmlHistory.getCurrentLocation();
	if (initialLocation == ""){
		initialLocation = 'main.htm';
	}
	// now initialize our starting UI
	makerequest(initialLocation, 'main');
  }
  /** A function that is called whenever the user presses the back or forward buttons. This function will be passed the newLocation, as well as any history data we associated with the location. */
function handleHistoryChange(newLocation) {
	// use the history data to update our UI
  makerequest(newLocation, 'main');
}

