
// ¸¶¿ì½º¿À¹ö¾Æ¿ô
function imgOver(imgEl) { imgEl.src = imgEl.src.replace(".gif", "on.gif"); }
function imgOut(imgEl) { imgEl.src = imgEl.src.replace("on.gif", ".gif"); }


// °Ë»öºÎºÐÀÇ ¼¿·ºÆ®
function viewSearchType(){
	var sTypeLIst = document.getElementById('searchlist');
	if (sTypeLIst.style.display == 'block') {
	sTypeLIst.style.display = 'none';
	}
	else {
	sTypeLIst.style.display = 'block';
	}
}

// ÆÄÀÏ°Ë»ö Ä«Å×°í¸®
var TimeOut    = 350;
var closeTimer = null;
function cateMenu(obj){
mcancelclosetime();
for (var i=0; i<=8; i++){
  if(obj == i){
	document.getElementById('cateSub0'+i+'').style.display='block';
  }else{
	document.getElementById('cateSub0'+i+'').style.display='none';
  }
}
}
function mclosetime(){
	closeTimer = window.setTimeout(mclose, TimeOut);
}
function mcancelclosetime(){
	if(closeTimer){
		window.clearTimeout(closeTimer);
		closeTimer = null;
	}
}
function mclose(){
	cateMenu('1');
}



// ÆÄÀÏ°Ë»ö Ä«Å×°í¸®
function sideMenu(obj){
	mcancelclosetime();
	for (var i=1; i<=6; i++){
		if(obj == i){
			document.getElementById('sideMenuSub0'+i+'').style.display='block';
		}else{
			document.getElementById('sideMenuSub0'+i+'').style.display='none';
		}
	}
}
function Sclosetime(){
	closeTimer = window.setTimeout(Sclose, TimeOut);
}
function Scancelclosetime(){
	if(closeTimer){
		window.clearTimeout(closeTimer);
		closeTimer = null;
	}
}
function Smclose(){
	sideMenu('1');
}




// ÆÄÀÏ¸®½ºÆ®ÀÇ Á¦¸ñ
function sList_Show(FLayer,SLayer){
		document.getElementById(FLayer).style.display = 'block'; 
		document.getElementById(SLayer).style.display = 'none'; 
}
function sList_Hide(FLayer,SLayer){
		document.getElementById(FLayer).style.display = 'none'; 
		document.getElementById(SLayer).style.display = 'block'; 
}



// ¾ÆÀÌµð&ºñ¹Ð¹øÈ£Ã£±â
function idpwSearch01(){
		document.getElementById('general_Member').style.display = 'block'; 
		document.getElementById('general_NameCheck').style.display = 'none'; 
}
function idpwSearch02(){
		document.getElementById('general_Member').style.display = 'none'; 
		document.getElementById('general_NameCheck').style.display = 'block'; 
}


// ´Þ·Â
function viewCalendar(){
	var sTypeLIst = document.getElementById('calendarBox');
	if (sTypeLIst.style.display == 'block') {
	sTypeLIst.style.display = 'none';
	}
	else {
	sTypeLIst.style.display = 'block';
	}
}


// ÀÌº¥Æ®¸µÅ©
function Search_Event(val){
	document.Event_Search.code.value=val;
	Event_Search.submit();
}


// °Ë»öºÎºÐÀÇ ¼¿·ºÆ®
function viewFileListViewType(){
	var sTypeLIst = document.getElementById('fileListview');
	if (sTypeLIst.style.display == 'block') {
		sTypeLIst.style.display = 'none';
	}
	else {
		sTypeLIst.style.display = 'block';
	}
}

//ÄÁÅÙÃ÷ÀÌ¿ëµµ¿ò¸»
function winError_Guide(){ 
	var winError_Guide = window.open('/CScenter/winError.asp?linkCode=6', 'winErrorGuide', 'width=720, height=645, resizable=0, scrollbars=no, status=0, titlebar=0, toolbar=0, left=10, top=10' );
}
//function winError_Guide(){ 
//	var winLft = (screen.width-720)/2;
//	var winTop = (screen.height-700)/2;
//	var winError_Guide = window.open('/CScenter/winError.asp?linkCode=6', 'winErrorGuide', 'width=720,height=645,resizable=0,scrollbars=no,status=0,titlebar=0,toolbar=0,top='+winLft+',left='+winTop);
//}

//´Ù¿î·Îµå»óÇ°±Ç ÀÌ¿ë¾È³»
function WinCouponGuide(){ 
  var winLeft = (screen.width-650)/2;
  var winTop = (screen.height-840)/2;
  var CouponGuide = window.open('/CScenter/couponGuide.asp','couponGuide','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=no,copyhistory=0,width=650,height=838,top=10,left=' + winLeft);
}

