
function late_changeURL(text_value){
var late_sel = document.getElementById("late_reason_select");
selection = late_sel[late_sel.selectedIndex].value;

if(document.getElementById('late_permission_0').checked) {
  late_permission = 'yes';
} 
else {
	late_permission = 'no';
}

window.location = _referpage + '&late_reason=' + selection + '&late_permission=' + late_permission ;
}
document.write("<form action=\"\" method=\"get\" name=\"form1\">");
document.write("<div id=\"prompt_form\" style=\"display:none\">");
document.write("<table width=\"380\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"list2\">");
document.write("  <tr>");
document.write("    <td width=\"65\" align=\"center\" valign=\"middle\"><img src=\"..\/images\/question_mark_green.png\" width=\"64\" height=\"64\" \/><br \/>");
document.write("      <\/td>");
document.write("    <td width=\"225\" align=\"center\"><p>Permission to be late ?");
document.write("<input type=\"radio\" name=\"late_permission\" value=\"yes\" id=\"late_permission_0\" \/>");
document.write("    yes");
document.write("  <input type=\"radio\" name=\"late_permission\" value=\"no\" id=\"late_permission_1\" checked=\"checked\"\/>");
document.write("    no");
document.write("<br><br><select name=\"late_reason_select\" id=\"late_reason_select\" class=\"select200\" onchange=\"selected()\"  >");
document.write("  <option value=\"no reason\">no reason<\/option>");
document.write("  <option value=\"transport\">transport<\/option>");
document.write("  <option value=\"overslept\">overslept<\/option>");
document.write("<\/select>");
document.write("    <\/td>");
document.write("  <\/tr>");
document.write("  <tr>");
document.write("    <td height=\"45\" colspan=\"2\" align=\"center\"><br \/>");
document.write("      <input name=\"input\" type=\"submit\" class=\"imagebutton\" onClick=\" needToConfirm = false; late_changeURL(); return document.MM_returnValue\" value=\"Save\"  \/>");
document.write("      <input name=\"button\" type=\"button\" class=\"imagebutton\" id=\"button\" onClick=\"parent.promptwindow.hide()\"  value=\"Cancel\" \/>");
document.write("    <\/td>");
document.write("  <\/tr>");
document.write("<\/table>");
document.write("<\/div>");
document.write("<\/form>");





//function changeURL(text_value){
//var sel = document.getElementById("early_reason_select");
//selection = sel[sel.selectedIndex].value;
//
//if(document.getElementById('early_permission_0').checked) {
//  early_permission = 'yes';
//} 
//else {
//	early_permission = 'no';
//}
//
//window.location = _referpage + '&early_reason=' + selection + '&early_permission=' + early_permission ;
//}
//document.write("<form action=\"\" method=\"get\" name=\"form1\">");
//document.write("<div id=\"prompt_form2\" style=\"display:none\">");
//document.write("<table width=\"380\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"list2\">");
//document.write("  <tr>");
//document.write("    <td width=\"65\" align=\"center\" valign=\"middle\"><img src=\"..\/images\/question_mark_green.png\" width=\"64\" height=\"64\" \/><br \/>");
//document.write("      <\/td>");
//document.write("    <td width=\"225\" align=\"center\"><p>Permission to leave early? ");
//document.write("<input type=\"radio\" name=\"early_permission\" value=\"yes\" id=\"early_permission_0\" \/>");
//document.write("    yes");
//document.write("  <input type=\"radio\" name=\"early_permission\" value=\"no\" id=\"early_permission_1\" checked=\"checked\"\/>");
//document.write("    no");
//document.write("<br><br><select name=\"early_reason_select\" id=\"early_reason_select\" class=\"select200\" onchange=\"selected()\"  >");
//document.write("  <option value=\"no reason\">no reason<\/option>");
//document.write("  <option value=\"transport\">transport<\/option>");
//document.write("  <option value=\"overslept\">overslept<\/option>");
//document.write("<\/select>");
//document.write("    <\/td>");
//document.write("  <\/tr>");
//document.write("  <tr>");
//document.write("    <td height=\"45\" colspan=\"2\" align=\"center\"><br \/>");
//document.write("      <input name=\"input\" type=\"submit\" class=\"imagebutton\" onClick=\" needToConfirm = false; changeURL(); return document.MM_returnValue\" value=\"Save\"  \/>");
//document.write("      <input name=\"button\" type=\"button\" class=\"imagebutton\" id=\"button\" onClick=\"parent.promptwindow.hide()\"  value=\"Cancel\" \/>");
//document.write("    <\/td>");
//document.write("  <\/tr>");
//document.write("<\/table>");
//document.write("<\/div>");
//document.write("<\/form>");

