/**
* º§¼Ò¸® Àü¼Û°ü·Ã ½ºÅ©¸³Æ® 
*
* @author  : Lee jong joo
* @version : 0.1
* @since   :  08/29/2003
*/
function kcm_pop()
{
	window.open('/event/kcm/pop.php','kcm','width=610,height=480,top=50, left=50, toolbars=no,resizable=yes,scrollbars=yes,status=yes')
}

function openPopup(url,na,wi,he){
	window.open(url,na,'toolbar=no,scrollbars=no,top=200,left=300,width='+wi+',height='+he+'/');
}

function buycoupon()
{
	window.open('/coupon/selectcoupon.php','coupon', 'top=50, left=50, width=400, height=340, toolbars=no,resizable=yes,scrollbars=yes,status=no');
}

function buycoupon2()
{
	window.open('/coupon/selectcoupon2.php','coupon', 'top=50, left=50, width=400, height=340');
}

function sk_cer_chk_js()
{
	window.open('http://www.skybell.co.kr/sk_certify/new/estation_chk.php','skt2','width=400,height=320,top=50, left=50, toolbars=no,resizable=yes,scrollbars=no');
	//window.open('http://fdb.tingbell.com/estation-url/url_index.asp','skt','width=400,height=320,top=50, left=50, toolbars=no,resizable=yes,scrollbars=no');
}

/* º§¼Ò¸®TO 10 START*/
function CheckUIElements()
{
	var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;
	var nDivTop;
	
	
	//nDivTop = 64;
	nDivTop = 0;
	/*
	if(location.pathname == "/" || location.pathname == "/main.asp")
		nDivTop = 194;
	else
		nDivTop = 140;
	*/

	yMenuFrom   = parseInt (sTop10.style.top, 10);
	yMenuTo     = document.body.scrollTop + nDivTop;//ÀÌ ¼ýÀÚ¸¦ ¼öÁ¤ÇÏ¸é À§ÂÊ¿©¹éÀ» Á¶Àý ÇÒ ¼ö ÀÖ½À´Ï´Ù(ÀÍ½ºÇÃ·Î·¯)

	timeoutNextCheck = 500;

	if ( yMenuFrom != yMenuTo ) 
	{
		yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
  
		if ( yMenuTo < yMenuFrom )
		  yOffset = -yOffset;

		sTop10.style.top = parseInt (sTop10.style.top, 10) + yOffset;

	timeoutNextCheck = 10;
	}

	setTimeout ("CheckUIElements()", timeoutNextCheck);
}	



function OnLoadLeftMenu()
{
	//sTop10.style.top = document.body.scrollTop;
	sTop10.style.top = 64;
	sTop10.style.visibility = "visible";
	
	CheckUIElements();

	return true;
}

/* º§¼Ò¸®TO 10 END*/


function auto_hangul_url()
{
	window.open('/help/auto_hangul_url.php','hangul_url','width=800,height=600,top=100, left=100, toolbars=no,resizable=yes,scrollbars=yes')
}

function certify_win_winc()
{
	window.open('/help/winc_help.php','winc','width=800,height=600,top=0, left=0, toolbars=no,resizable=yes,scrollbars=yes')
}

//°æÇ° ¼³¹®Á¶»ç °Ô½ÃÆÇ.
function present_board()
{
	window.open('/board_poll/bbs.php','present_bbs','width=650,height=500,top=50, left=50, toolbars=no,resizable=yes,scrollbars=yes')
}

//º§¼Ò¸® Àü¼Û ÆäÀÌÁö
function bell(Poly, num, whereis)
{
	window.open('/bell/?num='+num+'&Poly='+Poly+'&whereis=' +whereis+'&hit=first&kind=bell','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=400, height=600, scrollbars=yes, top=10, left=100')

	//window.open('/bbs/Send_Bell.php?num='+num+'&Poly='+Poly+'&whereis=' +whereis+'&hit=first','BellSend','toolbar=no, directories=no, status=no resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')
}

//º§¼Ò¸® Àü¼Û ÆäÀÌÁö - Å×½ºÆ®¿ë -
function cjy_bell(Poly, num, whereis)
{
	window.open('/bell/_index.php?num='+num+'&Poly='+Poly+'&whereis=' +whereis+'&hit=first&kind=bell','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')

	//window.open('/bbs/Send_Bell.php?num='+num+'&Poly='+Poly+'&whereis=' +whereis+'&hit=first','BellSend','toolbar=no, directories=no, status=no resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')
}

