var fBrw=(navigator.userAgent.indexOf('MSIE')!= -1 && navigator.userAgent.indexOf('Windows')!= -1);
function openModal(vpage,vtitle,vwidth,vheight)
{
	if (fBrw)
	{
		rs=window.showModalDialog(vpage, vtitle, 'dialogHeight:'+vheight+'px;dialogWidth:'+vwidth+'px;status:no;help:no');
		if (typeof(rs)!='undefined')
		{
			if (rs)
			{
				location.reload(true);
			}
		}
	}
	else
	{
		open(vpage, vtitle, 'toolbar=no,height='+vheight+',width='+vheight+',top='.concat((screen.height - vheight)/2).concat(',left=').concat((screen.width - vwidth)/2));
	}
}

function popupWin(vpage,vtitle,vwidth,vheight){
        var win = window.open(vpage,null, 'toolbar=no,resizable=yes,titlebar=no,scrollbars=yes,height='+vheight+',width='+vwidth+',top='.concat((screen.height - vheight)/2).concat(',left=').concat((screen.width - vwidth)/2));

   }
function selfrefresh(){
	window.location.reload();	
}

function myclose(){
	if(opener){
		opener.selfrefresh();
	}	
	self.close();
}

function ltrim (str)
	{
		resStr = "" ;
		for (i=0; i < str.length; i ++)
			if (str.substr(i,1)!=" ") break ;
		for (j=i; j < str.length; j ++)
			resStr += str.substr(j,1) ;
		return resStr;
	}
function rtrim (str)
	{
		resStr = "" ;
		for ( i = str.length-1;i>-1; i --)
			if (str.substr(i,1)!=" ") break ;
		for (j=i; j >-1; j --)
			resStr = str.substr(j,1) + resStr;
		return resStr;
	}
function trim (str)
	{
		return ltrim(rtrim(str));
	}
	
	
function isDigit(s)
	{
	var test=""+s;
	if(test=="0"||test=="1"||test=="2"||test=="3"||test=="4"||test=="5"||test=="6"||test=="7"||test=="8"||test=="9")
		{
		return (true) ;
		}
		return (false);
	}
	
function allDigit(s)
	{
		var test=""+s ;
		for (var k=0; k <test.length; k++)
		{
			var c=test.substring(k,k+1);
			if (isDigit(c)==false)
			{
				return (false);
			}
		}
		return (true);
	}
	
function isEmail(s)
	{
		var test=""+s ;
		for (var k=0; k <test.length; k++)
		{
			var c=test.substring(k,k+1);
			if (c=="@")
			{
				return (true);
			}
		}
		return (false);
	}

