function theTitle(title) {
    document.title = title;
}
function GetXML(url,thediv,thetitle){
	var xmlHttp;
	var output = document.getElementById(thediv);
	var ad1    = document.getElementById("google-side");
	
	// code for Mozilla, etc.
	if (window.XMLHttpRequest) {
		xmlHttp=new XMLHttpRequest()
	} /*else if (Msxml2.XMLHTTP) {
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	}*/ else if (window.ActiveXObject) {
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")
	} else {
		alert("Your browser does not support XMLHTTP.")
	}
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState==1) {
			var text = "<div id=\"loading\"><img src=\"_scripts/loader_dark.gif\" />Loading... Please wait.</div>";	
			output.innerHTML = text;
			theTitle('Loading... | ' + thetitle);
		}
		if(xmlHttp.readyState==4) {
			var text = xmlHttp.responseText;
			theTitle(thetitle);
			output.innerHTML = text;
			refreshAd("google-top");
			refreshAd("google-side");
			pageTracker._trackPageview(url);
		}
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
//Create an array 
var allPageTags = new Array(); 

function hideClass(theClass) {
  //Populate the array with all the page tags
  var allPageTags=document.getElementsByTagName("*");
  //Cycle through the tags using a for loop
  for (i=0; i<allPageTags.length; i++) {
    //Pick out the tags with our class name
    if (allPageTags[i].className==theClass) {
      //Manipulate this in whatever way you want
      allPageTags[i].style.display='none';
    }
  }
}

function toggleLayer(whichLayer) {
  var elem, vis;
  if(document.getElementById) { // this is the way the standards work
    elem = document.getElementById(whichLayer);
  } else if(document.all) { // this is the way old msie versions work
    elem = document.all[whichLayer];
  } else if(document.layers) { // this is the way nn4 works
    elem = document.layers[whichLayer];
  }
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  hideClass("layer");
  if(vis.display == '' && elem.offsetWidth != undefined && elem.offsetHeight != undefined)
    vis.display = (elem.offsetWidth != 0 && elem.offsetHeight !=0)?'block':'none';
    vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

function refreshAd(adName){
	var d = document.getElementById(adName);
	if(d){
		var s = d.getElementsByTagName('iframe');
		if(s && s.length){
			s[0].src = s[0].src + '&' +new Date().getTime();
		}
	}
	return true;
}