//º§¼Ò¸® Àü¼Û ÆäÀÌÁö Test
function _bell(Poly, num, whereis)
{
	window.open('/_bell/?num='+num+'&Poly='+Poly+'&whereis=' +whereis+'&hit=first&kind=bell','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')
}

//º§¼Ò¸® Àü¼Û ÆäÀÌÁö
function p128(Poly, num, whereis)
{
	window.open('/bell/?num='+num+'&Poly='+Poly+'&whereis=' +whereis+'&hit=first&kind=p128','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')
}
//º§¼Ò¸® Àü¼Û ÆäÀÌÁö
function _p128(Poly, num, whereis)
{
	window.open('/_bell/?num='+num+'&Poly='+Poly+'&whereis=' +whereis+'&hit=first&kind=p128','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')
}

//º§¼Ò¸® Àü¼Û ÆäÀÌÁö
function livebell(sec, num, whereis)
{
	window.open('/bell/?num='+num+'&sec='+sec+'&whereis=' +whereis+'&hit=first&kind=livebell','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=400, height=600, scrollbars=no, top=0, left=100')

	//window.open('/livebell/Send_Bell.php?num='+num+'&sec='+sec+'&whereis=' +whereis+'&hit=first','BellSend','toolbar=no, directories=no, status=no resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')
}

function _livebell(sec, num, whereis)
{
	//window.open('/livebell/Send_Bell.php?num='+num+'&sec='+sec+'&whereis=' +whereis+'&hit=first','BellSend','toolbar=no, directories=no, status=no resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')
	window.open('/bell/__index.php?num='+num+'&sec='+sec+'&whereis=' +whereis+'&hit=first&kind=livebell','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=400, height=600, scrollbars=no, top=0, left=100')
}

//µ¿¿µ»óº§ Àü¼Û ÆäÀÌÁö
function movbell(sec, num, whereis)
{
	window.open('/bell/?num='+num+'&sec='+sec+'&whereis=' +whereis+'&hit=first&kind=movbell','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=400, height=600, scrollbars=no, top=0, left=100')
	//window.open('/movbell/Send_Bell.php?num='+num+'&sec='+sec+'&whereis=' +whereis+'&hit=first','BellSend','toolbar=no, directories=no, status=no resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')
	
}
function _movbell(sec, num, whereis)
{
	window.open('/_bell/?num='+num+'&sec='+sec+'&whereis=' +whereis+'&hit=first&kind=movbell','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=400, height=600, scrollbars=no, top=0, left=100')

	//window.open('/movbell/Send_Bell.php?num='+num+'&sec='+sec+'&whereis=' +whereis+'&hit=first','BellSend','toolbar=no, directories=no, status=no resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')
}

//Àü°îº§ Àü¼Û ÆäÀÌÁö
function ptotal(num, whereis)
{
	window.open('/_bell/?num='+num+'&whereis=' +whereis+'&hit=first&kind=ptotal','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')
}

//Áøµ¿º§¼Ò¸® Àü¼Û ÆäÀÌÁö
function swingbell(Poly, num, whereis)
{
	window.open('/bell/?num='+num+'&Poly='+Poly+'&whereis=' +whereis+'&hit=first&kind=swingbell','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=400, height=600, scrollbars=no, top=0, left=100')

	//window.open('/swingbell/Send_Bell.php?num='+num+'&Poly='+Poly+'&whereis=' +whereis+'&hit=first','BellSend','toolbar=no, directories=no, status=no resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')
}
function _swingbell(Poly, num, whereis)
{
	window.open('/_bell/?num='+num+'&Poly='+Poly+'&whereis=' +whereis+'&hit=first&kind=swingbell','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=400, height=600, scrollbars=no, top=0, left=100')
}

function msgring(num)
{
	window.open('/msgring/Send_Bell.php?num='+num+'&hit=first','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')
}

//mp3 ´Ù¿î ÆäÀÌÁö
function mp3down(num, whereis)
{
	window.open('/bell/_index.php?num='+num+'&whereis=' +whereis+'&hit=first&kind=mp3down','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=780, height=684, scrollbars=yes, top=10, left=100')

	//window.open('/bbs/Send_Bell.php?num='+num+'&Poly='+Poly+'&whereis=' +whereis+'&hit=first','BellSend','toolbar=no, directories=no, status=no resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')
}

//º§¼Ò¸® Àü¼Û ÆäÀÌÁö Test
function __bell(Poly, num, whereis)
{
	window.open('/__bbs/Send_Bell.php?num='+num+'&Poly='+Poly+'&whereis=' +whereis+'&hit=first','BellSend','toolbar=no, directories=no, status=no, resizable=no, width=400, height=600, scrollbars=no, top=10, left=100')
}

