var rootdomain="http://"+window.location.hostname

function create_ajax_obj(){
	var obj = false
	if (window.XMLHttpRequest) // if Mozilla, Safari etc
		obj = new XMLHttpRequest()
	else if (window.ActiveXObject){ // if IE
		try {
			obj = new ActiveXObject("Msxml2.XMLHTTP")
			} 
			catch (e){
				try{
					obj = new ActiveXObject("Microsoft.XMLHTTP")
					}
					catch (e){}
				}
		}
	else{
		obj=false;
	}
		
	return obj;
}


function ajaxinclude(ajaxobj,url,divid) {
		ajaxobj.open('GET', url, false) //get page synchronously 
		ajaxobj.send(null)
		writecontent(ajaxobj,divid)
}

function writecontent(ajaxobj,divid){
	if (window.location.href.indexOf("http")==-1 || ajaxobj.status==200){
		str = ajaxobj.responseText;
		el = document.getElementById(divid);
		el.innerHTML = str;
	}
}

function load_ajax_weather(){
	ajaxobj = create_ajax_obj();
	ajaxinclude(ajaxobj,"/design/weather.php","weather_div");
}