﻿function initscroll()
{
			try {
			var o = document.getElementById('Login1_UserName');
			if (!o)
				o = document.getElementById('UserName');
            var p = document.getElementById('Login1_Password');
			if (!p)
				p = document.getElementById('Password');
            o.onfocus = function() {
					o.className = 'up focus';
            }
            o.onblur = function() {
                if (o.value.length==0)
					o.className = 'up';
            }
            p.onfocus = function() {
				p.className = 'up focus';
            }
            p.onblur = function() {
                if (p.value.length==0)
					p.className = 'up';
            }
            if (p.value.length>0)
				p.className = 'up focus';
			if (o.value.length>0)
				o.className = 'up focus';
			if (o.value.length>0)
            {
                p.focus();
                p.select();
            }
            else
            {
                o.focus();
                o.select();
            }
			}
			catch(ex)
			{
			}


        window.onresize = fixscroll;
        var obj = document.getElementById('inner');
        obj.style.overflowY = 'auto';
        obj.style.overflowX = 'hidden';
        fixscroll();
    
		document.getElementById('form1').onsubmit = checkinputs;
	
}



function checkinputs()
{
	var l = document.getElementById('Login1');
	var o = document.getElementById('Login1_UserName');
	if (!o)
		o = document.getElementById('UserName');
	var p = document.getElementById('Login1_Password');
	if (!p)
		p = document.getElementById('Password');
	if (o.value.length==0 && p.value.length==0)
	{
		o.focus();
        o.select();
		l.className = 'login euser epass';
		return false;
	}
	if (o.value.length==0)
	{
		o.focus();
        o.select();
		l.className = 'login euser';
		return false;
	}
	if (p.value.length==0)
	{
		p.focus();
        p.select();
		l.className = 'login epass';
		return false;
	}
	return true;
}

function fixscroll()
{
    var obj = document.getElementById('inner');
    var ih = (window.innerHeight)?window.innerHeight:document.documentElement.clientHeight;
    obj.style.height = (ih-(340))+ 'px';
}
