function MM_swapImage(imgId, imgPath) 
{ 
  oImg = document.getElementById(imgId);
  oImg.src= imgPath;
    
}


function findImageIndex(aryImages, sId)
{
    var nImageDx = -1;
    for (var nIdx = 0; nIdx < aryImages.length; nIdx++)
        if (aryImages[nIdx].id == sId)
        {
            nImageDx = nIdx;
            break;
        }
        
    return nImageDx;
}



function isEmpty(sValue)
{
	var bisEmpty = false;

    if (((sValue == "") && (sValue != "0")) ||
		(String(sValue) == "null") || 
		(String(sValue) == "undefined"))
		bisEmpty = true;

	return(bisEmpty);
} 

function doNothing()
{
}



function isBlank(sText)
{       
    var cTest;
    var nIdx;
    
    for(nIdx = 0; nIdx < sText.length; nIdx++)
    {
        cTest = sText.charAt(nIdx);
        if ((cTest != ' ') && (cTest != '\n') && (cTest != '\t')) 
            return false;
    }
    return true;
}    

function trim(sValue)
{  
    var cTrim = ' '; 
    var sReturn = sValue;
    
    // Remove the leading characters
    while (sReturn.charAt(0) == cTrim)
        sReturn = sReturn.substring(1, sReturn.length);
    
    // Remove the trailing characters
    while (sReturn.charAt(sReturn.length - 1) == cTrim)
        sReturn = sReturn.substring(0, sReturn.length - 1);
    
    return sReturn;
}

function removeCommas(sValue, bAltDecimal)
{
    //var reNoCommas = /,/g;
    //var reNoDecimalsAsCommas = /./g;
   
    if (bAltDecimal)
        sValue = String(sValue).replace(".", "");
    else
        sValue = String(sValue).replace(",", "");
        
    return sValue;
}



function setDate(sField)
{
    oDiv = document.getElementById(sField);
      alert(oDiv.name);
    var d,s;
    var c = ":";
   	d = new Date();
	s = d.getHours() + c;
	s += d.getMinutes() + '  ';
       s += (d.getMonth() + 1) + "/";
	s += d.getDate() + "/";
	s += d.getYear();
	oDiv.innertext = d ;
	alert(s);
	
} 


