function bShow(idint)
{
	if (idint == 1) {
		document.all.boardShow1.style.display="";
		document.all.boardShow2.style.display="none";
		document.all.boardShow3.style.display="none";
		document.all.imgShow1.style.display="";
		document.all.imgShow1_1.style.display="none";
		document.all.imgShow2.style.display="none";
		document.all.imgShow2_1.style.display="";
		document.all.imgShow3.style.display="none";
		document.all.imgShow3_1.style.display="";
	}
	
	if (idint == 2) {
		document.all.boardShow1.style.display="none";
		document.all.boardShow2.style.display="";
		document.all.boardShow3.style.display="none";
		document.all.imgShow1.style.display="none";
		document.all.imgShow1_1.style.display="";
		document.all.imgShow2.style.display="";
		document.all.imgShow2_1.style.display="none";
		document.all.imgShow3.style.display="none";
		document.all.imgShow3_1.style.display="";
	}
	
	if (idint == 3) {
		document.all.boardShow1.style.display="none";
		document.all.boardShow2.style.display="none";
		document.all.boardShow3.style.display="";
		document.all.imgShow1.style.display="none";
		document.all.imgShow1_1.style.display="";
		document.all.imgShow2.style.display="none";
		document.all.imgShow2_1.style.display="";
		document.all.imgShow3.style.display="";
		document.all.imgShow3_1.style.display="none";
	}
}

function OpenNewWindow(str) 
{
	str = "/counsel/judge/reply_count.asp?CodeCount=" + str
	window.open(str,'pay_page','location=no,directories=no,scrollbars=yes,resizable=no,width=470,height=470,top=0,left=0')
	return;
}

function ContentRedirect(str)
{
	if (str == 'Æò»ý¿î¼¼') {
		location.href="/unse/lifeluck/main.asp";
		return;
	}

	if (str == 'ÀÌ¸§Ç®ÀÌ') {
		location.href="/name/nameluck/main12.asp";
		return;
	}

	if (str == 'ºÎÀû½ÅÃ»') {
		location.href="/bujeok/goods/bujuk_list.asp";
		return;
	}

	if (str == '»ó´ã½ÅÃ»') {
		location.href="/apply/submain.asp";
		return;
	}

	if (str == 'ÀÛ¸í½ÅÃ»') {
		location.href="/name/namemake/order.asp?setgood=1";
		return;
	}

	if (str == 'ÀÌº¥Æ®½ÅÃ»') {
		location.href="/event/0406/order.asp";
		return;
	}

	if (str == '±ÃÇÕÇ®ÀÌ') {
		location.href="/unse/wedluck/main.asp";
		return;
	}

	if (str == 'Àç¹°¿î') {
		location.href="/unse/moneyluck/main.asp";
		return;
	}

	if (str == '°áÈ¥ÅÃÀÏ') {
		location.href="/unse/marriageluck/main.asp";
		return;
	}

	if (str == '¼¿ÇÁÀÛ¸í') {
		location.href="/name/nameself/order.asp";
		return;
	}

	if (str == 'µµÅëºñ°á') {
		location.href="/unse/2005yearluck/main.asp";
		return;
	}
	return;
}

function MM_showHideLayers() { //v3.0
  
	var i,p,v,obj,args=MM_showHideLayers.arguments;
  
	for (i=0; i<(args.length-2); i+=3)
		if ((obj=MM_findObj(args[i]))!=null) { 
			v=args[i+2];
			if (obj.style) {
				obj=obj.style; v=(v=='show')?'':(v='hide')?'none':v; 
			}
			obj.visibility=v;
		}
}

function EnterChecktop(i) {
   if(event.keyCode ==13 && i==1) 
   { 
       document.dotonglogform.doid.focus(); 
   }
   if(event.keyCode ==13 && i==2) 
   { 
       document.dotonglogform.dopwd.focus(); 
   }
   if(event.keyCode ==13 && i==3) 
   { 
//      document.user.submit();
		check(document.dotonglogform);
   } 
}

function Check_Num(tocheck) {
	var isnum = true;

	if (tocheck == null || tocheck == "") {
		isnum = false;
		return isnum;
	}

	for (var j = 0 ; j < tocheck.length; j++) {
  		if (tocheck.substring(j, j + 1) != "0" &&
		    tocheck.substring(j, j + 1) != "1" &&
		    tocheck.substring(j, j + 1) != "2" &&
		    tocheck.substring(j, j + 1) != "3" &&
		    tocheck.substring(j, j + 1) != "4" &&
		    tocheck.substring(j, j + 1) != "5" &&
		    tocheck.substring(j, j + 1) != "6" &&
		    tocheck.substring(j, j + 1) != "7" &&
		    tocheck.substring(j, j + 1) != "8" &&
		    tocheck.substring(j, j + 1) != "9") {
			isnum = false;
		}
	}
	return isnum;
}

