Solved

ASP: Problem loading text with " (double-quotes)

Posted on 2006-07-18
5
281 Views
Last Modified: 2008-02-01
I have an ASP Page that displays data in a tabular format.  The text entered in the text area contains " (double-quotes), it saves with double-quotes in the database, but when posted back to page, it messes the tabular format.  Is there a method that takes care of all the wild characters entered?
0
Comment
Question by:sireev
  • 2
5 Comments
 
LVL 6

Expert Comment

by:Devil666
ID: 17136175
hi there,

could you please post some sample code??
0
 
LVL 11

Accepted Solution

by:
kelvinwkw earned 100 total points
ID: 17136267
use this
server.htmlencode()
0
 

Author Comment

by:sireev
ID: 17137999
The answer I accepted worked for some parts.  This a very complicated page display, attaching the code; hopefully can make sense out of it.  The controls with "txt" suffix are the ones that need to accept all wild characters.

*************************************************************************************
<!-- #INCLUDE FILE="connection.asp" -->
<!-- #INCLUDE FILE="adovbs.inc" -->
<!-- #INCLUDE FILE="check2year.asp" -->

<%

Dim SCRIPT_NAME
SCRIPT_NAME = Request.ServerVariables("SCRIPT_NAME")

Dim PREVIOUS_PAGE
PREVIOUS_PAGE = "ProjectSelect.asp"

Dim vStatusDate, vCount

theStr = Request.QueryString("iEffort")
Session("effortId") = theStr 'Mid(theStr, (theComma + 2), (Len(theStr) - theComma))

Session("UserType") = Request.QueryString("iUserType")

IF Request.QueryString("iRowCnt") > "" THEN
  vCount = Request.QueryString("iRowCnt")
END IF

dim vRowCount
strSQL = "SELECT COUNT(1) CNT_ROW FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "'"

Set rstSQL = Server.CreateObject("ADODB.Recordset")
rstSQL.Open strSQL, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

vRowCount = rstSQL("CNT_ROW")
rstSQL.Close


Select Case LCase(Trim(Request.QueryString("action")))

      Case "save"
            'Response.Write(Request.Form)
            Set aConn = Server.CreateObject("ADODB.Connection")
            aConn.Open (connectString)
%><!-- #INCLUDE FILE="OracleSeq.asp" -->
<%
     v_sql = "DELETE FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "'"
     v_size = 1
%>
<!-- #INCLUDE FILE="OracleAdd.asp" -->
<%
                'response.write("Count: " & Request.Form("iStatusDate").Count)
            FOR n=1 to cint(Request.Form("iStatusDate").Count)
                  'IF (Request.Form("txt12")(n) <> "Y") THEN
                              'Response.Write ("<br>ROW: " & n & "<BR>")
                              vStatusDate = "TO_DATE(TRIM('" & Check2Year(Request.Form("iStatusDate")(n)) & "'),'MM/DD/RR')"
                              IF (Request.Form("iFinal")(n) = "Y") THEN
                                 vFinal = "Y"
                              ELSE
                                 vFinal = "N"
                              END IF
                              if cint(vRowCount) > 0 then
                                    if (Request.Form("txt1")(n)) > "" then
                                          vCategory = "'" & Request.Form("txt1")(n) & "'"
                                    else
                                          vCategory = "'" & Request.Form("sel1")(n) & "'"
                                    end if
                              else
                                    vCategory = "'" & Request.Form("sel1") & "'"
                              end if
                              vColorSfty = "'" & Request.Form("sel2")(n) & "'"
                              vColorQ = "'" & Request.Form("sel4")(n) & "'"
                              vColorScp = "'" & Request.Form("sel5")(n) & "'"
                              vColorSch = "'" & Request.Form("sel6")(n) & "'"
                              vColorB = "'" & Request.Form("sel7")(n) & "'"
                              vColor = "'" & Request.Form("sel8")(n) & "'"
                              vTop = "'" & Request.Form("sel3")(n) & "'"
                              
                              Response.Write(Request.Form("txt6")(n) & "<BR><BR>")
                              
                              v_sql = "INSERT INTO EPM_OVERSIGHT_MONTHLY " _
                                          & "(EFFORT_ID, " _
                                          & "CATEGORY_NAME, " _
                                          & "COLOR_SAFETY, " _
                                          & "COLOR_QUALITY, " _
                                          & "COLOR_SCOPE, " _
                                          & "COLOR_SCHEDULE, " _
                                          & "COLOR_BUDGET, " _
                                          & "COLOR, " _
                                          & "MAJOR_RISK_TEXT_1, " _
                                          & "MAJOR_RISK_TEXT_2, " _
                                          & "MAJOR_RISK_TEXT_3, " _
                                          & "UPCOMING_DELIVERABLE_1, " _
                                          & "UPCOMING_DELIVERABLE_2, " _
                                          & "UPCOMING_DELIVERABLE_3, " _
                                          & "UPCOMMING_DELIVERABLES_TEXT4, " _
                                          & "UPCOMMING_DELIVERABLES_TEXT5, " _
                                          & "UPCOMMING_DELIVERABLES_TEXT6, " _
                                          & "UPCOMING_DELIVERABLE_DATE_1, " _
                                          & "UPCOMING_DELIVERABLE_DATE_2, " _
                                          & "UPCOMING_DELIVERABLE_DATE_3, " _
                                          & "UPCOMMING_DELIVERABLES_DATE4, " _
                                          & "UPCOMMING_DELIVERABLES_DATE5, " _
                                          & "UPCOMMING_DELIVERABLES_DATE6, " _
                                          & "TOP_10, " _
                                          & "MONTH_DATE, " _
                                          & "STATUS_PROGRESS, " _
                                          & "ACTIONS_TO_ADDRESS, "_
                                          & "MAJOR_ISSUES, " _
                                          & "EXECUTIVE_SUMMARY, " _
                                          & "LAST_SPONSOR_UPDATE, "_
                                          & "FINAL" _
                                          & ") VALUES (" _
                                          & "'" & theStr & "', " _
                                          & vCategory & ", " _
                                          & vColorSfty & ", " _
                                          & vColorQ & ", " _
                                          & vColorScp & ", " _
                                          & vColorSch & ", " _
                                          & vColorB & ", " _
                                          & vColor & ", " _
                                          & "'" & REPLACE(Server.HTMLEncode(Request.Form("txt3")(n)), "'", "''") & "', " _
                                          & "'" & REPLACE(Server.HTMLEncode(Request.Form("txt4")(n)), "'", "''") & "', " _
                                          & "'" & REPLACE(Server.HTMLEncode(Request.Form("txt5")(n)), "'", "''") & "', " _
                                          & "'" & REPLACE(Server.HTMLEncode(Request.Form("txt6")(n)), "'", "''") & "', " _
                                          & "'" & REPLACE(Server.HTMLEncode(Request.Form("txt7")(n)), "'", "''") & "', " _
                                          & "'" & REPLACE(Server.HTMLEncode(Request.Form("txt8")(n)), "'", "''") & "', " _
                                          & "'" & REPLACE(Server.HTMLEncode(Request.Form("txt9")(n)), "'", "''") & "', " _
                                          & "'" & REPLACE(Server.HTMLEncode(Request.Form("txt10")(n)), "'", "''") & "', " _
                                          & "'" & REPLACE(Server.HTMLEncode(Request.Form("txt11")(n)), "'", "''") & "', " _
                                          & "TO_DATE(TRIM('" & Check2Year(Request.Form("txt12")(n)) & "'),'MM/DD/RR'), " _
                                          & "TO_DATE(TRIM('" & Check2Year(Request.Form("txt13")(n)) & "'),'MM/DD/RR'), " _
                                          & "TO_DATE(TRIM('" & Check2Year(Request.Form("txt14")(n)) & "'),'MM/DD/RR'), " _
                                          & "TO_DATE(TRIM('" & Check2Year(Request.Form("txt15")(n)) & "'),'MM/DD/RR'), " _
                                          & "TO_DATE(TRIM('" & Check2Year(Request.Form("txt16")(n)) & "'),'MM/DD/RR'), " _
                                          & "TO_DATE(TRIM('" & Check2Year(Request.Form("txt17")(n)) & "'),'MM/DD/RR'), " _
                                          & vTop & ", " _
                                          & vStatusDate & ", " _
                                          & "'" & REPLACE(Server.HTMLEncode(Request.Form("txt18")(n)), "'", "''") & "', " _
                                          & "'" & REPLACE(Server.HTMLEncode(Request.Form("txt19")(n)), "'", "''") & "', " _
                                          & "'" & REPLACE(Server.HTMLEncode(Request.Form("txt20")(n)), "'", "''") & "', " _
                                          & "'" & REPLACE(Server.HTMLEncode(Request.Form("txt21")(n)), "'", "''") & "', " _
                                          & "TO_DATE(TRIM('" & Check2Year(Request.Form("txt22")(n)) & "'),'MM/DD/RR'), " _
                                          & "'" & vFinal & "')"                              
                                    Response.Write(v_sql & "<br>")
                              v_size = v_size + 1
%>
<!-- #INCLUDE FILE="OracleAdd.asp" -->
<%
             Next
%>
<!-- #INCLUDE FILE="OracleRun.asp" -->
<%
 aConn.Close
 Set aConn = nothing
      
      
      'Response.Redirect(SCRIPT_NAME & "?iEffort=" & theStr & "&iUserType=" & Session("UserType") & "&i_msg=" & v_results)

Case Else

%>
<HTML>
<HEAD>
<% Response.CacheControl = "no-cache" %>
<% Response.AddHeader "Pragma", "no-cache" %>
<% Response.Expires = -1 %>
<SCRIPT src="validDate.js" language="Javascript"></script>
<SCRIPT>
var destCell;
var rCnt = 1;
function scrollHeader() {
  var myOffset = document.body;
  //Header offset
  var hOffset = parent.cFrame.document.body;
  //Values offset
  var vOffset = parent.aFrame.document.body;
  //var vOffset2 = parent.valuesl.document.body;
  vSt = myOffset.scrollTop;
  hSt = parent.aFrame.document.body.scrollLeft;
  hOffset.scrollLeft = hSt;
  vOffset.scrollTop = vSt;
  //vOffset2.scrollTop = vSt;
}
  vFirst = true;

