_gObjByID2 = function(id) {
    return document.getElementById(id);
}
function CheckLoginForm()
{
    if(_gObjByID2("username").value=="" || _gObjByID2("password").value==""){
        alert('ΥΚΊΕΊΝΓάΒλ¶Ό±ΨΠλΜξΠ΄!');
        _gObjByID2("username").focus();
        return false;
    }
    return true;
}
function ShowOrHideList(Status)
{
    _gObjByID2("divLoginMask").style.left = '1px';
    if(typeof(_gObjByID2("ddlType"))!="undefined" && _gObjByID2("ddlType")!=null)
    {
        _gObjByID2("ddlType").style.display=Status;
    }
}
function showLoginMask()
{
    _gObjByID2("divLoginMask").style.left = '1px';
    _gObjByID2("divLoginMask").style.top = '1px';
    _gObjByID2("divLoginMask").style.height=getbodyheight() +'px';
    _gObjByID2("divLoginMask").style.display="block";
}
function GetElementTopValue(obj)
{
var height=obj.offsetTop; 
while( obj.offsetParent.tagName.toUpperCase() != "BODY")
{
    obj = obj.offsetParent;
    height+=obj.offsetTop;
}
return height;
}
function showForm(obj)
{
    showLoginMask();
    ShowOrHideList("none");
    var left = (parseInt(getbodywidth())-parseInt(_gObjByID2("divLoginform").style.width))/2;
    _gObjByID2("divLoginform").style.left = left + 'px';
    var top = GetElementTopValue(obj);
    if(top<230){top = 230;}
    _gObjByID2("divLoginform").style.top = top + 'px';
    _gObjByID2("divLoginform").style.display="block";
}
function closeForm()
{
    ShowOrHideList("");
    _gObjByID2("divLoginMask").style.display="none";
    _gObjByID2("divLoginform").style.display="none";
}
function getbodyheight(){
    var height1=document.body.clientHeight;
    var height2=document.documentElement.clientHeight;
    if(height1==0 && height2==0){
        return 1000;}
    else{
        if(height1>height2)
        {
	        return height1;
        }
        else
        {
	        return height2;
        }
    }
}
function getbodywidth(){
    var width1=document.body.clientWidth;
    var width2=document.documentElement.clientWidth;
    if(width1==0 && width2==0){
	    return 1000;
    }
    else
    {
	    if(width1>width2)
	    {
		    return width1;
	    }
	    else		
	    {
	    	return width2;
	    }
    }
}
