function trim(stringToTrim)
	{
	return stringToTrim.replace(/^\s+|\s+$/g,"");
	}
	
function ltrim(stringToTrim)
	{
	return stringToTrim.replace(/^\s+/,"");
	}
	
function rtrim(stringToTrim)
	{
	return stringToTrim.replace(/\s+$/,"");
	}

function BreakOut()
	{
	if (top.location != self.location)
		{top.location = self.location;}
	}
	
function validEmail(strng)
		{
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(strng))
			{return true;}
		return false;
		}

function findPos(id)
	{
	obj = document.getElementById(id);
	var curleft = curtop = 0;
	if (obj.offsetParent)
		{
		do
			{
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
			} while (obj = obj.offsetParent);
		}
	return [curleft,curtop];
	}

function getPageSize()
	{
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight
	arrayPageSize = new Array(w,h) 
	return arrayPageSize;
	}

function getPageScrollTop()
	{
	var yScrolltop;
	var xScrollleft;
	if (self.pageYOffset || self.pageXOffset)
		{
		yScrolltop = self.pageYOffset;
		xScrollleft = self.pageXOffset;
		}
	else if (document.documentElement && document.documentElement.scrollTop || document.documentElement.scrollLeft )
		{	 // Explorer 6 Strict
		yScrolltop = document.documentElement.scrollTop;
		xScrollleft = document.documentElement.scrollLeft;
		}
	else if (document.body)
		{// all other Explorers
		yScrolltop = document.body.scrollTop;
		xScrollleft = document.body.scrollLeft;
		}
	arrayPageScroll = new Array(xScrollleft,yScrolltop) 
	return arrayPageScroll;
	}