function OpenBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
} 

function OpenWin(url) {
	var newwin = window.open(url,"","scrollbars=no,resizable=no, width=700,height=500");
	return false;
}

function refreshOpenerAndCloseMe(){
	try{
		window.opener.location.reload();
	}catch(ex){
	}
	window.close();
}

//checkNUM
//check if is number
//return 1:trueŁ¬0:false

function checkIntNum(Num) {
	var i,j,strTemp;
	strTemp = "0123456789";
	if ( Num.length == 0)
		return 0
	for (i = 0;i < Num.length; i++) {
		j = strTemp.indexOf(Num.charAt(i));
		if (j == -1) {
			return 0;
		}
	}
	return 1;
}

function checkFloatNumber(strValue,sign) 
{ 
	var number; 
	if (strValue==null) return false; 
	if ((sign!=null) && (sign!='-') && (sign!='+')) 
	{ 
		alert('IsNumber(string,sign) parameter error: sign should be null or "-" or "+"'); 
		return false; 
	} 
	number = new Number(strValue); 
	if (isNaN(number)) 
	{ 
		return false; 
	} 
	else if ((sign==null) || (sign=='-' && number<=0) || (sign=='+' && number>=0))
	{ 
		return true; 
	} 
	else 
	{
		return false; 
	}
} 

//clear left space
function js_ltrim(deststr)
{
	if(deststr==null)return "";
	var pos=0;
	var retStr=new String(deststr);
	if (retStr.lenght==0) return retStr;
	while (retStr.substring(pos,pos+1)==" ") pos++;
	retStr=retStr.substring(pos);
	return retStr;
}
//clear right space
function js_rtrim(deststr)
{
	if(deststr==null)return "";
	var retStr=new String(deststr);
	var pos=retStr.length;
	if (pos==0) return retStr;
	while (pos && retStr.substring(pos-1,pos)==" " ) pos--;
	retStr=retStr.substring(0,pos);
	return retStr;
}
//clear right and left space
function js_trim(deststr)
{
	if(deststr==null) return "";
	var retStr=new String(deststr);
	var pos=retStr.length;
	if (pos==0) return "";
	retStr=js_ltrim(retStr);
	retStr=js_rtrim(retStr);
	return retStr;
}

//can't start with "@" or "." , must contains three character after @, can't end with "."
function checkEmail(a){

		re = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;
		if (!re.test(a)){

			return 0;
			}
		return 1;
	}

