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";
          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 formHandler(form){
  	var URL = document.formw.bid.options[document.formw.bid.selectedIndex].value;
   	makerequest('brands.php?id=' + URL,'main');
}

////////////////////////////////////////
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 = ":::: Awael For Security ::::" ;
      }
    }
  }
  xmlhttp.send(null);
}
////////////////////////////////////////////////////////////////////////////
window.onload = initialize;
  function initialize() {
	dhtmlHistory.initialize();
	dhtmlHistory.addListener(handleHistoryChange);
	var initialLocation = dhtmlHistory.getCurrentLocation();
	if (initialLocation == ""){
		initialLocation = 'main.php';
	}
	// 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');
}
