/******************************************************************************************
'Function Name            :   Trim
'Function Description     :   This trims leading,trailing spaces in a passed string
'
'Input Parameter		  :	  inputString		-	The string to be trimmed
			'
'return value			  :	  Trimmed string
'******************************************************************************************/			
function Trim(inputString) 
{
	// Removes leading and trailing spaces from the passed string. If something besides
	// a string is passed in (null, custom object, etc.) then return the input.
	if (typeof inputString != "string") { return inputString; }
	
	var retValue = inputString;
	var ch = retValue.substring(0, 1);
	
	while (ch == " ") 
	{ // Check for spaces at the beginning of the string
		retValue = retValue.substring(1, retValue.length);
		ch = retValue.substring(0, 1);
	}
	ch = retValue.substring(retValue.length-1, retValue.length);
	while (ch == " ") 
	{ // Check for spaces at the end of the string
		retValue = retValue.substring(0, retValue.length-1);
		ch = retValue.substring(retValue.length-1, retValue.length);
	}
	return retValue; // Return the trimmed string 
} 
function VtourOpen(vtourlink)
	{
		if (document.all)
			var xMax= screen.width, yMax = screen.height;
		else
			if (document.layers)			
				var xMax= window.outerWidth, yMax = window.outerHeight;
			else
				var xMax= 640, yMax = 480;
		var xOffset = (xMax - 300)/2, yOffset = (yMax - 300)/2;
		window.open (vtourlink, 'window3', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=650, height=560, screenY='+yOffset+', screenX= '+xOffset+', top='+yOffset+', left= '+xOffset+'');
	}
function MapOpen(maplink)
	{
		if (document.all)
			var xMax= screen.width, yMax = screen.height;
		else
			if (document.layers)			
				var xMax= window.outerWidth, yMax = window.outerHeight;
			else
				var xMax= 640, yMax = 480;
		var xOffset = (xMax - 700)/2, yOffset = (yMax - 700)/2;
		window.open (maplink, 'window2', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=630, height=610, screenY='+yOffset+', screenX= '+xOffset+', top='+yOffset+', left= '+xOffset+'');
	}
