<!---
NN = (document.layers) ? 1 : 0;
IE = (document.all) ? 1 : 0;
var Months=new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
//******************************************************************************
function DayTime()
{
 var time = new Date();
 var temp;
 hrs = time.getHours();
 if (hrs>=0 && hrs<12)
    temp = "Good morning";
 if (hrs>=12 && hrs<17)
    temp = "Good afternoon";
 if (hrs>=17 && hrs<24)
    temp = "Good evening";
 return temp;
}
//******************************************************************************
function TodayDate()
{
 var res="", strDate;
 strDate = new Date();

 res=res+(WeekDays[parseInt(strDate.getDay())])+",&nbsp;&nbsp;";

 res=res+(Months[parseInt(strDate.getMonth())]);

 res=res+" "

 res=res+strDate.getDate();
 res=res+", "

 res=res+strDate.getFullYear();

 return res;
}
//******************************************************************************
function TodayDateXSLT()
{
 var res="", strDate;
 strDate = new Date();

 res="";
 res+=res+strDate.getFullYear();
 res+="-";
 res+=res+strDate.getMonth();
 res+="-";
 res=res+strDate.getDate();

 return res;
}
//******************************************************************************
function DateSelect(FormName,SelectGroupName,strD,showFlag,strStyles,intReqFlag,strDescr)
{
 var str="",strDate,strMonth,strYear,i;
 if (SelectGroupName.indexOf("required_") >-1) intReqFlag=1;
 else intReqFlag=0;
 if (strD=="")
    {
     strDate        = "";
     strMonth       = 0;
     strYear        = "";
    }
 else
    {
     strD= new String(strD);
     strYear =parseInt(strD.substr(0,4));
     strMonth=strD.substr(5,2);
     if (strMonth.substr(0,1)=="0") strMonth=strMonth.substr(1,1);
     strMonth=parseInt(strMonth);
     strDate =strD.substr(8,2);
     if (strDate.substr(0,1)=="0") strDate=strDate.substr(1,1);
     strDate=parseInt(strDate);
    }
 //strReqName=intReqFlag ? 'required_':'';
 strReqName="";
 str+='<table BORDER="0" CELLPADDING="0" CELLSPACING="0">';
 str+='<tr>';
 str+='<td align="center">';
 str+='<input onKeyPress="return validDigit(event);" type=text size="2" maxlength="2" name="num_'+strReqName+SelectGroupName+'_date" value="'+strDate+'">';
 str+='<input type=hidden name="title_'+SelectGroupName+'_date" value="DATE">';
 str+='</td>';
 str+='<td class="regular">&nbsp;&nbsp;&nbsp;</td>';
 str+='<td align="center">';
 str+='<select name="'+strReqName+SelectGroupName+'_month" size="1">';
 for (i=1;i<13;i++)
     {
      if (i==strMonth || (strMonth=="" && i==1))
          str+="<option selected value="+i+">"+Months[i-1]+"</option>";
      else
          str+="<option value="+i+">"+Months[i-1]+"</option>";
     }
 str+='</select>';
 str+='</td>';
 str+='<td class="regular">&nbsp;&nbsp;&nbsp;</td>';
 str+='<td align="center">';
 str+='<input onKeyPress="return validDigit(event);" type=text size="4" maxlength="4" name="num_'+strReqName+SelectGroupName+'_year" value="'+strYear+'">';
 str+='<input type=hidden name="title_'+SelectGroupName+'_year" value="Year">';
 str+='</td>';
 if (intReqFlag)
    {
     str+='<td class="regular">*</td>';
    }
 if (showFlag)
    {
     str+='<td>';
     str+='<a class=adminmenu href="javascript:ShowCalendar(&quot;'+strReqName+SelectGroupName+'&quot;,&quot;'+FormName+'&quot;,0,0,0';
     if (strStyles && strStyles!="") {str+=',&quot;'+strStyles+'&quot;';}
     str+=');" >&nbsp;['+(strDescr!=null?strDescr:'&nbsp;Select&nbsp;Date&nbsp;')+']</a>';
     str+='</td>';
    }
 str+='</tr>'
 str+='</table>';

 return str;
}
//*******************************************************************************************************************
function CheckDateOrder(strFormName, strDateName1, strDateName2)
{
 var strDate1="", strDate2="",
     strDate1_date="",strDate1_month="",strDate1_year="",
     strDate2_date="",strDate2_month="",strDate2_year="",
     which;

 which=document.forms[strFormName];

 strDate1_date  = new String(which.elements["num_"+strDateName1+"_date"].value);
 if (strDate1_date.length==1)strDate1_date="0"+strDate1_date;

 strDate1_month = new String(which.elements[strDateName1+"_month"].value);
 if (strDate1_month.length==1)strDate1_month="0"+strDate1_month;

 strDate1_year  = which.elements["num_"+strDateName1+"_year"].value;

 strDate2_date  = new String(which.elements["num_"+strDateName2+"_date"].value);
 if (strDate2_date.length==1)strDate2_date="0"+strDate2_date;

 strDate2_month = new String(which.elements[strDateName2+"_month"].value);
 if (strDate2_month.length==1)strDate2_month="0"+strDate2_month;

 strDate2_year  = which.elements["num_"+strDateName2+"_year"].value;

 if (strDate1_date=="" || strDate1_year=="" || strDate2_date=="" || strDate2_year=="") return 1;
 strDate1=strDate1_year+"-"+strDate1_month+"-"+strDate1_date;
 strDate2=strDate2_year+"-"+strDate2_month+"-"+strDate2_date;
 if (strDate1>strDate2)
    {
     alert("Error: date "+strDateName1.toUpperCase()+" cannot be later then date "+strDateName2.toUpperCase());
     which.elements["num_"+strDateName1+"_date"].focus();
     return 0;
    }
 return 1;
}
