<!--

var gstr = "";
var thankyoumsg = "" +
"<No justification is required \nfor the Thank You award." +
" \nHowever you should generate \na memo" +
" to the recipient and \ntheir supervisor" +
" detailing the \nreasons for the award. This memo \nshould go through your" +
" \nsupervisor for signature and \nwill be presented to the \nrecipient along" +
" with the \nThank You Award.>";

function openCenteredAbstract(id) {
    var width = 900;
    var height = 600;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top + ",scrollbars=yes";
    myWindow = window.open("showAbstract.php?docnum=" +id, "subWind", windowFeatures);
}

function openCenteredWindow() {
    var width = 620;
    var height = 490;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    myWindow = window.open("myimg.html", "subWind", windowFeatures);
}

function checkx(form)
{
 return true;
}

function clearmsg ()
{
//document.msgtag.style.visibility="hidden";
if (document.addForm.msg.value != "")
   {
   alert (document.addForm.msg.value);
   document.addForm.msg.value = "";
   history.go(-1);
   }
}

function Date ()
{
alert ("date is here");
}

function wochang (idx)
{
alert (idx);
alert (document.forms[idx].elements[1].value);
//document.forms[0].submit();
}

function myRed (doc) {
        if (doc.src.indexOf(curPage.toString()) < 0)
           {
        prefix = doc.src.substring(0,(doc.src.indexOf(".gif")));
        doc.src = prefix + "-red.gif";
        document.bboard.src = prefix + "-bbrd.gif";
           }
}

function myWhite (doc) {
        if (doc.src.indexOf(curPage.toString()) < 0)
           {
        prefix = doc.src.substring(0,(doc.src.indexOf("-red.gif")));
        doc.src = prefix + ".gif";
        document.bboard.src = curBbd;
           }
}

function goSubmit () {
if (parseInt(document.addForm.docnum.value) == document.addForm.docnum.value)
  document.addForm.submit(); 
else alert ("Document number must be in numeric value: \n\n  -- "+document.addForm.docnum.value);
}

function markDocument () {
if (document.addForm.entry.value == "")
   {
   alert ("You MUST enter a document number first, please try again.");
   }
else
{
if (confirm("Are you sure you want to mark this document as DELETE?")) 
   {
   alert ("Ok, this document is now marked as DELETE.");
   document.addForm.update.value = "no"; 
   document.addForm.mark.value = "yes"; 
   document.addForm.unmark.value = "no"; 
   document.addForm.submit(); 
   }
else 
   {
   // alert ("nothing change");
   }   
}
}

function unmarkDocument () {
if (confirm("Are you sure you want to un-mark DELETE this document?")) 
   {
   alert ("Ok, this document is now un-marked as DELETE.");
   document.addForm.update.value = "no"; 
   document.addForm.mark.value = "no"; 
   document.addForm.unmark.value = "yes"; 
   document.addForm.submit(); 
   }
else 
   {
   // alert ("nothing change");
   }   
}

function updateFields () {
var header = "This following fields are missing:\n\n";
var str = "";
var str1= "";
var str2= "";
var op1="";
var op2="";

if (document.addForm.entry.value == "")
   {
   alert ("You MUST enter a document number first, please try again.");
   }
else
{
//op1 = document.forms[0].elements[5].options[document.forms[0].elements[5].selectedIndex].value;
//op2 = document.forms[0].elements[6].options[document.forms[0].elements[6].selectedIndex].value;
//alert ("checkOp = " + op1);
//alert ("checkOp = " + op2);

// the following would work but not for NS
//alert ("op = " + document.addForm.Group.value);

if (document.addForm.Name.value == "") {str = str + "  - Name\n"; }
if (document.addForm.EmailAddress.value == "") {str = str + "  - Emaili Address\n"; }
if (document.addForm.Company.value == "")   {str = str + "  - Company\n"; }
if (document.addForm.DocumentTitle.value == "")   {str = str + "  - Document Title\n"; }
//if (op1 == "-------- Select Group -------")  {str = str + "  - Group\n";}
//if (op2 == "------ Select Subgroup ------") {str = str + "  - Subgroup\n"; }
if (str != "") 
    { alert (header + str); }
else  
    { 
    var out="";
    document.addForm.mark.value = "no"; 
    document.addForm.update.value = "yes"; 
    document.addForm.unmark.value = "no"; 
    var input = document.addForm.OtherAuthors.value;
    for (var i = 0; i < input.length; i++) 
     {
     if ((input.charCodeAt(i) == 13) && (input.charCodeAt(i + 1) == 10)) 
        {
        i++;
        out += "<BR>";
        } 
     else 
        {
        out += input.charAt(i);
        }
     }
    document.addForm.OtherAuthors.value = out;
    document.addForm.submit(); 
    }
}
}

