﻿function cTrim(str){
    return str.replace(/^\s+|\s+$/g, '');
}
//Function to center the User control Dialog window.
function reSizeTable(obj){        
    if(obj == null)
        return;
    obj.style.height = document.documentElement.clientHeight+'px';
    obj.style.width = document.documentElement.clientWidth+'px';
}

//Returns true if passed string is valid emailID else false.
function isEmailId(strEmail){    
    var val=strEmail.search(/\w+\@\w+\.[a-zA-Z]+[a-zA-Z|\.]+/);
    if(val>=0)
        return true;
    else
        return false;                
}
//Gets the page size (height & width) including the scroll
function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY){//Firefox.
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	}else if(document.body.scrollHeight > document.body.offsetHeight){//all but Explorer Mac.
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	}else{//works in Explorer 6 Strict, Mozilla (not FF) and Safari.
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}  	
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	return arrayPageSizeWithScroll;
}
