//Function to goto step 1 or step 2
function submit_onclick(id)
  {
    var aid = document.form1.AID.value;
    var rid = document.form1.ResourceID.value;
    var fil = document.form1.File.value;
	
		
			if (id=="0") {
			  location.href = fil+"_1.asp?AID="+aid+"&ResourceID="+rid+"&File="+fil;
			}
			else if (id=="1") {
			  location.href = fil+"_2.asp?AID="+aid+"&ResourceID="+rid+"&File="+fil;
			}
		
  }

//Function to save reflections in take stock and take action
function save_onclick(id)
  {
    if (id=="0") {
      var r = document.form1.Reflection.value;
      if (r.length > 0)
        document.form1.submit();
      else
        alert("Type something in the reflection box first.");
    }
    else if (id=="1") {
      var aid = document.form1.AID.value;
      var rid = document.form1.ResourceID.value;
      var fil = document.form1.File.value;
      location.href = fil+".asp?AID="+aid+"&ResourceID="+rid+"&File="+fil;
    }
  }
  
//Function to return to result page
function return_onclick()
  {
    var aid = document.form1.AID.value;	
    location.href = "asm_results_calculate.asp?AID="+aid;	
  }
  
  //Function to return to result page
function return_onclick_m()
  {
    var aid = document.form1.AID.value;
	location.href = "asm_results_calculate_m.asp?AID="+aid;
  }

function validate(form1) //Function with a parameter representing a form name.
{
  with(form1)
    {
	 var acode=document.form1.txtAcode.value
	 
	 if (form1.txtAcode.value == "")
	 {
		alert("Please enter the code");
		form1.txtAcode.focus();
		return false;
	 }
	 if (acode != "FL123" )
	 {
	 	alert("please enter the correct code!");
	 	return false;
	 }
	 	return true;
   }
}
//Function to save reflections in take stock and take action in toolkit
function tk_save_onclick(id)
  {
    if (id=="0") {
      var r = document.form1.Reflection.value;
      if (r.length > 0)
        document.form1.submit();
      else
        alert("Type something in the reflection box first.");
    }
    else if (id=="1") {
      window.close();
    }
  }
  //Function to save reflections in take stock and take action in Guilt
  function tk_save_onclick(id)
    {
      if (id=="0") {
        var r = document.form1.Reflection.value;
        if (r.length > 0)
          document.form1.submit();
        else
          alert("Type something in the reflection box first.");
      }
      else if (id=="1") {
        window.close();
      }
  }