function DateTimeControl(pObj,pWin,pVar,pShowDate,pShowTime,pDateFormat,pTimeFormat,pInitVal){
var t=this;
var monthDays = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
var weekdays = new Array("S","M","T","W","T","F","S");
var months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var dateformats = {"DDMMYYYY":[0,1,2],"DDMMMYYYY":[0,1,2]};
var cssBase;
var lDateArr;
t.setFlg = false;
t.setHH = false;
t.kyFlg = false;;
t._HH = 23;
t._MM = 59;
t._SS = 59;
t._HHStart = 0;
t.hh_opt = "optHH"+pVar;
t.mm_opt = "optMM"+pVar;
t.ss_opt = "optSS"+pVar;
t.ampm_opt = "optAMPM"+pVar;
t.AMAMFlg = false;
t.minYear = 1980;
t.maxYear = 2080;
t.dateSeperator = "-";
t.timeSeperator = ":";
t.AMPMseperator = " ";
t.dateTimeSep = " ";
t.calobj=pObj;
t.win = pWin;
t.hidVar = pVar;
t.variable="date_"+pVar;
if(typeof pShowDate=="undefined" || (pShowDate!=true && pShowDate!=false))
t.showDate=false;else t.showDate=pShowDate;
if(typeof pShowTime=="undefined" || (pShowTime!=true && pShowTime!=false))
t.showTime=false;else t.showTime=pShowTime;
if(typeof pDateFormat=="undefined" || !checkDateFormat(pDateFormat))
t.dateFormat="DDMMYYYY";else t.dateFormat=pDateFormat;
if(typeof pTimeFormat=="undefined" || (pTimeFormat!=12 && pTimeFormat!=24) )
t.timeFormat=24;else t.timeFormat=pTimeFormat;
t.objValue=new Array("","","","","","","");
t.popupWin=null;
t.date=new Date();t.tDt = new Date();
t.day;t.month;t.year;t.hours;t.min;t.sec;t.AMPM;
/*if(typeof pInitVal != "undefined")t.createDateTime(pInitVal);*/
t.initVal=pInitVal;
t.day=t.date.getDate();t.month=t.date.getMonth();t.year=t.date.getFullYear();
t.getMonthDays = function (pDate) {
var year = pDate.getFullYear();
var month = pDate.getMonth(); 
if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1)return 29;
else return monthDays[month];
}
function format(){	
var lArr = getFrmHash(t.dateFormat,dateformats);
var mm = "";var lStr = "";var lFmt = t.dateFormat.search(/mmm/i);
if(lFmt != -1){mm = months[t.objValue[1]].substring(0,3)}
else {if((t.objValue[1] + 1) < 10) mm = "0" +(t.objValue[1] + 1); else mm = t.objValue[1] + 1;}
for(var i in lArr){
if(i != 0 && i != 3)lStr += t.dateSeperator;
if(lArr[i]==1)lStr += mm;
else {if(t.objValue[lArr[i]] < 10) lStr += "0" + t.objValue[lArr[i]]; else lStr += t.objValue[lArr[i]];}	
}return lStr;}
t.getHTML=function(){
timeSetup();var lHTML = "";var lval = "";if(t.setFlg){lval = format();}
if(t.showDate){
lHTML += "<INPUT  class=txtbox TYPE=\"text\" NAME=\""+t.variable+"\" id=\""+t.variable+"\"  value=\""+lval+"\" size=10>&nbsp;";
lHTML += "<INPUT TYPE=\"button\" style=\"background:url(images/calendar.jpg) no-repeat;cursor:hand;border:none;width:16px;height:15px; vertical-align:top;\" id=\"btn_"+t.variable+"\" onClick=\""+t.calobj+".show()\">&nbsp;";
}
lval = "";
if(t.setFlg){lval = t.getDateAsString();t.setFlg= false;}
lHTML += genTimeHTML();
lHTML += "<INPUT TYPE=\"hidden\" NAME=\""+t.hidVar+"\" id=\""+t.hidVar+"\" value=\""+lval+"\" size=25>&nbsp;";
return lHTML;}
function genTimeHTML(){
var lHTML = "";
if(t.showTime){
lHTML +='<select class=\"timePicker\" id='+t.hh_opt+' onKeyUp='+t.calobj+'.setTime() onchange='+t.calobj+'.setTime()>';
if(t.setHH)lHTML +=createOptions(t._HHStart,t._HH,t.objValue[3])+'</select>';
else lHTML +=createOptions(t._HHStart,t._HH)+'</select>';
lHTML +='<select class=\"timePicker\" id='+t.mm_opt+' onKeyUp='+t.calobj+'.setTime() onchange='+t.calobj+'.setTime() >';
if(t.setHH)lHTML +=createOptions(0,t._MM,t.objValue[4])+'</select>';
else lHTML +=createOptions(0,t._MM)+'</select>';
lHTML +='<select class=\"timePicker\" id='+t.ss_opt+' onKeyUp='+t.calobj+'.setTime() onchange='+t.calobj+'.setTime() >';
if(t.setHH) lHTML +=createOptions(0,t._SS,t.objValue[5])+'</select>';
else lHTML +=createOptions(0,t._SS)+'</select>';
if(t.AMAMFlg){
lHTML +='<select class=\"timePicker\" id='+t.ampm_opt+' onKeyUp='+t.calobj+'.setTime() onchange='+t.calobj+'.setTime()>';
lHTML +='<option value="">-</option>';
if(t.setHH){
if(t.objValue[6]=="AM"){lHTML +='<option value=AM selected>AM</option>';lHTML +='<option value=PM>PM</option>';}
else if(t.objValue[6]=="PM"){lHTML +='<option value=AM >AM</option>';lHTML +='<option value=PM selected>PM</option>';}
else{lHTML +='<option value=AM>AM</option>';lHTML +='<option value=PM>PM</option>';}
}else{lHTML +='<option value=AM>AM</option>';lHTML +='<option value=PM>PM</option>';}
lHTML +='</select>';}}
t.setHH = false;
return lHTML;
}
t.setTime=function(){
var hh,mm,ss,ampm;	
hh=t.win.document.getElementById(t.hh_opt).value;
mm=t.win.document.getElementById(t.mm_opt).value;
ss=t.win.document.getElementById(t.ss_opt).value;
if(hh != "" && mm != "" && ss != ""){
if(t.timeFormat==12){
ampm=t.win.document.getElementById(t.ampm_opt).value;
if(ampm != ""){
t.objValue[3]=hh;t.objValue[4]=mm;t.objValue[5]=ss;t.objValue[6]=ampm;
}
else{t.objValue[3]="";t.objValue[4]="";t.objValue[5]="";t.objValue[6]="";}
}else{
t.objValue[3]=hh;t.objValue[4]=mm;t.objValue[5]=ss;
}}
else{t.objValue[3]="";t.objValue[4]="";t.objValue[5]="";t.objValue[6]="";}
var lDtStr = t.getDateAsString();
//if(lDtStr != "")
t.win.document.getElementById(t.hidVar).value = lDtStr;
}
function createOptions(pStart,pEnd,pSel){
var lHtml = '<option value="">-</option>';
var sel = "";
for(var i = pStart;i<=pEnd;i++){
if(pSel == i) sel = "selected";
else sel = "";
if(i < 10)lHtml+='<option value=0'+i+' '+sel+' >0'+i+'</option>';
else lHtml+='<option value='+i+' '+sel+' >'+i+'</option>';
}return lHtml;}
function timeSetup(){
if(t.timeFormat == 12){t._HH = 12;t._HHStart = 1;t.AMAMFlg = true;}
else{t._HH = 23;t._HHStart = 0;t.AMAMFlg = false;}}
function generateMonthHTML(pValue,pHighLight){
var lacf=true;
var lRetHTML = "";
var lDate = new Date();
lDate.setMonth(t.date.getMonth());
lDate.setFullYear(t.date.getFullYear());
var lMonthDays = t.getMonthDays(lDate);
lDate.setDate(1);
for(var i=0;i<lMonthDays;i++,lDate.setDate(lDate.getDate()+1)){
if(i==0){
lRetHTML += "<tr>";
for(var j=0;j<lDate.getDay();j++)
lRetHTML += "<td>&nbsp;</td>";
}
else if(lDate.getDay() == 0)lRetHTML += "</tr><tr>";
lRetHTML += "<td id=\"cell_"+lDate.getDate()+"\" ";
if((lacf && t.kyFlg && t.date.getDate()==(i+1))||(lacf && !t.kyFlg && lDate.getMonth()==t.month && lDate.getFullYear()==t.year && lDate.getDate()==t.day)){lRetHTML+=" class=\"active\" ";lacf=false;}
else {if(lDate.getDay() == 0)lRetHTML+=" class=\"weekend\" ";else lRetHTML+=" class=\"mnthDays\" ";}
lRetHTML +="><a href=\"#\" class=\"";
if(lDate.getDay() == 0)lRetHTML+="wkend";else lRetHTML+="wkdy";
lRetHTML +="\" onClick=\"javascript:pObj.setSelected("+lDate.getDate()+")\" >"+lDate.getDate()+"</a></td>";
if(i == (lMonthDays-1)){			
var lCnt = 6 - lDate.getDay();
for(var j=0;j<lCnt;j++)lRetHTML += "<td>&nbsp;</td>";
lRetHTML += "</tr>";
}}
return lRetHTML;
}
function generateCalHTML(){
var lStr = "<HTML><HEAD><TITLE>Pick Date</TITLE><script>var pWin=window.opener;var pObj=pWin."+t.calobj+";";
lStr += "if(document.addEventListener){document.addEventListener('keydown',pObj.handleKeyEv,true) ;}else{document.attachEvent('onkeydown',pObj.handleKeyEv)}</script></HEAD>";
lStr += "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"css/datetimecontrol.css\" title=\"DateTimeControl\" /><BODY >";
var table = "<center><table class=\"tbl\">";
table +="<thead><tr class=\"button\"><td><input type=\"button\" value=&lt;&lt; title=\"Decrement Year\" class=\"headBtn\" onclick=\"javascript:pObj.yearChange(-1);\"></td>";
table +="<td><input type=\"button\" value=&lt; title=\"Decrement Month\" class=\"headBtn\" onclick=\"javascript:pObj.monthChange(-1);\"></td>";
table +="<td colspan=3 align=center ><input type=\"button\" value=\"Today\" title=\"Today's Date\" class=\"headBtn\" onclick=\"javascript:pObj.showToday();\" ></td>";
table +="<td><input type=\"button\" value=&gt; title=\"Increment Month\" class=\"headBtn\" onclick=\"javascript:pObj.monthChange(1);\"></td>"
table +="<td><input type=\"button\" value=&gt;&gt; title=\"Increment Year\" class=\"headBtn\" onclick=\"javascript:pObj.yearChange(1);\"></td></tr></thead>";
var currDate = "<tr><td colspan=7 class=\"tblHead\" >"+months[t.date.getMonth()]+"  "+t.date.getFullYear()+"</td></tr>";
table += currDate;var wd = "<tr class=\"wkDyNm\">";
for(var i=0;i<weekdays.length;i++){
if(i==0)wd += "<td class=\"weekend\">"+weekdays[i]+"</td>";
else wd += "<td class=\"wkDyNm\">"+weekdays[i]+"</td>";}
wd += "</tr>";table += wd ;
table += generateMonthHTML();
var tfoot = "<tfoot><tr class=\"button\">";
tfoot += "<td colspan=7 align=center><input type=\"button\" value=\"[clear]\" class=\"button\" onClick=\"javascript:pObj.clear();\">&nbsp;&nbsp;&nbsp;";
tfoot +="<input type=\"button\" value=\"[close]\" class=\"button\" onClick=\"javascript:pObj.close();\"></td>"
tfoot +="</tr></tfoot>";
table += tfoot +"</table></center>";
lStr += table+"</BODY></HTML>";
return lStr;
}
t.handleKeyEv=function(pEv){
	var key = pEv.keyCode;
	switch(key){
	case 37:nav(-1);break;// Left	
	case 39:nav(1);break;// Right
	case 38:nav(-7);break;// Up
	case 40:nav(7);break;// Down
	case 13:t.setSelected(t.date.getDate());break;// Enter
	case 27:t.close();break;// Esc
	}
}
function nav(pVal){
	t.tDt=t.date;
	var cm=t.date.getMonth();var cur=t.date.getDate();var day=t.date.getDay();	var cyr=t.date.getFullYear();
	t.date.setDate(t.date.getDate()+pVal);
	var nm=t.date.getMonth();var nyr=t.date.getFullYear();	
	t.kyFlg=true;
	if(cm==0 && nm==11)t.show();
	else if(cm==11 && nm==0)t.show();
	else if(cm>nm)t.show();
	else if(cm<nm)t.show();	
	t.popupWin.document.getElementById("cell_"+(t.date.getDate())).className="active";
	var cc=t.popupWin.document.getElementById("cell_"+cur);
	if(cc!=null){
	if(day!=0)cc.className="mnthDays";
	else cc.className="weekend";
	}
	t.popupWin.focus();
}
t.dateBound = function (pDate){
if(pDate.getFullYear()<t.minYear)t.date.setYear(t.minYear);
else if(pDate.getFullYear()>t.maxYear)t.date.setYear(t.maxYear);
}
t.yearChange = function(pVal){
if(pVal<0)t.date.setFullYear(t.date.getFullYear()-1);
else t.date.setFullYear(t.date.getFullYear()+1);	
t.show();return;
}
t.monthChange = function(pVal){
t.date.setDate(1);
if(pVal<0)t.date.setMonth((t.date.getMonth()-1));
else t.date.setMonth(t.date.getMonth()+1);
t.show();return;
}
t.showToday = function(){
var lDt = new Date();
t.date=lDt;
t.show();return;
}
t.clear = function(){
if (t.showDate) t.win.document.getElementById(t.variable).value = "";
t.createDateTime(pInitVal);
t.day=t.date.getDate();t.month=t.date.getMonth();t.year=t.date.getFullYear();
t.objValue[0]="";t.objValue[1]="";t.objValue[2]="";t.objValue[3]="";t.objValue[4]="";t.objValue[5]="";t.objValue[6]="";
t.win.document.getElementById(t.hidVar).value = "";
if(t.showTime) {
t.win.document.getElementById(t.hh_opt).value = "";
t.win.document.getElementById(t.mm_opt).value = "";
t.win.document.getElementById(t.ss_opt).value = "";
if(t.timeFormat==12)t.win.document.getElementById(t.ampm_opt).value = "";
}
}
t.disable=function(pFlag){
if (t.showDate) t.win.document.getElementById(t.variable).disabled=pFlag;
if(t.showTime) {
t.win.document.getElementById(t.hh_opt).disabled=pFlag;
t.win.document.getElementById(t.mm_opt).disabled=pFlag;
t.win.document.getElementById(t.ss_opt).disabled=pFlag;
if(t.timeFormat==12)t.win.document.getElementById(t.ampm_opt).disabled=pFlag;
}
}
t.focus=function(){
if (t.showDate) t.win.document.getElementById("btn_"+t.variable).focus();
else if (t.showTime) t.win.document.getElementById(t.hh_opt).focus();
}
t.close = function(){
t.popupWin.close();
t.popupWin = null;
}
t.destroy=function(){
t.popupWin = null;
}
t.setSelected = function(pDate){
t.date.setDate(pDate);
t.day=t.date.getDate();t.month=t.date.getMonth();t.year=t.date.getFullYear();
t.objValue[0]=t.day;t.objValue[1]=t.month;t.objValue[2]=t.year;
var lDtStr1 = format();
t.win.document.getElementById(t.variable).value = lDtStr1;
var lDtStr = t.getDateAsString();
//if(lDtStr != "")
t.win.document.getElementById(t.hidVar).value = lDtStr;
t.close();
}
t.getDateAsString = function(){	
var lRetStr = "";
if(t.showTime && (String(t.objValue[3]) == "")){return lRetStr;}
else if(t.showDate && String(t.objValue[1]) == "")return lRetStr;
if(t.showTime && t.showDate){
var hh,mm,ss;
hh=getInt(t.objValue[3]);mm=getInt(t.objValue[4]);ss=getInt(t.objValue[5]);
lRetStr += format();lRetStr += t.dateTimeSep;lRetStr += (hh<10?"0"+hh:hh)+t.timeSeperator+(mm<10?"0"+mm:mm)+t.timeSeperator+(ss<10?"0"+ss:ss);
if(t.timeFormat == 12)lRetStr += t.AMPMseperator+t.objValue[6];
}
else if(t.showTime){lRetStr += t.dateTimeSep;lRetStr += t.objValue[3]+t.timeSeperator+t.objValue[4]+t.timeSeperator+t.objValue[5];
if(t.timeFormat == 12)lRetStr += t.AMPMseperator+t.objValue[6];}
else if(t.showDate)lRetStr += format();
return lRetStr;
}
t.show = function(){
if(t.showDate){
try{
if(t.popupWin == null || t.popupWin.closed){
t.createDateTime();
t.popupWin = t.win.open("","","width=200,height=250,resizable=0,top=200,left=500");
}
}catch (err){
t.createDateTime();
t.popupWin = t.win.open("","","width=200,height=250,resizable=0,top=200,left=500");
}
var lStr = generateCalHTML();
writeWin(t.popupWin,lStr);
t.popupWin.focus();
return;
}}
//Private Function To Write HTML
function writeWin(pWindow,pHTML){
var doc = pWindow.document;
doc.open();
doc.writeln(pHTML);
doc.close();
}
function validate(pValue,pFlag){//Args 1 Value To Be Parsed, Args 2 true if date,false if time
if(pFlag){
var ldt = getDate(pValue);
if(isNaN(ldt.getDate()))
return false;
else{
if(lDateArr[0] != ldt.getDate() || lDateArr[1] != (ldt.getMonth()+1) || lDateArr[2] != ldt.getFullYear())
return false;
}}
return true;
}
t.setDateTime = function(pDate){
if(typeof pDate != "undefined"){
t.date= pDate;
t.objValue[0]=t.date.getDate();
t.objValue[1]=t.date.getMonth();
t.objValue[2]=t.date.getFullYear();
t.objValue[3]=t.date.getHours();
t.objValue[4]=t.date.getMinutes();
t.objValue[5]=t.date.getSeconds();	
t.day=t.date.getDate();t.month=t.date.getMonth();t.year=t.date.getFullYear();
if(t.timeFormat==12){
if((t.date.getHours() > 12) || ((t.date.getHours() == 12) && (t.date.getMinutes() > 0 || t.date.getSeconds() > 0)))t.objValue[6] = "PM";
else t.objValue[6] = "AM";
if(t.date.getHours() > 12)t.objValue[3]=(t.date.getHours() - 12);
}
if(t.showDate){if(t.win.document.getElementById(t.variable) == null){t.setFlg=true;t.setHH=true;}}
if(t.showTime){if(t.win.document.getElementById(t.hh_opt) == null){t.setFlg=true;t.setHH=true;}}
var dtstr = t.getDateAsString();
t.setDateFrmString(dtstr);
}}
t.setDateFrmString=function(pString){
//t.clear();
if(t.showDate){if(t.win.document.getElementById(t.variable) == null){t.setFlg=true;t.setHH=true;}}
if(t.showTime){if(t.win.document.getElementById(t.hh_opt) == null){t.setFlg=true;t.setHH=true;}}
if(!t.createDateTime(pString)){
t.setFlg = false;t.setHH = false;
}
if(!t.setFlg && t.win.document.getElementById(t.hidVar) != null)t.win.document.getElementById(t.hidVar).value=t.getDateAsString();
}
t.createDateTime = function(pInit){
var lValue = "";
if(t.showDate && !t.setFlg)
lValue = trim(t.win.document.getElementById(t.variable).value);	
if(typeof pInit != "undefined"){
lValue = trim(pInit);
}
if(lValue != ""){
if(t.showDate && t.showTime){
var lLen = t.dateFormat.length + (t.dateSeperator.length * 2);
var lDtStr = getDtTmStr(lValue,true);
if(!validate(lDtStr,true)){if(!t.setFlg)t.win.document.getElementById(t.variable).value="";return false;}
if(!t.setFlg)t.win.document.getElementById(t.variable).value=lDtStr;	
if(typeof pInit != "undefined"){
var lTimeStr = trim(getDtTmStr(lValue,false));
if(!getTime(lTimeStr)){if(!t.setFlg)t.win.document.getElementById(t.variable).value="";return false;}
}
t.date = getDate(lDtStr);
}
else if(t.showTime){
if(!getTime(lValue))return false;
}
else if(t.showDate){			
if(!validate(lValue,true)){if(!t.setFlg)t.win.document.getElementById(t.variable).value="";return false;}
t.date = getDate(lValue);
if(!t.setFlg)t.win.document.getElementById(t.variable).value=lValue;
}
if(t.showDate){
t.objValue[0]=t.date.getDate();
t.objValue[1]=t.date.getMonth();
t.objValue[2]=t.date.getFullYear();
t.day=t.date.getDate();t.month=t.date.getMonth();t.year=t.date.getFullYear();
}}
else t.date = new Date();
var lDtStr = t.getDateAsString();
if(!t.setFlg)t.win.document.getElementById(t.hidVar).value=lDtStr;
return true;
}
function getFrmHash(pValue,pHash){
for(var i in pHash){if(i.indexOf(pValue) != -1)return pHash[i];}
return;
}
function getDtTmStr(pString,pFlag){
if(pFlag){
if(pString.indexOf(t.dateTimeSep) != -1)
return pString.substring(0,pString.indexOf(t.dateTimeSep));
else return pString;
}
else{
if(pString.indexOf(t.dateTimeSep) != -1)
return pString.substring(pString.indexOf(t.dateTimeSep))
else return pString;
}}
function getDate(pString){
var mm,dd,yy,dtAr;
var dt = new Date();
lDateArr = new Array(3);
var arr = getFrmHash(t.dateFormat,dateformats);
if(t.dateSeperator != "") dtAr = pString.split(t.dateSeperator);
yy = t.dateFormat.search(/yyyy/i);
dd = t.dateFormat.search(/dd/i);
mm = t.dateFormat.search(/mmm/i);
if(mm != -1){
var lMnth;
if(t.dateSeperator != "")
lMnth = dtAr[arr[1]];
else
lMnth = pString.substring(mm,mm+3);
for(var i=0;i<months.length;i++){
var inx = months[i].toUpperCase().indexOf(lMnth.toUpperCase());
if(inx==0){lDateArr[1]=(i+1);break;}
}}
else{
mm = t.dateFormat.search(/mm/i);
if(t.dateSeperator == "")
lDateArr[1] = pString.substring(mm,mm+2);
else
lDateArr[1] = dtAr[arr[1]];
}
if(t.dateSeperator == ""){
lDateArr[0] = pString.substring(dd,dd+2);
lDateArr[2] = pString.substring(yy,yy+4);
}
else{
lDateArr[0] = dtAr[arr[0]];
lDateArr[2] = dtAr[arr[2]];
}//dt.setDate(lDateArr[0]);
dt.setFullYear(lDateArr[2]);
dt.setMonth((lDateArr[1]-1),lDateArr[0]);
return dt;
}
function getTime(pString){
var hh,mm,ss,ampm;
if(t.timeSeperator.length < 1) return false;
if(t.timeFormat==24){
var timeArr=pString.split(t.timeSeperator);
if(timeArr.length < 3)return false;
else{
hh=timeArr[0];mm=timeArr[1];ss=timeArr[2];
if((isNaN(hh) || hh<0 || hh>23) || (isNaN(mm) || mm<0 || mm>59) || (isNaN(ss) || ss<0 || ss>59))return false;
else{
t.objValue[3]=hh;t.objValue[4]=mm;t.objValue[5]=ss;
if(!t.setHH){
t.win.document.getElementById(t.hh_opt).value=(hh<10?"0"+getInt(hh):hh);
t.win.document.getElementById(t.mm_opt).value=(mm<10?"0"+getInt(mm):mm);
t.win.document.getElementById(t.ss_opt).value=(ss<10?"0"+getInt(ss):ss);}
}}}
else{
if(t.AMPMseperator.length<1)return false;
var timeArr=pString.split(t.AMPMseperator);
if(timeArr.length < 2) return false;
var timeprt=timeArr[0].split(t.timeSeperator);
if(timeprt.length < 3)return false;
hh=timeprt[0];mm=timeprt[1];ss=timeprt[2];ampm=timeArr[1];
if((isNaN(hh) || hh<0 || hh>12) || (isNaN(mm) || mm<0 || mm>59) || (isNaN(ss) || ss<0 || ss>59))return false;
if(ampm.toUpperCase() != "AM" && timeArr[1].toUpperCase() != "PM")return false;
if(hh==0)hh=12;
t.objValue[3]=hh;t.objValue[4]=mm;t.objValue[5]=ss;t.objValue[6]=ampm;
if(!t.setHH){
t.win.document.getElementById(t.hh_opt).value=(hh<10?"0"+getInt(hh):hh);
t.win.document.getElementById(t.mm_opt).value=(mm<10?"0"+getInt(mm):mm);
t.win.document.getElementById(t.ss_opt).value=(ss<10?"0"+getInt(ss):ss);
t.win.document.getElementById(t.ampm_opt).value=ampm;}
}
return true;
}
function checkDateFormat(pVal){
var fmt = getFrmHash(pVal,dateformats);
return (typeof fmt != "undefined");
}
function trim(stringToTrim) {
return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function getInt(pStr){
return eval(pStr);
}
return t;
}
