/****************************************************************
** URL 정리
****************************************************************/
function urlParse(url) {
	var strLocation = url.split('?');
	var strResult = new Array();
	var i =0;

	if(strLocation.length > 1) {
		strsplitLocation = strLocation[1].split('&');

		for(i=0; i<strsplitLocation.length; i++) {
			strsplitLocation[i] = strsplitLocation[i].split('=');

			if(strsplitLocation[i][1] != 'undefined') {
				strResult[i] = strsplitLocation[i][0] + "=" + strsplitLocation[i][1];
			}
		}
	}
	result = strLocation[0] + "?" + strResult.join('&');
	return result;
}

/****************************************************************
** 메인서브 이동
****************************************************************/
function goMain( id, mode, type, met, vt, category, no ) {
	Url = "main_sub.html?mTop=" + id + "&mode=" + mode + "&type=" + type + "&met=" + met + "&vt=" + vt +"&category=" + category + "&no=" + no;
	xUrl = urlParse(Url);
	top.location.href = xUrl;
}


/* 새 창 띄우기 */
function PopWin( Url, Xsize, Ysize, Scroll )
{
	var opt = "toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=1,"

	if( Xsize  == null ) Xsize  = 500
	if( Ysize  == null ) Ysize  = 400
	if( Scroll == null ) Scroll = 1

	opt = "width=" + Xsize + ",height=" + Ysize + ",scrollbars=" + Scroll
	newWindow = window.open( Url, 'popSub', opt)
	newWindow.focus()
}

/* 링크된 텍스트 칼라 바꾸기 */
function setHover( color )
{
    var object = window.event.srcElement

    object.defaultColor = object.style.color
    object.style.color = color

	if( object.title )
	{
		window.status = object.title
	}

    object.onmouseout = function()
    {
        object.style.color = object.defaultColor

		if( object.title )
		{
			window.status = ''
		}
    }

	return true
}

/* 점프메뉴 */
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  if( selObj.options[selObj.selectedIndex].value != '' )
      window.open( selObj.options[selObj.selectedIndex].value );
  if (restore) selObj.selectedIndex=0;
}

/************************ 탭 스위칭 by Uks.. ****************************/
function fn_main_list(sInline,bImage, mEvent) {

	/****************************************
	** 행사갤러리 **
	****************************************/
	if(bImage == 1) {
		objNews1 = $('edugiViews');
    sImage = "img/main/lecture1_over.gif";
		BsImage1 = "img/main/lecture2_out.gif";
	} else if(bImage == 2) {
		objNews1 = $('edusangViews');
    sImage = "img/main/lecture2_over.gif";
		BsImage1 = "img/main/lecture1_out.gif";
	} else if(bImage == 3) {
		objNews1 = $('broadtwoViews');
    sImage = "img/main/broadcasting1_over.gif";
		BsImage1 = "img/main/broadcasting2_out.gif";
	} else if(bImage == 4) {
		objNews1 = $('broadoneViews');
    sImage = "img/main/broadcasting2_over.gif";
		BsImage1 = "img/main/broadcasting1_out.gif";
}

	/****************************************
	** 요 까지~ **
	****************************************/

	try {
		mEvent.srcElement.src = sImage;
	} catch (e) {
		mEvent.target.src = sImage;
	}
	if(typeof( objNews1 ) != "undefined") objNews1.src = BsImage1;




	/****************************************
	** 상설강좌 **
	****************************************/
	if(sInline == 'pannel_edusangViews') {
	  Element.show('pannel_edusangViews');
	  Element.hide('pannel_edugiViews');
	} else if(sInline == 'pannel_edugiViews') {
	  Element.hide('pannel_edusangViews');
	  Element.show('pannel_edugiViews');

	} else if(sInline == 'pannel_broadoneViews') {
	  Element.show('pannel_broadoneViews');
	  Element.hide('pannel_broadtwoViews');
  } else if(sInline == 'pannel_broadtwoViews') {
	  Element.hide('pannel_broadoneViews');
	  Element.show('pannel_broadtwoViews');
	}

	return false;
}