function trim(strText) {
		// this will get rid of leading spaces 
		while (strText.substring(0,1) == ' ') 
				strText = strText.substring(1, strText.length);
		// this will get rid of trailing spaces 
		while (strText.substring(strText.length-1,strText.length) == ' ')
				strText = strText.substring(0, strText.length-1);
	 return strText;
}

function pad(value, padChar, strLength) {
	var newValue = value.toString();

	for (var i = value.length; i < strLength; i++) {
		newValue = padChar + newValue;
	}

	return newValue;
}

function isEmpty(value) {
	if (trim(value) == "") {
		return true;
	} else {
		return false;
	}
}

function setToVis(obj) {
	document.getElementById(obj).style.visibility = "visible";
}

function setToInVis(obj) {
	document.getElementById(obj).style.visibility = "hidden";
}

function getWindowDimensions() {
	var myWidth = 0 //width of window
	var myHeight = 0; //height of window
	var myScrollX = 0; //current scroll distance from left
	var myScrollY = 0 //current scroll distance from top
	var myScrollWidth = 0; //height of page content
	var myScrollHeight = 0; //height of page content
	
	if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
    //DOM
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
    myScrollX = document.body.scrollLeft;
    myScrollY = document.body.scrollTop;
    myScrollWidth = document.body.scrollWidth;
    myScrollHeight = document.body.scrollHeight;
   
  } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
    //IE 6 in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
    myScrollX = document.documentElement.scrollLeft;
    myScrollY = document.documentElement.scrollTop;
    myScrollWidth = document.documentElement.scrollWidth;
    myScrollHeight = document.documentElement.scrollHeight;
    
  } else if (typeof(window.innerWidth) == 'number') {
    //Netscape
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
    myScrollX = window.pageXOffset;
    myScrollY = window.pageYOffset;
    myScrollWidth = window.scrollWidth;
    myScrollHeight = window.scrollHeight;
  }
  
  var myPageWidth = (myScrollWidth > myWidth)? myScrollWidth: myWidth;
  var myPageHeight = (myScrollHeight >  myHeight)? myScrollHeight: myHeight;
  
	return {width: myWidth, height: myHeight, scrollX: myScrollX, scrollY: myScrollY, pageWidth: myPageWidth, pageHeight: myPageHeight};
}
