function showCalendar(bItem)
{
  sDate=showModalDialog("../common/calendar1.html?",bItem.value,"dialogWidth:206px;dialogHeight:235px");
  d1=new Date(sDate);
  if (d1 != "NaN")
  {
    bItem.value=d1.getFullYear() + "/" + ((d1.getMonth()<9)?"0":"") + (d1.getMonth()+1) + "/" + ((d1.getDate()<=9)?"0":"") + d1.getDate();
  }
  
}

function showLOV(bItem, option)
{
  setCookie("LOVParam2","");
  retStr=showModalDialog("../common/lov.jsp?option="+option,window,"dialogWidth:400px;dialogHeight:300px");
  if (retStr!=null) bItem.value=retStr;
}

function showLOV2(bItem, option)
{
  retStr=showModalDialog("lov.asp?option="+option,window,"dialogWidth:400px;dialogHeight:300px");
  if (retStr!=null) bItem.value=retStr;
}

function m_in(obj) {                
        obj.style.color="red";
}                
                
function m_out(obj) {                
        obj.style.color="#000000"; 
}  

function send(sValue) {
	window.returnValue = sValue;
	window.close();
}

function setCookie(sName, sValue){
  today=new Date();
  today.setTime(today.getTime()+60*1000);
  document.cookie=sName + "=" + escape(sValue) + ";expires="+today.toGMTString() + ";path=/"
}

function getCookie(sSearch) {
  sData="";
  sName=sSearch+"=";
  theCookie=document.cookie+";";
  start=theCookie.indexOf(sName);
  if (start != -1)
  {
    end = theCookie.indexOf(";",start);
    sData=unescape(theCookie.substring(start+sName.length,end));
  }
  return sData;
}
 
function leftTrim(sString) 
{
  for (i=0;i<sString.length;i++) {
    if (sString.substr(i,1) != " ") return sString.substr(i,sString.length-i);
  }
  return "";
}

function rightTrim(sString) 
{
  for (i=sString.length;i>0;i--) {
    if (sString.substr(i-1,1) != " ") return sString.substr(0,i); 
  }
  return "";
}

function allTrim(sString) 
{
  return leftTrim(rightTrim(sString));
}

