/****************************************************************
** 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 PopWinSubSbjac( 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, 'sbjacSub', 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
}

/* 마우스 오버 이미지 바꾸기 */
var overImage = new Array(900);

for( var i = 0; i < 900; i++ )
overImage[i] = new Image();


overImage[1].src = 'img/btn_Mypage_e.gif';
overImage[2].src = 'img/btn_house02.gif';
overImage[3].src = 'img/btn_house03.gif';
overImage[4].src = 'img/btn_house04e.gif';
overImage[5].src = 'img/btn_house05e.gif';

overImage[6].src = 'img/btn_bottom01e.gif';
overImage[7].src = 'img/btn_bottom02e.gif';
overImage[8].src = 'img/btn_bottom03e.gif';
overImage[9].src = 'img/btn_bottom04e.gif';
overImage[10].src = 'img/btn_bottom05e.gif';

overImage[21].src = 'img/mainBan01e.gif';
overImage[22].src = 'img/mainBan02e.gif';
overImage[23].src = 'img/mainBan03e.gif';

overImage[41].src = 'img/btnLoginb.gif';

overImage[51].src = 'img/2007/login_over.gif';
overImage[52].src = 'img/2007/logout_over.gif';
overImage[53].src = 'img/2007/e_menu1_over.gif';
overImage[54].src = 'img/2007/e_menu2_over.gif';
overImage[55].src = 'img/2007/e_menu3_over.gif';





function inner_rolloverMenu( num, image )
{
	if( !image.gimaSet )
	image.defaultSrc = image.src;
	image.src = overImage[num].src;

	if( !image.gimaSet )
	{
		image.onmouseout = function()
		{
			image.src = image.defaultSrc;
			image.gimaSet = 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;
}


/* 온포커스한꺼번에 */
function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;


function fn_main_list(sInline,bImage, mEvent) {

	/****************************************
	** 문화예술계 소식게시판 **
	****************************************/
	if(bImage == 1) {

		objNews1 = $('53120');
		objNews2 = $('53130');

		sImage = "img/main/1_over.gif";
		BsImage1 = "img/main/2_out.gif";
		BsImage2 = "img/main/3_out.gif";

	} else if(bImage == 2) {

		objNews1 = $('53110');
		objNews2 = $('53130');

		sImage = "img/main/2_over.gif";
		BsImage1 = "img/main/1_out.gif";
		BsImage2 = "img/main/3_out.gif";


	} else if(bImage == 3) {

		objNews1 = $('53110');
		objNews2 = $('53120');

		sImage = "img/main/3_over.gif";
		BsImage1 = "img/main/1_out.gif";
		BsImage2 = "img/main/2_out.gif";

	/****************************************
	** 협회지부게시판 **
	****************************************/
	} else if(bImage == 4) {

		objNews1 = $('55200');

		sImage = "img/main/heb_over.gif";
		BsImage1 = "img/main/gi_out.gif";

	} else if(bImage == 5) {

		objNews1 = $('55100');

		sImage = "img/main/gi_over.gif";
		BsImage1 = "img/main/heb_out.gif";
	}

	/****************************************
	** 요 까지~ **
	****************************************/

	try {
		mEvent.srcElement.src = sImage;
	} catch (e) {
		mEvent.target.src = sImage;
	}
	if(typeof( objNews1 ) != "undefined") objNews1.src = BsImage1;
	if(typeof( objNews2 ) != "undefined") objNews2.src = BsImage2;


	/****************************************
	** 문화예술계 소식게시판 **
	****************************************/
	if(sInline == 'pannel_53110') {
	  $('pannel_53110').style.display = "inline";
	  $('pannel_53120').style.display = "none";
	  $('pannel_53130').style.display = "none";

	} else if(sInline == 'pannel_53120') {
	  $('pannel_53110').style.display = "none";
	  $('pannel_53120').style.display = "inline";
	  $('pannel_53130').style.display = "none";

	} else if(sInline == 'pannel_53130') {
	  $('pannel_53110').style.display = "none";
	  $('pannel_53120').style.display = "none";
	  $('pannel_53130').style.display = "inline";

	/****************************************
	** 협회지부게시판 **
	****************************************/
	} else if(sInline == 'pannel_55100') {
	  $('pannel_55100').style.display = "inline";
	  $('pannel_55200').style.display = "none";

	} else if(sInline == 'pannel_55200') {
	  $('pannel_55100').style.display = "none";
	  $('pannel_55200').style.display = "inline";
	}

	return false;
}
