var XMLHttpReq;
var currentSort;
function createXMLHttpRequest() {
	if(window.XMLHttpRequest) {
		XMLHttpReq = new XMLHttpRequest();
	}else if (window.ActiveXObject) {
		try {
			XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
		try {
			XMLHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {}
		}
	}
}

function sendRequest(url,func) {
	createXMLHttpRequest();
	XMLHttpReq.open("GET", url, true);
	XMLHttpReq.onreadystatechange = function() {
		if (XMLHttpReq.readyState == 4) {
			if (XMLHttpReq.status == 200) {
				eval(func);
			} else {
				alert("Exception:"+XMLHttpReq.status);
			}
		}
	}
	XMLHttpReq.send(null);
}
	function $() {
		return document.getElementById(arguments[0]);
	}
	function showContent(where) {
		var res = XMLHttpReq.responseText;
		$(where).innerHTML = res;
	}
	function showIndexList(sid,where){
		var url = "showIndexListAction.do?type=index&sid="+sid+"&s=5";
		sendRequest(url,"showContent('"+where+"')");
	}
	function showContentTxt(id,where){
		var url = "showContentAction.do?id="+id+"";
		sendRequest(url,"showContent('"+where+"')");
	}
	function showStaticContentTxt(id,where){
		var url = "showContentAction.do?act=static&id="+id+"";
		sendRequest(url,"showContent('"+where+"')");
	}
	function showCateDesc(id,where){
		var url = "showCatDescAction.do?id="+id+"";
		sendRequest(url,"showContent('"+where+"')");
	}
	function showList(type,sid,s,p,where){
		var url = "showIndexListAction.do?type="+type+"&sid="+sid+"&s="+s+"&p="+p+"";
		sendRequest(url,"showContent('"+where+"')");
	}
	function showLinks(type,s,p,where){
		var url = "showLinksAction.do?type="+type+"&s="+s+"&p="+p+"";
		sendRequest(url,"showContent('"+where+"')");
	}
	function showCategory(id,sid,s,p,where){
		var url = "showCategoryAction.do?id="+id+"&sid="+sid+"&s="+s+"&p="+p+"";
		sendRequest(url,"showContent('"+where+"')");
	}
	function addHits(id,tab){
		var url = "addHitsAction.do?id="+id+"&tab="+tab+"";
		sendRequest(url,"");
	}
	function showAttorneys(cid,where){
		var url = "showAttorneysAction.do?cid="+cid+"";
		sendRequest(url,"showContent('"+where+"')");
	}
	function showAttorney(id,where){
		var url = "showAttorneyAction.do?id="+id+"";
		sendRequest(url,"showContent('"+where+"')");
	}
	function showCountry(sid,where){
		var url = "showLocationsAction.do?type=country&sid="+sid+"";
		if(sid!='0'){
			sendRequest(url,"showContent('"+where+"')");
		}
	}
	function showCity(cid){
		var url = "showLocationsAction.do?type=city&cid="+cid+"";
		if(cid!='0'){
			sendRequest(url,"showContent('bycity')");
		}
	}
	function showMap(id){
		var url = "showLocationsAction.do?type=image&id="+id+"";
		if(id!='0'){
			sendRequest(url,"showContent('showmap')");
		}
	}
	function showDiv(where){
		if($(where).style.display == "none"){
			$(where).style.display = "block";
		}else{
			$(where).style.display = "none";
		}
	}
	function showContactsOther(id,where){
		if(id=='85'){
			$(where).style.display = "block";
		}else{
			$(where).style.display = "none";
		}
	}
	function unFocus(){
		document.sform.hidetxt.focus() ;
	}

