//Create a dummy function which calls two function
//1-> function validate_form
//2-> function confirmpassword_function

function dummy_function(doc)
{
    var return_value;
    var check_validity;
    //Get the value returned by the functin in a variable
    return_value = validate_form(doc);    
    
    if(return_value == true)
    {
		var firstname = doc.frm_txt_fname.value;
		var lastname = doc.frm_txt_sname.value;
		
		if((firstname == "") && (lastname == ""))
		{
			alert(tmp_str_RegUser);
			return false;
		}
	}

    //Check if the first set of values are validated and then validate the next set
    if (return_value == true)
    {   
        //->Fist set of validations are done, now proceed to the second one
        //Check for validity of the passwords entered
        check_validity = confirmpassword_function(doc);

        //Return the value
        return check_validity;
    }
    else
    {   
        return false;
    }

}

function confirmpassword_function(doc)
{
    str = "";       
          
    if(doc.frm_txt_watchwoord.value != "")
    {
	 if(doc.frm_txt_watchwoord.value != doc.frm_txt_watchwoord1.value)
        {
              str += "Wachtwoord veranderen and Opnieuw type van het wachtwoord does not match.\n"
        }
    }
    
    if(str)
    {
         alert(str);
         return false;
    }
    else
    {
         return true;
    }
}

function validate_edit(doc)
{
	
	return_value = validate_form(doc);    	
	    
	if(return_value == true)
	{
		var firstname = doc.frm_txt_fname.value;
		var lastname = doc.frm_txt_sname.value;

		if((firstname == "") && (lastname == ""))
		{
			alert(tmp_str_RegUser);
			return false;
		}
	}
	else
	{
		return false;
	}
	
	

	return_value = confirmpassword_function_edit(doc);

	if(return_value == false)
	{
		return false;
		
	}
	
	return return_value;
}  


function confirmpassword_function_edit(doc)
{
    str = "";       
          
    if(doc.frm_txt_ChangePass.value != "")
    {
	 if(doc.frm_txt_ChangePass.value != doc.frm_txt_ConfirmPassword.value)
        {
              str += "Wachtwoord veranderen and Opnieuw type van het wachtwoord does not match.\n"
        }
    }
    
    if(str)
    {
         alert(str);
         return false;
    }
    else
    {
         return true;
    }
}