function genReset () {
  document.addForm.reset();
}


function doReset () {
  window.status = " ";
     document.addForm.status.value="-reset-";
     document.addForm.submit();
/*
  if (document.addForm.status.value=="msgup")
     {
     document.addForm.status.value="-reset-";
     document.addForm.submit();
     }
  else
    {
  document.addForm.docnum.value="";
  document.addForm.reset();
    }
*/
}

function checkNetScan () {
var header = "This following fields are missing:\n\n";
var str = "";

if (document.addForm.SSP.value == "") {str = str + "  - SSP Number\n"; }
if (document.addForm.ScanDate.value == "") {str = str + "  - Scan Date\n"; }
if (document.addForm.Device.value == "") {str = str + "  - Device Type\n"; }
if (document.addForm.userfile.value == "") {str = str + "  - Scan Result Filename\n"; }

if (str != "")
    {
    alert (header + str);
    window.status = " ";
    }
else
    {
    document.msg.src = "uploadmsg.gif";
    window.status = "Please wait while file is uploading ...";
    //document.addForm.submit();
    setTimeout ('document.addForm.submit()',500);
    }
}

function checkUpload () {
var header = "This following fields are missing:\n\n";
var str = "";

if (document.addForm.docnum.value == "") {str = str + "  - Document Number\n"; }
if (document.addForm.userfile.value == "") {str = str + "  - MPEG Document\n"; }

if (parseInt(document.addForm.docnum.value) != document.addForm.docnum.value)
   {str = str + "\n ** Document number must be in numeric value: "+
document.addForm.docnum.value+"      ";
   }

if (str != "") 
    { 
    alert (header + str); 
    window.status = " ";
    }
else  
    {
    document.msg.src = "uploadmsg.gif";
    window.status = "Please wait while file is uploading ...";
    //document.addForm.submit();
    setTimeout ('document.addForm.submit()',500);
    }
}

function checkUpload1 () {
var header = "This following fields are missing:\n\n";
var str = "";

if (document.addForm.Company.value == "") {str = str + "  - Company Name\n"; }
if (document.addForm.userfile.value == "") {str = str + "  - MPEG-7 Document\n"; }

if (str != "")
    {
    alert (header + str);
    window.status = " ";
    }
else
    {
    document.msg.src = "uploadmsg.gif";
    window.status = "Please wait while file is uploading ...";
    //document.addForm.submit();
    setTimeout ('document.addForm.submit()',500);
    }
}

function checkUploadSchema () {
var header = "This following fields are missing:\n\n";
var str = "";

alert ("hi");
}

function checkUploadInstance () {
var header = "This following fields are missing:\n\n";
var str = "";

if (document.addForm.User.value == "") {str = str + "  - User Name\n"; }
if (document.addForm.Email.value == "") {str = str + "  - Email Address\n"; }
if (document.addForm.Company.value == "") {str = str + "  - Company Name\n"; }
if (document.addForm.userfile.value == "") {str = str + "  - MPEG-7 Document\n";
 }

if (str != "")
    {
    alert (header + str);
    window.status = " ";
    }
else
    {
    document.msg.src = "uploadmsg.gif";
    window.status = "Please wait while file is uploading ...";
    //document.addForm.submit();
    setTimeout ('document.addForm.submit()',500);
    }
}

function checkUploadProfile () {
document.addForm.mode.value ="upload";
/*
var header = "This following fields are missing:\n\n";
var str = "";

if (document.addForm.User.value == "") {str = str + "  - User Name\n"; }
if (document.addForm.Email.value == "") {str = str + "  - Email Address\n"; }
if (document.addForm.PName.value == "") {str = str + "  - Profile Name\n"; }
if (document.addForm.userfile.value == "") {str = str + "  - Profile File\n";
 }

if (str != "")
    {
    alert (header + str);
    window.status = " ";
    }
else
    {
    document.msg.src = "uploadmsg.gif";
    window.status = "Please wait while file is uploading ...";
    //document.addForm.submit();
    setTimeout ('document.addForm.submit()',500);
    }
*/
document.addForm.submit();
}

