/**
 * trim value
 * @param string strToTrim. value to be trim.
 * @return string
 */
function trim(strToTrim)
{
	if(typeof(strToTrim) == 'undefined') return "";
	return strToTrim.replace(/^\s+|\s+$/g,"");
}

/**
 * set object visibility
 * @param string strObjName. object name.
 * @param boolean blnShow. true=visible | false=collapse
 */
function setObjVisibility(strObjName, blnShow)
{	
	var obj = document.getElementById(strObjName);
	if(obj == null) return;

//	var strVisibleValue ;
//	if(blnShow == 'true') strVisibleValue = 'visible';
//	else strVisibleValue = 'collapse';
//	obj.style.visibility = strVisibleValue;

	if(blnShow == true)
	{
		obj.style.display = '';
		//obj.style.visibility = 'visible';		
	}
	else obj.style.display = 'none';
}

/**
 * set object Div msg
 * @param string strObjName. regex.
 * @param string strMsg. msg
 * @param string strClassName. css class name
 */
function setDivMsg(strObjName, strMsg, strClassName)
{
	var obj = document.getElementById(strObjName);
	if(obj == null) return;
	if(typeof(strClassName) != 'undefined') 
	{
		strMsg = "<span class='" + strClassName +"'>" + strMsg + "</span>";
	}
	obj.innerHTML  = strMsg;
}


function toUpperCase(obj) {
	obj.value = obj.value.toUpperCase();
}

function toLowerCase(obj) {
	obj.value = obj.value.toLowerCase();
}

function popWin(url) 
{
	w = window.open(url, "W958b6e9ea6bed1f9c5288b15959dad77", "left=150,top=120,menubar=no,height=600,width=800,scrollbars=yes,resizable=yes");
	w.focus();
 }

function popNew(url,name) 
{
	w=screen.width-10;
	h=screen.height-55; 
	if (name=='') name='ForntWindows';
	ForntWindow=window.open(url,name,'scrollbars=1,status=0,toolbar=0,menu=0,width='+w+',height='+h+',left=1,top=1');
	ForntWindow.focus();
} 

function doConfirm()
{
	if(!confirm("Are you sure?")) return false;
	return true;
}


function bookmarksite(title,url)
{
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	else if(document.all)// ie
		window.external.AddFavorite(url, title);
}

function sMail(sU, sH)
{
	sLink = '<a href="' + 'mai' + 'lto:' +  sU + '@' + sH + '">' + sU + '@' + sH + '</a>';
	document.write(sLink);
}
