Agent=window.navigator.userAgent;
isOpera=Agent.indexOf("Opera")==-1?false:true;
isIE=(document.all&&!isOpera)?true:false;
isW3CDOM=document.getElementById?true:false;
isNN4x=(Agent.indexOf("/4.")!=-1&&!isIE&&!isOpera&&!isW3CDOM)?true:false;
isWindows=Agent.indexOf("Windows")!=-1?true:false;
isSafari=Agent.indexOf("Safari")==-1?false:true;
isNetscape=Agent.indexOf("Netscape")==-1?false:true;

function Defined(vrbl)
{
	var str_Undefined="undefined"
	var str_Empty="";
	var str_Null="null";
	
	if(typeof(vrbl)==str_Undefined||(str_Empty+vrbl)==str_Undefined||vrbl==null||(str_Empty+vrbl)==str_Null||(str_Empty+vrbl)==str_Empty)return false;
	else return true;
}
function checkMail(value) {
	re =/^[A-Za-z0-9_\-]+(\.[A-Za-z0-9_\-]+)*@([A-Za-z0-9_\-]+\.)+[A-Za-z0-9_\-]{2,3}$/;
	if(!re.test(value))
		return false;
	return true;
}
function isNumber(str)
{
	for (i=0; i<str.length; i++)
	{
		c=str.substring(i,i+1)
		if (c==',') c='.';
		if	(isNaN(c) && c!='.' && c!=',')
			return false;
	}
	return true;
}
function CheckFieldInDate(value) {
	re =/\d{2}.\d{2}.\d{4}/;
	if(!re.test(value))
		return false;
	return true;
}

function CheckFieldInSpace(value) {
	count = value.length;
	count_space = 0;
	for (i = 0; i < count; i++)	{
		if (value.charAt(i) == " " || value.charAt(i) == "\t")
			count_space++;
	}
	if (count_space == count || count == 0) return true;
	else return false;
}