function checkProcessAHG () {
var header = "This following fields are missing:\n\n";
var str = "";

if (document.addForm.DBName.value == "") {str = str + "  - Database Name\n"; }
if (document.addForm.TBLName.value == "") {str = str + "  - Table Name\n"; }
if (document.addForm.userfile.value == "") {str = str + "  - CVS File\n";
 }

if (str != "")
    {
    alert (header + str);
    window.status = " ";
    }
else
    {
    document.msg.src = "uploadmsg.gif";
    window.status = "Please wait while file is uploading ...";
    //document.addForm.submit();
    setTimeout ('document.addForm.submit()',500);
    }
}

function byHand () {
document.addForm.mode.value ="byhand";
var header = "This following fields are missing:\n\n";
var str = "";

if (document.addForm.User.value == "") {str = str + "  - User Name\n"; }
if (document.addForm.Email.value == "") {str = str + "  - Email Address\n"; }
if (document.addForm.PName.value == "") {str = str + "  - Profile Name\n"; }

if (str != "")
    {
    alert (header + str);
    window.status = " ";
    }
else
    {
    document.addForm.submit();
    }
}

function checkAbstractFields () {
var header = "This following fields are missing:\n\n";
var str = "";

if (document.forms[1].elements[0].value=="") {str = str + "  - AuthorID\n";}
if (document.forms[1].elements[1].value=="") {str = str + "  - Title\n";}
if (document.forms[1].elements[2].value=="") {str = str + "  - Abstract\n";}
if (str != "")
    { alert (header + str); }
else
    document.editForm.submit();
}

function checkUSDPIFFields () {
var header = "This following fields are missing:\n\n";
var str = "";
var day1="", day2="", day3="";

if (document.forms[1].elements[2].value=="") {str = str + "  - First Name\n";}
if (document.forms[1].elements[3].value=="") {str = str + "  - Last Name\n";}
if (document.forms[1].elements[4].value=="") {str = str + "  - Organization\n";}
if (document.forms[1].elements[5].value=="") {str = str + "  - Job Title\n";}
if (document.forms[1].elements[6].value=="") {str = str + "  - Email Address\n";}
if (document.forms[1].elements[7].value=="") {str = str + "  - Confirm Email\n";}
if (document.forms[1].elements[8].checked==true) {day1="-";}
if (document.forms[1].elements[9].checked==true) {day2="-";}
if (document.forms[1].elements[10].checked==true) {day3="-";}
if (day1 == "" && day2 == ""  && day3 == "")
   { str = str + "  - You must select at least one event day\n";}
if (str != "") 
    { alert (header + str); }
else  
   {
if (document.forms[1].elements[6].value != document.forms[1].elements[7].value)
   alert ("'Email Address' and 'Confirm Email' not match, please try again!");
else
    document.editForm.submit();
   }
}

function checkINTLDPIFFields () {
var header = "This following fields are missing:\n\n";
var str = "";

if (document.forms[1].elements[1].value=="") {str = str + "  - First Name\n";}
if (document.forms[1].elements[2].value=="") {str = str + "  - Last Name\n";}
if (document.forms[1].elements[3].value=="") {str = str + "  - Organization\n";}
if (document.forms[1].elements[4].value=="") {str = str + "  - Job Title\n";}
if (document.forms[1].elements[5].value=="") {str = str + "  - Email Address\n";}
if (document.forms[1].elements[6].value=="") {str = str + "  - Confirm Email\n";}
if (str != "") 
    { alert (header + str); }
else  
   {
if (document.forms[1].elements[5].value != document.forms[1].elements[6].value)
   alert ("'Email Address' and 'Confirm Email' not match, please try again!");
else
    document.editForm.submit();
   }
}

function signUp () {
var header = "This following fields are missing:      \n\n";
var passwd = "*** Password & Re-password don't match, please re-enter! ***\n\n";
var str = "";
var str1 = "";

if (document.addForm.Login.value == "") {str = str + "  - Login\n"; }
if (document.addForm.Passwd.value == "") {str = str + "  - Password\n"; }
if (document.addForm.Repasswd.value == "") {str = str + "  - Re-password\n"; }
if (document.addForm.Name.value == "") {str = str + "  - Name\n"; }
if (document.addForm.Email.value == "") {str = str + "  - Email Address\n"; }
if (document.addForm.Company.value == "")   {str = str + "  - Company\n"; }
if (document.addForm.Passwd.value != document.addForm.Repasswd.value) 
   {str1 = passwd; }
if (str != "" || str1 != "") 
   {
   if (str != "")
      { alert (header + str + "\n\n" + str1); }
   else
      { alert (header + str1); }
   }
else  
    {
    document.addForm.submit();
    }
}

