String.prototype.trim = function() {return this.replace(/^\s+|\s+$/g,"");}			// trim both sides
String.prototype.ltrim = function() {return this.replace(/^\s+/,"");}				// trim left side
String.prototype.rtrim = function() {return this.replace(/\s+$/,"");}				// trim right side

var ce = null;

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
function ShowMenu(e, m){
	HideMenus();

	if (document.getElementById(m)==null) return;		

	var l = findPosX(e);var t = findPosY(e);
	document.getElementById(m).style.left=l;
	document.getElementById(m).style.top=t+e.offsetHeight;
	document.getElementById(m).className = "menuItem";
}
function TurnMeOn(e){
	e.className="siOn";
}
function TurnMeOff(e){
	e.className="siOff";
}
function OpenLink(l, t){
	if (t!=null&&t!="undefined"&&t!="")
	{
		if (l.indexOf("http")==-1){
			l="http://"+l;
		}
		window.open(l); 
	}
	else
		window.location.href=l;
	
	return false;
}
function HideMenus(){
	for (var i=0;i<menus.length;i++)
		document.getElementById(menus[i]).className = "hide";
}
function OpenTour(url, useLarge){
		window.open(url,'vtour','status=yes,scrollbars=no,resizable=no,width=600,height=750');
}
/*
function ShowStatus(e, d, s){
	if (e==null) return;
	
	var dStat = document.getElementById(d);
	
	if (dStat==null || (dStat!=null&&ce==dStat) return;
		
	var l = findPosX(e);var t = findPosY(e);
	dStat.style.left=l;
	dStat.style.top=t+dStat.offsetHeight-6;
}
function HideStatus(d){
	ce==null;
	dStat.className = "hide";
}
*/