<!--

function LTrim(str)
{
   if( str == null ){ return null; }
   for(var i = 0; str.charAt(i) == " "; i++);
   return str.substring(i, str.length);
}

function RTrim(str)
{
   if( str == null ){return null;}
   for(var i = str.length-1; str.charAt(i)==" "; i--);
   return str.substring(0, i+1);
}

function Trim(str){ return LTrim(RTrim(str)); }

function getClientTime()
{
	var today = new Date();
	var h = today.getHours();
	var i =today.getMinutes();
	var d = today.getDate();
	var m = today.getMonth();
	var y = today.getFullYear();
	document.write(d + "." + m + "." + y + " " + h + ":" + i);
}

function getBrowserInfo()
{
	var curBrowser = "Unknown browser";
	var userAgent = navigator.userAgent.toLowerCase();
	var version = parseInt(navigator.appVersion);
	var subVersion = parseFloat(navigator.appVersion);
	var ns  = ((userAgent.indexOf('mozilla')!=-1) && ((userAgent.indexOf('spoofer')==-1) && (userAgent.indexOf('compatible') == -1)))
	if( ns && (version == 2) ) curBrowser = "Netscape 2";
	if( ns && (version == 3) ) curBrowser = "Netscape 3";
	if( ns && (version == 4) )  curBrowser = "Netscape 4";
	if( ns && (subVersion < 4.04) ) curBrowser = "Netscape 4.0x";
	if( ns && (version == 5) ) curBrowser = "Netscape 5";
	if( ns && (version == 6) ) curBrowser = "Netscape 6";
	if( ns && (userAgent.indexOf('netscape') != -1) ) curBrowser = "Netscape " + userAgent.substr(userAgent.length-3, 3);
	if( ns && (userAgent.indexOf('firefox') != -1) ) curBrowser = "Mozilla Firefox " + userAgent.substr(userAgent.length-(userAgent.length-1-userAgent.lastIndexOf("/")));
	var ie = (userAgent.indexOf('msie') != -1);
	if( ie && (version == 2) ) curBrowser = "MSIE 2";
	if( ie && (version == 4) && (userAgent.indexOf('msie 4.')!=-1) ) curBrowser = "MSIE 4";
	if( ie && (version == 4) && (userAgent.indexOf('msie 5.0')!=-1) ) curBrowser = "MSIE 5";
	if( ie && (version == 4) && (userAgent.indexOf('msie 5.5')!=-1) ) curBrowser = "MSIE 5.5";
	if( ie && (version == 4) && (userAgent.indexOf('msie 6.0')!=-1) ) curBrowser = "MSIE 6";
	if( userAgent.indexOf('opera') != -1 ) curBrowser = "Opera " + userAgent.substr(userAgent.lastIndexOf("opera ")+6);
	return curBrowser;
}

function validLogin()
{
	if( Trim(document.frmLogin.uname.value).length < 3 )
	{
		alert("Please enter your username.");
		document.frmLogin.uname.focus();
		document.frmLogin.uname.select();
		return false;
	}
	if( Trim(document.frmLogin.upass.value).length < 4 )
	{
		alert("Please enter your password.");
		document.frmLogin.upass.focus();
		document.frmLogin.upass.select();
		return false;
	}
	return true;
}

function validContact()
{
	if( Trim(document.frmCon.name.value).length < 2 )
	{
		alert("Please enter your name.");
		document.frmCon.name.focus();
		document.frmCon.name.select();
		return false;
	}
	if( Trim(document.frmCon.email.value).length < 8 )
	{
		alert("Please enter your email address.");
		document.frmCon.email.focus();
		document.frmCon.email.select();
		return false;
	}
	if( Trim(document.frmCon.comments.value).length < 5 )
	{
		alert("Please enter your inquiry.");
		document.frmCon.comments.focus();
		document.frmCon.comments.select();
		return false;
	}
	return true;
}

function validOrd()
{
	if( Trim(document.frmOrd.name.value).length < 2 )
	{
		alert("Please enter your name.");
		document.frmOrd.name.focus();
		document.frmOrd.name.select();
		return false;
	}
	if( Trim(document.frmOrd.email.value).length < 8 || Trim(document.frmOrd.email.value).indexOf("@") < 1 )
	{
		alert("Please enter valid email address.");
		document.frmOrd.email.focus();
		document.frmOrd.email.select();
		return false;
	}
	return true;
}

function showGal(_path, _width, _height)
{
	var iMargin = 20;
	x = window.open(_path, "winp", "width=" + (parseInt(_width) + iMargin)  + ",height=" + (parseInt(_height) + iMargin) + ",toolbar=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top="+(screen.availHeight - _height)/2+",left="+(screen.availWidth - _width)/2);
	x.focus();
}

//-->