/*document.write("<div id=\"cancel_form3\" style=\"display:none\">");
document.write("<table  border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"list2\">");
document.write("  <tr>");
document.write("    <td  align=\"center\" valign=\"middle\"><img src=\"..\/images\/question_mark_green.png\" width=\"64\" height=\"64\" \/><br \/>");
document.write("      <\/td>");
document.write("    <td width=\"350\" align=\"center\"><p>");
document.write("      <label class=\"label_std\">If you close this window, the changes you <\/label><br \/>");
document.write("      <label class=\"label_std\">made will not be saved.<\/label><br \/><br \/>");
document.write("      <label class=\"label_std\">Do you want to continue to close this window?<\/label><br \/>");
document.write("    <\/td>");
document.write("  <\/tr>");
document.write("  <tr>");
document.write("    <td height=\"45\" colspan=\"2\" align=\"center\"><br \/>");
document.write("      <input name=\"input\" type=\"submit\" class=\"imagebutton\" onClick=\" needToConfirm = false; MM_goToURL('parent',_referpage);return document.MM_returnValue\" value=\"Yes\"  \/>");
document.write("      <input name=\"button\" type=\"button\" class=\"imagebutton\" id=\"button\" onClick=\"parent.cancelwindow3.hide()\"  value=\"No\" \/>");
document.write("    <\/td>");
document.write("  <\/tr>");
document.write("<\/table>");
document.write("<\/div>");

document.write("<div id=\"cancel_form4\" style=\"display:none\">");
document.write("<table  border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"list2\">");
document.write("  <tr>");
document.write("    <td  align=\"center\" valign=\"middle\"><img src=\"..\/images\/question_mark_green.png\" width=\"64\" height=\"64\" \/><br \/>");
document.write("      <\/td>");
document.write("    <td  align=\"center\"><p>");
document.write("      <label class=\"label_std\">Do you want to set this job to be completed?<\/label><br \/>");
document.write("      <label class=\"label_std\">This action cannot be undone!<\/label><br \/>");
document.write("      <label class=\"label_std\">Do you want to continue?<\/label><br \/>");
document.write("    <\/td>");
document.write("  <\/tr>");
document.write("  <tr>");
document.write("    <td height=\"45\" colspan=\"2\" align=\"center\"><br \/>");
document.write("      <input name=\"input\" type=\"submit\" class=\"imagebutton\" onClick=\" needToConfirm = false; MM_goToURL('parent',_referpage);return document.MM_returnValue\" value=\"Yes\"  \/>");
document.write("      <input name=\"button\" type=\"button\" class=\"imagebutton\" id=\"button\" onClick=\"parent.cancelwindow4.hide()\"  value=\"No\" \/>");
document.write("    <\/td>");
document.write("  <\/tr>");
document.write("<\/table>");
document.write("<\/div>");
*/


function late_reasons(text, referpage, name){
_text = text;	
_referpage = referpage;
_name = name


if (_text==1) {
//Open a modal window populated with the contents of a hidden DIV, and assign the result to a global variable called "cancelwindow"
promptwindow=dhtmlmodal.open('promptwindow', 'div', 'prompt_form', 'Late reason for '+_name, 'width=400px,height=175px,center=1,resize=0,scrolling=1')
}

//if (_text==2) {
////Open a modal window populated with the contents of a hidden DIV, and assign the result to a global variable called "cancelwindow"
//promptwindow=dhtmlmodal.open('promptwindow2', 'div', 'prompt_form2', '', 'width=400px,height=175px,center=1,resize=0,scrolling=1')
//}

/*if (_text==3) {
//Open a modal window populated with the contents of a hidden DIV, and assign the result to a global variable called "cancelwindow"
cancelwindow=dhtmlmodal.open('cancelwindow3', 'div', 'cancel_form3', '', 'width=450px,height=175px,center=1,resize=0,scrolling=1')
}

if (_text==4) {
//Open a modal window populated with the contents of a hidden DIV, and assign the result to a global variable called "cancelwindow"
cancelwindow=dhtmlmodal.open('cancelwindow4', 'div', 'cancel_form4', '', 'width=400px,height=150px,center=1,resize=0,scrolling=1')
}*/
}

