/*===============================================================================
  getDisplayDate(new Date); --> returns date in DD/MM/YYYY format
=================================================================================*/
function getDisplayDate(passedDate) {
    theDate = new Date(passedDate);

    // split into day, month, year
    var iDay = theDate.getDate();
    var iMonth = theDate.getMonth();

    if (iDay <10) {
      iDay = "0" + iDay; // if you want leading zero on month
    }

    if (iMonth <10) {
      //iMonth = "0" + (parseInt(theDate.getMonth()) + 1)  ; // if you want leading zero on month
      iMonth = (parseInt(theDate.getMonth()) + 1)  ; // if you want leading zero on month
    }
    iYear = theDate.getFullYear();

    sDisplayDate = iDay + "/" + iMonth + "/" + iYear;

    return sDisplayDate;
}


/*===============================================================================
  clearListBox(Objeto ListBox); --> clears all the options in a list box
=================================================================================*/
function clearListBox(lstBoxObj) {
  //clear list box
  for(var i=lstBoxObj.options.length;i>=0;i--) {
    lstBoxObj.options[i] = null;
  }
}


/*===============================================================================
Displaying the new-item Icon
===============================================================================*/
function newItem(expiryDate)  {  
  exp = new Date(expiryDate);
  cur = new Date();
  if (cur.getTime() < exp.getTime())
    document.write("<IMG SRC=\"elements\/images\/new.gif\" BORDER=0 ALT=\"nuevo\">" );  
}

