var rootdomain="http://"+window.location.hostname

function ajaxinclude(url) {
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.open('GET', url, false) //get page synchronously 
page_request.send(null)
writecontent(page_request)
}

function writecontent(page_request){
if (window.location.href.indexOf("http")==-1 || page_request.status==200)
document.write(page_request.responseText)
}

function popupSearchWin(theURL, winName, winWidth, winHeight) {
    var w = 800, h = 600;
	if (document.all) {
	   /* the following is only available after onLoad */
	   w = document.body.clientWidth;
	   h = document.body.clientHeight;
	
	} else if (document.layers) {
	   w = window.innerWidth;
	   h = window.innerHeight;
	}
	var leftPos = (w-winWidth)/2, topPos = (h-winHeight)/2;
    newWin = window.open(theURL, winName, 'width='+winWidth+',height='+winHeight+',top='+topPos+',left='+leftPos+',status=yes,toolbar=no,menubar=yes,scrollbars=yes,resizable=yes');
    if (window.focus) newWin.focus();
    return newWin;
}

function popupCentered(url, windowName, width, height, options) {
    if (width == null) width = 400;
    if (height == null) height = 300;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    if (options != null && options.length > 0) windowFeatures = windowFeatures + "," + options;
    var myWindow = window.open(url, windowName, windowFeatures);
    return myWindow;
}
