window.onload=function(){

	if( parent && document.title ) {
		parent.document.title = document.title;
	}

	layerPositionOut();

	if(document.getElementById("navigation"))
		document.getElementById("navigation").style.height = 356 + "px"; // 20100121 ¼öÁ¤ 326->356

	if (screen.width<980) {
		if(document.getElementById("wrap")) {

			document.getElementById("wrap").style.width = 980 + "px";

		   }

	}

	if(document.getElementById("ttlLink")) {

		document.getElementById("ttlLink").style.width = 980 + "px";

		}

	if (document.getElementById("leftNavigation")) {

			document.getElementById("leftNavigation").style.height = 547 + "px"; //js ¼öÁ¤»çÇ× 20090629 ¼öÁ¤ 505->547

		}

	}

//Login View
function popLogin() {
  document.getElementById("login").style.display = "block";
  if(document.getElementById("ID").value != "") {
    document.getElementById("PASSWORD").focus();
  } else {
    document.getElementById("ID").focus();
  }
}
//Login Close
function popLoginClose() {
  document.getElementById("login").style.display = "none";
  document.getElementById("ID").value = "";
  document.getElementById("PASSWORD").value = "";
}

//Popup Close
function popClose() {
  self.close();
}

//Faq
function faqView(obj) {
  for (var i=1; i<11; i++) {
    document.getElementById('faq'+i).style.display = "none";
    document.getElementById('q'+i).style.backgroundImage = "url('/img/common/bg_gray.gif')";
  }
  document.getElementById('faq'+obj).style.display = "block";
  document.getElementById('q'+obj).style.backgroundImage = "url('/img/common/bg_white.gif')";
}

//È¸¿ø°¡ÀÔ
function memberJoin() {
//  location.href="http://www.tworld.co.kr/outsite_sso.html?http://webzone.tworld.co.kr/webzone/member/controller/MemberRegServlet.jsp?UP_CD=INIT&SiteCd=ttl&xtr_cate=LK&xtr_ref=ttl.co.kr&xtr_kw=-join_us";
  location.href="http://www.tworld.co.kr/outsite_sso.html?http://webzone.tworld.co.kr/normal.do?serviceId=S_CERT0001&viewId=V_CERT0000&UP_CD=INIT&SiteCd=ttl&xtr_cate=LK&xtr_ref=ttl.co.kr&xtr_kw=-join_us";
}
//ID/PW Ã£±â
function searchIdPw() {
//  location.href="http://www.tworld.co.kr/outsite_sso.html?http://webzone.tworld.co.kr/webzone/member/controller/IdPwdServlet.jsp?UP_CD=INIT&SiteCd=ttl&xtr_cate=LK&xtr_ref=ttl.co.kr&xtr_kw=-ID_PW_preview";
  location.href="http://www.tworld.co.kr/outsite_sso.html?http://webzone.tworld.co.kr/normal.do?serviceId=SDUMMY0001&viewId=V_IDPW0000&UP_CD=INIT&SiteCd=ttl&xtr_cate=LK&xtr_ref=ttl.co.kr&xtr_kw=-ID_PW_preview";
}

//È¸¿øÁ¤º¸º¯°æ
function memberModify() {
//  location.href="http://www.tworld.co.kr/outsite_sso.html?http://webzone.tworld.co.kr/webzone/member/WebZoneMain.jsp?MainParam=UP_CD=MEMUP~SiteCd=ttl&xtr_cate=LK&xtr_ref=ttl.co.kr&xtr_kw=-info_edit";
  location.href="http://www.tworld.co.kr/outsite_sso.html?http://webzone.tworld.co.kr/wzsvc.do?MainParam=UP_CD=MEMUP~SiteCd=ttl&xtr_cate=LK&xtr_ref=ttl.co.kr&xtr_kw=-info_edit";
}

