//-------------------------------------
// trim() ÇÔ¼ö
//-------------------------------------

function trim(Aparam) 
{
	return Aparam.replace(/(^\s*)|(\s*$)/g, "");
}

//-------------------------------------
//³¯Â¥ À¯È¿¼º °Ë»ç YYYY-MM-DD, YYYYMMDD
//-------------------------------------
function IsValidDate(yyyymmdd)
{
	//if( !(yyyymmdd.length==10 || yyyymmdd.length==8) ){ return false;}
	
	var tmp = yyyymmdd.replace(/-/g,""); 
	
	//ÁÖÀÇ : getMonth() => 0~11
	var iYY = tmp.substr(0,4);
	var iMM = tmp.substr(4,2)-1;
	var iDD = tmp.substr(6,2);
	
	var vDate = new Date(iYY,iMM,iDD);
	
	if( vDate.getFullYear() != iYY ||
		vDate.getMonth()    != iMM ||
		vDate.getDate()     != iDD )
	{
		return false;
	}
	else
	{
		return true;
	}
}

//----------------------------
// ÆÄÀÏ¸í ±¸ÇÏ±â
//----------------------------
function GetFileName(StrFilePath)
{
    if(StrFilePath.length == 0)
    {
        return("");
    }
    
    var StartIndex = 0;
   
    if((Aindex=StrFilePath.lastIndexOf("\\")) != -1)
    {
        StartIndex = Aindex + 1;
    }
    else
    {
        if((Aindex=StrFilePath.lastIndexOf("/")) != -1)
        {
            StartIndex = Aindex + 1;
        }
        else
        {
            StartIndex = 0;
        }
    }
    return(StrFilePath.substr(StartIndex));
}

//----------------------------
// ÆÄÀÏÈ®ÀåÀÚ ±¸ÇÏ±â
//----------------------------
function GetFileExtName(StrFileName)
{
    if((DotIndex = StrFileName.lastIndexOf(".")) == -1)
        return("");
        
    return(StrFileName.substr(DotIndex+1));
}

//----------------------------
// ½ºÆ®¸µÀÇ ¿À¸¥ÂÊ ºÎºÐÀ» Àß¶ó³»±â
//----------------------------
function GetRightPart(str, num)
{
    if(str.length <= num)
        return(str);
    
    return(str.substr(str.length-num));
}

//----------------------------
// ½ºÆ®¸µÀÇ ¿ÞÂÊ ºÎºÐÀ» Àß¶ó³»±â
//----------------------------
function GetLeftPart(str, num)
{
    if(str.length <= num)
        return(str);
    
    return(str.substr(0, num));
}

//----------------------------
// ¸¶¿ì½º ¿À¹ö, ¾Æ¿ô Ã³¸®
//----------------------------
function mouseoverm(p)
{
	p.style.color="#FF0000";
	p.style.textDecoration="underline";
}

function mouseoutm(p)
{
	p.style.color="#1C37FF";
	p.style.textDecoration="none";
}

