 function VText(Contents)
 
 {
  var checkOK = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz. ";
  var checkStr = Contents;
  var allValid = true;
  
  for (i = 0;  i < checkStr.length; i++)
  {
	ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
		{   
			if (ch == checkOK.charAt(j))
				break;
			if (escape(ch) == "%0D")
				{
					ch = checkStr.charAt(i+1)
					if (escape(ch) == "%0A")
						{
						i = i + 1;
						break;
						}
				}
			if (j == 53)
				{
				allValid = false;
				break;
				}	
		}
    
  }

  if (!allValid)
  {
    return (false);
  }
  else
  {
  return (true);
  }  
 }
 
 
 
 function VSpclChar(Contents)
 
 {
  var checkOK = ' ~`!@#$%^&*()_-+=<>?/,."\':;{}[]|\ ';
  var checkStr = Contents;
  var allValid = true;
  
  for (i = 0;  i < checkStr.length;  i++)
  {
	ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
		{   
			if (ch == checkOK.charAt(j))
				break;
			
			if (j == 32)
				{
				allValid = false;
				break;
				}	
		}
    
  }

  if (!allValid)
  {
    return (false);
  }
  else
  {
  return (true);
  }  
 }
 
 
 
 function VTextmail(contents)
  {
  var checkStr = contents;
  var flag1 = 0;
  var flag2 = 0;
  var ch;
  
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    if(ch == "@" && checkStr.length > 6)
       {
         flag1 = 1;  
       } 
    if(ch == "." && checkStr.length > 6)
       {
         flag2 = 1;  
       }
          
   }
    
    if (flag1 == 0 || flag2 == 0)
		{
		return (false);
		}
    return true;
 }
 
 //New E-mail validation
 function VEmail(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}
 
function trim(str)
{
	var tstr;
	var i;	
	if(str.length > 0)
	{
		i = 0
		while(str.charAt(i) == ' ') { i++ }
		tstr = str.substring(i,str.length)
		i    = tstr.length -1
		while(tstr.charAt(i) == ' ') { i --}
		tstr = tstr.substring(0,i+1)
		return(tstr)
	}
	else
	return("")
	
}//end of function trim	 
 
 function VUrl(contents){
 return true
 }
 
 function VNum(contents){
  var checkOK = "0,.123456789";
  var checkStr = contents;
  var allValid = true;
  var ch;
  
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      { 
       if (ch == checkOK.charAt(j))
			{
			break;
			}
		if (j == 11)
			{
			allValid = false;
			break;
			}
      } 
        if (!allValid)
			{
			return (false);
		    }
   }
    return (true);
 }
 
 function VNumRs(contents,rsmaxlength)
 {
  var checkOK = "0.,123456789";
  var checkStr = contents;
  var allValid = true;
  var ch,arrRs,arrCheckDots;
 
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    
    for (j = 0;  j < checkOK.length;  j++)
      { 
       if (ch == checkOK.charAt(j))
			{
			break;
			}
		if (j == 11)
			{
			allValid = false;
			break;
			}
      } 
      
    if (!allValid)
		{
			return (false);
		}
   }
   
	if (contents.indexOf(".") == -1)
		{
			if(contents.length > parseInt(rsmaxlength)-2)
				{
					return (false);	
				}
		}
	else
		{	
			arrRs = contents.split(".")
			if(arrRs[0].length > parseInt(rsmaxlength - 2) || arrRs[1].length > 2)
				{
					return (false);
				}
		}
	
	arrCheckDots = contents.split(".")
	if(arrCheckDots.length > 2)
		{
			return (false);
		}
		
    return (true);   
 }
 
 //Telephone no. validation
 
 function VPhone(contents){
  var checkOK = ")(0123456789-+ ";
  var checkStr = contents;
  var allValid = true;
  var ch;
  
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      { 
       if (ch == checkOK.charAt(j))
			{
			break;
			}
	   if (j == 14)
			{
			allValid = false;
			break;
			}
      } 
        if (!allValid)
			{
			return (false);
		    }
   }
   return true;
 }
 

 function VAddress(Contents)
 
 {
  var checkOK = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789,-/()#&. ";
  var checkStr = Contents;
  var allValid = true;
  
  for (i = 0;  i < checkStr.length;  i++)
  {
	ch = checkStr.charAt(i);

    for (j = 0; j < checkOK.length; j++)
		{   
			if (ch == checkOK.charAt(j))
				break;
			if (escape(ch) == "%0D")
				{
					ch = checkStr.charAt(i+1)
					if (escape(ch) == "%0A")
						{
						i = i + 1;
						break;
						}
				}
			if (j == 71)
				{
				allValid = false;
				break;
				}	
		}
				
  }

  if (!allValid)
  {
    return (false);
  }
  else
  {
  return (true);
  }  
 }

 
  
 //Mobile no. validation
 
 function VMobile(contents){
  var checkOK = "0123456789- ";
  var checkStr = contents;
  var allValid = true;
  var ch;
  
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      { 
       if (ch == checkOK.charAt(j))
			{
			break;
			}
	   if (j == 11)
			{
			allValid = false;
			break;
			}
      } 
        if (!allValid)
			{
			return (false);
		    }
   }
   return true;
 }
 
  