//¿¬¿¹ÀÎ Ä³¸¯ÅÍ Àü¼Û ÆäÀÌÁö
function char_send( num)
{
	window.open('/bbs_char/Send_Image.php?num='+num+'&hit=first','ImageSendPage','toolbar=no, directories=no, status=no, resizable=no, width=402, height=305, scrollbars=no, top=100, left=100');
}

function _char_send(num)
{
	window.open('/bbs_char/_Send_Image.php?num='+num+'&hit=first','ImageSendPage','toolbar=no, directories=no, status=no, resizable=no, width=502, height=355, scrollbars=no, top=100, left=100');
}

//Ä³¸¯ÅÍ Àü¼Û ÆäÀÌÁö
function ImageView(num,Telecom)
{
	window.open('/character/Send_Image.php?num='+num+'&TeleCom='+Telecom,'ImageSendPage','toolbar=no, directories=no, status=no, resizable=no, width=402, height=305, scrollbars=no, top=100, left=100');
}

 function show_waiting() {
  var _x = document.body.clientWidth/2 + document.body.scrollLeft - 145;
  var _y = document.body.clientHeight/2 + document.body.scrollTop - 44;
  zb_waiting.style.posLeft=_x;
  zb_waiting.style.posTop=_y;
  zb_waiting.style.visibility='visible';
 }

 function hide_waiting() {
  zb_waiting.style.visibility='hidden';
  check_attack.check.value=0;
 }

  function unlock()
 {
  check_attack.check.value=0;
 }
 var imageBoxHandler;
  function hideImageBox() {
  if(imageBoxHandler) {
   if(imageBoxHandler != 'undefined') {
    if(imageBoxHandler.closed==false) imageBoxHandler.close();
   }
  }
 }

 // È¨ÇÇ ÀÌµ¿
function myHome(userid)
{
	window.open("http://home.skybell.co.kr/shop/myshop/?userid=" + userid, "pshop", "top=100, left=100, width=740, height=490");
	//alert ( '·Î±×ÀÎÈÄ ÂÊÁö º¸³»±â°¡ °¡´ÉÇÕ´Ï´Ù' );
}

 // È¨ÇÇ ÀÌµ¿
function myHomeHid(hid)
{
	window.open("http://home.skybell.co.kr/shop/myshop/?hid=" + hid, "pshop", "top=100, left=100, width=740, height=490");
}

function onlynumber()
{
    if((event.keyCode<48)||(event.keyCode>57))
    event.returnValue=false;
} 

function objWrite(str1) {
	document.write(str1);
}



/*******************************************************************************
* ÄíÅ°¼³Á¤
*
* name                  -       ÄíÅ°¸í
* value                 -       °ª
* expiredays    -       ½Ã°£ (ÀÏ´ÜÀ§)
*******************************************************************************/
function setCookie( name, value, expiredays )
{
        var today = new Date();
        today.setDate( today.getDate() + expiredays );
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
}


function today_woon()
{
	var url = "http://www.skybell.co.kr/unse/today/today_woon_result.php";
	location.href=url;
	//window.open(url, "today_woon", "top=100, left=100, width=514, height=350, scrollbars=yes");
}

function saju_input()
{
	var url = "http://unse.skybell.co.kr/mem_info/mem_info_form.php";
	window.open(url, "today_woon", "top=100, left=100, width=514, height=350, scrollbars=yes");
}



