

//?,??? ??? ?? ?? ?? yyyy-mm-dd(week)
/**
	* ?? 쾨? YYYY???? ??
*/
function getYear() {

    var now = new Date();
    return now.getFullYear();

    return getCurrentTime().substr(0,4);
}
/**
* ?? 墩? MM???? ??
*/

function getMonth() {

    var now = new Date();

    var month = now.getMonth() + 1; // 1?=0,12?=11??? 1 ??
    if (("" + month).length == 1) { month = "0" + month; }

    return month;

    return getCurrentTime().substr(4,2); 
}

/**
* ?? 휑? DD???? ??
*/

function getDay() {

    var now = new Date();

    var day = now.getDate();
    if (("" + day).length == 1) { day = "0" + day; }

    return day;

    return getCurrentTime().substr(6,2);
}

/**
* ?? ??? ??
*/
function getDayOfWeek() {
    var now = new Date();

    var day = now.getDay(); //???=0,???=1,...,???=6
//    var week = new Array('Sun','Mon','Tue','Wed','Tur','Fri','Sat');
    var week = new Array('일','월','화','수','목','금','토');

    return week[day];
}

function getDayOfWeek2() {
    var now = new Date();

    var day = now.getDay(); //???=0,???=1,...,???=6
    var week = new Array('Sun','Mon','Tue','Wed','Tur','Fri','Sat');

    return week[day];
}

function getToday() {

		nYear = getYear();
		nMonth = getMonth();
		nDay = getDay();
		nDayOfWeek = getDayOfWeek();
		
		nToday = "<span style=\"font-family: ; font-size: 8pt; color: #000000; font-weight: bold; letter-spacing: 0\">" +nMonth + "." + nDay + "(" + nDayOfWeek + ")</span>";
		//nToday = nYear + "-" + nMonth + "-" + nDay + "(" + nDayOfWeek + ")";
		//alert(nToday);
		document.write(nToday);
}


// ?? ??(?? ??? ?????)
function go(url) {
	location.replace(url);
}

// ?? ??(?? ????)
function searchCheck(form){
	var val1 = form.searchtext.value;
	if (CheckStr(val1, " ", "")==0)
	{
		
		alert('???? ?????');
		form.searchtext.value= "";
		form.searchtext.focus();
		
		return false;
	}else{
		if (form.searchpart[0].selected)
			form.action = "http://app.yonhapnews.co.kr/YNA/Basic/Article/Search/YIBW_showSearchTotalList.aspx";
		else if (form.searchpart[1].selected)
			form.action = "http://app.yonhapnews.co.kr/YNA/Basic/Article/Search/YIBW_showSearchArticleList.aspx";
		else if (form.searchpart[2].selected)
			form.action = "http://app.yonhapnews.co.kr/YNA/Basic/Article/Search/YIBW_showSearchPhotoList.aspx";
		else if (form.searchpart[3].selected)
			form.action = "http://app.yonhapnews.co.kr/YNA/Basic/Article/Search/YIBW_showSearchMPICList.aspx";
		else if (form.searchpart[4].selected)
			form.action = "http://app.yonhapnews.co.kr/YNA/Basic/Article/Search/YIBW_showSearchGraphicList.aspx";
		else if (form.searchpart[5].selected)
			form.action = "http://app.yonhapnews.co.kr/YNA/Basic/Article/Search/YIBW_showSearchPressList.aspx";
		else if (form.searchpart[6].selected)
			form.action = "http://app.yonhapnews.co.kr/YNA/Basic/Article/Search/YIBW_showSearchPeopleList.aspx";
		else if (form.searchpart[7].selected)
			form.action = "http://app.yonhapnews.co.kr/YNA/Basic/Article/Search/YIBW_showSearchFestivalList.aspx";
		else if (form.searchpart[8].selected)
			form.action = "http://app.yonhapnews.co.kr/YNA/Basic/Article/Search/YIBW_showSearchBlogList.aspx";
		return true;
	}			
}

//????
function CheckStr(strOriginal, strFind, strChange){
	var position, strOri_Length;
	position = strOriginal.indexOf(strFind);

	while (position != -1){
		strOriginal = strOriginal.replace(strFind, strChange);
		position    = strOriginal.indexOf(strFind);
	}
	strOri_Length = strOriginal.length;
	return strOri_Length;
}


function embededview(embededid)
{
	document.write(document.getElementById(embededid).value);		
}

function embededviewdata(embededdata)
{
	document.write(embededdata);		
}

