function loginAction(obj,e)
	{
	if (!obj && !e) // ONLOAD
		{
		if (document.getElementById('lgn').value == '' && document.getElementById('pas').value == '' )
			{
			document.getElementById('lgn').style.backgroundImage= 'url(_img/_inp/input255mail.png)'
			document.getElementById('pas').style.backgroundImage= 'url(_img/_inp/input255pass.png)'
			}
		return false
		}
	if (e.type=='focus' && obj.name=='user_id')
		{
		obj.style.backgroundImage= 'url(_img/_inp/input255.png)'
		obj.select()
		}
	if (e.type == 'blur' && obj.name == 'user_id' && obj.value == '') obj.style.backgroundImage= 'url(_img/_inp/input255mail.png)'
	if (e.type == 'focus' && obj.name == 'password') obj.style.backgroundImage= 'url(_img/_inp/input255.png)'
	if (e.type == 'blur' && obj.name == 'password' && obj.value == '') obj.style.backgroundImage= 'url(_img/_inp/input255pass.png)'
	if (e.type == 'dblclick') document.getElementById('pas').style.backgroundImage= ''
	if (e.type == 'submit' && document.loginForm.password.value != '') return true
	return false
	}

function saveCookie()
	{
	}

function getCookie(c_name)
	{
	if (document.cookie.length>0)
		{
		c_start= document.cookie.indexOf(c_name + '=')
		if (c_start!=-1)
			{
			c_start= c_start + c_name.length+1
			c_end= document.cookie.indexOf(";",c_start)
			if (c_end==-1) c_end= document.cookie.length
			return unescape(document.cookie.substring(c_start,c_end))
			} 
		}
	return false
	}

function setCookie(c_name,value,expiredays)
	{
	var exdate=new Date()
	exdate.setDate(exdate.getDate()+expiredays)
	document.cookie=c_name+ '=' +escape(value)+((expiredays==null) ? '' : ';expires='+exdate.toGMTString());
	}

function checkCookie()
	{
	username= getCookie('username')
	password= getCookie('password')
	document.getElementById('user_id').value= 'george'
	document.getElementById('password').value= 'emil'
	}

function saveCookie()
	{
	username=document.getElementById('user_id').value
	password=document.getElementById('password').value
	if (document.getElementById('agree').checked) 
		{
		setCookie('username',username,366)
		setCookie('password',password,366)
		}
	}

function emailCheck(str) 
	{
		alert ('emailCheck')
	var at= '@'
	var dot= '.'
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1) return false
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr) return false
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr) return false
	if (str.indexOf(at,(lat+1))!=-1) return false
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot) return false
	if (str.indexOf(dot,(lat+2))==-1) return false
	if (str.indexOf(" ")!=-1) return false
	return true
	}