var result

function OpenApplication(application,cover) {		
    document.getElementById(cover).style.visibility = "visible";
    document.getElementById(application).style.visibility = "visible";
    document.getElementById("MainMenu").style.visibility = "hidden";
    scroll(0,0);
}

function CloseApplication(application,cover) {	
    var answer = window.confirm("Select 'OK' to close your application");

    if (answer)
    {
        document.getElementById(cover).style.visibility = "hidden";
        document.getElementById(application).style.visibility = "hidden";
        document.getElementById("MainMenu").style.visibility= "visible";
    }
}

function GoToSection(validation, nextSection, currentSection) {		
    if (validation.length == 0 || Page_ClientValidate(validation)) 
    {
	    document.getElementById(currentSection).style.visibility = "hidden";
	    document.getElementById(nextSection).style.visibility = "visible";
	    document.getElementById("MainMenu").style.visibility="hidden";
	}
}

function SubmitApplication(currentSection) {	
    document.getElementById(currentSection).style.visibility = "hidden";
    var waitDiv = document.createElement("DIV"); 
    waitDiv.id = "waitDiv";  
    waitDiv.className = "WaitBox";
    waitDiv.innerHTML = "<div>Please Wait...</div><img src='/images/paws.gif' alt='Please Wait...' />";
    
    document.getElementsByTagName("BODY")[0].appendChild(waitDiv);     
    
    return false;
}

function AtLeastOnePhone_ClientValidate(sender, args) {
    var homePhone = "";
    var cellPhone = "";
    var workPhone = "";
    
    if (sender.home != null)
        homePhone = document.getElementById(sender.home);
    if (sender.cell != null) 
        cellPhone = document.getElementById(sender.cell);
    if (sender.work != null)
        workPhone = document.getElementById(sender.work);
  
    args.IsValid = (homePhone.value.length > 0 || cellPhone.value.length > 0 || workPhone.value.length > 0);
  
    return args;
}

