// JavaScript Document

/*---------------------------------------------------
* String Trim Functions
*---------------------------------------------------*/
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}

/*---------------------------------------------------
* Get Browser's Width and Height
*---------------------------------------------------*/
function getScreenSize() {
	var w = 0;
	var h = 0;
	if(typeof(window.innerWidth) == 'number'){
		w = window.innerWidth;
		h = window.innerHeight;
	}else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
		w = document.documentElement.clientWidth;
		h = document.documentElement.clientHeight;
	}else if(document.body && (document.body.clientWidth || document.body.clientHeight)){
		w = document.body.clientWidth;
		h = document.body.clientHeight;
	}
	return w+'x'+h;
}

/*-------------------------------------------------------------*/
/* Fix for 'protected' Email javascript response text  
/*-------------------------------------------------------------*/
function insertEmail(id, alink){
	var elem = document.getElementById(id);
	elem.innerHTML = alink;
}
