var formmanager = new function(){

	this.submit = function (sId){
		var hdnInvia = document.createElement('input');
		hdnInvia.type = "hidden";
		hdnInvia.name = "invia";
		hdnInvia.id = "invia";
		hdnInvia.value = 1;
	  getobj(sId).appendChild(hdnInvia);
		getobj(sId).submit(); 
	}
	this.creadata = function (sVal,sDate){
		 var aVal = sVal.split("-");
		 //assegna valori
	   getobj("g_" + sDate).value = aVal[0];
	   getobj("m_" + sDate).value = aVal[1];
	   getobj("a_" + sDate).value = aVal[2];
	   //colora di bianco
	   this.disevidcampo("g_" + sDate);
	   this.disevidcampo("m_" + sDate);
	   this.disevidcampo("a_" + sDate);
	}
	this.eviddata = function (sDate){
	   this.evidcampo("g_" + sDate);
	   this.evidcampo("m_" + sDate);
	   this.evidcampo("a_" + sDate);
	}
	this.disevidcampo = function (sField){
		 getobj(sField).style.backgroundColor='#ffffff';
	}
	this.evidcampo = function (sField){
	   getobj(sField).style.backgroundColor='#FFA07A';
	}
	this.blurme = function (oObj){
		 oObj.style.backgroundColor='#ffffff';
		 oObj.style.borderColor='#000000';
	}
	this.focusme = function (oObj){
		 oObj.style.backgroundColor='#FFFFA4';
		 oObj.style.borderColor='#FA9100';
	}
	this.showtab = function (sTab,sOtherTab){
		 var oOtherTabs = sOtherTab.split(","),i;
		 for (i = 0 ; i < oOtherTabs.length ; i++)
			 hide(oOtherTabs[i]);
		 show(sTab);	
	}
	this.resetrowcolor = function (sTagContainer){
		var oRows = getobj(sTagContainer).getElementsByTagName('tr'), i;
		for (i = 0 ; i < oRows.length ; i++)
			if (oRows[i].className.indexOf("pari") != -1)	
				if (i % 2){
					oRows[i].className = "private-line private-dispari";
					oRows[i].onmouseout = function(){
						this.className = "private-line private-dispari";
					}			
				}else{
					oRows[i].className = "private-line private-pari";
					oRows[i].onmouseout = function(){
						this.className = "private-line private-pari";
					}			
				}					
	}

}