// ¿À´ÃÇÏ·ç ÀÌÃ¢À» ¿­Áö¾ÊÀ½
function getCookie(name) {
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length ){
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) 
			endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
		break;
	}
	return "";
}
function setCookie_notice(name, value, expiredays){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function startTime(){
	var time= new Date();
	hours= time.getHours();
	mins= time.getMinutes();
	secs= time.getSeconds();
	closeTime=hours*3600+mins*60+secs;
	Timer();
}
function Timer(){
	var time= new Date();
	hours= time.getHours();
	mins= time.getMinutes();
	secs= time.getSeconds();
	curTime=hours*3600+mins*60+secs
	closeTime+=60;
	if (curTime>=closeTime){
	document.getElementById('MSG_layerPopup').style.display = 'none';
	} else{
	window.setTimeout("Timer()",1000)
	document.getElementById('MSG_layerPopup').style.display = 'block';
	}
}

// ÇÃ·¹½Ã ½ºÅ©¸³Æ®
function setEmbed() {
  var obj = new String;
  var parameter = new String;
  var embed = new String;
  var html = new String;
  var allParameter = new String;
  var clsid = new String;
  var codebase = new String;
  var pluginspace = new String;
  var embedType = new String;
  var src = new String;
  var width = new String;
  var height = new String;

  this.init = function( getType , s ,w , h ) {
    if ( getType == "flash" ) {
      clsid = "D27CDB6E-AE6D-11cf-96B8-444553540000";
      codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0";
      pluginspage = "http://www.macromedia.com/go/getflashplayer";
      embedType = "application/x-shockwave-flash";
    }
    /* type Ãß°¡
    else if ( ) {
    }
    */
    parameter += "<param name='movie' value='"+ s + "'>\n";
    parameter += "<param name='quality' value='high'>\n";	
	parameter += "<param name='menu' value='false'>\n";
	parameter += "<param name='allowScriptAccess' value='always'>\n";
	parameter += "<param name='swliveconnect' value='true'>\n";

    src = s;
    width = w;
    height = h;
  }

  this.parameter = function( parm , value ) {
    parameter += "<param name='"+parm +"' value='"+ value + "'>\n";
    allParameter += " "+parm + "='"+ value+"'";
  }

  this.show = function() {
    if ( clsid ) {
      obj = "<object classid=\"clsid:"+ clsid +"\" codebase=\""+ codebase +"\" width='"+ width +"' height='"+ height +"'>\n";
    }

    embed = "<embed src='" + src + "' pluginspage='"+ pluginspage + "' type='"+ embedType + "' width='"+ width + "' height='"+ height +"'"+ allParameter +" allowScriptAccess=\"always\" swliveconnect=\"true\"></embed>\n";

    if ( obj ) {
      embed += "</object>\n";
    }

    html = obj + parameter + embed;
    document.write( html );
  }
}


// ÅÇ¹æ½ÄÀÇ ¸®½ºÆ®
function tabOn(tabid,a,href) {
  tabMenu_sel = document.getElementById("tab"+tabid+"m"+a);
  tabContent_sel = document.getElementById("tab"+tabid+"c"+a);
  if(tabContent_sel.style.display=="block"){
    //document.location.href = href;
  }else{
    for (i=1;i<=10;i++) {
      if(i<10){inn="0"+i;} else {inn=""+i;}
      tabMenu = document.getElementById("tab"+tabid+"m"+i);
      tabContent = document.getElementById("tab"+tabid+"c"+i);
      if (tabMenu) { //°´Ã¼°¡Á¸ÀçÇÏ¸é
        if (tabMenu.tagName=="IMG") { tabMenu.src = tabMenu.src.replace("on.gif", ".gif"); } //ÀÌ¹ÌÁöÀÏ¶§
        if (tabMenu.tagName=="A") { tabMenu.className=""; } //¾ÞÄ¿ÀÏ¶§
      }
      if (tabContent) { tabContent.style.display="none"; }
    }
    if(a<10){ann="0"+a;} else {ann=""+a;}
    tabMenu = tabMenu_sel;
    tabContent = tabContent_sel;
  //  alert(tabMenu.tagName);
    if (tabMenu) { //°´Ã¼°¡Á¸ÀçÇÏ¸é
      if (tabMenu.tagName=="IMG") { tabMenu.src = tabMenu.src.replace(".gif", "on.gif"); } //ÀÌ¹ÌÁöÀÏ¶§
      if (tabMenu.tagName=="A") { tabMenu.className="on"; } //¾ÞÄ¿ÀÏ¶§
    }
    if (tabContent) { tabContent.style.display="block"; }
    tabMore = document.getElementById("tab"+tabid+"more");
  }
}



// ¿ìÃø floating
function initMoving(id,xleft,ytop) {
  target = document.getElementById(id);
  if (!target) return false;
  var obj = target;
  obj.initLeft = xleft;//Àý´ëÁÂÇ¥x
  obj.initTop = ytop;//Àý´ëÁÂÇ¥y
  obj.bottomLimit = document.documentElement.scrollHeight - 0;
  obj.topLimit = 100; // ¿ø·¡ 295 ¸¦ 150À¸·Î ¹Ù²Þ

  obj.style.position = "absolute";
  obj.top = obj.initTop;
  obj.left = obj.initLeft;
  obj.style.top = obj.top + "px";
  obj.style.left = obj.left + "px";

  obj.getTop = function() {
    if (document.documentElement.scrollTop) {
      return document.documentElement.scrollTop;
    } else if (window.pageYOffset) {
      return window.pageYOffset;
    } else {
      return 0;
    }
  }
  obj.getHeight = function() {
    if (self.innerHeight) {
      return self.innerHeight;
    } else if(document.documentElement.clientHeight) {
      return document.documentElement.clientHeight;
    } else {
      return 500;
    }
  }
  obj.move = setInterval(function() {
    pos = obj.getTop() + obj.getHeight() / 2 - 365;

    if (pos > obj.bottomLimit)
      pos = obj.bottomLimit
    if (pos < obj.topLimit)
      pos = obj.topLimit

    interval = obj.top - pos;
    obj.top = obj.top - interval / 3;
    obj.style.top = obj.top + "px";
  }, 40)
}






function MainList_One(val)
{
		var frm = document.frmSearchList_one;
		frm.schMenu1.value = val;
		frm.schMenu2.value = '';
		frm.searchstr.value = '';
		frm.page.value = '1';
		frm.submit();
}
function SubList_One(val1, val2)
{
	var frm = document.frmSearchList_one;
	frm.schMenu2.value = val1;
	frm.schMenu1.value = val2;
	frm.searchstr.value = '';
	frm.page.value = '1';
	frm.submit();
}
