function load_div_content(divid, url){
	$(document).ready(function() {
		$(divid).load(url);
	});
}

function get_div_content(qs, divid){	// qs is full page to submit to e.g. /map/text_list.php?text_output=shotrlist
	var xmlHttp;
		
	try{  // Firefox, Opera 8.0+, Safari  
		xmlHttp=new XMLHttpRequest();  
	}
	catch (e){  // Internet Explorer  
		try	{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
		}
		catch (e){
			try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e){
				alert("Your browser does not support AJAX!");      
				return false;      
			}
		}
	}
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
//			alert("content updated");
			document.getElementById(divid).innerHTML=xmlHttp.responseText;
		}
	}
//	alert("Making a request");
	xmlHttp.open("GET",qs,true);
	xmlHttp.send(null);		
}

function addBookmark(title, url) {
	if (window.sidebar) { // firefox
		window.sidebar.addPanel(title, url, "");
	} else if( document.all ) { //MSIE
		window.external.AddFavorite(url,title);
	} else {
		alert("Sorry, your browser doesn't support this - please add the bookmark manually");
	}
}

function checkPhone(strString){
	var strValidChars = "0123456789";
	var strChar;
	var blnResult = true;
	var strReturn='';
	
	if (strString.length == 0) return '';
	for (i = 0; i < strString.length; i++){
		strChar = strString.charAt(i);
		if (strValidChars.indexOf(strChar) != -1) strReturn+=strChar;
	}
	if(strReturn.length==11) return strReturn;
	else return '';
}


