// JavaScript Document
function $(id) {
	if (typeof(id) != "string" || id == "") return null;
	if (document.getElementById && document.getElementById(id)) {
		return document.getElementById(id);
	} else if (document.all && document.all[id]) {
		return document.all[id];
	} else if (document.layers && document.layers[id]) {
		return document.layers[id];
	} else {
		return null;
	}
}
function loadAJAXDiv(url,obj){
		var divobj=$(obj);
		var xhttp=getXmlhttp();		
			xhttp.onreadystatechange=function(){
				if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
				{					
					var str=xhttp.responseText;
					if(str.replace(/\r\n/g,'').length>2){
						divobj.innerHTML=str;
					}
				}
			}
		xhttp.open("GET",url,true);
		xhttp.setRequestHeader("If-Modified-Since","0");
		xhttp.send(null);
}
function getDataPost(url,params,func){
   	var xhttp = getXmlhttp();
	xhttp.onreadystatechange=function(){
	   if(xhttp.readyState==4&&(xhttp.status==200||window.location.href.indexOf("http")==-1)){
		   func(xhttp.responseText);   
	   }
		
	}
	xhttp.open("POST",url,true);
	xhttp.setRequestHeader("If-Modified-Since","0");
	//xmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	xhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	xhttp.send(params);	
}
function getXmlhttp()
{
	var http_request;
	
	if(window.XMLHttpRequest) { 
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType("text/xml");
		}
	}
	else if (window.ActiveXObject) { 
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) { 
		window.alert("can't create XMLHttpRequest object.");
		return null;
	}	
	return http_request;
}
function SelectAll(objID){
  var objID=document.myform(objID);
  var allID=document.getElementById("houseAllocation");
  for(var i=0;i<objID.length;i++){  
	objID[i].checked=true;
  }
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