function update () {
var header = "This following fields are missing:      \n\n";
var passwd = "*** Password & Re-password don't match, please re-enter! ***\n\n";
var str = "";
var str1 = "";

if (document.addForm.Passwd.value == "") {str = str + "  - Password\n"; }
if (document.addForm.Repasswd.value == "") {str = str + "  - Re-password\n"; }
if (document.addForm.Name.value == "") {str = str + "  - Name\n"; }
if (document.addForm.Email.value == "") {str = str + "  - Email Address\n"; }
if (document.addForm.Company.value == "")   {str = str + "  - Company\n"; }
if (document.addForm.Passwd.value != document.addForm.Repasswd.value)
   {
   str1 = passwd; 
   }
if (str != "" || str1 != "")
   {
   if (str != "")
      { alert (header + str + "\n\n" + str1); }
   else
      { alert (header + str1); }
   }
else
    {
    document.addForm.submit();
    }
}

function register () {
var header = "This following fields are missing:      \n\n";
var str = "";

if (document.addForm.Login.value == "") {str = str + "  - Login\n"; }
if (document.addForm.Name.value == "") {str = str + "  - Name\n"; }
if (document.addForm.Email.value == "") {str = str + "  - Email Address\n"; }
if (document.addForm.Company.value == "")   {str = str + "  - Company\n"; }
if (str != "")
   {
   alert (header + str); 
   }
else
   {
   document.addForm.submit();
   }
}

function login () {
var header = "This following fields are missing:      \n\n";
var str = "";

if (document.addForm.Login.value == "") {str = str + "  - Login\n"; }
if (document.addForm.Passwd.value == "") {str = str + "  - Password\n"; }
if (str != "")
   {
   alert (header + str);
   }
else
   {
   document.addForm.submit();
   }
}

function init () {
//if (self.location.indexOf("nomination.html") > 0)
  if (document.forms.length > 0)
     {
     //document.addForm.nominee.focus();
     //document.addForm.justification.value = thankyoumsg;
     //document..elements[10].value = thankyoumsg;
     }
}

function checkOp () {

var selected = document.forms[0].elements[1].options[document.forms[0].elements[1].selectedIndex].value;
//alert ("checkOp = " + selected);

if (selected == "Thank You from ITL Certificate")
   { document.forms[0].elements[10].value = thankyoumsg; }
else
   { document.forms[0].elements[10].value = ""; }
}

function showPicture (simg,sname,sdiv,smsg,syear,award) {
var MSIE=navigator.userAgent.indexOf("MSIE");
var NETS=navigator.userAgent.indexOf("Netscape");
var OPER=navigator.userAgent.indexOf("Opera");
var sound="applause.wav";
var h=350;
var w=400;
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
var winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=0,resizable=0,status=0,directories=0,location=0';
var text =  "<html>\n<head>\n<title>"+award+": "+sname+"</title>\n";
text +="<body BGCOLOR=#ffe89d>\n";
text += "<b><center>\n<br>";
text +="<img src="+simg+" ><br>";
text +='<font FACE="verdana, arial, geneva" SIZE=2 color=blue>'+sname+"<br>\n";
text +='<font FACE="verdana, arial, geneva" SIZE=1 color=blue>'+sdiv+"<br>\n";
text +='<font FACE="verdana, arial, geneva" SIZE=2 color=red>'+smsg+"<br>\n";
text +='<font FACE="verdana, arial, geneva" SIZE=2 color=black>'+syear+"<br>\n";
if((MSIE>-1) || (OPER>-1)) {
text += "<BGSOUND SRC="+sound+" LOOP=INFINITE>";
} else {
text+="<EMBED SRC="+sound+" AUTOSTART=TRUE ";
text+="HIDDEN=true VOLUME=100 LOOP=false>";
}
text += "</b></center>\n</body>\n</html>\n";

w=window.open('','',winprops);
w.document.write(text);

w = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { w.window.focus(); }
}

/*
var statusWin=null;
    

//openStatus('loading.htm');


function closeSearching(){
    if (statusWin != null){
        statusWin.close();
    }
}   

function openStatus(url){
    statusWin=null;
    var pos = "center";
    var h = 100;
    var w = 300;
    myleft=(screen.width)?(screen.width-w)/2:100;
    mytop=(screen.height)?(screen.height-h)/2:100;
    settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
    statusWin=window.open(url,"searchstat",settings);
    statusWin.focus();
}
*/

//-->


