function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function setCookie( name, value, expiredays ) {
    var todayDate = new Date();
        todayDate.setDate( todayDate.getDate() + expiredays );
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + "; domain=.dbgo.com ;"
    }

function closeWin() {
//    if ( document.notice_form.chk.value == 1 ){
        setCookie( "maindiv2", "done" , 3650000 );
//    }
    document.all['divpop'].style.visibility = "hidden";
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

////////////////µðºñ°í °ÔÀÓ
//window.attachEvent("onload",init);	 //µðºñ°í °ÔÀÓ
var cnt,max;
function init() {
    cnt=1;
    max=5;
    lol=setInterval("chg()",5000);
}

function chg() {
	eval("document.all.crdTop0"+cnt).style.display="none";
	if (cnt >= max) cnt=0;
	eval("document.all.crdTop0"+(++cnt)).style.display="block";
}

//window.attachEvent("onload",init3);
var cnt3,max3;
function init3() {
    cnt3=1;
    max3=4;
    lol3=setInterval("chg3()",5000);
}

function chg3() {
	eval("document.all.mental_1_"+cnt3).style.display="none";
	if (cnt3 >= max3) cnt3=0;
	eval("document.all.mental_1_"+(++cnt3)).style.display="block";
}

////////////////////////Áß¾Ó ÅØ½ºÆ® ¹è³Ê
//window.attachEvent("onload",init44);
var cnt44,max44;
function init44() {
    cnt44=1;
    max44=3;  //´º½ºtable°¹¼ö
    lol44=setInterval("chg44()",3000);
}

function chg44() {
	eval("document.all.center_text_banner"+cnt44).style.display="none";
	if (cnt44 >= max44) cnt44=0;
	eval("document.all.center_text_banner"+(++cnt44)).style.display="block";
}


//////////////////// ·¹ÀÌ½Ì°É
//window.attachEvent("onload",init1);
var cnt1,max1;
function init1() {
    cnt1=1;
    max1=6;  //·¹ÀÌ½Ì°É
    lol1=setInterval("chg1()",4000);
}

function chg1() {
	eval("document.all.racing_"+cnt1).style.display="none";
	if (cnt1 >= max) cnt1=0;
	eval("document.all.racing_"+(++cnt1)).style.display="block";
}

//////////////////// ¹«·áÄíÆù
//window.attachEvent("onload",init2);
var cnt2,max2;
function init2() {
    cnt2=1;
    max2=4;  //¹«·áÄíÆù
    lol2=setInterval("chg2()",3000);
}

function chg2() {
	eval("document.all.coupon_"+cnt2).style.display="none";
	if (cnt2 >= max2) cnt2=0;
	eval("document.all.coupon_"+(++cnt2)).style.display="block";
}



function tabChg01(num) {
	if (num == 0) {
	tmenu00.src="http://img.dbgo.com/images_new/main/m_tap_03_over.gif";
	tmenu01.src="http://img.dbgo.com/images_new/main/m_tap_04.gif";
    tmenu02.src="http://img.dbgo.com/images_new/main/m_tap_05.gif";
	crdTop00.style.display='block';
	crdTop01.style.display='none';
    crdTop02.style.display='none';

	}else if (num == 1){
	tmenu00.src="http://img.dbgo.com/images_new/main/m_tap_03.gif";
	tmenu01.src="http://img.dbgo.com/images_new/main/m_tap_04_over.gif";
    tmenu02.src="http://img.dbgo.com/images_new/main/m_tap_05.gif";
	crdTop00.style.display='none';
	crdTop01.style.display='block';
    crdTop02.style.display='none';

		}else if (num == 2){
	tmenu00.src="http://img.dbgo.com/images_new/main/m_tap_03.gif";
	tmenu01.src="http://img.dbgo.com/images_new/main/m_tap_04.gif";
    tmenu02.src="http://img.dbgo.com/images_new/main/m_tap_05_over.gif";
	crdTop00.style.display='none';
	crdTop01.style.display='none';
    crdTop02.style.display='block';
   }
}

function tabChg02(num) {
	if (num == 3) {
	tmenu03.src="http://img.dbgo.com/images_new/main/m_tap_01_over.gif";
	tmenu04.src="http://img.dbgo.com/images_new/main/m_tap_02.gif";
	crdTop03.style.display='block';
	crdTop04.style.display='none';

	}else if (num == 4){
	tmenu03.src="http://img.dbgo.com/images_new/main/m_tap_01.gif";
	tmenu04.src="http://img.dbgo.com/images_new/main/m_tap_02_over.gif";
	crdTop03.style.display='none';
	crdTop04.style.display='block';

   }
}


function tabChg03(num) {
	if (num == 5) {
	tmenu05.src="http://img.dbgo.com/images_new/main/m_tap_06_over.gif";
	tmenu06.src="http://img.dbgo.com/images_new/main/m_tap_07.gif";
	crdTop05.style.display='block';
	crdTop06.style.display='none';

	}else if (num == 6){
	tmenu05.src="http://img.dbgo.com/images_new/main/m_tap_06.gif";
	tmenu06.src="http://img.dbgo.com/images_new/main/m_tap_07_over.gif";
	crdTop05.style.display='none';
	crdTop06.style.display='block';

   }
}


//////////////////////dbgo game
function tlolhg(num) {
	if (num == 1) {

	//clearInterval(lol);
	crdTop01.style.display='block';
	crdTop02.style.display='none';
	crdTop03.style.display='none';

	//init();


	}else if (num == 2){

	//clearInterval(lol);
	crdTop01.style.display='none';
	crdTop02.style.display='block';
	crdTop03.style.display='none';

	//init();

	}else if (num ==3){

	//clearInterval(lol);
	crdTop01.style.display='none';
	crdTop02.style.display='none';
	crdTop03.style.display='block';

	//init();

	}else{

	//clearInterval(lol);
	crdTop01.style.display='block';
	crdTop02.style.display='none';
	crdTop03.style.display='none';

	//init();

   }
}

/////////////////////°øÁö»çÇ×, ÀúÀÛ±Çº¸È£¸ñ·Ï
function tlolhg1(num) {
	if (num == 1) {
		//clearInterval(lol1);
		gongi_1.style.display='block';
		gongi_2.style.display='none';
		//init1();
	}else if (num == 2){
		//clearInterval(lol1);
		gongi_1.style.display='none';
		gongi_2.style.display='block';
		//init1();
	}
}

/////////////////////ÇÒÀÎÄíÆù
function tlolhg2(num) {
	if (num == 1) {
		///clearInterval(lol2);
		coupon_1.style.display='block';
		coupon_2.style.display='none';
		coupon_3.style.display='none';
		coupon_4.style.display='none';
		//init2();
	}else if (num == 2){
		//clearInterval(lol2);
		coupon_1.style.display='none';
		coupon_2.style.display='block';
		coupon_3.style.display='none';
		coupon_4.style.display='none';
		//init2();
	}
	else if (num == 3){
		//clearInterval(lol2);
		coupon_1.style.display='none';
		coupon_2.style.display='none';
		coupon_3.style.display='block';
		coupon_4.style.display='none';
		//init2();
	}
	else if (num == 4) {
		//clearInterval(lol2);
		coupon_1.style.display='none';
		coupon_2.style.display='none';
		coupon_3.style.display='none';
		coupon_4.style.display='block';
		//init2();
	}
}

//////////////////////////Áñ°Å¿î µðºñ°í
function tlolhg6(num) {
	if (num == 1) {
	fundbgo_1.style.display='block';
	fundbgo_2.style.display='none';
	fundbgo_3.style.display='none';
	}else if (num == 2){
	fundbgo_1.style.display='none';
	fundbgo_2.style.display='block';
	fundbgo_3.style.display='none';
	}else if (num == 3){
	fundbgo_1.style.display='none';
	fundbgo_2.style.display='none';
	fundbgo_3.style.display='block';
   }
}

//////////////////////////// ½É¸®Å×½ºÆ®
function tlolhg3(num) {
	if (num == 1) {
		mental_1.style.display='block';
		mental_2.style.display='none';
	}else if (num == 2){
		mental_1.style.display='none';
		mental_2.style.display='block';
	}
}

////////////////////////////½É¸®Å×½ºÆ®
function tlolhg4(num) {

	//ÀÎ±â
	if (num == 1){

		tlolhg3(1);
		mental_1_1.style.display='block';
		mental_1_2.style.display='none';
		mental_1_3.style.display='none';
		mental_1_4.style.display='none';

	}
	else if (num == 2) {

		tlolhg3(1);
		mental_1_1.style.display='none';
		mental_1_2.style.display='block';
		mental_1_3.style.display='none';
		mental_1_4.style.display='none';

	}
	else if (num == 3) {

		tlolhg3(1);
		mental_1_1.style.display='none';
		mental_1_2.style.display='none';
		mental_1_3.style.display='block';
		mental_1_4.style.display='none';

	}
	else if (num == 4) {

		tlolhg3(1);
		mental_1_1.style.display='none';
		mental_1_2.style.display='none';
		mental_1_3.style.display='none';
		mental_1_4.style.display='block';

	}

	//´º
	else if (num == 5) {

		tlolhg3(2);
		mental_2_1.style.display='block';
		mental_2_2.style.display='none';
		mental_2_3.style.display='none';
		mental_2_4.style.display='none';
	}
	else if (num == 6) {

		tlolhg3(2);
		mental_2_1.style.display='none';
		mental_2_2.style.display='block';
		mental_2_3.style.display='none';
		mental_2_4.style.display='none';
	}
	else if (num == 7) {

		tlolhg3(2);
		mental_2_1.style.display='none';
		mental_2_2.style.display='none';
		mental_2_3.style.display='block';
		mental_2_4.style.display='none';
	}
	else if (num == 8) {

		tlolhg3(2);
		mental_2_1.style.display='none';
		mental_2_2.style.display='none';
		mental_2_3.style.display='none';
		mental_2_4.style.display='block';
	}
}

/////////////////////////À©µµ¿ì ¹ÙÅÁÈ­¸é
function tlolhg5(num) {
	if (num == 1) {
		window_1.style.display='block';
		window_2.style.display='none';
		window_3.style.display='none';

	}else if (num == 2){
		window_1.style.display='none';
		window_2.style.display='block';
		window_3.style.display='none';
	}
	else if (num == 3){
		window_1.style.display='none';
		window_2.style.display='none';
		window_3.style.display='block';
	}
}


/////////////////////////À¯¸Ó
function tlolhg7(num) {
	if (num == 1) {
		humor_1.style.display='block';
		humor_2.style.display='none';
		humor_3.style.display='none';

	}else if (num == 2){
		humor_1.style.display='none';
		humor_2.style.display='block';
		humor_3.style.display='none';
	}
	else if (num == 3){
		humor_1.style.display='none';
		humor_2.style.display='none';
		humor_3.style.display='block';
	}
}



function go_url(str){
//	alert('Á¡°ËÁßÀÔ´Ï´Ù.');
	if (str == 'entertain')
	{
		top.location.href="http://entertain.dbgo.com/dbgo/dbgo_entertainment.php?navi=0&dst=www";
		//alert('Á¡°ËÁßÀÔ´Ï´Ù.');
	}
	else if (str == 'fortune')
	{
		top.location.href="http://fortune.dbgo.com/main.php?dst=www";
	}
	else if (str == 'comic')
	{
		top.location.href="http://comic.dbgo.com?dst=www";
	}
	else if (str == 'freegame')
	{
		top.location.href="http://freegame.dbgo.com/main_new.php?dst=www";
	}
	else if (str == 'freesms')
	{
		top.location.href="http://freesms.dbgo.com/sub07_09.html?dst=www";
	}
	else if (str == 'disk')
	{
		top.location.href="http://disk.dbgo.com/index.php?dst=www";
	}
	else
	{
		top.location.href="http://game.dbgo.com?dst=www";
	}
}

function go_url1(str){
//	alert('Á¡°ËÁßÀÔ´Ï´Ù.');
	if (str == 'entertain')
	{
		top.location.href="http://entertain.dbgo.com/dbgo/dbgo_entertainment.php?navi=0&dst=www1";
		//alert('Á¡°ËÁßÀÔ´Ï´Ù.');
	}
	else if (str == 'fortune')
	{
		top.location.href="http://fortune.dbgo.com/main.php?dst=www1";
	}
	else if (str == 'comic')
	{
		top.location.href="http://comic.dbgo.com?dst=www1";
	}
	else if (str == 'freegame')
	{
		top.location.href="http://freegame.dbgo.com/main_new.php?dst=www1";
	}
	else if (str == 'freesms')
	{
		top.location.href="http://freesms.dbgo.com/sub07_09.html?dst=www1";
	}
	else if (str == 'disk')
	{
		top.location.href="http://disk.dbgo.com/index.php?dst=www1";
	}
	else
	{
		top.location.href="http://game.dbgo.com?dst=www1";
	}
}

function s_chk(thisForm){
	if(!thisForm.q.value){
		alert("°Ë»ö¾î¸¦ ³Ö¾îÁÖ¼¼¿ä");
		thisForm.q.focus();
		return false;
	}
return true;
}

function  clrImg(obj,t){
	if ( obj.value == "G¸¶ÄÏ" && t==0)
	{
		obj.style.filter="alpha(opacity:"+100+")";
		obj.value="";
	}

	if ( !obj.value && t==1)
	{
		obj.style.filter="alpha(opacity:"+30+")";
		obj.value="G¸¶ÄÏ";
	}
}



//½ºÅ©·Ñ¸µ
function textScroll(scroll_el_id) {
	this.objElement = document.getElementById(scroll_el_id);
	this.objElement.style.position = 'relative';
	this.objElement.style.overflow = 'hidden';

	this.objLi = this.objElement.getElementsByTagName('li');
	this.height = this.objElement.offsetHeight; // li ¿¤¸®¸ÕÆ®°¡ ¿òÁ÷ÀÌ´Â ³ôÀÌ(¿ÜºÎ¿¡¼­ º¯°æ°¡´É)
	this.num = this.objLi.length; // li ¿¤¸®¸ÕÆ®ÀÇ ÃÑ °¹¼ö
	this.totalHeight = this.height*this.num; // ÃÑ ³ôÀÌ
	this.scrollspeed = 2; // ½ºÅ©·ÑµÇ´Â px
	this.objTop = new Array(); // °¢ liÀÇ top À§Ä¡¸¦ ÀúÀå
	this.timer = null;

	for(var i=0; i<this.num; i++){
		this.objLi[i].style.position = 'absolute';
		this.objTop[i] = this.height*i;
		this.objLi[i].style.top = this.objTop[i]+"px";
	}
}

textScroll.prototype.move = function(){
	for(var i=0; i<this.num; i++) {
		this.objTop[i] = this.objTop[i] - this.scrollspeed;
		this.objLi[i].style.top = this.objTop[i]+"px";
	}
	if(this.objTop[0]%this.height == 0){
		this.jump();
	}else{
		clearTimeout(this.timer);
		this.timer = setTimeout(this.name+".move()",50);
	}
}

textScroll.prototype.jump = function(){
	for(var i=0; i<this.num; i++){
		if(this.objTop[i] == this.height*(-2)){
			this.objTop[i] = this.objTop[i] + this.totalHeight;
			this.objLi[i].style.top = this.objTop[i]+"px";
		}
	}
	clearTimeout(this.timer);
	this.timer = setTimeout(this.name+".move()",3000);
}

textScroll.prototype.start = function() {
	this.timer = setTimeout(this.name+".move()",3000);
}