//viene de calcularExpediente.js

function ahora(){
	var today = getdata('fechayhora_server',0);
	xfechayhora_server.loadXML(today);
	parseERROR(xfechayhora_server.documentElement);	
	today = xfechayhora_server.recordset.Fields(0).Value;
	return today;
}

function fecha_server(){
	return replace(ahora().substring(0,10),'-','/');
}

function hora_server(){
	return ahora().substring(11,19);
}

//Hasta aca era de calcularExpediente.js


//viene de common.js

function toDatetime(dates)
{
 return String(dates.charAt(6) + dates.charAt(7) + dates.charAt(8) + dates.charAt(9) + '-' + dates.charAt(3) + dates.charAt(4) + '-' + dates.charAt(0) + dates.charAt(1));
}


//function toTimeInt(t) QUITADA: NO SE USA

//function returnMes(number) QUITADA: NO SE USA

//Hasta aca era de common.js


//viene de ServerDate.js

//function ServerDate() QUITADA: NO SE USA

function getServerDate()
{

  var d = _d();
  return parseDIGITto2(d.getDate());
}
function getServerMonth()
{


  var d = _d();
  return parseDIGITto2(d.getMonth()+1);
}
function getServerYear()
{

  var d = _d();
  return d.getFullYear();
}
//---------------- FORMAT: hh:mm -> 01:05 -----------------------
function ServerHour()
{ 
  var d = _d();
  return parseDIGITto2(d.getHours())+':'+parseDIGITto2(d.getMinutes());
}
function _d(){ return new Date(getFieldDate()); }
// --------------------------------------------------------------
function parseDIGITto2(x){ return (String(x).length == 1)?'0'+x:x; }

function MenosToSlash(x){ return parseDIGITto2(x.split('-')[1]) + '/' + parseDIGITto2(x.split('-')[0]) + '/' + x.split('-')[2]; }

function SlashToMenos(x){ return parseDIGITto2(x.split('/')[1]) + '-' + parseDIGITto2(x.split('/')[0]) + '-' + x.split('/')[2]; }

function InvertMonthAndDay(x){ return parseDIGITto2(x.split('/')[0]) + '/' + parseDIGITto2(x.split('/')[1]) + '/' + x.split('/')[2]; }

function convertToNumericDate(d){ return Date.parse(new Date(d.substring(6,10),d.substring(3,5)-1,d.substring(0,2))); }

function getFieldDate()
{
  var post = funcPOST('../../../data/get_date_time.asp');
  //alert(post);
  var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
  xmlDoc.async = false;
  xmlDoc = new_DOMDocumentEmpty(post);
  //alert(xmlDoc.xml);
  var j;
  if(xmlDoc.documentElement.hasChildNodes())
  	j = (xmlDoc.documentElement.hasChildNodes())?xmlDoc.selectSingleNode('//row').getAttribute("unknow"):0;
  return parseDIGITto2(j.split('/')[1]) + '/' + parseDIGITto2(j.split('/')[0]) + '/' + j.split('/')[2];
}

//Hasta aca era de ServerDate.js