function check(formchecktop) {
	var cnum = true;
	if (formchecktop.donum.value==""){
        alert("\nµµ±úºñ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		formchecktop.donum.focus();
		return;
	}
	cnum = Check_Num(formchecktop.donum.value);
	if ((!cnum) || (formchecktop.donum.value.length < 3)) {
		alert("\nµµ±úºñ¹øÈ£´Â 3ÀÚ¸® ¼ýÀÚ¸¸ °¡´ÉÇÕ´Ï´Ù.");
		formchecktop.donum.focus();
		return;
	}
	if(formchecktop.doid.value==""){
		alert("È¸¿ø¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		formchecktop.doid.focus();
		return;
	}
	if (formchecktop.dopwd.value=="")
	{
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		formchecktop.dopwd.focus();
		return;
	}
	formchecktop.submit();
}

function logout_chk() {
	eval("parent.location='/log/logout.asp'");
}

function Gongji(idx) {
	window.open("/counsel/gonji/read.asp?idx="+idx,"win_pop","width=470,height=420,top=100,left=200,scrollbars=yes");
}

function ch(obj)
{
	obj.value="";
	obj.style.textAlign="";
	obj.style.fontWeight="";
}


	function poll(){
		chk = document.form;
		example = false;

		for(var x=0;x<chk.poll.length;x++){
			result = chk.poll[x].checked;
			if (result==true){
				example = true;
				break;
			}
		}

		if (example==false){
			alert('ÅõÇ¥¸¦ ÇÏ¼Å¾ß ÇÕ´Ï´Ù.  ');
			return;
		}
	
		winStatus = "width=420,height=450,top=0,left=0,menubar=no,status=no,scrollbars=yes";

		window.open("","win_poll",winStatus)
		chk.target="win_poll";
		chk.submit();
		
	}

	function poll_result(idx){
		window.open("/client/poll_pop.asp?idx="+idx,"win_poll","width=420,height=450,top=0,left=0,menubar=no,status=no,scrollbars=yes")
	}

	function  Search(frm){
		if (frm.keyword.value==""){
			alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
			frm.keyword.focus();
			return false;
		}
	}

	function DicSearch(){
		document.Dform.submit();
	}

function win_open1(no) {
	 if (no == "1"){
     POP = window.open("/pop/040719.asp", "WIN_SUB", "menubar=0, top=0,left=0,toolbar=0,location=0,directory=0,scrollbars=0,resizable=0,width=450,height=392");
     POP.focus();
	 }
	 else  {
	 POP = window.open("/pop/040726.asp", "WIN_SUB", "menubar=0, top=0,left=0,toolbar=0,location=0,directory=0,scrollbars=0,resizable=0,width=450,height=468");
     POP.focus();
	 }
     //return;        
}
//function win_open2() {
//	 POP = window.open("/pop/050214.asp", "WIN_SUB", "menubar=0, top=0,left=0,toolbar=0,location=0,directory=0,scrollbars=0,resizable=0,width=400,height=475");
//     POP.focus();
//}

//¹è³Ê º¯È¯
var i = 1;

banner1 = new Image();
banner1.src = "/img/banner/main_top.gif";
banner2= new Image();
banner2.src = "/img/banner/041101_main.gif";
//banner3= new Image();
//banner3.src = "/img/banner/main_050212.gif";
banner3= new Image();
banner3.src = "/img/banner/main_bell.gif";


var links = new Array

links[1] = "/common/company/news/read.asp?idx=19&code=16&page=" 
links[2] = "/unse/0506yearluck/main.asp"
//links[3] = "/event/0502/050201.asp"
links[3] = "/unse/mobile/bell.asp"

var description = new Array

description[1] = "´ëÇÑ¹Î±¹ ¿î¼¼ »çÀÌÆ® ÀÔ¼Ò¹® ÃÖ°í µµÅë(Ô³÷×)"
description[2] = "¾÷±×·¹ÀÌµåµÈ 2008³â µµÅëºñ°á Ãâ½Ã!!!"
//description[3] = "È¸¿ø°¡ÀÔÇÏ¸é ¿µÈ­ÇÑÆíÀÌ °øÂ¥!"
description[3] = "º°ÀÚ¸®¿Í Ç÷¾×ÇüÀ¸·Î ³» »ç¶û&¿î¼¼ º§¼Ò¸®¸¦ ´Ù¿î¹ÞÀÚ!"

function loadBanner(){

        var time= new Date();
        hours= time.getHours();
        mins= time.getMinutes();
        secs= time.getSeconds();
        closeTime=hours*3600+mins*60+secs;
        closeTime+=4;	/* ÀÌ¹ÌÁö º¯È¯ Å¸ÀÌ¸Ó Á¶Àý */
        Timer();

}

function Timer(){
        var time= new Date();
        hours= time.getHours();
        mins= time.getMinutes();
        secs= time.getSeconds();
        curTime=hours*3600+mins*60+secs
        if (curTime>=closeTime){
		if (i < 3){
			i++;
			document.all.banner.src = eval("banner" + i + ".src");
		}
		else{
			i = 1;
			document.all.banner.src = eval("banner" + i + ".src");
		}
		loadBanner();
	}
        else{
                window.setTimeout("Timer()",1000)}

}

function clickLink(){
	top.location = links[i]
}

function descript(){
	window.status = description[i]
}

function nothing() {
	window.status=""
}

//ºÎÀû ½ºÅ©·Ñ ÇÔ¼ö
function showMessage(n, show) {
  var whichEl = (NS4) ? eval("message" + n) :
                        eval("message" + n + ".style");
  whichEl.visibility = (show) ? ((NS4) ? "show" : "visible") :
                                ((NS4) ? "hide" : "hidden");
}

function nextMessage() {
  var fromInd = current;
  current = (fromInd == ar.length - 1) ? 0 : fromInd + 1;
  scrollBanner(fromInd, current);
}

function moveUp() {
  if (NS4) {
    fromEl.top -= increment;
    if (toEl.top - increment <= toElTarget) {
      toEl.top = toElTarget;
      clearInterval(intervalID);
      fromEl.visibility = "hide";
      timeoutID = setTimeout("nextMessage()", pause);
    } else {
      toEl.top -= increment;
    }
  } else {
    fromEl.pixelTop -= increment;
    if (toEl.pixelTop - increment <= toElTarget) {
      toEl.pixelTop = toElTarget;
      clearInterval(intervalID);
      fromEl.visibility = "hidden";
      timeoutID = setTimeout("nextMessage()", pause);
    } else {
      toEl.pixelTop -= increment;
    }
  }
}

function scrollBanner(from, to) {
  if (NS4) {
    fromEl = eval("message" + from);
    toEl = eval("message" + to);
    toEl.top = fromEl.top + bannerHeight;
    toElTarget = fromEl.top;
  } else {
    fromEl = eval("message" + from + ".style");
    toEl = eval("message" + to + ".style");
    toEl.pixelTop = fromEl.pixelTop + bannerHeight;
    toElTarget = fromEl.pixelTop;
  }
  showMessage(to, true); // show the upcoming message
  intervalID = setInterval("moveUp()", interval);
}

function makeIE() {
  // assign the necessary code to a variable
  var text = '<DIV ID="banner_4" STYLE="position:absolute">';
  for (var i = ar.length - 1; i >= 0; i--) {
    text += '<DIV ID="message' + i + 
            '" STYLE="position:absolute"></DIV>';
  }
  text += '</DIV>';

  // insert the code before the end of the document
  document.body.insertAdjacentHTML("BeforeEnd", text);

  // define the main element's properties
  with (banner_4.style) {
    width = bannerWidth;
    height = bannerHeight;
    clip = "rect(0 " + bannerWidth + " " + bannerHeight + " 0)";
    backgroundColor = bannerColor;
    pixelLeft = bannerLeft;
    pixelTop = bannerTop;
  }

  // define the child elements' properties
  for (i = 0; i < ar.length; i++) {
    with (eval("message" + i + ".style")) {
      visibility = "hidden";
      pixelLeft = leftPadding;
      pixelTop = topPadding;
      width = bannerWidth - leftPadding;
      backgroundColor = bannerColor;
    }
  }
}

function makeNS() {
  // create the main element
  banner_4 = new Layer(bannerWidth);

  // define the main element's properties
  with (banner_4) {
    clip.right = bannerWidth;
    clip.bottom = bannerHeight;
    document.bgColor = bannerColor;
    left = bannerLeft;
    top = bannerTop;
    visibility = "show";
  }

  // define the child elements' properties
  for (var i = 0; i < ar.length; i++) {
    // create a child element
    eval("message" + i + " = " + 
         "new Layer(bannerWidth - leftPadding, banner)");
    with(eval("message" + i)) {
      visibility = "hide";
      left = leftPadding;
      top = topPadding;
      document.bgColor = bannerColor;
    }
  }
}

function fillBanner() {
  var whichEl;
  if (NS4) {
    for (var i = 0; i < ar.length; i++) {
      whichEl = eval("message" + i);
      whichEl.document.write(ar[i]);
      whichEl.document.close();
    }
  } else {
    for (var i = 0; i < ar.length; i++) {
      whichEl = eval("message" + i);
      whichEl.innerHTML = ar[i];
    }
  }
}

function startBanner() {
  if (NS4)
    makeNS()
  else
    makeIE();
  fillBanner();
  showMessage(0, true);
  current = 0;
  timeoutID = setTimeout("nextMessage()", pause);
}



function swf(src,w,h){
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	html += '<param name="movie" value="'+src+'">';
	html += '<param name="quality" value="high">';
	html += '<PARAM NAME=wmode VALUE=transparent>';
	html += '<param name="swliveconnect" value="true">';
	html += '<embed src="'+src+'" quality=high  wmode=transparent  loop=false menu=false width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer"><\/embed>';
	html += '<\/object>';
	document.write(html);
}
