//ContTrack.js
// 31-Jan-2005 Diego Millan - Added popClm() function.
// 23-Mar-2005 Jim Mohrle  - Edited functions to work without a frameset.
// 04-Apr-2005 Diego Millan - Centered 'Close' button in popClm() function.
//
function setTitle()
{
   document.forms[0].elements[0].focus();
}

function selectAll() {

   j = document.iframe1.document.getElementsByName("chk_select").length;

   for(k=0;k<j;k++) {
      document.iframe1.document.getElementsByName("chk_select")[k].checked=true;
      document.forms[0].txt_select[k].value = "Y";
   }
}

function unselectAll()
{
   j = document.iframe1.document.getElementsByName("chk_select").length;

   for(k=0;k<j;k++) {
       document.iframe1.document.getElementsByName("chk_select")[k].checked=false;
       document.forms[0].txt_select[k].value = "N";
   }
}

function callSubmit()
{
   vChecked = "N";

   j = document.iframe1.document.getElementsByName("chk_select").length;

   for(k=0;k<j;k++) {
       if(document.iframe1.document.getElementsByName("chk_select")[k].checked==true) {
          vChecked="Y";
       }
   }

   if(vChecked=="N") {
      alert("Please Select Container No. first.");
   }
   else {
      document.forms[0].submit();
   }
}

function mOver(i)
{
   window.status = i;
}

function mOut()
{
   window.status = "";
}

function popClm(p_eqp_no,p_ref_no,p_iri,p_clm,p_arv)
{
 newWin = window.open("","sub","scrollbars=no,menubar=no,status=no,height=250,width=600,left=150,top=150,alwaysRaised=yes");
 if (!newWin.opener) newWin.opener = window; //? what la hell, it works,,,

 var newContent = "<html><head><title>CLM INFORMATION</title><link rel='stylesheet' href='/htm/wapcls01.css' type='text/css'></head>\n";
 newContent += "<body class='boxDsp'>\n";
 newContent += "<table class='boxDsp'>\n"
 newContent += "<colgroup><col width=250><col width=350></colgroup>\n"
 newContent += "<tr class='boxHdr'><td colspan=2>Eqp No: "+p_eqp_no+"</td></tr>\n"
 newContent += "<tr><td colspan=2>&nbsp;</td></tr>\n"
 newContent += "<tr><td class='boxLbl'>Ingate Ramp</td>\n"
 newContent += "<td>"+p_iri+"</td></tr>\n"
 newContent += "<tr><td colspan='2'>&nbsp;</td></tr>\n"
 newContent += "<tr><td class='boxLbl'>Last Location Date/Time/Name</td>\n"
 newContent += "<td>"+p_clm+"</td></tr>\n"
 newContent += "<tr><td colspan='2'>&nbsp;</td></tr>\n"
 newContent += "<tr><td class='boxLbl'>Arrival</td>\n"
 newContent += "<td>"+p_arv+"</td></tr>\n"
 newContent += "<tr><td colspan='2'>&nbsp;</td></tr>\n"
 newContent += "<tr><td class='boxLbl'>Last Free Day</td>\n"
 newContent += "<td>-</td></tr>\n"
 newContent += "<tr><td colspan='2'>&nbsp;</td></tr>\n"
 newContent += "<tr class='boxDsp'><td colspan=2 align='center'><input class='btn' type='button' value='Close' onClick='window.close()'></td></tr>\n"
 newContent += "</table>\n";
 newContent += "</body></html>";
 newWin.document.write(newContent);
 newWin.document.close();

 newWin.focus();
 //InitializeTimer();
}

