//쿠키관련파일
function setCookie(name, value, expires){		//쿠키 세팅(이름, 값, 유지시간)
  //alert('setCookie호출');
  document.cookie = name + "=" + escape (value) +
    "; path=/; expires=" + expires;
    //"; expires=" + expires.toGMTString();
}

function setCookieTime(command, time){
	var expdate = new Date();
	if(command == "add")
		//expdate.setTime(expdate.getTime() + time);	//시간 설정
		expdate.setDate(expdate.getDate() + time);
	if(command == "delete")
	    expdate.setDate(expdate.getDate() - 1);
		//expdate.setTime(expdate.getTime() - 1);							//삭제시 시간 설정
	return expdate.toGMTString();
}

function getCookie(Name){			//쿠키 얻기(이름만 주면 됨)
	var search = Name + "="
	if(document.cookie.length > 0) { // 쿠키가 설정되어 있다면
		offset = document.cookie.indexOf(search)
		if(offset != -1) { 			// 쿠키가 존재하면
			offset += search.length
			end = document.cookie.indexOf(";", offset)
			if (end == -1)
				end = document.cookie.length
			return unescape(document.cookie.substring(offset, end))
		}
		else
		{
			return "";
		}
		
	}
	else
	{
		return "";
	}
}

function makeArray(prevArray){
	var tempArray = new Array();
	var tempIndex = 0;
	for(var i=0 ; i<prevArray.length ; i++){
		if(prevArray[i] != ""){
			tempArray[tempIndex] = prevArray[i];
			tempIndex++;
		}
	}
	return tempArray;
}