function Is_Blank_Space(contents)
{
   
   var Found
   for (i = 0;  i < contents.length;  i++)
   {    
        ch = contents.charAt(i);
        if(ch == " ")
        {
         Found = true  
         break;
        }
   }//end of for  
    
   if(Found){return true} else {return false} 
   
 
}//end of function
 
 
function VTextNum(Contents)
 
 {
  var checkOK = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ";
  var checkStr = Contents;
  var allValid = true;
  
  for (i = 0;  i < checkStr.length;  i++)
  {
	ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
		{   
			if (ch == checkOK.charAt(j))
				break;
			if (escape(ch) == "%0D")
				{
					ch = checkStr.charAt(i+1)
					if (escape(ch) == "%0A")
						{
						i = i + 1;
						break;
						}
				}
			if (j == 63)
				{
				allValid = false;
				break;
				}	
		}
    
  }

  if (!allValid)
  {
    return (false);
  }
  else
  {
  return (true);
  }  
 }

 //Function to Validate for Entry of Single Quotes...
	function Is_Single_Quote(id)
	{
		   id.value = (id.value).replace(/'/g, "")
	}
	
	//Function to Validate for Entry of Double Quotes...
	function Is_Double_Quote(id)
	{
		   id.value = (id.value).replace(/"/g, "")
	}
	
function Is_Single_Code(checkStr)
{
   
   var Found
   for (i = 0;  i < checkStr.length;  i++)
   {    
        ch = checkStr.charAt(i);
        if(ch == "'")
        {
         Found = true  
         break;
        }
   }//end of for  
    
   if(Found){return true} else {return false} 
   
 
}//end of function

// Function for comma
function Is_Comma(checkStr)
{
   
   var Found
   for (i = 0;  i < checkStr.length;  i++)
   {    
        ch = checkStr.charAt(i);
        if(ch == ",")
        {
         Found = true  
         break;
        }
   }//end of for  
    
   if(Found){return true} else {return false} 
   
 
}//end of function

function Is_Double_Code(checkStr)
{
   
   var Found
   for (i = 0;  i < checkStr.length;  i++)
   {    
        ch = checkStr.charAt(i);
        if(ch == '"')
        {
         Found = true  
         break;
        }
   }//end of for  
    
   if(Found){return true} else {return false} 
   
 
}//end of function
	
function Confirm(frmName)
{
	var blnFlag, flag;
	
	flag = false;
	frmObject = eval('document.' + frmName);
	for (i=0; i<frmObject.length; i++)
		if(frmObject[i].type == "checkbox")
			if (frmObject[i].checked) {
				flag = true;
				break;
			}	
	if (flag == true) {
		blnFlag = confirm("Are you sure you want to delete the Record ? ");
		if (blnFlag == true)
			return true;
		else
			return false;
	}
	else {
		alert("Select a record to delete.");
		return false;
	}	
}

function Confirm_App(frmName)
{
	var blnFlag, flag;
	
	flag = false;
	frmObject = eval('document.' + frmName);
	for (i=0; i<frmObject.length; i++)
		if(frmObject[i].type == "checkbox")
			if(frmObject[i].name == "chkApprove") {
				if (frmObject[i].checked) {
					flag = true;
					break;
				}
			}	
	if (flag == true) {
		blnFlag = confirm("Are you sure you want to Approve? ");
		if (blnFlag == true)
			return true;
		else
			return false;
	}
	else {
		alert("Select a property to approve.");
		return false;
	}	
}

function Confirm_Sold(frmName)
{
	var blnFlag, flag;
	
	flag = false;
	frmObject = eval('document.' + frmName);
	for (i=0; i<frmObject.length; i++)
		if(frmObject[i].type == "checkbox")
			if(frmObject[i].name == "chkSold") {
				if (frmObject[i].checked) {
					flag = true;
					break;
				}
			}	
	if (flag == true) {
		blnFlag = confirm("Are you sure you want to Sold Property? ");
		if (blnFlag == true)
			return true;
		else
			return false;
	}
	else {
		alert("Select a property to Sold.");
		return false;
	}	
}

function Confirm_Leased(frmName)
{
	var blnFlag, flag;
	
	flag = false;
	frmObject = eval('document.' + frmName);
	for (i=0; i<frmObject.length; i++)
		if(frmObject[i].type == "checkbox")
			if(frmObject[i].name == "chkLeased") {
				if (frmObject[i].checked) {
					flag = true;
					break;
				}
			}	
	if (flag == true) {
		blnFlag = confirm("Are you sure you want to Leased Property? ");
		if (blnFlag == true)
			return true;
		else
			return false;
	}
	else {
		alert("Select a property to Leased.");
		return false;
	}	
}

function ConfirmCheque(frmName)
{
	var blnFlag, flag;
	
	flag = false;
	frmObject = eval('document.' + frmName);
	for (i=0; i<frmObject.length; i++)
		if(frmObject[i].type == "checkbox")
			if (frmObject[i].checked) {
				flag = true;
				break;
			}	
	if (flag == false) {
		alert("Select Cheque.");
		return false;
	}	
}


function ConfirmProcess(frmName)
{
	var blnFlag, flag;
	
	flag = false;
	frmObject = eval('document.' + frmName);
	for (i=0; i<frmObject.length; i++)
		if(frmObject[i].type == "checkbox")
			if (frmObject[i].checked) {
				flag = true;
				break;
			}	
	if (flag == true) {
		blnFlag = confirm("Are you sure you want to process the Record ? ");
		if (blnFlag == true)
			return true;
		else
			return false;
	}
	else {
		alert("Select a record to process.");
		return false;
	}	
}

function ConfirmMerchant(frmName)
{
	var blnFlag, flag;
	
	flag = false;
	frmObject = eval('document.' + frmName);
	for (i=0; i<frmObject.length; i++)
		if(frmObject[i].type == "checkbox")
			if (frmObject[i].checked) {
				flag = true;
				break;
			}	
	if (flag == true) {
		blnFlag = confirm("Are you sure you want to post the TPF Charges? ");
		if (blnFlag == true)
			return true;
		else
			return false;
	}
	else {
		alert("Select Merchant.");
		return false;
	}	
}


function ConfirmTransfer(frmName)
{
	var blnFlag, flag;
	
	flag = false;
	frmObject = eval('document.' + frmName);
	for (i=0; i<frmObject.length; i++)
		if(frmObject[i].type == "checkbox")
			if (frmObject[i].checked) {
				flag = true;
				break;
			}	
	if (flag == true) {
		blnFlag = confirm("Are you sure you want to transfer stock ? ");
		if (blnFlag == true)
			return true;
		else
			return false;
	}
	else {
		alert("Select a record to transfer.");
		return false;
	}	
}

function ConfirmReceive(frmName)
{
	var blnFlag, flag;
	
	flag = false;
	frmObject = eval('document.' + frmName);
	for (i=0; i<frmObject.length; i++)
		if(frmObject[i].type == "checkbox")
			if (frmObject[i].checked) {
				flag = true;
				break;
			}	
	if (flag == false) {
		alert("Select a Asset to Receive");
		return false;
	}	
}

function clearfield(frmname,txtsearch)
{

var objForm;
var objtxt;

objForm = eval("document." + frmname);

for (i=0; i<objForm.length; i++)
		if(objForm[i].type == "text")
			if (objForm[i].value) {
				objForm[i].value = ""
				break;
			}	
	
}

//Function for Dates
function changeDays(form_month,form_day,form_year) {
  mth = form_month.selectedIndex;
  sel = form_year.selectedIndex;
  yr = form_year.options[sel].text;
  numDays = numDaysIn(mth,yr);
  form_day.options.length = numDays+1;
  for (i=27;i<=numDays;i++) {
    form_day.options[i].text = i;
  }
  day = form_day.selectedIndex+1;
}

function numDaysIn(mth,yr) {
  if (mth==4 || mth==6 || mth==9 || mth==11) return 30;
  else if ((mth==2) && leapYear(yr)) return 29;
  else if (mth==2) return 28;
  else return 31;
}

function leapYear(yr) {
  if (((yr % 4 == 0) && yr % 100 != 0) || yr % 400 == 0)
    return true;
  else
    return false;
}

/*function to compare two dates (one is greater or lesser than another one)
  Pass first parameter is lesser date and second parameter is greater date
*/
function CompareDate(dtDate1DD, dtDate1MM, dtDate1YY, dtDate2DD, dtDate2MM, dtDate2YY)
{
	var dtDate1, dtDate2

	dtDate1 = dtDate1YY + dtDate1MM + dtDate1DD;
	dtDate2 = dtDate2YY + dtDate2MM + dtDate2DD;
	
	if (dtDate2 <= dtDate1)
		return false;
	else
		return true;
}

function IsNumeric(intVal)
{
	 var i
	 var flag = true;
	 
	 /*if more than one decimal point is found in numbers*/
					
	 for (i = 0;  i < intVal.length; i++)
	 {
	   ch = intVal.charCodeAt(i);
	   
	   /* 32 is ascii value for space character. 
		  34 is ascii value for double quote and 39 is ascii value for single quote.
		  Range of ascii value for numbers 0 - 9 is 48 - 57
	   */
	   if (ch == 32 || ch == 34 || ch == 39 || ch < 48 || ch > 57) {
			flag = false;
			break;
	   }		

	}
	
	return flag;
}

function IsDecimal(dblVal)
{
	 var i, intVal;
	 var flag = true;
	 
	 intVal = dblVal.split(".");
	 
	 /*if more than one decimal point is found in numbers*/
	 if (intVal.length > 2) {
		flag = false;
		return flag;
	}
	
	for (i = 0;  i < intVal.length; i++)
		if (intVal[i] == "") {
			flag = false;
			return flag;
		}	
		
					
	 for (i = 0;  i < dblVal.length; i++)
	 {
	   ch = dblVal.charCodeAt(i);

	   /* 32 is ascii value for space character. 
		  34 is ascii value for double quote and 39 is ascii value for single quote.
		  32 is ascii value for dot character. 
		  Range of ascii value for numbers 0 - 9 is 48 - 57
	   */
	   if ((ch == 32 || ch == 34 || ch == 39 || ch < 48 || ch > 57) && ch != 46) {
			flag = false;
			break;
	   }		

	}
	
	return flag;
}

function IsMapDecimal(dblVal, intDecimalLeft)
{
	 var i, intVal;
	 var flag = true;
	 //alert(dblVal.length > intDecimalLeft);	
	 if (dblVal.length > intDecimalLeft)	{
			return false;
	}		
	 
	 intVal = dblVal.split(".");
	 
	 /*if more than one decimal point is found in numbers*/
	 if (intVal.length > 2) {
		flag = false;
		return flag;
	}
	
	for (i = 0;  i < intVal.length; i++)
		if (intVal[i] == "") {
			flag = false;
			return flag;
		}	
		
					
	 for (i = 0;  i < dblVal.length; i++)
	 {
	   ch = dblVal.charCodeAt(i);

	   /* 32 is ascii value for space character. 
		  34 is ascii value for double quote and 39 is ascii value for single quote.
		  32 is ascii value for dot character. 
		  Range of ascii value for numbers 0 - 9 is 48 - 57
	   */
	   if ((ch == 32 || ch == 34 || ch == 39 || ch < 48 || ch > 57) && ch != 46) {
			flag = false;
			break;
	   }		

	}
	
	return flag;
}

function CheckDate(intDay,intMonth,intYear,intUsrDay,intUsrMonth,intUsrYear,strField)
	{
		var dtDate;
		dtDate = eval(strField);
		
		if (parseInt(intUsrMonth) == 2)
			{	
				if (parseInt(intUsrDay) >= 30)
					{
						alert("Not a valid date");
						dtDate.focus();
						return false;
					}
											
				if (((parseInt(intUsrYear) % 4 == 0) && parseInt(intUsrYear) % 100 != 0) || parseInt(intUsrYear) % 400 == 0)
					{
						//leap year
					}
				else
					{
						if (parseInt(intUsrDay) >= 29)
							{
								alert("Not a valid date");
								dtDate.focus();
								return false;
							}
					}						
			}
						
		if (parseInt(intUsrMonth) == 4 || parseInt(intUsrMonth) == 6 || parseInt(intUsrMonth) == 9 || parseInt(intUsrMonth) == 11)
			{
				if (parseInt(intUsrDay) > 30)
					{
						alert("Not a valid date");
						dtDate.focus();
						return false;
					}
			}
					
		//selected date shouldn't be greater than todays date
		if (parseInt(intUsrYear) == parseInt(intYear))
			{
				if (parseInt(intUsrMonth) > parseInt(intMonth))
					{
						alert("Date should not be greater than today's date" );					
						dtDate.focus();
						return false;
					}
				if (parseInt(intUsrMonth) == parseInt(intMonth))
					{
						if (parseInt(intUsrDay) > parseInt(intDay))
						{
							alert("Date should not be greater than today's date" );
							dtDate.focus();
							return false;
						}
					}
			}		
	}



/*
FormatNumber(Expression, NumDigitsAfterDecimal, IncludeLeadingDigit,
             UseParensForNegativeNumbers, GroupDigits)
======================================================================
*/



/**********************************************************************
	IN:
		NUM - the number to format
		decimalNum - the number of decimal places to format the number to
		bolLeadingZero - true / false - display a leading zero for
										numbers between -1 and 1
		bolParens - true / false - use parenthesis around negative numbers
		bolCommas - put commas as number separators.
 
	RETVAL:
		The formatted number!
 **********************************************************************/
function FormatNumber(num,decimalNum,bolLeadingZero,bolParens,bolCommas)
{ 
        if (isNaN(parseInt(num))) return "NaN";

	var tmpNum = num;
	var iSign = num < 0 ? -1 : 1;		// Get sign of number
	var arrlngNumber;
	var strZeroAfterDecimal;
	var lngCounter;
	lngCounter =0 ;
	// Adjust number so only the specified number of numbers after
	// the decimal point are shown.
	tmpNum *= Math.pow(10,decimalNum);
	tmpNum = Math.round(Math.abs(tmpNum))
	tmpNum /= Math.pow(10,decimalNum);
	tmpNum *= iSign;					// Readjust for sign
	
	
	// Create a string object to do our formatting on
	var tmpNumStr = new String(tmpNum);

	// See if we need to strip out the leading zero or not.
	if (!bolLeadingZero && num < 1 && num > -1 && num != 0)
		if (num > 0)
			tmpNumStr = tmpNumStr.substring(1,tmpNumStr.length);
		else
			tmpNumStr = "-" + tmpNumStr.substring(2,tmpNumStr.length);
		
	// See if we need to put in the commas
	if (bolCommas && (num >= 1000 || num <= -1000)) {
		var iStart = tmpNumStr.indexOf(".");
		if (iStart < 0)
			iStart = tmpNumStr.length;

		iStart -= 3;
		while (iStart >= 1) {
			tmpNumStr = tmpNumStr.substring(0,iStart) + "," + tmpNumStr.substring(iStart,tmpNumStr.length)
			iStart -= 3;
		}		
	}

	// See if we need to use parenthesis
	if (bolParens && num < 0)
		tmpNumStr = "(" + tmpNumStr.substring(1,tmpNumStr.length) + ")";
	
	arrlngNumber = tmpNumStr.split(".");
	
	if ( arrlngNumber.length == 0 )
	{
		for (lngCounter =1;lngCounter<=decimalNum;lngCounter++ )
		{
			strZeroAfterDecimal = strZeroAfterDecimal + "0"	;
		}
			
		return tmpNumStr + "." + strZeroAfterDecimal ;		// Return our formatted string!	
	}
	strZeroAfterDecimal = "";
	if ( arrlngNumber.length == 1 )
	{
		for (lngCounter =1;lngCounter<=decimalNum;lngCounter++ )
		{
			strZeroAfterDecimal = strZeroAfterDecimal + "0"	;
		}
			
		return tmpNumStr + "." + strZeroAfterDecimal ;		// Return our formatted string!	
	}
	 
	if ( arrlngNumber.length == 2 )
	{
		for (lngCounter =1;lngCounter<=decimalNum - arrlngNumber[1].length ;lngCounter++ )
		{
			strZeroAfterDecimal = strZeroAfterDecimal + "0"	;
		}
			
		return tmpNumStr + strZeroAfterDecimal ;		// Return our formatted string!	
	}
	return tmpNumStr;
	
}

//Validation for Date picker
// fixPosition() attaches the element named eltname
// to an image named eltname+'Pos'
//
function fixPosition(divname) {
 divstyle = getDivStyle(divname);
 positionerImgName = divname + 'Pos';
 // hint: try setting isPlacedUnder to false
 isPlacedUnder = false;
 if (isPlacedUnder) {
  setPosition(divstyle,positionerImgName,true);
 } else {
  setPosition(divstyle,positionerImgName)
 }
}
var hdnSDate;
function toggleDatePicker(eltName,formElt,txtWONo) {
  var x = formElt.indexOf('.');
  var formName = formElt.substring(0,x);
  var formEltName = formElt.substring(x+1);
  hdnSDate = (eval(formElt));
  newCalendar(eltName,document.forms[formName].elements[formEltName], eval("document.forms[formName].txtWONo"));
  toggleVisible(eltName);
}

// fixPositions() puts everything back in the right place after a resize.
function fixPositions()
{
 // add a fixPosition call here for every element
 // you think might get stranded in a resize/reflow.
 fixPosition('daysOfMonth');
 fixPosition('daysOfMonth2');
}

function toggleDatePicker1(eltName,formElt) {
  var x = formElt.indexOf('.');
  var formName = formElt.substring(0,x);
  var formEltName = formElt.substring(x+1);
  newCalendar(eltName,document.forms[formName].elements[formEltName]);
  toggleVisible1(eltName);
}