function writeAlbumImgList(albumImg, hotFlag, view, event)
{
	var strBuf = '';
	
	if (event=='Y')
	{
		swf_s = "album_event2.gif";
		swf_b = "event_b.swf";
	}
	else
	{
		swf_s = "album_hot2.gif";
		swf_b = "hot_b.swf";
	}


	if ( view=='s' )
	{
		if (hotFlag=='Y' || event=='Y') {
		strBuf = strBuf.concat("<div id=vcharacter style='position:relative; width:80; height:80; overflow:hidden'>");
		strBuf = strBuf.concat("<div id=vlayer1 style='position:absolute; width:0px; heigth:0px; left:45; top:5; z-index:100'><img src='/img/"+swf_s+"' width='30' height='30'></div>");
		strBuf = strBuf.concat("<div id=vlayer2 style='position:absolute; left:0; top:0; z-index:1'>");
		strBuf = strBuf.concat("<table cellspacing='1' cellpadding='4' border='0' bgcolor='#D9D9D9'><tr bgcolor='white'><td align='center'>");
		strBuf = strBuf.concat("<img id=vlayerimg1 src="+ albumImg +" width=70 height=70>");
		strBuf = strBuf.concat("</td></tr></table>");
		strBuf = strBuf.concat("</div></div>");
		} else {
			strBuf = strBuf.concat("<table cellspacing=1 cellpadding=4 border=0 bgcolor=#D9D9D9><tr><td bgcolor=#FFFFFF>");
			strBuf = strBuf.concat("<img id=vlayerimg1 src="+ albumImg +" width=70 height=70'>");
			strBuf = strBuf.concat("</td></tr></table>");
		}
	}
	else 
	{
		if (hotFlag=='Y' || event=='Y') {
		strBuf = strBuf.concat("<div id=vcharacter style='position:relative; width:170; height:170; overflow:hidden'>");
		strBuf = strBuf.concat("<div id=vlayer1 style='position:absolute; width:0px; heigth:0px; left:5; top:5; z-index:100'><embed src=/album/img/"+swf_b+" quality=high width=160 height=160 type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash WMode=Transparent></embed></div>");
		strBuf = strBuf.concat("<div id=vlayer2 style='position:absolute; left:0; top:0; z-index:1'>");
		strBuf = strBuf.concat("<table cellspacing='1' cellpadding='4' border='0' bgcolor='#D9D9D9'><tr bgcolor='white'><td align='center'>");
		strBuf = strBuf.concat("<img id=vlayerimg1 src="+ albumImg +" width=160 height=160>");
		strBuf = strBuf.concat("</td></tr></table>");
		strBuf = strBuf.concat("</div></div>");
		} else {
			strBuf = strBuf.concat("<table cellspacing=1 cellpadding=4 border=0 bgcolor=#D9D9D9><tr><td bgcolor=#FFFFFF>");
			strBuf = strBuf.concat("<img id=vlayerimg1 src="+ albumImg +" width=160 height=160'>");
			strBuf = strBuf.concat("</td></tr></table>");
		}
	}
	objWrite(strBuf);
}

function goAlbum(album_id)
{
	location.href="/album/?album_id=" + album_id;
}

function ms_start()
{
	startpage.style.behavior='url(#default#homepage)';
	startpage.setHomePage('http://www.skybell.co.kr/?r=sta');
}

function ms_favor()
{
	if (document.all)
		window.external.AddFavorite('http://www.skybell.co.kr/?r=fav', '¡Úº§¼Ò¸®Ãµ±¹¡ÚÇÚµåÆùº§¼Ò¸®,¹®ÀÚ¸Þ¼¼Áö');
}

/* marquee */
var marqueeId	= null;
var marqueeObj	= null;
var marqueeOn	= false;
var marqueeCls	= new marqueeClass();

function marqueeStart (Obj) {
	if (marqueeOn) return;
	if (!Obj) return;
	if (!Obj.style) return;
	if (!Obj.style.width) return;

	if (Obj.scrollWidth > parseInt(Obj.style.width)) {
		marqueeCls.set(Obj);
		marqueeId	= setInterval('marqueeCls.scroll()',26);
	}
}

function marqueeEnd (Obj) {
	clearInterval(marqueeId);
	marqueeCls.init();
}

function marqueeClass() {
}

marqueeClass.prototype.set = function(Obj) {
	marqueeOn = true;
	marqueeObj = Obj;
	marqueeObj.style.overflow = "visible";
	marqueeObj.style.position = "relative";
	marqueeObj.style.paddingLeft = parseInt(marqueeObj.style.width);
	marqueeObj.style.paddingRight = parseInt(marqueeObj.style.width);
	marqueeObj.style.left = -66;
//	marqueeObj.style.color = "#E7406e";
	
//	marqueeObj.style.textDecoration='underline';

}

marqueeClass.prototype.init = function() {
	marqueeOn = false;
	if (!marqueeObj) return;
	marqueeObj.style.overflow = "hidden";
	marqueeObj.style.paddingLeft = 0;
	marqueeObj.style.paddingRight = 0;
	marqueeObj.style.left = 0;
//	marqueeObj.style.color = "#666666";
//	marqueeObj.style.textDecoration='none';
}

marqueeClass.prototype.scroll = function() {
	if (!marqueeObj) return;

	if (marqueeObj.scrollWidth + parseInt(marqueeObj.style.left) < parseInt(marqueeObj.style.width)) {
		marqueeObj.style.left = 0;
	} else {
		marqueeObj.style.left = parseInt(marqueeObj.style.left) - 1;
	}
}