//--  ÇÏÀ§ Á¤º¸°ü¸® ¸Þ´º -------------------------------------------------------------//
// °³ÀÎÁ¤º¸Ãë±Þ¹æÄ§
function fnPrivacyPolicy() {
    vGoFooterPopup('/html/common/privacyPolicy.html','privacyPolicy');
}
// À¥È¸¿øÀÌ¿ë¾à°ü
function fnAgreement() {
    vGoFooterPopup('/html/common/webArticle.html','webArticle');
}
// °³Á¤¸â¹ö½± ÀÌ¿ë¾à°ü
function fun_view() {
    vGoFooterPopup('/html/common/memberArticle.html','memberArticle');
}
// Ã¥ÀÓÀÇ ÇÑ°è¿Í ¹ýÀû°íÁö
function fun_notice() {
    vGoFooterPopup('/html/common/legalNotice.html','legalNotice');
}
// ÀÌ¸ÞÀÏ ¹«´Ü ¼öÁý°ÅºÎ
function fun_reject() {
    window.open('/html/common/rejectEmail.html','reject','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=220');
}
// Footer popup
function vGoFooterPopup(pUrl, pNm) {
    window.open(pUrl, pNm, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=491,height=322');
}

// »çÀÌÆ®¸Ê
function fnSiteMap() {
    if (location.pathname.indexOf('/jsp/') == 0) {
        location.href="/jsp/common/sitemap.jsp";
    }
    else if (location.pathname.indexOf('/ting/') == 0) {
        location.href="/ting/common/sitemap.jsp";
    }
    else if (location.pathname.indexOf('/tingjr/') == 0) {
        location.href="/tingjr/common/sitemap.jsp";
    }
    return;
}
//-- ÇÏÀ§ Á¤º¸°ü¸® ¸Þ´º ³¡-------------------------------------------------------------//


// GNB °ü·Ã
function layerheightOut() {
 document.all.navigation.height = 215; //js ¼öÁ¤»çÇ× 100120  185 -> 215
 if (document.getElementById("keyword")) {
  document.getElementById("keyword").style.display = "block";
 }
 if (document.getElementById("keywords")) {
  document.getElementById("keywords").style.display = "block";
 }
 if (document.getElementById("gnbs")) {
  document.getElementById("gnbs").style.zIndex = "0";
 }
 if (document.getElementById("gnb")) {
  document.getElementById("gnb").style.zIndex = "0";
 }
 if (document.getElementById("gnbsub")) {
  document.getElementById("gnbsub").style.zIndex = "0";
 }
 /* <!------ 100120 Ãß°¡ºÐ ------> */
 if (document.getElementById("keyword_main")) {
  document.getElementById("keyword_main").style.display = "block";
 }
 if (document.getElementById("maingnb")) {
  document.getElementById("maingnb").style.zIndex = "0";
 }
 /* <!------ //100120 Ãß°¡ºÐ ------> */
 //select °¡ ÀÖÀ» ¶§
    var link = document.getElementById("selbox");
    if (link){
        link.style.display="block";
    }
}

function layerheightOver() {
 document.all.navigation.height = 356; //js ¼öÁ¤»çÇ× 100120  325 -> 356
 if (document.getElementById("keyword")) {
  document.getElementById("keyword").style.display = "none";
 }
 if (document.getElementById("keywords")) {
  document.getElementById("keywords").style.display = "none";
 }
 if (document.getElementById("gnbs")) {
  document.getElementById("gnbs").style.zIndex = "10";
 }
 if (document.getElementById("gnbsub")) {
  document.getElementById("gnbsub").style.zIndex = "10";
 }
 if (document.getElementById("gnb")) {
  document.getElementById("gnb").style.zIndex = "10";
 }
 /* <!------ 100120 Ãß°¡ºÐ ------> */
 if (document.getElementById("keyword_main")) {
  document.getElementById("keyword_main").style.display = "none";
 }
 if (document.getElementById("maingnb")) {
  document.getElementById("maingnb").style.zIndex = "10";
 }
 /* <!------ //100120 Ãß°¡ºÐ ------> */
 //select °¡ ÀÖÀ» ¶§
    var link = document.getElementById("selbox");
    if (link){
        link.style.display="none";
    }
}

function layerPositionOver() {
 /* <!------ 100120 Ãß°¡ºÐ ------> */
 if (document.getElementById("keyword_main")) {
  document.getElementById("keyword_main").style.zIndex = "0";
 }
 if (document.getElementById("maingnb")) {
  document.getElementById("maingnb").style.zIndex = "10";
 }
 /* <!------ //100120 Ãß°¡ºÐ ------> */

  if (document.getElementById("keyword")) {
    document.getElementById("keyword").style.zIndex = "0";
  }
  if (document.getElementById("keywords")) {
    document.getElementById("keywords").style.zIndex = "0";
  }
  if (document.getElementById("gnbs")) {
    document.getElementById("gnbs").style.zIndex = "10";
  }
  if (document.getElementById("gnbsub")) {
    document.getElementById("gnbsub").style.zIndex = "10";
  }
  if (document.getElementById("gnb")) {
    document.getElementById("gnb").style.zIndex = "10";
  }
  //091223	¹ÙÀÌ·¯½º Å°¿öµå °Ë»ö ¹ØÀ¸·Î ¸Þ´º ºüÁöÁö ¾Ê°Ô ÇÏ±â
  if (document.getElementById("virus")) {
	  if (document.getElementById("index")) {
		document.getElementById("index").style.zIndex = "10";
	  }
  }
}

function layerPositionOut() {
  if (document.getElementById("keyword")) {
    document.getElementById("keyword").style.zIndex = "10";
  }
  if (document.getElementById("keywords")) {
    document.getElementById("keywords").style.zIndex = "10";
  }
  if (document.getElementById("gnbs")) {
    document.getElementById("gnbs").style.zIndex = "0";
  }
  if (document.getElementById("gnb")) {
    document.getElementById("gnb").style.zIndex = "0";
  }
  if (document.getElementById("gnbsub")) {
    document.getElementById("gnbsub").style.zIndex = "0";
  }
  //091223	¹ÙÀÌ·¯½º Å°¿öµå °Ë»ö ¹ØÀ¸·Î ¸Þ´º ºüÁöÁö ¾Ê°Ô ÇÏ±â
  if (document.getElementById("virus")) {
	  if (document.getElementById("index")) {
		document.getElementById("index").style.zIndex = "0";
	  }
  }
  /* <!------ 100120 Ãß°¡ºÐ ------> */
 if (document.getElementById("keyword_main")) {
  document.getElementById("keyword_main").style.zIndex = "10";
 }
 if (document.getElementById("maingnb")) {
  document.getElementById("maingnb").style.zIndex = "0";
 }
 /* <!------ //100120 Ãß°¡ºÐ ------> */
}

//TTL INFO Event View Popup
function popEventView(url) {
  window.open(url,'eventview','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=675,height=700');
}
function popPastView(url) {
  window.open(url,'eventview','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=675,height=700');
}

function goEventView(url) {
  window.location = url;
}

// MY TTL
function myFrameOver() {
  document.getElementById("mycinema").style.display = "block";
}
function myFrameOut() {
  document.getElementById("mycinema").style.display = "none";
}

//test
function myFrameUrl(obj) {
  if (obj=='1') {
    myttlcinema.location.href="/html/cinema/myTTL_01.html";
  }
  if (obj=='2') {
    myttlcinema.location.href="/html/cinema/myTTL_02.html";
  }
  if (obj=='3') {
    myttlcinema.location.href="/html/cinema/myTTL_03.html";
  }
}

function sendToActionScript(value1,value2){
  return document.getElementById("leftNavigation").sendToFlash(value1,value2);
}

//ÇÃ·¡½Ã ±âº» + ÆÄ¶ó¹ÌÅÍ
function FlashIncParam(f_name,f_value,f_width,f_height,f_align,f_param) {
    var v_param = "";

    // ¸ÞÀÎ¸Þ´ºÀÇ ³ôÀÌ Á¶Á¤.(2009.05.28 ¼Û¹Î¿ì)
    if (f_name == "navigation") {
        switch(f_value) {
            case '/flash/navigation' :
                f_height = parseInt(f_height, 10) + 65;
                break;
            case '/flash/ting/navigation_ting' :
            case '/flash/tingjr/navigation_jr' :
                f_height = 356; // input : 115 => 356À¸·Î º¯°æ. 2010.01.21
                break;
        }
    }

    // TTL ÇÖ!¾ÆÀÌÅÛ ÁÂÃø¸Þ´ºÀÎ °æ¿ì¸¸ ÇØ´ç.(2009.07.28 ¼Û¹Î¿ì)
    if (f_value == '/flash/leftNavigation2_1') {
        switch(f_param) {
            case 'tCulture' : // TÄÃÃ³¸â¹ö½Ê.
                v_param = 'mainPage=1&subPage=0';
                break;
            case 'melon' : // ¸á·Ð MP3 50% ÇÒÀÎ.
                v_param = 'mainPage=2&subPage=0';
                break;
            case 'happy' : // Çàº¹Ã¼Çè¸â¹ö½Ê.
                v_param = 'mainPage=3&subPage=0';
                break;
            case 'eventList' : // TTL ÀÌº¥Æ® - ÁøÇà ÀÌº¥Æ®.
                v_param = 'mainPage=4&subPage=1';
                break;
            case 'eventPast' : // TTL ÀÌº¥Æ® - Áö³­ ÀÌº¥Æ®.
                v_param = 'mainPage=4&subPage=2';
                break;
            case 'eventWiner' : // TTL ÀÌº¥Æ® - ´çÃ·ÀÚ¹ßÇ¥.
                v_param = 'mainPage=4&subPage=3';
                break;
            default :
                v_param = f_param;
        }
    }
    else {
        v_param = f_param;
    }

    document.write('<object id="'+f_name+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+f_width+'" height="'+f_height+'">') ;
    document.write('<param name="movie" value="'+f_value+'.swf" />') ;
    document.write('<param name="quality" value="high" />') ;
    document.write('<param name="menu" value="false" />') ;
    document.write('<param name="wmode" value="transparent" />') ;
    document.write('<param name="allowScriptAccess" value="always" />');
    document.write('<PARAM NAME=scale VALUE=noscale> ');
    document.write('<PARAM NAME="SAlign" VALUE="'+f_align+'">') ;
    document.write('<param name="FlashVars" value="'+v_param+'">');
    document.write('<embed src="'+f_value+'.swf" quality="high" name="'+f_name+'" SAlign="'+f_align+'" scale=noscale width="'+f_width+'" height="'+f_height+'" allowScriptAccess="always"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />') ;
    document.write('</object>') ;
}


/* <!------ 100108 Ãß°¡ºÐ png »ç¿ë ÀÚ¹Ù½ºÅ©¸³Æ® ------> */
function setPng24(obj) {
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src='';
	return '';
}
/* <!------ //100108 Ãß°¡ºÐ png »ç¿ë ÀÚ¹Ù½ºÅ©¸³Æ® ------> */

/**
 * »óÀ§ ¸ÞÀÎÆäÀÌÁö·Î ÀÌµ¿ÇÔ.
 * (1:TTL, 2:TING, 3:TING JUNIOR)
 */
function vGoTopMain(pParam) {
    if (pParam == 1) {
        top.location.href = "http://" + CONST_TTL_DOMAIN;
    }
    else if (pParam == 2) {
        top.location.href = "http://" + CONST_TING_DOMAIN;
    }
    else if (pParam == 3) {
        top.location.href = "http://" + CONST_TINGJR_DOMAIN;
    }
}