function AddExecSummary () {
  vOK = true;
  vRow=document.all('oTbl').rows.length;
  vLen = vRow - 2;
  vFirst = true;
  t = 3;
  //alert(vRow)
  //The following couple of lines prevents from getting an error message, and also resets the Date option
  //item to the first when the last date has been added.
  if (parent.cFrame.iStatusDate.selectedIndex == -1) {
            parent.cFrame.iStatusDate.selectedIndex=0;
  }

  if (vRow > 2) {
    vDat = parent.cFrame.iStatusDate.options[parent.cFrame.iStatusDate.selectedIndex].value;
    vText = parent.cFrame.iStatusDate.options[parent.cFrame.iStatusDate.selectedIndex].text;
    for (i=1; i <= vLen; i++) {
     if (vLen == 1) {
      vDat2 = document.all('iStatusDate').value;
     }
     else {
      vDat2 = document.all('iStatusDate', i-1).value;
     }
//          vDat2 = document.all('iStatusDate', i).value;
            if (Date.parse(vDat2) == Date.parse(vDat)) {
             vOK = false;
            }
            if (Date.parse(vDat2) > Date.parse(vDat)) {
               if (vFirst) {
                vRow = i + 1;
                vFirst = false;
               }
            }
    } // end for loop
  }
  else {
      vDat = parent.cFrame.iStatusDate.options[parent.cFrame.iStatusDate.selectedIndex].value;
      vText = parent.cFrame.iStatusDate.options[parent.cFrame.iStatusDate.selectedIndex].text;
  }
  if (vOK) {
    vCells = parent.cFrame.oTbl_hdr.rows(0).childNodes.length;
    iRow = oTbl.insertRow(vRow);
    for (i=1;i <= vCells; i++) {
            iRow.insertCell();
    }
    iRow.children(0).nowrap = true;
    iRow.children(0).innerHTML="<INPUT type=hidden nowrap name=iStatusDate VALUE='" + vDat + "'>" + vText;
    //r=1;
    r=0;
    for (i=1; i < vCells; i++) {
      if (vRow > 2) {
        if (oTbl.rows(1).children[i].children(0)){
          iRow.children[i].innerHTML=oTbl.rows(1).children[i].children(0).value;
          //alert(oTbl.rows(vRow-1).children(i).children(0).name)
          if (oTbl.rows(vRow-1).children(i).children(0).tagName == "SELECT") {
                  if (oTbl.rows(vRow-1).children(i).children(0).name != "iFinal") {
                        if (oTbl.rows(vRow-1).children(i).disabled)
                              iRow.children[i].children(0).disabled = false
                        iRow.children(i).children(0).options.selectedIndex = oTbl.rows(vRow-1).children(i).children(0).options.selectedIndex;
                  } // END IF 4
          } else {
                  r=r+1;
                  //alert(i + ": " + oTbl.rows(vRow-1).children(i).innerHTML)
                  if (oTbl.rows(vRow-1).children(i).children(0).tagName == "INPUT") {
                        if (r == 2 && oTbl.rows(vRow-1).children(i).children(0).name == "txt2") {
                              document.all('holdValue').value =oTbl.rows(vRow-1).children[i].children(0).value;
                              iRow.children[i].name="txt" + r;
                              iRow.children[i].title=oTbl.rows(vRow-1).children[i].children(0).value;
                              destCell = iRow.children[i];
                              iRow.children[i].innerHTML=oTbl.rows(vRow-1).children[i].innerHTML;
                              iRow.children[i].onclick=textEdit;
                              saveVal();
                        }
                        else {
                              iRow.children(i).innerHTML = oTbl.rows(vRow-1).children(i).innerHTML;
                              if (iRow.children(i).children(0).name == "iFinal") {
                                    iRow.children(i).innerHTML =oTbl.rows(1).children(i).children(0).value;
                              }

                                        if (iRow.children(i).children(0).name == "txt22")  {
                                                iRow.children(i).onclick=textEdit2;
                                        }
                        }
                        /*if (oTbl.rows(vRow-1).children(i).children(0).name == "txt12" ||
                              oTbl.rows(vRow-1).children(i).children(0).name == "txt13") {
                              if (oTbl.rows(vRow-1).children(i).children(1).tagName == "SELECT") {
                                    iRow.children(i).children(1).options.selectedIndex = oTbl.rows(vRow-1).children(i).children(1).options.selectedIndex;                                    
                                    iRow.children(i).children(0).value = oTbl.rows(vRow-1).children(i).children(1).options[oTbl.rows(vRow-1).children(i).children(1).options.selectedIndex].value;
                                    iRow.children[i].innerHTML=oTbl.rows(vRow-1).children[i].innerHTML;
                              }
                        }*/
                  }
                  if (oTbl.rows(vRow-1).children(i).children(0).tagName == "TABLE") {
                           if ((oTbl.rows(vRow-1).children(i).children(0).rows(0).childNodes(0).innerHTML) == "SFTY") {
                              iRow.children(i).children(0).rows(0).childNodes(1).children(0).selectedIndex=oTbl.rows(vRow-1).children(i).children(0).rows(0).childNodes(1).children(0).selectedIndex;
                              iRow.children(i).children(0).rows(1).childNodes(1).children(0).selectedIndex=oTbl.rows(vRow-1).children(i).children(0).rows(1).childNodes(1).children(0).selectedIndex;
                              iRow.children(i).children(0).rows(2).childNodes(1).children(0).selectedIndex=oTbl.rows(vRow-1).children(i).children(0).rows(2).childNodes(1).children(0).selectedIndex;
                              iRow.children(i).children(0).rows(3).childNodes(1).children(0).selectedIndex=oTbl.rows(vRow-1).children(i).children(0).rows(3).childNodes(1).children(0).selectedIndex;
                              iRow.children(i).children(0).rows(4).childNodes(1).children(0).selectedIndex=oTbl.rows(vRow-1).children(i).children(0).rows(4).childNodes(1).children(0).selectedIndex;
                              iRow.children(i).children(0).rows(5).childNodes(0).children(0).selectedIndex=oTbl.rows(vRow-1).children(i).children(0).rows(5).childNodes(0).children(0).selectedIndex;
                           }
                           else {
                        vTRow = oTbl.rows(vRow-1).children(i).children(0).children(0).childNodes.length;
                        vTCol = oTbl.rows(vRow-1).children(i).children(0).children(0).children(0).childNodes.length;
//                        for (k=1;k<vTCol;k++) {
//                              for (j=0;j<vTRow;j++) {
//                                    document.all('holdValue').value = oTbl.rows(vRow-1).children(i).children(0).children(0).children[j].children(k).children(0).value;
//                                    iRow.children[i].children(0).children(0).children[j].children(k).name = oTbl.rows(vRow-1).children(i).children(0).children(0).children[j].children(k).children(0).name;
//                                    iRow.children[i].children(0).children(0).children[j].children(k).title = oTbl.rows(vRow-1).children(i).children(0).children(0).children[j].children(k).children(0).value;
//                                    destCell = iRow.children[i].children(0).children(0).children[j].children(k);
//                                    if (k != 2) {
//                                          iRow.children[i].children(0).children(0).children[j].children(k).onclick=textEdit;
//                                    } else {
//                                          iRow.children[i].children(0).children(0).children[j].children(k).onclick=textEdit2;
//                                    }
//                                    saveVal();
//                              } // end vTRow for
//                        } // end vTCol for

                            }
                  }
              } // end if 3
            } // end if 2
      } else {
              r=1;
          iRow.children[i].innerHTML=oTbl.rows(vRow-1).children[i].children(0).value;
              if (iRow.children[i].children(0).tagName == "INPUT") {
                        r=r+1;
                        if (r == 2) {
                              document.all('holdValue').value ="";
                              iRow.children[i].name="txt" + r;
                          document.all('holdId').value = iRow.children[i].name;
                              iRow.children[i].onclick=textEdit;
                          destCell = iRow.children[i];
                          saveVal();
                        }
              } // end if 3        
          if (iRow.children[i].children(0).tagName == "TABLE") {
                     if ((iRow.children(i).children(0).rows(0).childNodes(0).innerHTML) == "SFTY") {
                       iRow.children(i).children(0).rows(0).childNodes(1).children(0).selectedIndex=0;
                       iRow.children(i).children(0).rows(1).childNodes(1).children(0).selectedIndex=0;
                       iRow.children(i).children(0).rows(2).childNodes(1).children(0).selectedIndex=0;
                       iRow.children(i).children(0).rows(3).childNodes(1).children(0).selectedIndex=0;
                       iRow.children(i).children(0).rows(4).childNodes(1).children(0).selectedIndex=0;
                       iRow.children(i).children(0).rows(5).childNodes(0).children(0).selectedIndex=0;
                     }
                     else {
                        vTRow = iRow.children[i].children(0).children(0).childNodes.length;
                        vTCol = iRow.children[i].children(0).children(0).children(0).childNodes.length;
                        for (k=1;k<vTCol;k++) {
                              for (j=0;j<vTRow;j++) {
                                          document.all('holdValue').value = iRow.children[i].children(0).children(0).children[j].children(k).children(0).value;
                                          iRow.children[i].children(0).children(0).children[j].children(k).name = iRow.children[i].children(0).children(0).children[j].children(k).children(0).name;
                                          iRow.children[i].children(0).children(0).children[j].children(k).title = iRow.children[i].children(0).children(0).children[j].children(k).children(0).value;
                                          destCell = iRow.children[i].children(0).children(0).children[j].children(k);
                                          if (k != 2) {
                                                iRow.children[i].children(0).children(0).children[j].children(k).onclick=textEdit;
                                          } else {
                                                iRow.children[i].children(0).children(0).children[j].children(k).onclick=textEdit2;
                                          }
                                          saveVal();
                              }
                        }
                       }
              }
      } // end if 1
 }
    parent.cFrame.document.all('iStatusDate').selectedIndex = parent.cFrame.document.all('iStatusDate').selectedIndex + 1;
    aVal=true;
    vOk=false
    vFirst=false;
   }
   else {
         alert("Duplicate month " + parent.cFrame.document.all('iStatusDate').options[parent.cFrame.document.all('iStatusDate').selectedIndex].text + ".  Action canceled.");
     }

 }


