var isnav=false;
var isiex=false;
var nav4=false;
var oper=false;
var browser='';
var version=parseInt(navigator.appVersion);
if (navigator.appName=="Netscape") {
	isnav=true;
	browser='nav';
	}else{
	isiex=true;
	browser='iex';
}
//check for Opera
if (navigator.userAgent.indexOf("Opera") > -1){
	oper=true;
	browser='nav';
}
var res="";
if (screen.width > 800){
	res="1024";
	}
var tag="div";
if (isnav && version == 4){
	tag="layer";
	nav4=true;
	}
document.write('<LINK REL="StyleSheet" HREF="liquid_'+browser+res+'.css" TYPE="text/css">');
var tag="div";
function get_object(obj){
	if (typeof obj=="string"){
	if (isnav==true && version>=5){
	theobj=eval('document.getElementById("'+obj+'").style');
			}
	if (isnav==true && version==4){
	theobj=eval(container+'document.'+obj);
			}
	if (isiex==true){
	theobj=eval("document.all."+obj+".style");
			}
	} else {
		theobj=obj;
	}
	return theobj
}
function show(obj){
	var theobj=get_object(obj);
	theobj.visibility="visible";
}
function hide(obj){
	var theobj=get_object(obj);
	theobj.visibility="hidden";
}
function shift_to(obj,x,y){
	var theobj=get_object(obj);
	if (isnav==true && version>=5){
		theobj.left=x+"px";
		theobj.top=y+"px";
	}
	if (isnav==true && version==4){
		theobj.moveTo(x,y);
	}
	if (isiex==true){
		theobj.pixelLeft+=x;
		theobj.pixelTop+=y;
	}
}
function shift_by(obj,x,y){
	var theobj=get_object(obj);
	if (isnav==true && version>=5){
		theobj.left=parseInt(theobj.left)+x+"px";
		theobj.top=parseInt(theobj.top)+y+"px";
		}
	if (isnav==true && version==4){
			theobj.moveBy(x,y);
		}
	if (isiex==true){
			theobj.pixelLeft+=x;
			theobj.pixelTop+=y;
		}
}
function get_left(obj){
	var theobj=get_object(obj);
	if (isnav==true && version>=5){
		return parseInt(theobj.left);
	}
	if (isnav==true && version==4){
		return theobj.left;
	}
	if (isiex==true){
		return theobj.pixelLeft;
	}
}
function get_top(obj){
	var theobj=get_object(obj);
	if (isnav==true && version>=5){
		return parseInt(theobj.top);
	}
	if (isnav==true && version==4){
		return theobj.top;
	}
	if (isiex==true){
		return theobj.pixelTop;
	}
}	
function get_width(obj){
	var theobj=get_object(obj);
	if (isnav==true && version>=5){
		return parseInt(theobj.width);

	}
	if (isnav==true && version==4){
		return theobj.width;
	}
	if (isiex==true){
		return theobj.pixelWidth;
	}
}
function get_height(obj){
	var theobj=get_object(obj);
	if (isnav==true && version>=5){
		return parseInt(theobj.height);
	}
	if (isnav==true && version==4){
		return theobj.height;
	}
	if (isiex==true){
		return theobj.pixelHeight;
	}
}	
function set_clip(obj,top,right,bottom,left){
	var theobj=get_object(obj);
	if (isnav==true && version==4){
		theobj.clip.left=left;
		theobj.clip.top=top;
		theobj.clip.right=right;
		theobj.clip.bottom=bottom;
	}
	if (isiex==true || (isnav==true && version>=5)){
		theobj.clip='rect('+top+'px '+right+'px '+bottom+'px '+left+'px)';

	}
}
function put(obj,contents){
	if (isiex==true){
	var theobj=eval("document.all."+obj);
	theobj.innerHTML=contents;				
	}
	if (isnav==true && version>=5){
	var theobj=eval('document.getElementById("'+obj+'")');
	theobj.innerHTML=contents;	
	}
	if (isnav==true && version==4){
	theobj=eval("document."+obj+".document");
	theobj.write(contents);
	theobj.close();
	}
}
function change_bgc(obj,color){
	var theobj=get_object(obj);
	if (isnav==true && version==4){
		theobj.bgColor=color;
	}
	if (isiex==true || (isnav==true && version>=5)){
		theobj.backgroundColor=color;
	}

}
function set_index(outframe,inframe,zorder){
	var theobj=get_object(inframe);
	if (isiex==true || (isnav==true && version>=5)){
		theobj.zIndex=zorder;
	}
	if (isnav==true && version==4){
document.layers[outframe].document.layers[inframe].zIndex=zorder;
	}
}
function setVariables() {
if (navigator.appName == "Netscape") {
v=".top=";
dS="document.";
sD="";
y="window.pageYOffset";
}
else {
v=".pixelTop=";
dS="";
sD=".style";
y="document.body.scrollTop+document.body.clientHeight-135";
   }
}
function checkLocation() {
object="thishead";
yy=eval(y);
eval(dS+object+sD+v+yy);
setTimeout("checkLocation()",10);
}
//AJAX
var response; //Declare response as a global for AJAX output
function getanswer(str,url)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
url=url+"?q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 

xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById(response).innerHTML=xmlHttp.responseText
} 
} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
function set_height(obj,this_height,width){
	var theobj=get_object(obj);
	if (isnav==true && version>=5){
		theobj.height=this_height;
		theobj.borderWidth=width;
	}
	if (isnav==true && version==4){
		theobj.height=this_height;
		theobj.borderWidth=width;
	}
	if (isiex==true){
		theobj.pixelHeight=this_height;
		theobj.borderWidth=width;
	}
}	
	//<![CDATA[

	function show_map(this_map,lat,lon,address,telephone) {
	  	address=address+'<br><img src="images/telephone.gif" width="21" height="16" alt="Telephone"> '+telephone;
		// Create our "tiny" marker icon
		var icon = new GIcon();
		icon.image = "images/business.gif";
		icon.iconSize = new GSize(14, 14);
		icon.iconAnchor = new GPoint(0, 0);
		icon.infoWindowAnchor = new GPoint(7, 1);

		var map = new GMap(document.getElementById(this_map));
    		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.centerAndZoom(new GPoint(lat,lon),8);

		// Create a marker whose info window displays the given number.
		function createMarker(point) {  
			var marker = new GMarker(point, icon);  // Show this marker's index in the info window when it is clicked.  
			GEvent.addListener(marker, 'click', function() {	marker.openInfoWindowHtml(address);  });  
		return marker;
		}

		var point = new GPoint(lat,lon);
		var marker = createMarker(point);
		map.addOverlay(marker);
	}

	//]]>
