﻿// JScript File

function ResetForm()
{
    document.getElementById("txtUser").value = "";
    document.getElementById("txtPass").value = "";
    document.getElementById("lblMsg").innerHTML = "";
    return true;//false
}

function Trim (str) 
{
	while (str.charAt(0) == ' ')
	str = str.substring(1);
	while (str.charAt(str.length - 1) == ' ')
	str = str.substring(0, str.length - 1);
	return str;
}
		
function ValidateLogin()
{			
   if (Trim(document.form1.txtUser.value).length == 0)
   {
		alert("User name cannot be left blank!");
		document.form1.txtUser.focus();
		return (false);
   }       
   
   if (Trim(document.form1.txtPass.value).length == 0)
   {
		alert("Password required!");
		document.form1.txtPass.focus();
		return (false);
   }
   return (true);
}

function noRightClick() 
{
	//Calling this script a function called noRightClick 
	if (event.button==2) 
	{ //If the clicked button is 2 (right click) 
		alert('Right click is disabled!') //Popup with the message: Right click is disabled! 
	} 
}	
	
function C2()
{
	return (false);
}


//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

var updateProgressDiv;
function pageLoad(sender, args)
{   
    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest);    

    updateProgressDiv = $get('updateProgressDiv');
    //  add our handler to the document's //  keydown event
/*
    if(!args.get_isPartialLoad())
    {
        $addHandler(document, "keydown", onKeyDown);
    }
*/

}

function beginRequest(sender, args)
{   
   var updateProgressDivBounds = Sys.UI.DomElement.getBounds(updateProgressDiv);
   var x = Math.round(screen.width/2) - Math.round(updateProgressDivBounds.width / 2);
   var y = Math.round(screen.height/2)  - Math.round(updateProgressDivBounds.height / 2);         
   updateProgressDiv.style.display = '';             
   updateProgressDiv.style.zindex = 999;
   Sys.UI.DomElement.setLocation(updateProgressDiv, x, y);     
}

function endRequest(sender, args) 
{
    updateProgressDiv.style.display = 'none'; 
}    

function overlay(curobj, subobj)
{
    if (document.getElementById)
    {
        var subobj = document.getElementById(subobj);
        subobj.style.left= "150px";         /*  "300px";        /* getposOffset(curobj, "left")+"px" */
        subobj.style.top= "370px";         /*  "195px";        /*getposOffset(curobj, "top")+"px" */
        subobj.style.display="block" ;
        subobj.style.zIndex=99999 ;
        return false;   
    }
    else
    {
        return true;
    }
}

function overlayclose(subobj)
{ 
    document.getElementById(subobj).style.display="none"; 
    return false; 
}

//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