function getCharacters(vVal){
   sVal = unescape(vVal.replace(/[\r\n\s]/gi, "&#32;"));
   sVal = unescape(sVal.replace(/["]/gi, "\""));
//   sVal = unescape(sVal.replace(/[']/gi, "''"));
   sVal = unescape(sVal.replace(/[”]/gi, "\""));
   sVal = unescape(sVal.replace(/[“]/gi, "\""));
   sVal = unescape(sVal.replace(/[‘]/gi, "''"));
   sVal = unescape(sVal.replace(/[’]/gi, "''"));
   sVal = unescape(sVal.replace(/[<]/gi, "&#60;"));
   sVal = unescape(sVal.replace(/[>]/gi, "&#62;"));
   
return sVal
}
var len = 1000;

function saveVal(){
   vVal=document.all('holdValue').value;
   myClick=destCell.onclick;
      sVal = getCharacters(vVal);
   if (destCell.children(0)){
     myID=destCell.children(0).name;
     len = destCell.children(0).size;
   }
   else {
     myID=destCell.name;
     len = destCell.size;
   }
   if (myID == '' || myID == null) {
   myID = document.all('holdId').value;
   }
   half_len = len/2;
   if (vVal.length < 15)
            tVal =  vVal;
   else
            tVal = vVal.substring(0, 15) + "...";
// Copy from Exec Summ
    if (vVal.length < 1)
            tVal = "...";
      else
            tVal = vVal;
   destCell.title = vVal;
   destCell.innerHTML= "<INPUT TYPE=HIDDEN SIZE= " + len + " ID=" + myID + " NAME=" + myID + " ONCLICK=" + "textEdit()" + " VALUE=" + sVal + ">" + tVal;
}

function saveVal2(){
   vVal=document.all('holdValue').value;
   myClick=destCell.onclick;
      sVal = getCharacters(vVal);
   if (destCell.children(0)){
     myID=destCell.children(0).name;
   }
   else {
     myID=destCell.name;
   }
   if (myID == '' || myID == null) {
   myID = document.all('holdId').value;
   }
   //tVal =  vVal.substring(0,15) + "...";
   if (vVal.length > 0)
            tVal = vVal;
   else
            tVal = "...";
   destCell.title = vVal;
   destCell.innerHTML= "<INPUT TYPE=HIDDEN ID=" + myID + " NAME=" + myID + " ONCLICK=" + "textEdit2()" + " VALUE=" + sVal + ">" + tVal;
}

 function textEdit() {
  iCell=window.event.srcElement;
  destCell=iCell;
  document.all('holdId').value = destCell.name;
      if (destCell.children(0))
            len = destCell.children(0).size;
        iVal=iCell.title;
      document.all('holdValue').value = iVal;
    ah=document.body.offsetHeight;
    aw=document.body.offsetWidth;
    vHold=window.open ('textOVEdit.asp?txtVal=' + iVal + '&maxLen=' + len,'txtEdit', config='left=0,top=0,height=' + ah + ',width=' + aw + ',toolbar=no, menubar=no, scrollbars=auto, resizable=yes,location=no, directories=no, status=yes');  
    vHold.moveTo(0,0);
    vHold.resizeTo(screen.availWidth, screen.availHeight);

  if (vHold.opener == null) vHold.opener = self;
 }
 
 function textEdit2() {
  iCell=window.event.srcElement;
  destCell=iCell;
  document.all('holdId').value = destCell.name;
        iVal=iCell.title;
      document.all('holdValue').value = iVal;
    ah=110;//document.body.offsetHeight;
    aw=200;//document.body.offsetWidth;
    vHold=window.open ('dateEdit.asp?txtVal=' + iVal,'txtEdit', config='left=0,top=0,height=' + ah + ',width=' + aw + ',toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, directories=no, status=no');  
    vHold.moveTo(300,300);
    //vHold.resizeTo(screen.availWidth, screen.availHeight);

      if (vHold.opener == null) vHold.opener = self;
 }

function checkAVal() {
   if (aVal) {
     if (confirm("You may have made changes since you last saved.  Press OK to save changes, or Cancel to exit.")) {
            _enable();
        document.all('evForm').submit();
     }
   }
 }

 function _enable() {
  /* this function is required to be able to save the changes made to the page*/
  vRow=document.all('oTbl').rows.length;
  vLen = vRow - 2;

  if (vRow > 2) {
    for (i=1; i <= vLen; i++) {
            if (vLen == 1) {
                        document.all('oTbl').rows(i+1).children(2).children(0).rows(0).childNodes(1).children(0).disabled=false;
                        document.all('oTbl').rows(i+1).children(2).children(0).rows(1).childNodes(1).children(0).disabled=false;
                        document.all('oTbl').rows(i+1).children(2).children(0).rows(2).childNodes(1).children(0).disabled=false;
                        document.all('oTbl').rows(i+1).children(2).children(0).rows(3).childNodes(1).children(0).disabled=false;
                        document.all('oTbl').rows(i+1).children(2).children(0).rows(4).childNodes(1).children(0).disabled=false;
                        document.all('oTbl').rows(i+1).children(2).children(0).rows(5).childNodes(0).children(0).disabled=false;
                  if (document.all('sel2'))
                        document.all('sel2').disabled = false;
                  if (document.all('sel3'))
                        document.all('sel3').disabled = false;
                  if (document.all('sel4'))
                        document.all('sel4').disabled = false;
                  if (document.all('sel5'))
                        document.all('sel5').disabled = false;
                  if (document.all('sel6'))
                        document.all('sel6').disabled = false;
                  if (document.all('sel7'))
                        document.all('sel7').disabled = false;
                  if (document.all('sel8'))
                        document.all('sel8').disabled = false;
            } else {
                        document.all('oTbl').rows(i+1).children(2).children(0).rows(0).childNodes(1).children(0).disabled=false;
                        document.all('oTbl').rows(i+1).children(2).children(0).rows(1).childNodes(1).children(0).disabled=false;
                        document.all('oTbl').rows(i+1).children(2).children(0).rows(2).childNodes(1).children(0).disabled=false;
                        document.all('oTbl').rows(i+1).children(2).children(0).rows(3).childNodes(1).children(0).disabled=false;
                        document.all('oTbl').rows(i+1).children(2).children(0).rows(4).childNodes(1).children(0).disabled=false;
                        document.all('oTbl').rows(i+1).children(2).children(0).rows(5).childNodes(0).children(0).disabled=false;

                  if (document.all('sel2', i))
                        document.all('sel2', i).disabled = false;
                  if (document.all('sel3', i))
                        document.all('sel3', i).disabled = false;
                  if (document.all('sel4', i))
                        document.all('sel4', i).disabled = false;
                  if (document.all('sel5', i))
                        document.all('sel5', i).disabled = false;
                  if (document.all('sel6', i))
                        document.all('sel6', i).disabled = false;
                  if (document.all('sel7', i))
                        document.all('sel7', i).disabled = false;
                  if (document.all('sel8', i))
                        document.all('sel8', i).disabled = false;
            }
    } // end for loop
  }
 
}


function doSub() {
   vNoSave=false;
   _enable();
   document.all('evForm').submit();
}

function doBack() {
   parent.closing=false;
   parent.document.location.replace("oversightDefault.asp?" + parent.document.all('qString').value);
}
   
function makeSum() {
   var wVal = "";
   wVal = "<BODY bgcolor='cornsilk'>\n";
   wVal = wVal + "<TABLE border = 1>\n";
   wVal = wVal + "<TR>\n";
   wVal = wVal + "<TD>\n";
   wVal = wVal + "<INPUT TYPE='BUTTON' style='font-size:12' VALUE='Go Back' onclick='parent.aFrame.doBack();' id='BUTTON'1 name='BUTTON'1>\n";
   wVal = wVal + "<INPUT TYPE='BUTTON' style='font-size:12' <%IF Session("UserType") = "BROWSER" THEN %> DISABLED <%END IF%> VALUE='Save' onclick='parent.aFrame.doSub();'>\n";
   wVal = wVal + "</TD>\n";
   wVal = wVal + "</TR>\n";
   wVal = wVal + "</TABLE>\n";
   wVal = wVal + "</BODY>\n";
   parent.bFrame.document.write(wVal);
}

 aVal=false;
 vNoSave=true;
 
function setWidth() {
      var oRow = document.all('hideRow');
      oRow.style.visibility = "hidden";
      var oTable = parent.aFrame.document.all('oTbl');
      var oHeader = parent.cFrame.document.all('oTbl_Hdr');
      for(var j=0; j<oTable.rows(1).cells.length; j++)
      {
            var oWidth = oTable.rows(1).cells(j).clientWidth;
            var myWidth = oWidth - 2;
            oHeader.rows(0).cells(j).children(0).style.width = myWidth;
            var oTitle = oTable.rows(1).cells(j).title;
            oHeader.rows(0).cells(j).children(0).title = oTitle;
            oHeader.rows(0).cells(j).children(0).style.fontSize = oTable.style.fontSize;
      }
}

function showMsg() {
<% IF Request.QueryString("i_msg") > "" THEN %>
alert(unescape(escape('<%= Request.QueryString("i_msg")%>')));
<% ELSE %>
null;
<% END IF %>
}

function doUnFinal(vMonth) {
   if (confirm("Do you want to reset " + vMonth + "?")) {
     parent.closing=false;
     //_enable();
     document.location.replace("overSummUnFinal.asp?" + "iUnMonth=" + vMonth + "&i_projid=<%=Session("effortId")%>&iUserType=<%=Session("UserType")%>") ;  
  }
}

function chngColor(selColor) {
pRows=selColor.parentNode.parentNode.parentNode;
pRows.rows[5].childNodes[0].childNodes[0].selectedIndex = 0;
  for (i=0; i<5; i++) {
    if (pRows.rows[i].childNodes[1].childNodes[0].selectedIndex > pRows.rows[5].childNodes[0].childNodes[0].selectedIndex) {
      pRows.rows[5].childNodes[0].childNodes[0].selectedIndex = pRows.rows[i].childNodes[1].childNodes[0].selectedIndex;
    }
  }
}

</SCRIPT>
<BODY onScroll="scrollHeader();setWidth();" bgcolor="cornsilk" onload="makeSum();setWidth();showMsg();" onbeforeunload=" if (vNoSave) {checkAVal()}">
<FORM action="oversightSummMain.asp?action=save&iEffort=<%=theStr%>&iUserType=<%=Session("UserType")%>" method=POST ID="evForm">
<INPUT TYPE=HIDDEN ID="holdValue">
<INPUT TYPE=HIDDEN ID="holdId">
<TABLE ID="oTbl" border=1 width=740 style="font-size:12" scrolltop=100>
<TR bordercolor=green>
<TD>
</TD>
</TR>
<TR id=hideRow>
  <TD bordercolor=cornsilk nowrap><B>StatusDte</B></TD>
<%
      Response.Write("<TD bordercolor=cornsilk style='font-weight:bold'")

            vName = "sel" & "1"
            vCount = vRowcount
            if (cInt(vRowCount) < 1) THEN
                  strSQL2 = "SELECT CATEGORY_NAME FROM EPM_CATEGORY"
            
                  Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
                  rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                  vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12'>"
            
                  Do While Not rstSQL2.EOF
       
                  vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("CATEGORY_NAME") & "'>" & rstSQL2.fields("CATEGORY_NAME") & "</OPTION>"
                  rstSQL2.MoveNext

                  Loop

                  vVal = vVal & "</SELECT>"
                  rstSQL2.Close
            else        
                  strSQL2 = "SELECT CATEGORY_NAME FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "'"
'Response.Write(strSQL2)
                  Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
                  rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                  vVal = vVal & "<INPUT TYPE=HIDDEN ID=txt1 NAME=txt1 VALUE='" & rstSQL2.fields("CATEGORY_NAME") & "'>" & rstSQL2.fields("CATEGORY_NAME")
                  rstSQL2.Close
            end if
            
            Response.Write(""">" & "Category Name" & "<INPUT nowrap TYPE=hidden ID=" &vName & " VALUE=""" & vVal & """></TD>"  & vbcrlf)
         
            Response.Write("<TD bordercolor=cornsilk style='font-weight:bold'>")
                        Response.Write("Color<INPUT nowrap TYPE=hidden ID=sel2b value= ""<TABLE border=0>")
                        Response.Write("<TR>")
                        Response.Write("<TD>SFTY</TD>")
                        Response.Write("<TD>")

            strSQL2 = "SELECT  1 AS csort, 'Green' AS color FROM dual UNION " &_
                        "SELECT  2 AS csort, 'White' AS color FROM dual UNION " &_
                        "SELECT  3 AS csort, 'Yellow' AS color FROM dual UNION " &_
                        "SELECT  4 AS csort, 'Red' AS color FROM dual"
            
            Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
            rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

        vName = "sel2"
        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' onchange='chngColor(this)'>"

        Do While Not rstSQL2.EOF
       
        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "'>" & rstSQL2.fields("color") & "</OPTION>"
        rstSQL2.MoveNext

        Loop

        vVal = vVal & "</SELECT>"
        rstSQL2.Close

            Response.Write(vVal & "</TD></TR>")
                        Response.Write("<TR>")
                        Response.Write("<TD>Q</TD>")
                        Response.Write("<TD>")

            Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
            rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

        vName = "sel4"
        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' onchange='chngColor(this)'>"

        Do While Not rstSQL2.EOF
       
        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "'>" & rstSQL2.fields("color") & "</OPTION>"
        rstSQL2.MoveNext

        Loop

        vVal = vVal & "</SELECT>"
        rstSQL2.Close


            Response.Write(vVal & "</TD></TR>")
                        Response.Write("<TR>")
                        Response.Write("<TD>SCP</TD>")
                        Response.Write("<TD>")

            Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
            rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

        vName = "sel5"
        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' onchange='chngColor(this)'>"

        Do While Not rstSQL2.EOF
       
        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "'>" & rstSQL2.fields("color") & "</OPTION>"
        rstSQL2.MoveNext

        Loop

        vVal = vVal & "</SELECT>"
        rstSQL2.Close


            Response.Write(vVal & "</TD></TR>")
                        Response.Write("<TR>")
                        Response.Write("<TD>SCH</TD>")
                        Response.Write("<TD>")

            Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
            rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

        vName = "sel6"
        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' onchange='chngColor(this)'>"

        Do While Not rstSQL2.EOF
       
        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "'>" & rstSQL2.fields("color") & "</OPTION>"
        rstSQL2.MoveNext

        Loop

        vVal = vVal & "</SELECT>"
        rstSQL2.Close


            Response.Write(vVal & "</TD></TR>")
                        Response.Write("<TR>")
                        Response.Write("<TD>$</TD>")
                        Response.Write("<TD>")

            Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
            rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

        vName = "sel7"
        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' onchange='chngColor(this)'>"

        Do While Not rstSQL2.EOF
       
        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "'>" & rstSQL2.fields("color") & "</OPTION>"
        rstSQL2.MoveNext

        Loop

        vVal = vVal & "</SELECT>"
        rstSQL2.Close

            Response.Write(vVal & "</TD></TR>")
                        Response.Write("<TR>")
                        Response.Write("<TD colspan=2 align=center>")

            Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
            rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

        vName = "sel8"
        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' disabled >"

        Do While Not rstSQL2.EOF
       
        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "'>" & rstSQL2.fields("color") & "</OPTION>"
        rstSQL2.MoveNext

        Loop

        vVal = vVal & "</SELECT>"
        rstSQL2.Close

            Response.Write(vVal & "</TD></TR></TABLE>""></TD>"  & vbcrlf)

            Response.Write("<TD bordercolor=cornsilk style='font-weight:bold'")

            strSQL2 = "SELECT 'Y' AS TOP FROM dual UNION SELECT 'N' AS TOP FROM dual"
            
            Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
            rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

        vName = "sel" & "3"
        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' onchange=''>"

        Do While Not rstSQL2.EOF
       
            vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("TOP") & "'>" & rstSQL2.fields("TOP") & "</OPTION>"
        rstSQL2.MoveNext

        Loop

        vVal = vVal & "</SELECT>"
        rstSQL2.Close

            Response.Write(""">" & "Assign Top 10" & "<INPUT nowrap TYPE=hidden ID=" & vName & " VALUE=""" & vVal & """></TD>"  & vbcrlf)

            Response.Write("<TD bordercolor=cornsilk style='font-weight:bold'")

            strSQL2 = "SELECT 1, MAJOR_RISK_TEXT_1 TEXT FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "'AND MONTH_DATE= (select max(month_date) from epm_oversight_monthly WHERE EFFORT_ID = '" & Session("effortId") & "')" _
                        & " UNION SELECT 2, MAJOR_RISK_TEXT_2 TEXT FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "' AND MONTH_DATE= (select max(month_date) from epm_oversight_monthly WHERE EFFORT_ID = '" & Session("effortId") & "')" _
                        & " UNION SELECT 3, MAJOR_RISK_TEXT_3 TEXT FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "' AND MONTH_DATE= (select max(month_date) from epm_oversight_monthly WHERE EFFORT_ID = '" & Session("effortId") & "')" _
                        & " ORDER BY 1"
                        
            Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
            rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

            'Response.Write(strSQL2)
            vCtr = 3
            vritr = 1
            vVal = "<TABLE style='font-size:12'>"
            iVal = ""
        Do While Not rstSQL2.EOF
            
                  if isNull(rstSQL2("TEXT")) then
                  vValue = rstSQL2("TEXT")
                  else
                   vValue = replace(rstSQL2("TEXT"), """", "&quot;")
                  end if
          if (LEN(rstSQL2("TEXT")) < 15) then
          vRisk = rstSQL2("TEXT")
          else
          vRisk = MID(rstSQL2("TEXT"), 1, 15) & "..."
          end if

            vName = "txt" & vCtr
            iVal = iVal & "<TR><TD>" & vritr & ".)</TD><TD TITLE='" & vValue & "' onclick='textEdit()'><INPUT TYPE=HIDDEN SIZE=60 ID=" & vName & " NAME=" & vName & " TITLE='" & vValue & "' VALUE='" & vValue & "'>" & vRisk & "</TD></TR>"
            vCtr = vCtr + 1
            vritr = vritr + 1
            rstSQL2.MoveNext

        Loop
            
            if (iVal = "") then
                  for i=1 to 3
                  vName = "txt" & vCtr
                  iVal = iVal & "<TR><TD>" & i & ".)</TD><TD onclick='textEdit()'><INPUT TYPE=HIDDEN size=60 ID=" & vName & " NAME=" & vName & " TITLE='' VALUE=''>...</TD></TR>"
                  vCtr = vCtr + 1
                  next
            end if

        vVal = vVal & iVal & "</TABLE>"
        rstSQL2.close
       
            Response.Write(""">" & "Major Risks" & "<INPUT nowrap TYPE=hidden ID=txt3 VALUE=""" & vVal & """></TD>"  & vbcrlf)


            Response.Write("<TD bordercolor=cornsilk style='font-weight:bold'")

            strSQL2 = "SELECT 1, UPCOMING_DELIVERABLE_1, UPCOMING_DELIVERABLE_DATE_1 FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "' AND MONTH_DATE=(select max(month_date) from epm_oversight_monthly WHERE EFFORT_ID = '" & Session("effortId") & "')" _
                        & " UNION SELECT 2, UPCOMING_DELIVERABLE_2, UPCOMING_DELIVERABLE_DATE_2 FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "' AND MONTH_DATE=(select max(month_date) from epm_oversight_monthly WHERE EFFORT_ID = '" & Session("effortId") & "')" _
                        & " UNION SELECT 3, UPCOMING_DELIVERABLE_3, UPCOMING_DELIVERABLE_DATE_3 FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "' AND MONTH_DATE=(select max(month_date) from epm_oversight_monthly WHERE EFFORT_ID = '" & Session("effortId") & "')" _
                        & " UNION SELECT 4, UPCOMMING_DELIVERABLES_TEXT4, UPCOMMING_DELIVERABLES_DATE4 FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "' AND MONTH_DATE=(select max(month_date) from epm_oversight_monthly WHERE EFFORT_ID = '" & Session("effortId") & "')" _
                        & " UNION SELECT 5, UPCOMMING_DELIVERABLES_TEXT5, UPCOMMING_DELIVERABLES_DATE5 FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "' AND MONTH_DATE=(select max(month_date) from epm_oversight_monthly WHERE EFFORT_ID = '" & Session("effortId") & "')" _
                        & " UNION SELECT 6, UPCOMMING_DELIVERABLES_TEXT6, UPCOMMING_DELIVERABLES_DATE6 FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "' AND MONTH_DATE=(select max(month_date) from epm_oversight_monthly WHERE EFFORT_ID = '" & Session("effortId") & "')" _
                        & " ORDER BY 1"

            Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
            rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

            'Response.Write(strSQL2)
            vCtr = 6
            vditr = 12
            vritr = 1
            vVal = "<TABLE style='font-size:12'>"
            iVal = ""

        Do While Not rstSQL2.EOF
                  if isNull(rstSQL2.fields("UPCOMING_DELIVERABLE_1")) then
                  vValue = Server.HTMLEncode(rstSQL2.fields("UPCOMING_DELIVERABLE_1"))
                  else
                  vValue = replace(Server.HTMLEncode(rstSQL2.fields("UPCOMING_DELIVERABLE_1")), "'", "&#39;")
                  end if
                  vName = "txt" & vCtr
                  vdName = "txt" & vditr

                      if (LEN(rstSQL2("UPCOMING_DELIVERABLE_1")) < 15) then
                            vTitle = rstSQL2("UPCOMING_DELIVERABLE_1")
                    else
                            vTitle = MID(rstSQL2("UPCOMING_DELIVERABLE_1"), 1, 15) & "..."
                    end if

                      if (LEN(rstSQL2("UPCOMING_DELIVERABLE_DATE_1")) < 15) then
                            vDateTitle = rstSQL2("UPCOMING_DELIVERABLE_DATE_1")
                    else
                            vDateTitle = MID(rstSQL2("UPCOMING_DELIVERABLE_DATE_1"), 1, 15) & "..."
                    end if

                  iVal = iVal & "<TR>"
                  iVal = iVal & "<TD>" & vritr & ").</TD>"
                  iVal = iVal & "<TD onclick='textEdit()' TITLE='" & vValue & "'><INPUT TYPE=HIDDEN size=50 ID=" & vName & " NAME=" & vName & " VALUE='" & vValue & "'>" & vTitle  & "</TD>"
                  iVal = iVal & "<TD onclick='textEdit2()' TITLE='" & rstSQL2("UPCOMING_DELIVERABLE_DATE_1") & "'><INPUT TYPE=HIDDEN ID=" & vdName & " NAME=" & vdName & " TITLE='" & rstSQL2.fields("UPCOMING_DELIVERABLE_DATE_1") & "' VALUE='" & rstSQL2.fields("UPCOMING_DELIVERABLE_DATE_1") & "'>" & vDateTitle  & "</TD>"
                  iVal = iVal & "</TR>"
                  vCtr = vCtr + 1
                  vditr = vditr + 1
                  vritr = vritr + 1
                  rstSQL2.MoveNext

        Loop
            
            if (iVal = "") Then
                  for i=1 to 6
                        vName = "txt" & vCtr
                        vdName = "txt" & vditr
                        iVal = iVal & "<TR>"
                        iVal = iVal & "<TD>" & i & ").</TD>"
                        iVal = iVal & "<TD onclick='textEdit()'><INPUT TYPE=HIDDEN size=50 ID=" & vName & " NAME=" & vName & " TITLE='' VALUE=''>...</TD>"
                        iVal = iVal & "<TD onclick='textEdit2()'><INPUT TYPE=HIDDEN ID=" & vdName & " NAME=" & vdName & " TITLE='' VALUE=''>...</TD>"
                        iVal = iVal & "</TR>"
                        vCtr = vCtr + 1
                        vditr = vditr + 1
                  next
            end if            

        vVal = vVal & iVal & "</TABLE>"
        rstSQL2.close

            Response.Write(""">" & "Upcoming Deliverables/Dates" & "<INPUT nowrap TYPE=hidden ID=txt6 VALUE=""" & vVal & """></TD>"  & vbcrlf)

            Response.Write("<TD nowrap bordercolor=cornsilk style='font-weight:bold'")
            strSQL2 = "SELECT STATUS_PROGRESS, ACTIONS_TO_ADDRESS FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "' AND MONTH_DATE=(select max(month_date) from epm_oversight_monthly WHERE EFFORT_ID = '" & Session("effortId") & "')"

            
            Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
            rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText


        vVal=""

        Do while Not rstSQL2.EOF



          if (LEN(rstSQL2("STATUS_PROGRESS")) < 15) then
          vTitle1 = rstSQL2("STATUS_PROGRESS")
          else
          vTitle1 = MID(rstSQL2("STATUS_PROGRESS"), 1, 15) & "..."
          end if
         
          if (LEN(rstSQL2("STATUS_PROGRESS")) > 0) then      
                  vValue1= REPLACE(rstSQL2("STATUS_PROGRESS"), "'", "&#39;")
              else
                vValue1 = ""
          end if

          if (LEN(rstSQL2("ACTIONS_TO_ADDRESS")) < 15) then
          vTitle2 = rstSQL2("ACTIONS_TO_ADDRESS")
          else
          vTitle2 = MID(rstSQL2("ACTIONS_TO_ADDRESS"), 1, 15) & "..."
          end if
         
          if (LEN(rstSQL2("ACTIONS_TO_ADDRESS")) > 0) then      
                  vValue2 = REPLACE(rstSQL2("ACTIONS_TO_ADDRESS"), "'", "&#39;")
              else
                vValue2 = ""
          end if


              vVal= "<TABLE><TR><TD bordercolor=cornsilk title='" & vValue1 & "' onclick='textEdit()'><INPUT TYPE=HIDDEN size=500 ID=txt18 NAME=txt18 VALUE='" & vValue1 & "' >" & vTitle1 & "</TD></TR>" & _
                    "<TR><TD bordercolor=cornsilk  title='" & vValue2 & "' onclick='textEdit()'><INPUT TYPE=HIDDEN size=500 ID=txt19 NAME=txt19 VALUE='" & vValue2 & "' >" & vTitle2 & "</TD></TR></TABLE></TD>"

            rstSQL2.MoveNext

        loop
        rstSQL2.close
       
        if (vVal = "") then
                  vVal = "<TABLE><TR><TD bordercolor=cornsilk onclick='textEdit()'><INPUT TYPE=HIDDEN size=500 ID=txt18 NAME=txt18>...</TD></TR><TR><TD bordercolor=cornsilk onclick='textEdit()'><INPUT TYPE=HIDDEN size=500 ID=txt19 NAME=txt19>...</TD></TR></TABLE></TD>"
        end if

       
            Response.Write(""">" & "Status Progress" & "<INPUT nowrap TYPE=hidden ID=" & vName & " VALUE=""" & vVal & """></TD>"  & vbcrlf)
            
            Response.Write("<TD bordercolor=cornsilk style='font-weight:bold'")
            strSQL2 = "SELECT EXECUTIVE_SUMMARY, MAJOR_ISSUES FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "' AND MONTH_DATE=(select max(month_date) from epm_oversight_monthly WHERE EFFORT_ID = '" & Session("effortId") & "')"

            
            Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
            rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText


        vVal=""

        Do while Not rstSQL2.EOF



          if (LEN(rstSQL2("MAJOR_ISSUES")) < 15) then
          vTitle1 = rstSQL2("MAJOR_ISSUES")
          else
          vTitle1 = MID(rstSQL2("MAJOR_ISSUES"), 1, 15) & "..."
          end if
         
          if (LEN(rstSQL2("MAJOR_ISSUES")) > 0) then      
                  vValue1= REPLACE(rstSQL2("MAJOR_ISSUES"), "'", "&#39;")
              else
                vValue1 = ""
          end if

          if (LEN(rstSQL2("EXECUTIVE_SUMMARY")) < 15) then
          vTitle2 = rstSQL2("EXECUTIVE_SUMMARY")
          else
          vTitle2 = MID(rstSQL2("EXECUTIVE_SUMMARY"), 1, 15) & "..."
          end if
          if (LEN(rstSQL2("EXECUTIVE_SUMMARY")) > 0) then      
                  vValue2 = REPLACE(rstSQL2("EXECUTIVE_SUMMARY"), "'", "&#39;")
              else
                vValue2 = ""
          end if


              vVal= "<TABLE><TR><TD bordercolor=cornsilk title='" & vValue1 & "' onclick='textEdit()'><INPUT TYPE=HIDDEN size=500 ID=txt20 NAME=txt20 VALUE='" & vValue1 & "' >" & vTitle1 & "</TD></TR>" & _
                    "<TR><TD bordercolor=cornsilk  title='" & vValue2 & "' onclick='textEdit()'><INPUT TYPE=HIDDEN size=500 ID=txt21 NAME=txt21 VALUE='" & vValue2 & "' >" & vTitle2 & "</TD></TR></TABLE></TD>"

            rstSQL2.MoveNext

        loop
        rstSQL2.close
       
        if (vVal = "") then
                  vVal = "<TABLE><TR><TD bordercolor=cornsilk onclick='textEdit()'><INPUT TYPE=HIDDEN size=500 ID=txt20 NAME=txt20>...</TD></TR><TR><TD bordercolor=cornsilk onclick='textEdit()'><INPUT TYPE=HIDDEN size=500 ID=txt21 NAME=txt21>...</TD></TR></TABLE></TD>"
        end if

       
            Response.Write(""">" & "Status Progress" & "<INPUT nowrap TYPE=hidden ID=" & vName & " VALUE=""" & vVal & """></TD>"  & vbcrlf)
            


  Response.Write("<TD bordercolor=cornsilk style='font-weight:bold' onclick='textEdit2()'><INPUT nowrap TYPE=hidden ID=txt22 VALUE=""<TABLE><TR><TD onclick='textEdit2()'><INPUT TYPE=HIDDEN ID=txt22 NAME=txt22 >...</TD></TR>""</TD>" & vblfcr)

  vVal = "<SELECT NAME='iFinal' style='font-size:12' onchange='aVal=true'><OPTION VALUE='N'>No</OPTION><OPTION VALUE='Y'>Finalize!</OPTION></SELECT>"  

  Response.Write("<TD bordercolor=cornsilk style='font-weight:bold' title=""Select Finalize! and save to lock values""><INPUT TYPE=hidden ID=iFinal VALUE=""" & vVal & """>Final</TD>" & vblfcr)
 
Response.Write("</TR>" & vbcrlf)

            strSQL = "SELECT COLOR, COLOR_SAFETY, COLOR_QUALITY, COLOR_SCOPE, COLOR_SCHEDULE, COLOR_BUDGET, CATEGORY_NAME, MAJOR_RISK_TEXT_1, MAJOR_RISK_TEXT_2, MAJOR_RISK_TEXT_3, " _
                        & "UPCOMING_DELIVERABLE_1, UPCOMING_DELIVERABLE_2, UPCOMING_DELIVERABLE_3, " _
                        & "UPCOMMING_DELIVERABLES_TEXT4, UPCOMMING_DELIVERABLES_TEXT5, UPCOMMING_DELIVERABLES_TEXT6, " _
                        & "UPCOMING_DELIVERABLE_DATE_1, UPCOMING_DELIVERABLE_DATE_2, UPCOMING_DELIVERABLE_DATE_3, " _
                        & "UPCOMMING_DELIVERABLES_DATE4, UPCOMMING_DELIVERABLES_DATE5, UPCOMMING_DELIVERABLES_DATE6, " _
                        & "TOP_10, MONTH_DATE, STATUS_PROGRESS, MAJOR_ISSUES, FINAL, LAST_SPONSOR_UPDATE, ACTIONS_TO_ADDRESS, EXECUTIVE_SUMMARY" _
                        & " FROM EPM_OVERSIGHT_MONTHLY WHERE EFFORT_ID = '" & Session("effortId") & "'" _
                        & " ORDER BY MONTH_DATE"
'Response.Write(strSQL)
            Set rstSQL = Server.CreateObject("ADODB.Recordset")
            rstSQL.Open strSQL, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

        vFirst=TRUE
       
        Do While Not rstSQL.EOF
          IF (vLastStatusDate <> rstSQL.fields("MONTH_DATE")) THEN
            IF (vFirst = FALSE) THEN
              IF (vFinal = "Y") THEN
                IF Request.QueryString("iUserType") = "ADMIN" THEN
                 Response.Write("<TD borderColor='red'><INPUT TYPE=HIDDEN NAME='iFinal' VALUE='Y'><span onclick=""doUnFinal('" & vLastStatusDate & "')"">YES</span></TD></TR>")
                ELSE
                  Response.Write("<Td borderColor='red'><INPUT TYPE=HIDDEN NAME='iFinal' VALUE='Y'>YES</TD></TR>")
                END IF
              ELSE
                Response.Write("<TD><SELECT NAME='iFinal' onchange=""aVal=true"" style=""font-size:12""><OPTION VALUE='N'>No</OPTION><OPTION VALUE='Y'>Finalize!</OPTION></SELECT></TD></TR>")        
              END IF
            END IF
            Response.Write("<TR><TD><INPUT TYPE=HIDDEN nowrap ID=iStatusDate NAME=iStatusDate VALUE='" & Check2Year(rstSQL.fields("MONTH_DATE")) & "'> " & Year(rstSQL.fields("MONTH_DATE")) & "-" & MonthName(Month(rstSQL.fields("MONTH_DATE")),3) & "</TD>")
            vFirst=FALSE
          END IF
          vFinal = rstSQL.fields("FINAL")
          IF (vFinal="Y") THEN
             Response.Write("<TD borderColor='red'><INPUT TYPE=HIDDEN ID=txt1 NAME=txt1 VALUE='" & rstSQL.fields("CATEGORY_NAME")& "'>" & rstSQL.fields("CATEGORY_NAME") & "</TD>" & vbcrlf)
          ELSE
             Response.Write("<TD ><INPUT TYPE=HIDDEN ID=txt1 NAME=txt1 VALUE='" & rstSQL.fields("CATEGORY_NAME")& "'>" & rstSQL.fields("CATEGORY_NAME") & "</TD>" & vbcrlf)
          END IF
          IF (vFinal="Y") THEN
             Response.Write("<TD borderColor='red'>")
                        Response.Write("<TABLE border=0>")
                        Response.Write("<TR>")
                        Response.Write("<TD>SFTY</TD>")
                        Response.Write("<TD>")
             strSQL2 = "SELECT 1 AS csort, 'Green' AS color FROM dual UNION " &_
                        "SELECT  2 AS csort, 'White' AS color FROM dual UNION " &_
                        "SELECT  3 AS csort, 'Yellow' AS color FROM dual UNION " &_
                        "SELECT  4 AS csort, 'Red' AS color FROM dual"
            
                        Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
                        rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                        vName = "sel" & "2"
                        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12;' disabled>"

                        Do While Not rstSQL2.EOF
                        
                        if rstSQL("COLOR_SAFETY") = rstSQL2("COLOR") then
                              vSelect = " Selected "
                        else
                              vSelect = ""
                        end if
       
                        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "'" & vSelect & ">" & rstSQL2.fields("color") & "</OPTION>"
                        rstSQL2.MoveNext

                        Loop

                        vVal = vVal & "</SELECT>"
                        rstSQL2.Close

                        Response.Write(vVal)
                        Response.Write("</TD></TR><TR>")
                        Response.Write("<TD>Q</TD>")
                        Response.Write("<TD>")


                        rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                        vName = "sel" & "4"
                        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12;' disabled>"

                        Do While Not rstSQL2.EOF
                        
                        if rstSQL("COLOR_QUALITY") = rstSQL2("COLOR") then
                              vSelect = " Selected "
                        else
                              vSelect = ""
                        end if
       
                        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "'" & vSelect & ">" & rstSQL2.fields("color") & "</OPTION>"
                        rstSQL2.MoveNext

                        Loop

                        vVal = vVal & "</SELECT>"
                        rstSQL2.Close

                        Response.Write(vVal)
                        Response.Write("</TD></TR><TR>")
                        Response.Write("<TD>SCP</TD>")
                        Response.Write("<TD>")


                        rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                        vName = "sel" & "5"
                        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12;' disabled>"

                        Do While Not rstSQL2.EOF
                        
                        if rstSQL("COLOR_SCOPE") = rstSQL2("COLOR") then
                              vSelect = " Selected "
                        else
                              vSelect = ""
                        end if
       
                        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "'" & vSelect & ">" & rstSQL2.fields("color") & "</OPTION>"
                        rstSQL2.MoveNext

                        Loop

                        vVal = vVal & "</SELECT>"
                        rstSQL2.Close

                        Response.Write(vVal)
                        Response.Write("</TD></TR><TR>")
                        Response.Write("<TD>SCH</TD>")
                        Response.Write("<TD>")


                        rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                        vName = "sel" & "6"
                        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12;' disabled>"

                        Do While Not rstSQL2.EOF
                        
                        if rstSQL("COLOR_SCHEDULE") = rstSQL2("COLOR") then
                              vSelect = " Selected "
                        else
                              vSelect = ""
                        end if
       
                        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "'" & vSelect & ">" & rstSQL2.fields("color") & "</OPTION>"
                        rstSQL2.MoveNext

                        Loop

                        vVal = vVal & "</SELECT>"
                        rstSQL2.Close
                        Response.Write(vVal)
                        Response.Write("</TD></TR><TR>")
                        Response.Write("<TD>$</TD>")
                        Response.Write("<TD>")

                        rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                        vName = "sel" & "7"
                        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12;' disabled>"

                        Do While Not rstSQL2.EOF
                        
                        if rstSQL("COLOR_BUDGET") = rstSQL2("COLOR") then
                              vSelect = " Selected "
                        else
                              vSelect = ""
                        end if
       
                        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "'" & vSelect & ">" & rstSQL2.fields("color") & "</OPTION>"
                        rstSQL2.MoveNext

                        Loop

                        vVal = vVal & "</SELECT>"
                        rstSQL2.Close

                        Response.Write(vVal & "</TD></TR>" & vbcrlf)

                        Response.Write("<TR>")
                        Response.Write("<TD colspan=2 align=center>")

                        rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                        vName = "sel" & "8"
                        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12;' disabled>"

                        Do While Not rstSQL2.EOF
                        
                        if rstSQL("COLOR") = rstSQL2("COLOR") then
                              vSelect = " Selected "
                        else
                              vSelect = ""
                        end if
       
                        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "'" & vSelect & ">" & rstSQL2.fields("color") & "</OPTION>"
                        rstSQL2.MoveNext

                        Loop

                        vVal = vVal & "</SELECT>"
                        rstSQL2.Close
                        Response.Write(vVal)


                        Response.Write("</TD></TR></TABLE></TD>" & vbcrlf)
          ELSE
                        Response.Write("<TD>")
                        Response.Write("<TABLE border=0>")
                        Response.Write("<TR>")
                        Response.Write("<TD>SFTY</TD>")
                        Response.Write("<TD>")

                   strSQL2 = "SELECT 1 AS csort, 'Green' AS color FROM dual UNION " &_
                        "SELECT  2 AS csort, 'White' AS color FROM dual UNION " &_
                        "SELECT  3 AS csort, 'Yellow' AS color FROM dual UNION " &_
                        "SELECT  4 AS csort, 'Red' AS color FROM dual"
            
                        Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
                        rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                        vName = "sel" & "2"
                        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' onchange='chngColor(this)'>"

                        Do While Not rstSQL2.EOF
       
                        if (rstSQL("COLOR_SAFETY") = rstSQL2("COLOR")) then
                        vSelect = " Selected "
                        else
                        vSelect = ""
                        end if

                        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "' " & vSelect & ">" & rstSQL2.fields("color") & "</OPTION>"
                        rstSQL2.MoveNext

                        Loop

                        vVal = vVal & "</SELECT>"
                        rstSQL2.Close
                        Response.Write(vVal & "</TD></TR>" & vbcrlf)

                        Response.Write("<TR>")
                        Response.Write("<TD>Q</TD>")
                        Response.Write("<TD>")

                        rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                        vName = "sel" & "4"
                        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' onchange='chngColor(this)'>"

                        Do While Not rstSQL2.EOF
       
                        if (rstSQL("COLOR_QUALITY") = rstSQL2("COLOR")) then
                        vSelect = " Selected "
                        else
                        vSelect = ""
                        end if

                        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "' " & vSelect & ">" & rstSQL2.fields("color") & "</OPTION>"
                        rstSQL2.MoveNext

                        Loop

                        vVal = vVal & "</SELECT>"
                        rstSQL2.Close
                        Response.Write(vVal & "</TD></TR>" & vbcrlf)

                        Response.Write("<TR>")
                        Response.Write("<TD>SCP</TD>")
                        Response.Write("<TD>")

                        rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                        vName = "sel" & "5"
                        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' onchange='chngColor(this)'>"

                        Do While Not rstSQL2.EOF
       
                        if (rstSQL("COLOR_SCOPE") = rstSQL2("COLOR")) then
                        vSelect = " Selected "
                        else
                        vSelect = ""
                        end if

                        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "' " & vSelect & ">" & rstSQL2.fields("color") & "</OPTION>"
                        rstSQL2.MoveNext

                        Loop

                        vVal = vVal & "</SELECT>"
                        rstSQL2.Close
                        Response.Write(vVal & "</TD></TR>" & vbcrlf)

                        Response.Write("<TR>")
                        Response.Write("<TD>SCH</TD>")
                        Response.Write("<TD>")

                        rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                        vName = "sel" & "6"
                        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' onchange='chngColor(this)'>"

                        Do While Not rstSQL2.EOF
       
                        if (rstSQL("COLOR_SCHEDULE") = rstSQL2("COLOR")) then
                        vSelect = " Selected "
                        else
                        vSelect = ""
                        end if

                        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "' " & vSelect & ">" & rstSQL2.fields("color") & "</OPTION>"
                        rstSQL2.MoveNext

                        Loop

                        vVal = vVal & "</SELECT>"
                        rstSQL2.Close
                        Response.Write(vVal & "</TD></TR>" & vbcrlf)

                        Response.Write("<TR>")
                        Response.Write("<TD>$</TD>")
                        Response.Write("<TD>")

                        rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                        vName = "sel" & "7"
                        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' onchange='chngColor(this)'>"

                        Do While Not rstSQL2.EOF
       
                        if (rstSQL("COLOR_BUDGET") = rstSQL2("COLOR")) then
                        vSelect = " Selected "
                        else
                        vSelect = ""
                        end if

                        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "' " & vSelect & ">" & rstSQL2.fields("color") & "</OPTION>"
                        rstSQL2.MoveNext

                        Loop

                        vVal = vVal & "</SELECT>"
                        rstSQL2.Close

                        Response.Write(vVal & "</TD></TR>" & vbcrlf)

                        Response.Write("<TR>")
                        Response.Write("<TD colspan=2 align=center>")

                        rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                        vName = "sel" & "8"
                        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' disabled>"

                        Do While Not rstSQL2.EOF
       
                        if (rstSQL("COLOR") = rstSQL2("COLOR")) then
                        vSelect = " Selected "
                        else
                        vSelect = ""
                        end if

                        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("color") & "' " & vSelect & ">" & rstSQL2.fields("color") & "</OPTION>"
                        rstSQL2.MoveNext

                        Loop

                        vVal = vVal & "</SELECT>"
                        rstSQL2.Close
                  Response.Write(vVal & "</TD></TR>" & vbcrlf)



                        Response.Write("</TABLE></TD>" & vbcrlf)          END IF
          IF (vFinal="Y") THEN
             Response.Write("<TD borderColor='red'>")
                        strSQL2 = "SELECT 'Y' AS TOP FROM dual UNION SELECT 'N' AS TOP FROM dual"
            
                        Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
                        rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                        vName = "sel" & "3"
                        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' disabled>"

                        Do While Not rstSQL2.EOF
       
                        if (rstSQL("TOP_10") = rstSQL2("TOP")) then
                        vSelect = " Selected "
                        else
                        vSelect = ""
                        end if

                        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("TOP") & "' " & vSelect & ">" & rstSQL2.fields("TOP") & "</OPTION>"
                        rstSQL2.MoveNext

                        Loop

                        vVal = vVal & "</SELECT>"
                        rstSQL2.Close

             Response.Write(vVal & "</TD>" & vbcrlf)
          ELSE
                        Response.Write("<TD>")

                        strSQL2 = "SELECT 'Y' AS TOP FROM dual UNION SELECT 'N' AS TOP FROM dual"
            
                        Set rstSQL2 = Server.CreateObject("ADODB.Recordset")
                        rstSQL2.Open strSQL2, connectString, adOpenForwardOnly, adLockReadOnly, adCmdText

                        vName = "sel" & "3"
                        vVal = "<SELECT ID=" & vName & " " & " NAME=" & vName & " style='font-size:12' onchange=''>"

                        Do While Not rstSQL2.EOF
       
                        if (rstSQL("TOP_10") = rstSQL2("TOP")) then
                        vSelect = " Selected "
                        else
                        vSelect = ""
                        end if

                        vVal = vVal & "<OPTION VALUE='" & rstSQL2.fields("TOP") & "' " & vSelect & ">" & rstSQL2.fields("TOP") & "</OPTION>"
                        rstSQL2.MoveNext

                        Loop

                        vVal = vVal & "</SELECT>"
                        rstSQL2.Close

             Response.Write(vVal & "</TD>" & vbcrlf)
          END IF

          dim vRisk1, vRisk2, vRisk3
          if (LEN(rstSQL("MAJOR_RISK_TEXT_1")) < 15) then
          vRisk1 = rstSQL("MAJOR_RISK_TEXT_1")
          else
          vRisk1 = MID(rstSQL("MAJOR_RISK_TEXT_1"), 1, 15) & "..."
          end if
          if (LEN(rstSQL("MAJOR_RISK_TEXT_2")) < 15) then
          vRisk2 = rstSQL("MAJOR_RISK_TEXT_2")
          else
          vRisk2 = MID(rstSQL("MAJOR_RISK_TEXT_2"), 1, 15) & "..."
          end if
          if (LEN(rstSQL("MAJOR_RISK_TEXT_3")) < 15) then
          vRisk3 = rstSQL("MAJOR_RISK_TEXT_3")
          else
          vRisk3 = MID(rstSQL("MAJOR_RISK_TEXT_3"), 1, 15) & "..."
          end if
          if (LEN(rstSQL("MAJOR_RISK_TEXT_1")) > 0) then      
                  vVal1 = REPLACE(rstSQL("MAJOR_RISK_TEXT_1"), "'", "&#39;")
              else
                vVal1 = ""
          end if
          if (LEN(rstSQL("MAJOR_RISK_TEXT_2")) > 0) then      
                  vVal2 = REPLACE(rstSQL("MAJOR_RISK_TEXT_2"), "'", "&#39;")
              else
                vVal2 = ""
          end if
          if (LEN(rstSQL("MAJOR_RISK_TEXT_3")) > 0) then      
                  vVal3 = REPLACE(rstSQL("MAJOR_RISK_TEXT_3"), "'", "&#39;")
              else
                vVal3 = ""
          end if
          IF (vFinal="Y") THEN
             Response.Write("<TD borderColor='red'><TABLE style='font-size:12'><TR><TD>1).</TD><TD nowrap><INPUT TYPE=HIDDEN size=60 ID=txt3 NAME=txt3 VALUE='" & vVal1 & "'>" & vRisk1 & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD>2).</TD><TD nowrap><INPUT TYPE=HIDDEN size=60 ID=txt4 NAME=txt4 VALUE='" & vVal2 & "'>" & vRisk2 & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD>3).</TD><TD nowrap><INPUT TYPE=HIDDEN size=60 ID=txt5 NAME=txt5 VALUE='" & vVal3 & "'>" & vRisk3 & "</TD></TR>" & vbcrlf)
             Response.Write("</TABLE></TD>" & vbcrlf)
          ELSE
             Response.Write("<TD >")
             Response.Write("<TABLE style='font-size:12'><TR>")
             Response.Write("<TD>1).</TD><TD onclick=""textEdit()"" title='" & vVal1 & "' nowrap><INPUT TYPE=HIDDEN size=60 ID=txt3 NAME=txt3 VALUE='" & vVal1 & "'>" & vRisk1 & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD>2).</TD><TD onclick=""textEdit()"" title='" & vVal2 & "' nowrap><INPUT TYPE=HIDDEN size=60 ID=txt4 NAME=txt4 VALUE='" & vVal2 & "'>" & vRisk2 & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD>3).</TD><TD onclick=""textEdit()"" title='" & vVal3 & "' nowrap><INPUT TYPE=HIDDEN size=60 ID=txt5 NAME=txt5 VALUE='" & vVal3 & "'>" & vRisk3 & "</TD></TR>" & vbcrlf)
             Response.Write("</TABLE></TD>" & vbcrlf)
          END IF

          dim vtext1, vtext2, vtext3, vtext4, vtext5, vtext6
          if (LEN(rstSQL("UPCOMING_DELIVERABLE_1")) < 15) then      
                vtext1 = rstSQL("UPCOMING_DELIVERABLE_1")
          else
                  vtext1 = MID(rstSQL("UPCOMING_DELIVERABLE_1"), 1, 15) & "..."
          end if
          if (LEN(rstSQL("UPCOMING_DELIVERABLE_2")) < 15) then
          vtext2 = rstSQL("UPCOMING_DELIVERABLE_2")
          else
          vtext2 = MID(rstSQL("UPCOMING_DELIVERABLE_2"), 1, 15) & "..."
          end if
          if (LEN(rstSQL("UPCOMING_DELIVERABLE_3")) < 15) then
          vtext3 = rstSQL("UPCOMING_DELIVERABLE_3")
          else
          vtext3 = MID(rstSQL("UPCOMING_DELIVERABLE_3"), 1, 15) & "..."
          end if

          if (LEN(rstSQL("UPCOMMING_DELIVERABLES_TEXT4")) < 15) then      
                vtext4 = rstSQL("UPCOMMING_DELIVERABLES_TEXT4")
          else
                  vtext4 = MID(rstSQL("UPCOMMING_DELIVERABLES_TEXT4"), 1, 15) & "..."
          end if
          if (LEN(rstSQL("UPCOMMING_DELIVERABLES_TEXT5")) < 15) then
          vtext5 = rstSQL("UPCOMMING_DELIVERABLES_TEXT5")
          else
          vtext5 = MID(rstSQL("UPCOMMING_DELIVERABLES_TEXT5"), 1, 15) & "..."
          end if
          if (LEN(rstSQL("UPCOMMING_DELIVERABLES_TEXT6")) < 15) then
          vtext6 = rstSQL("UPCOMMING_DELIVERABLES_TEXT6")
          else
          vtext6 = MID(rstSQL("UPCOMMING_DELIVERABLES_TEXT6"), 1, 15) & "..."
          end if


          if (LEN(rstSQL("UPCOMING_DELIVERABLE_1")) > 0) then      
                  vVal1 = REPLACE(rstSQL("UPCOMING_DELIVERABLE_1"), "'", "&#39;")
              else
                vVal1 = ""
          end if
          if (LEN(rstSQL("UPCOMING_DELIVERABLE_2")) > 0) then      
                  vVal2 = REPLACE(rstSQL("UPCOMING_DELIVERABLE_2"), "'", "&#39;")
              else
                vVal2 = ""
          end if
          if (LEN(rstSQL("UPCOMING_DELIVERABLE_3")) > 0) then      
                  vVal3 = REPLACE(rstSQL("UPCOMING_DELIVERABLE_3"), "'", "&#39;")
              else
                vVal3 = ""
          end if
          if (LEN(rstSQL("UPCOMMING_DELIVERABLES_TEXT4")) > 0) then      
                  vVal4 = REPLACE(rstSQL("UPCOMMING_DELIVERABLES_TEXT4"), "'", "&#39;")
              else
                vVal4 = ""
          end if
          if (LEN(rstSQL("UPCOMMING_DELIVERABLES_TEXT5")) > 0) then      
                  vVal5 = REPLACE(rstSQL("UPCOMMING_DELIVERABLES_TEXT5"), "'", "&#39;")
              else
                vVal5 = ""
          end if
          if (LEN(rstSQL("UPCOMMING_DELIVERABLES_TEXT6")) > 0) then      
                  vVal6 = REPLACE(rstSQL("UPCOMMING_DELIVERABLES_TEXT6"), "'", "&#39;")
              else
                vVal6 = ""
          end if
         IF (vFinal="Y") THEN
             Response.Write("<TD borderColor='red'><TABLE style='font-size:12'><TR><TD>1).</TD><TD nowrap><INPUT TYPE=HIDDEN size=50 ID=txt6 NAME=txt6 VALUE='" & vVal1 & "'>" & vtext1 & "</TD>" & vbcrlf)
             Response.Write("<TD><INPUT TYPE=HIDDEN ID=txt12 NAME=txt12 VALUE='" & rstSQL.fields("UPCOMING_DELIVERABLE_DATE_1")& "'>" & MID(rstSQL.fields("UPCOMING_DELIVERABLE_DATE_1"), 1, 12) & "..." & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD>2).</TD><TD nowrap><INPUT TYPE=HIDDEN size=50 ID=txt7 NAME=txt7 VALUE='" & vVal2 & "'>" & vtext2 & "</TD>" & vbcrlf)
             Response.Write("<TD><INPUT TYPE=HIDDEN ID=txt13 NAME=txt13 VALUE='" & rstSQL.fields("UPCOMING_DELIVERABLE_DATE_2")& "'>" & MID(rstSQL.fields("UPCOMING_DELIVERABLE_DATE_2"), 1, 12) & "..." & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD>3).</TD><TD nowrap><INPUT TYPE=HIDDEN size=50 ID=txt8 NAME=txt8 VALUE='" & vVal3 & "'>" & vtext3 & "</TD>" & vbcrlf)
             Response.Write("<TD><INPUT TYPE=HIDDEN ID=txt14 NAME=txt14 VALUE='" & rstSQL.fields("UPCOMING_DELIVERABLE_DATE_3")& "'>" & MID(rstSQL.fields("UPCOMING_DELIVERABLE_DATE_3"), 1, 12) & "..." & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD>4).</TD><TD nowrap><INPUT TYPE=HIDDEN size=50 ID=txt9 NAME=txt9 VALUE='" & vVal4 & "'>" & vtext4 & "</TD>" & vbcrlf)
             Response.Write("<TD><INPUT TYPE=HIDDEN ID=txt15 NAME=txt15 VALUE='" & rstSQL.fields("UPCOMMING_DELIVERABLES_DATE4")& "'>" & MID(rstSQL.fields("UPCOMMING_DELIVERABLES_DATE4"), 1, 12) & "..." & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD>5).</TD><TD nowrap><INPUT TYPE=HIDDEN size=50 ID=txt10 NAME=txt10 VALUE='" & vVal5 & "'>" & vtext5 & "</TD>" & vbcrlf)
             Response.Write("<TD><INPUT TYPE=HIDDEN ID=txt16 NAME=txt16 VALUE='" & rstSQL.fields("UPCOMMING_DELIVERABLES_DATE5")& "'>" & MID(rstSQL.fields("UPCOMMING_DELIVERABLES_DATE5"), 1, 12) & "..." & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD>6).</TD><TD nowrap><INPUT TYPE=HIDDEN size=50 ID=txt11 NAME=txt11 VALUE='" & vVal6 & "'>" & vtext6 & "</TD>" & vbcrlf)
             Response.Write("<TD><INPUT TYPE=HIDDEN ID=txt17 NAME=txt17 VALUE='" & rstSQL.fields("UPCOMMING_DELIVERABLES_DATE6")& "'>" & MID(rstSQL.fields("UPCOMMING_DELIVERABLES_DATE6"), 1, 12) & "..." & "</TD></TR>" & vbcrlf)
             Response.Write("</TABLE></TD>" & vbcrlf)
          ELSE
             Response.Write("<TD>")
             Response.Write("<TABLE style='font-size:12'><TR>")
             Response.Write("<TD>1).</TD><TD onclick=""textEdit()"" title='" & Server.HTMLEncode(vVal1) & "' nowrap><INPUT TYPE=HIDDEN size=50 ID=txt6 NAME=txt6 VALUE='" & Server.HTMLEncode(vVal1) & "'>" & Server.HTMLEncode(vtext1) & "</TD>" & vbcrlf)
             Response.Write("<TD onclick=""textEdit2()"" title='" & rstSQL.fields("UPCOMING_DELIVERABLE_DATE_1") & "'><INPUT TYPE=HIDDEN ID=txt12 NAME=txt12 VALUE='" & rstSQL.fields("UPCOMING_DELIVERABLE_DATE_1")& "'>" & MID(rstSQL.fields("UPCOMING_DELIVERABLE_DATE_1"), 1, 12) & "..." & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD>2).</TD><TD onclick=""textEdit()"" title='" & vVal2 & "' nowrap><INPUT TYPE=HIDDEN size=50 ID=txt7 NAME=txt7 VALUE='" & vVal2 & "'>" & vtext2 & "</TD>" & vbcrlf)
             Response.Write("<TD onclick=""textEdit2()"" title='" & rstSQL.fields("UPCOMING_DELIVERABLE_DATE_2") & "'><INPUT TYPE=HIDDEN ID=txt13 NAME=txt13 VALUE='" & rstSQL.fields("UPCOMING_DELIVERABLE_DATE_2") & "'>" & MID(rstSQL.fields("UPCOMING_DELIVERABLE_DATE_2"), 1, 12) & "..." & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD>3).</TD><TD onclick=""textEdit()"" title='" & vVal3 & "' nowrap><INPUT TYPE=HIDDEN size=50 ID=txt8 NAME=txt8 VALUE='" & vVal3 & "'>" & vtext3 & "</TD>" & vbcrlf)
             Response.Write("<TD onclick=""textEdit2()"" title='" & rstSQL.fields("UPCOMING_DELIVERABLE_DATE_3") & "'><INPUT TYPE=HIDDEN ID=txt14 NAME=txt14 VALUE='" & rstSQL.fields("UPCOMING_DELIVERABLE_DATE_3") & "'>" & MID(rstSQL.fields("UPCOMING_DELIVERABLE_DATE_3"), 1, 12) & "..." & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD>4).</TD><TD onclick=""textEdit()"" title='" & vVal4 & "' nowrap><INPUT TYPE=HIDDEN size=50 ID=txt9 NAME=txt9 VALUE='" & vVal4 & "'>" & vtext4 & "</TD>" & vbcrlf)
             Response.Write("<TD onclick=""textEdit2()"" title='" & rstSQL.fields("UPCOMMING_DELIVERABLES_DATE4") & "'><INPUT TYPE=HIDDEN ID=txt15 NAME=txt15 VALUE='" & rstSQL.fields("UPCOMMING_DELIVERABLES_DATE4")& "'>" & MID(rstSQL.fields("UPCOMMING_DELIVERABLES_DATE4"), 1, 12) & "..." & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD>5).</TD><TD onclick=""textEdit()"" title='" & vVal5 & "' nowrap><INPUT TYPE=HIDDEN size=50 ID=txt10 NAME=txt10 VALUE='" & vVal5 & "'>" & vtext5 & "</TD>" & vbcrlf)
             Response.Write("<TD onclick=""textEdit2()"" title='" & rstSQL.fields("UPCOMMING_DELIVERABLES_DATE5") & "'><INPUT TYPE=HIDDEN ID=txt16 NAME=txt16 VALUE='" & rstSQL.fields("UPCOMMING_DELIVERABLES_DATE5")& "'>" & MID(rstSQL.fields("UPCOMMING_DELIVERABLES_DATE5"), 1, 12) & "..." & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD>6).</TD><TD onclick=""textEdit()"" title='" & vVal6 & "' nowrap><INPUT TYPE=HIDDEN size=50 ID=txt11 NAME=txt11 VALUE='" & vVal6 & "'>" & vtext6 & "</TD>" & vbcrlf)
             Response.Write("<TD onclick=""textEdit2()"" title='" & rstSQL.fields("UPCOMMING_DELIVERABLES_DATE6") & "'><INPUT TYPE=HIDDEN ID=txt17 NAME=txt17 VALUE='" & rstSQL.fields("UPCOMMING_DELIVERABLES_DATE6")& "'>" & MID(rstSQL.fields("UPCOMMING_DELIVERABLES_DATE6"), 1, 12) & "..." & "</TD></TR>" & vbcrlf)
             Response.Write("</TABLE></TD>" & vbcrlf)
          END IF

          dim vprog, vactions
          if (LEN(rstSQL("STATUS_PROGRESS")) < 15) then
          vprog = rstSQL("STATUS_PROGRESS")
          else
          vprog = MID(rstSQL("STATUS_PROGRESS"), 1, 15) & "..."
          end if
         
          if (LEN(rstSQL("STATUS_PROGRESS")) > 0) then      
                  vVal1 = REPLACE(rstSQL("STATUS_PROGRESS"), "'", "&#39;")
              else
                vVal1 = ""
          end if

          if (LEN(rstSQL("ACTIONS_TO_ADDRESS")) < 15) then
          vactions = rstSQL("ACTIONS_TO_ADDRESS")
          else
          vactions = MID(rstSQL("ACTIONS_TO_ADDRESS"), 1, 15) & "..."
          end if
          if (LEN(rstSQL("ACTIONS_TO_ADDRESS")) > 0) then      
                  vVal2 = REPLACE(rstSQL("ACTIONS_TO_ADDRESS"), "'", "&#39;")
              else
                vVal2 = ""
          end if


         IF (vFinal="Y") THEN
             Response.Write("<TD borderColor='red' nowrap><TABLE><TR><TD><INPUT TYPE=HIDDEN size=500 ID=txt18 NAME=txt18 VALUE='" & vVal1 & "' >" & vprog & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD borderColor='red' nowrap><INPUT TYPE=HIDDEN size=500 ID=txt19 NAME=txt19 VALUE='" & vVal2 & "' >" & vactions & "</TD></TR></TABLE></TD>" & vbcrlf)
          ELSE
             Response.Write("<TD><TABLE><TR><TD nowrap onclick=""textEdit()"" title='" & vVal1 & "'><INPUT TYPE=HIDDEN size=500 ID=txt18 NAME=txt18 VALUE='" & vVal1 & "'>" & vprog & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD nowrap onclick=""textEdit()"" title='" & vVal2 & "'><INPUT TYPE=HIDDEN size=500 ID=txt19 NAME=txt19 VALUE='" & vVal2 & "'>" & vactions & "</TD></TR></TABLE></TD>" & vbcrlf)
          END IF

          dim vissue, vexec
          if (LEN(rstSQL("MAJOR_ISSUES")) < 15) then
          vissue = rstSQL("MAJOR_ISSUES")
          else
          vissue = MID(rstSQL("MAJOR_ISSUES"), 1, 15) & "..."
          end if
         
          if (LEN(rstSQL("MAJOR_ISSUES")) > 0) then      
                  vVal1 = REPLACE(rstSQL("MAJOR_ISSUES"), "'", "&#39;")
              else
                vVal1 = ""
          end if
          if (LEN(rstSQL("EXECUTIVE_SUMMARY")) < 15) then
          vexec = rstSQL("EXECUTIVE_SUMMARY")
          else
          vexec = MID(rstSQL("EXECUTIVE_SUMMARY"), 1, 15) & "..."
          end if
         
          if (LEN(rstSQL("EXECUTIVE_SUMMARY")) > 0) then      
                  vVal2 = REPLACE(rstSQL("EXECUTIVE_SUMMARY"), "'", "&#39;")
              else
                vVal2 = ""
          end if


          IF (vFinal="Y") THEN
             Response.Write("<TD borderColor='red' nowrap><TABLE><TR><TD><INPUT TYPE=HIDDEN size=500 ID=txt20 NAME=txt20 VALUE='" & vVal1 & "'>" & vissue & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD><INPUT TYPE=HIDDEN size=500 ID=txt21 NAME=txt21 VALUE='" & vVal2 & "'>" & vexec & "</TD></TR></TABLE></TD>" & vbcrlf)
          ELSE
             Response.Write("<TD><TABLE><TR><TD nowrap onclick=""textEdit()"" title='" & vVal1 & "'><INPUT TYPE=HIDDEN size=500 ID=txt20 NAME=txt20 VALUE='" & vVal1 & "'>" & vissue & "</TD></TR>" & vbcrlf)
             Response.Write("<TR><TD nowrap onclick=""textEdit()"" title='" & vVal2 & "'><INPUT TYPE=HIDDEN size=500 ID=txt21 NAME=txt21 VALUE='" & vVal2 & "'>" & vexec & "</TD></TR></TABLE></TD>" & vbcrlf)
          END IF


      IF (vFinal = "Y") THEN
             Response.Write("<TD borderColor='red'><INPUT TYPE=HIDDEN ID=txt22 NAME=txt22 VALUE='" & rstSQL.fields("LAST_SPONSOR_UPDATE")& "'>" & MID(rstSQL.fields("LAST_SPONSOR_UPDATE"), 1, 11) & "..." & "</TD>" & vbcrlf)
         
      ELSE
             Response.Write("<TD onclick=""textEdit2()"" title=""" & rstSQL.fields("LAST_SPONSOR_UPDATE") & """><INPUT TYPE=HIDDEN ID=txt22 NAME=txt22 VALUE=""" & rstSQL.fields("LAST_SPONSOR_UPDATE")& """>" & MID(rstSQL.fields("LAST_SPONSOR_UPDATE"), 1, 11) & "..." & "</TD>" & vbcrlf)

      END IF      

          vLastStatusDate = rstSQL.fields("MONTH_DATE")
          ctr=ctr+1
          rstSQL.MoveNext
        Loop

        rstSQL.Close
              IF (vFirst = False) THEN
                        IF (vFinal = "Y") THEN
                          IF Session("UserType") = "ADMIN" OR Session("UserType") = "SUPERVISOR" OR _
                                    Request.QueryString("iUserType") = "ADMIN" OR Request.QueryString("iUserType") = "SUPERVISOR" THEN
                            Response.Write("<TD borderColor='red'><INPUT TYPE=HIDDEN NAME='iFinal' VALUE='Y'><span onclick=""doUnFinal('" & vLastStatusDate & "')"">YES</span></TD></TR>")
                          ELSE
                            Response.Write("<TD borderColor='red'><INPUT TYPE=HIDDEN NAME='iFinal' VALUE='Y'>YES</TD></TR>")
                          END IF
                        ELSE
                          Response.Write("<TD><SELECT NAME='iFinal' onchange=""aVal=true"" style=""font-size:12""><OPTION VALUE='N'>No</OPTION><OPTION VALUE='Y'>Finalize!</OPTION></SELECT></TD></TR>")        
                        END IF
                  END IF            
%>
</TABLE>
<INPUT TYPE=HIDDEN ID="sel2" name = "sel2">
<INPUT TYPE=HIDDEN ID="sel4" name = "sel4">
<INPUT TYPE=HIDDEN ID="sel5" name = "sel5">
<INPUT TYPE=HIDDEN ID="sel6" name = "sel6">
<INPUT TYPE=HIDDEN ID="sel7" name = "sel7">
<INPUT TYPE=HIDDEN ID="sel8" name = "sel8">
</FORM>
<%
  End Select
%>
**************************************************************************************
0
 

Author Comment

by:sireev
ID: 17139186
Found the problem and fixed it.  Thanks for all the help
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question