/*supportato fino alla versione 2003 di visual studio */

 var OnitDatePick_IncludePath="";
 
 
 function ctl_CheckDataTemporalePick(name,msg,Formato,da,a,riselect){
 	var Data = new OnitDate();
 	var Data_a = new OnitDate();
 	var Data_da = new OnitDate();
	var strData= OnitDataPickGet(name);
	var valido=true;
	if (!ctl_CheckDataPick(name,true,"Formato data non corretto",Formato,riselect)) return;
 	Data.parse(strData);
	/* la data è corretta */
	da=da.replace(/\'/g,"\"");
	a=a.replace(/\'/g,"\"");
	Data_a.parse(a);
 	if (Data_a.data==null) Data_a.parse(eval(a));
	Data_da.parse(da);
 	if (Data_da.data==null) Data_da.parse(eval(da));
 	/* eseguo i confronti*/
 	if (Data_da.data!=null){
 		valido=((Data.data-Data_da.data)>=0 );
 	}
 	if (Data_a.data!=null){
 		valido= (valido && ((Data.data-Data_a.data)<=0 ));
 	}
 	if(!valido){	/* la data non è valida */
 		alert(msg);
 		OnitDataPickSet(name,"");
 		if (riselect) OnitDataPickFocus(name,1,false);
 	}
 }
 
 
 
 /* controlla la validità della data nel controllo e la formatta eventualmente */
 function ctl_CheckDataPick(name, Formatta, msg, formato,riselect){
 	var Data = new OnitDate();
 	var strData, strFormato,strDataTmp,ogg, bReturn=true;
 	var comunicaErrore=true;
 	strData = OnitDataPickGet(name);
 	strDataTmp="";
 	ogg=document.getElementById(name);if(ogg) strDataTmp+=ogg.value;
 	ogg=document.getElementById(name+"1");if(ogg) strDataTmp+=ogg.value;
 	ogg=document.getElementById(name+"2");if(ogg) strDataTmp+=ogg.value;
 	ogg=document.getElementById(name+"3");if(ogg) strDataTmp+=ogg.value;
 	if (strDataTmp=="") return false; 
 	Data.parse(strData);
 	if (Data.data !=null){ /* data valida */
 		if (Formatta){
 			if (formato!=1)	strFormato="dd\/MM\/yy"; else strFormato="day dd month yy";
 			OnitDataPickSet(name,Data.format(strFormato));
 		}
  		bReturn=true;
	} else {
 		OnitDataPickSet(name,"");
 		bReturn=false;
 		/* eventuale procedura sullo sbiancamento */
 		if (window["OnitDataPick_SetBlank"] ){
			OnitDataPick_SetBlank(name);
			comunicaErrore=false;
		}
 		if (msg!="" && comunicaErrore) 
 			alert(msg);
 		if (riselect) {OnitDataPickFocus(name,1,false);}
 	}
 	return bReturn
 }
 
function interpretaData(strData){
	var d = new OnitDate();
	d.parse(strData);
	if (d.data==null) return new Date(); 
	else return d.data; 
}

function renderHtlmCalendar(idTab,Height,Width,CalPopup){
	var str="",i=0,j=0, IdCella="";
	var days = Array("l", "m", "m", "g", "v", "s", "d");
	// intestazione
	str += "<table id=\"" + idTab + "\" language=\"javascript\" cellspacing=\"0\" cellpadding=\"1\" bordercolor=\"#3366CC\" border=\"0\" style=\" color:#003399;background-color:White;border-color:#3366CC;border-width:1px;border-style:solid;font-family:Verdana;font-size:8pt;height: " + Height + ";width: " + Width + ";border-collapse:collapse;Z-INDEX: 10000; LEFT:0px;TOP:0px ; POSITION: absolute;\">  \n";
    str += "<tr><td colspan=\"7\" style=\"background-color:#003399;border-color:#3366CC;border-width:1px;border-style:Solid;height:25px;\">" + "\n"
    str += "<table cellspacing=\"0\" border=\"0\" style=\"color:#CCCCFF;font-family:Verdana;font-size:10pt;font-weight:bold;width:100%;border-collapse:collapse;\">" + "\n"
 	str += "<tr>";
 	/*pulsanti*/

    str += "<td style=\"color:#CCCCFF;font-size:8pt;width:7.5%;background-color:Transparent;\"><a href=\"javascript:inc_dec_anno('" + idTab + "',true)\" style=\"color:#CCCCFF\" title=\"Decrementa di un anno\"><img src=\"\/onit_common\/images\/OnitDatePick\/anno_dw.gif\" border=0 \/><\/a><\/td>";
    str += "<td style=\"color:#CCCCFF;font-size:8pt;width:7.5%;background-color:Transparent;\"><a href=\"javascript:inc_dec_mese('" + idTab + "',true)\" style=\"color:#CCCCFF\" title=\"Decrementa di un mese\"><img src=\"\/onit_common\/images\/OnitDatePick\/mese_dw.gif\" border=0 \/><\/a><\/td>";
    /*nome del mese*/
    str += "<td id=\"" + idTab + "_Mese\" align=\"Center\" style=\"width:70%;background-color:Transparent;color:white;\"> mese <\/td>" + "\n";
    /*pulsanti*/
    str += "<td align=\"Right\" style=\"color:#CCCCFF;font-size:8pt;width:15%;background-color:Transparent;\"><a href=\"javascript:inc_dec_mese('" + idTab + "',false)\" style=\"color:#CCCCFF\" title=\"Incrementa di un mese\"><img src=\"\/onit_common\/images\/OnitDatePick\/mese_up.gif\" border=0 \/><\/a><\/td>";
    str += "<td align=\"Right\" style=\"color:#CCCCFF;font-size:8pt;width:15%;background-color:Transparent;\"><a href=\"javascript:inc_dec_anno('" + idTab + "',false)\" style=\"color:#CCCCFF\"  title=\"Incrementa di un anno\"><img src=\"\/onit_common\/images\/OnitDatePick\/anno_up.gif\" border=0 \/><\/a><\/td>" ;

	str += "<\/tr>" + "\n";
    str += "<\/table><\/td><\/tr>" + "\n";
    //giorni
    str += "<tr>";
    for (i=0;i<days.length;i++ )
        str += " <td align=\"Center\" style=\"color:#336666;background-color:#99CCCC;height:1px;\">" + days[i] + "<\/td>" + "\n";
    str += "<\/tr>";
    //righe numeri
    for (i = 1; i<= 6;i++){
        str += "<tr>" + "\n";
        for (j = 1;j<= 6; j++){
            IdCella = idTab + "_" + i + "_" + j;
            str += "<td id=\"" + IdCella + "\" onClick=\"javascript: day_click('" + IdCella + "','" + idTab + "'," + CalPopup +")\" align=\"Center\" style=\"color:#999999;width:14%;\"> <\/td>" + "\n";
        }
        IdCella = idTab + "_" + i + "_" + 7;
        str += "<td id=\"" + IdCella + "\" onClick=\"javascript: day_click('" + IdCella + "','" + idTab + "'," + CalPopup +")\" align=\"Center\" style=\"color:#FF0000;width:14%;\">10<\/td>" + "\n";
        str += "<\/tr>" + "\n";
    }
    str += "<\/table>"
    str += "\n";
    str += "<INPUT id=\"" + idTab + "_Hid\" value=\"\" style=\"Z-INDEX: 102; LEFT: 409px; WIDTH: 53px; POSITION: relative; \" type=\"hidden\" >"
    str += "\n";
	return str;
}

function fillCal(idTab,d){
var d2;
var giorno;
var riga=1;
var col=1;
var elMesi=new Array("Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic");
document.getElementById(idTab+"_Mese").innerHTML=""+elMesi[d.getMonth()]+" "+ d.getFullYear();
document.getElementById(idTab+"_Hid").value=d;
giorno = d.getDate();
d.setDate(1);
d2=new Date(d);
d2.setMonth(d2.getMonth()+1);
for (riga=1;riga<=6;riga++)
{
	for (col=1;col<=6;col++)
	{
		document.getElementById(idTab+"_"+riga+"_"+col).innerHTML="";
		document.getElementById(idTab+"_"+riga+"_"+col).style.backgroundColor="white";
	}
	document.getElementById(idTab+"_"+riga+"_7").style.backgroundColor="#CCCCFF";
	document.getElementById(idTab+"_"+riga+"_7").innerHTML="";
}
col=1; riga=1;
for (;d<d2 ;d.setDate(d.getDate()+1))
{
	var g=d.getDay();
	col=((g+6)%7)+1;
	document.getElementById(idTab+"_"+riga+"_"+col).innerHTML=d.getDate();
	document.getElementById(idTab+"_"+riga+"_"+col).style.cursor="hand";
	if (d.getDate()==giorno) document.getElementById(idTab+"_"+riga+"_"+col).style.backgroundColor="#99CCCC";
	if (col==7) riga++;
}
}

function inc_dec_mese(id,inc){
	var data= Date();
	var newMonth,valMonth;
	if ((document.getElementById(id+"_Hid").value)=="")
	{data = new Date();}
	else 
	{data= new Date(document.getElementById(id+"_Hid").value);}
	newMonth=(data.getMonth()+(!inc?1:-1)); 
	data.setMonth(newMonth);
	valMonth=newMonth;
	if (newMonth<0) valMonth=11;
	if (newMonth>11) valMonth=0;
	if (data.getMonth()!=valMonth){data.setMonth(valMonth);	}
	
	document.getElementById(id+"_Hid").value=data;
	fillCal(id,data);
}

function inc_dec_anno(id,inc){
	var data= Date();
	if ((document.getElementById(id+"_Hid").value)=="")
	{data = new Date();}
	else 
	{data= new Date(document.getElementById(id+"_Hid").value);}
	if (!inc)
	{data.setYear(data.getFullYear()+1);}
	else 
	{data.setYear(data.getFullYear()-1);}
	
	document.getElementById(id+"_Hid").value=data;
	fillCal(id,data);
}

function calcolaOffsetCal(o,isTop){
if (o==null || o.tagName.toUpperCase() =="DIV" || o.tagName.toUpperCase() =="SPAN") return 0; 
	else return ((isTop ? o.offsetTop : o.offsetLeft)+ calcolaOffsetCal(o.offsetParent,isTop));
}

function apri_chiudi_Calendario(id,controlloTemp,mess,formato,formatoData,da,a,sel){
	var d;
	var str_g, str_m , str_a , spanCal;
	/*analizzo lo stato di apertura se chiuso*/
	spanCal = document.getElementById(id + "_Span");
	if(spanCal.style.display=="none"){
		var ogg =document.getElementById(id + "_Int");
		spanCal.innerHTML = renderHtlmCalendar(id+"_Cal","200px","220px");
		document.getElementById(id + "_Cal").style.left=calcolaOffsetCal(ogg,false);
		document.getElementById(id + "_Cal").style.top=calcolaOffsetCal(ogg,true)+ogg.offsetHeight; 
		spanCal.style.display="block";
		d=interpretaData(OnitDataPickGet(id));
		fillCal(id + "_Cal",new Date(d));
	} else { /*aperto*/
		spanCal.style.display="none";
		d= new Date(document.getElementById(id + "_Cal_Hid").value);
		str_g=d.getDate()+""; str_g= (str_g.length<2 ?"0"+str_g :str_g);
		str_m=(d.getMonth()+1)+""; str_m=(str_m.length<2 ?"0"+str_m :str_m); 
		str_a =(d.getFullYear()<100?d.getFullYear()+1900:d.getFullYear());
		OnitDataPickSet(id,(str_g+"/"+str_m+"/"+str_a));
		if (controlloTemp){ /*controllo temporale*/
			ctl_CheckDataTemporalePick(id,mess,formatoData,da,a,sel);
		} else {/*solo formattazione*/
			ctl_CheckDataPick(id,formato,mess,formatoData,sel);
		}
	}
}

var OnitDatePick_win=null;
function apri_chiudi_Calendario_pop(id,controlloTemp,mess,formato,formatoData,da,a,sel){
	if (!OnitDatePick_win){
		var strHtml="", strIncludes;
		var d=interpretaData(OnitDataPickGet(id));
		var ogg =document.getElementById(id + "_Int");
		var padre ;
		var w=100, h=100, top, left;
		// inizializzazione hidden
		document.getElementById(id+"_Span").innerHTML = "<INPUT id=\"" + id + "_Cal_Hid\" value=\"\" type=\"hidden\" >" ;
		/* codice per aprire la popup*/

		strHtml=	"<html><head><title>Calendario<\/title><\/head><body scroll='no' style='border:none'>\n";
		strHtml += "\n<INPUT id='\"OnitDatePick1_Cal_Hid\"' value=\"\" style=\"Z-INDEX: 102; LEFT: 409px; WIDTH: 53px; POSITION: relative; \" type=\"hidden\" > \n";
		strHtml += "\n";
		strHtml += "<span id='calSpan' style=\" top:0px; left:0px \">\n" + renderHtlmCalendar(id+"_Cal","200px","220px",true) + "\n</span>\n";
		strHtml += "<\/body>";
		strHtml += "<script language=\"javascript\" >\n"
		strHtml += datePick_renderScript();
		strHtml += " fillCal(\""+id +"_Cal\",new Date(\'"+d+"\')); \n";
		strHtml += " <\/script>";
		strHtml += "<\/html>";
		h=200;
		w=220;
		padre=ogg;
		top=0; left=0;
		while (padre!=null){
			top+=padre.offsetTop; left+=padre.offsetLeft;
			padre=padre.offsetParent;
		}
		var p=calc_screenXY();
		/*la seguente riga rimedia il posizionamento errato causato dallo scroll nei div*/
		if (top+p[1]>window.screen.height) top = (window.screen.height-p[1]);
		if (top+p[1]+ogg.offsetHeight+h > window.screen.height){ /*se il calendario sborda in basso lo metto sopra il controllo*/
			top+=p[1]-h-30;
		} else {
			top+=p[1]+ogg.offsetHeight;
		}
		left+=p[0];
		var sFeatures="directories=no, fullscreen=0, height=" +h+ " ,width=" +w +",top="+top+",left="+left+",";
		sFeatures +="toolbar=no,titlebar=3,status=no,menubar=no";
		OnitDatePick_win =window.open("about:blank","mio",sFeatures);
		OnitDatePick_win.document.write(strHtml);
		OnitDatePick_win.document.close();

		} else {
		var d= new Date(document.getElementById(id+"_Cal_Hid").value);
				var str_g=d.getDate()+""; str_g= (str_g.length<2 ?"0"+str_g :str_g);
		var str_m=(d.getMonth()+1)+""; str_m=(str_m.length<2 ?"0"+str_m :str_m); 
		var str_a =(d.getFullYear()<100?d.getFullYear()+1900:d.getFullYear());
		OnitDataPickSet(id,(str_g+"/"+str_m+"/"+str_a));
		if (controlloTemp){ //controllo temporale
			ctl_CheckDataTemporalePick(id,mess,formatoData,da,a,sel);
		} else {//solo formattazione
			ctl_CheckDataPick(id,formato,mess,formatoData,sel);
		}
		// chiusura della finestra
		OnitDatePick_close_win();
	}
}

function datePick_renderScript(){
	var str="";
	str+=fillCal+"\n";
	str+=inc_dec_mese+"\n";
	str+=inc_dec_anno+"\n";
	str+=day_click+"\n";
	return str;
}

function day_click(id,idTab,CalPopup){
	var data;
	if (document.getElementById(id).innerHTML!="")
	{
		for (riga=1;riga<=6;riga++)
		{
			for (col=1;col<=6;col++) document.getElementById(idTab+"_"+riga+"_"+col).style.backgroundColor="white";
			document.getElementById(idTab+"_"+riga+"_7").style.backgroundColor="#CCCCFF";
		}
		document.getElementById(id).style.backgroundColor="#99CCCC";
		data= new Date(document.getElementById(idTab+"_Hid").value);
		data.setDate(document.getElementById(id).innerHTML);
		document.getElementById(idTab+"_Hid").value=data;
		if (CalPopup){
			window.opener.document.getElementById(idTab+"_Hid").value = data; //campo hidden della pagina madre
			window.opener.document.getElementById(idTab+"_Btn").click();
			/* chiamo l'override OnitDataPick_ClickDay nella pagina chiamante */
			if(window.opener["OnitDataPick_ClickDay"]) window.opener.OnitDataPick_ClickDay(idTab.replace(/_Cal\s*$/,""));
		}else {
			document.getElementById(idTab+"_Btn").click();
			/* chiamo l'override OnitDataPick_ClickDay nella pagina stessa */
			if(window["OnitDataPick_ClickDay"]) window.OnitDataPick_ClickDay(idTab.replace(/_Cal\s*$/,""));
		}
	}
}
function OnitDatePick_close_win(){
 if (OnitDatePick_win){
  	 OnitDatePick_win.close();
  	 OnitDatePick_win = null;
  }
}
window.onfocus=OnitDatePick_close_win;


function OnitDataPickGet(id){
	if(document.getElementById(id+"1")==null){/*textbox*/
		return document.getElementById(id).value;
	} else {/*dataBox -- compongo la data g/m/a*/
		var ris, v; 
		v=document.getElementById(id+"1").value; if(v=="") return "";
		ris=v+"/";
		v=document.getElementById(id+"2").value; if(v=="") return "";
		ris+= v+"/";
		v=document.getElementById(id+"3").value; if(v=="")return "";
		ris+= v; return ris;
	}
}
function OnitDataPickSet(id,strData){
	if(document.getElementById(id+"1")==null){/*textbox*/
		document.getElementById(id).value=strData;
	} else {/*dataBox -- scompongo la data g/m/a*/
		var s=strData.split("/");
		if(s.length==3){
			document.getElementById(id+"1").value=s[0]; document.getElementById(id+"2").value=s[1]; 
			/* siccome può contenere l'ora faccio un replace */
			document.getElementById(id+"3").value=s[2].replace(/\s\d+(\.|:)\d+(\.|:)*\d*/,"");
		} else {
			document.getElementById(id+"1").value=""; document.getElementById(id+"2").value=""; document.getElementById(id+"3").value="";
		}
	}
}

function OnitDataPickFocus(id,nBox,sel){/*id= nome calendario, nBox= [1,2,3,4(bottone)] casella a cui si deve dare il focus,sel= se selezionare il contenuto */
	var og;
	if(document.getElementById(id+"1")==null){/*textbox*/
		og=document.getElementById(id);
	} else {/*dataBox*/
		if(nBox<1 || nBox>4) return;
		og = document.getElementById(id+nBox);
	}
	if(nBox==4){ og = document.getElementById(id+"_Cal_Btn");}
	if (og){ if(sel) {og.select();} og.focus();};
};

function EspandiAnnoData(valore){
	var ris=valore, upB=(new Date()).getFullYear()+30;
	if (valore.length<=2 && valore.length>0 && !isNaN(valore)){
		if (upB%100 > valore) ris=(upB-upB%100)+parseInt(valore,10);
		else ris=(upB-upB%100)-100+parseInt(valore,10);
	}
	return ris;
}

function OnitDataPickIsDate(id){
	var i,o;
	var re=/^(\s*)(\d+)(\s*)$/
	if(document.getElementById(id+"1")==null){/*textbox*/
		return !(document.getElementById(id).value=="");
	} else {
		for (i=1; i<=3; i++){
			o=document.getElementById(id+i);  if(!re.test(o.value)){o.focus(); return false; }
		}
		return true;
	}
}
function OnitDataPickEnable(id,bEnable){
	var ogg, oldState=true, i;
	for (i=1; i<=3; i++){
		ogg=document.getElementById(id+i);
		if (ogg) {oldState=ogg.disabled; ogg.disabled = !bEnable}
	}
	ogg=document.getElementById(id+"_Cal_Btn");
	if (ogg) {oldState=ogg.disabled; ogg.disabled = !bEnable}
	return oldState;
}
var TastiEsclusi=new Array(0,9,16,20,17,91,92,93,18,13,45,36,35,33,34,37,38,39,40);

function analizzaData(e,id,ord,next,blr){
	var j;
	for (j =0; j<TastiEsclusi.length && !blr; j++){if (TastiEsclusi[j]==e.keyCode) return;}
	var testo=id.value;
	var t=testo;
	var l =new Array(3); l[0]=2;l[1]=2;l[2]=4;
	var rLow= new Array(3); rLow[0]=1;rLow[1]=1; rLow[2]=0;
	var rUp= new Array(3);rUp[0]=31; rUp[1]=12;rUp[2]=9999;
	var i;
	
	/*eliminazione dei caratteri alfabetici*/
	for (i=0; i<testo.length;i++){
		if (isNaN(testo.charAt(i))){
			t=testo.substring(0,i)+testo.substring(i+1,testo.length);
			id.value=t; break;
		}
	}
	
	if ((t.length>=l[ord-1]) || blr){ /*passaggio al campo prossimo nel blur esegue solo controllo o se scrivo tutte le cifre*/
		var generico=id.id.substring(0,id.id.length-1);/*nome base del controllo*/
		if((parseInt(t,10)>=rLow[ord-1]) && (parseInt(t,10)<=rUp[ord-1]) ){/*se i valori sono inclusi nei range*/
			if (!blr){
				if(ord!=3){/*dal 3° textbox non vado + al primo */
					document.getElementById(generico+next).focus();
					document.getElementById(generico+next).select();
				}
			} else { /* evento blur */
				if (t.length==1 && ord <3) id.value=("0"+t);
			}
		} else { /*cancella*/
			id.value="";id.focus();
		}
		DateBoxValida(generico,ord);
	}
}

function DateBoxValida(generico,ord){
	/*valido la data*/
	var dysInMonth= new Array(31,29,31,30,31,30,31,31,30,31,30,31); 
	var compD,compM,compY,dd,mm,yy,bise; /* comp indica quali textbox sono completi*/
	var obj1 =document.getElementById(generico+1);/*giorno*/
	var obj2 =document.getElementById(generico+2);/*mese*/
	var obj3 =document.getElementById(generico+3);/*anno*/
	var re1,re2,re3; re1=/^\d+$/g; re2=/^\d+$/g; re3=/^\d+$/g;
	compD=re1.test(obj1.value); dd=(compD ? parseInt(obj1.value,10) : 0);
	compM=re2.test(obj2.value); mm=(compM ? parseInt(obj2.value,10) : 0);
	compY=re3.test(obj3.value); yy=(compY ? parseInt(obj3.value,10) : 0);
	if (compY){
		/* Un anno e' bisestile se il suo numero e' divisibile per 4, tranne che se sia divisibile per 100 (ma e' bisestile se e' divisibile per 400).*/	
		if ((yy%400)==0 || ((yy%4)==0 && (yy%100)!=0 ) ){
			dysInMonth[1]=29;
		} else {
			dysInMonth[1]=28;
		}
	}
	/*controllo del giorno se è stato introdotto il mese */
	if (compD && compM){
		if (dd>dysInMonth[mm-1] || dd<1){
			/*il giorno non è valido*/
			obj1.value="";  obj1.focus();
		}
	}
}

function calc_screenXY(oggDateBox){
	var intTopPos, intLeftPos;
	if(window.screenY)
	{
		intTopPos = window.screenY+120;
		intLeftPos= window.screenX+5;
	}
	if(window.screenTop)
	{
		intTopPos = window.screenTop;
		intLeftPos= window.screenLeft;
	}
	return new Array(intLeftPos,intTopPos);
}

/* gestisce il blur dal controllo */
/*proc è una eventuale procedura di controllo di validazione */
/*non esistendo activeElement, su mozilla il blur scatta all uscita dall ultimo textbox*/
function OnitDatePick_blurs(ctl,e,proc){
	var at=document.activeElement;
	var isBlur=true;
	var parentRow, pickerId;
	parentRow=ctl.parentNode.parentNode;
	pickerId=ctl.id.substring(0,ctl.id.length-1);
	if(ctl.readOnly || ctl.disabled) isBlur=false;/*se il controllo è disabilitato non deve scattare il blur*/
	if(at){
		if(at) {if(at.parentNode){ if(at.parentNode.parentNode==parentRow) isBlur=false; } };
	} else {
		isBlur = (ctl.id==(pickerId+"3"));
	} 
	if (isBlur && proc) proc(); 
	if (isBlur && window["OnitDataPick_Blur"] ){
		OnitDataPick_Blur(pickerId,e);
	}
}

/*OnitDatePick: oggetto che identifica un insieme di controlli datapiker raggruppati per targhet*/
/*OnitDatePick.nome_target[i]: l'i-esimo elemento catalogato sotto un certo target */
var OnitDatePick= new Object();

/* costruttore della classe OnitDatePickElem che immagazzina informazioni sullo stato di un datapick*/
function OnitDatePickElem(id,target,indice){
	this.clientId=id;
	this.target=target;
	this.indice=indice;
	this.Get= function(){return OnitDataPickGet(this.clientId);}
	this.Set= function(strData){OnitDataPickSet(this.clientId,strData);}
	this.Focus=function(nBox,sel){return OnitDataPickFocus(this.clientId,nBox,sel);}
	this.IsDate= function(){return OnitDataPickIsDate(this.clientId);}
	this.Enable= function(bEnabled){return OnitDataPickEnable(this.clientId,bEnabled);}
	if(!OnitDatePick[target]) OnitDatePick[target]=new Array();
	if (indice<0) this.indice = OnitDatePick[target].length;/*creazione atomatica dell'indice*/
	OnitDatePick[target][this.indice]=this;
}
