<!--
// ¿ëµµ : ÁöÁ¤ÇÑ ·¹ÀÌ¾î¸¸ º¸ÀÌ°í ³ª¸ÓÁö °ü·Ã ·¹ÀÌ¾î´Â ¼û±è.
// ÀÎÀÚ : name - ¿¤¸®¸ÕÆ® ¾ÆÀÌµð °ªÀÇ °øÅëºÎºÐ ex> menu1, menu2, .. ¿¡¼­ menu
//        id - ¿¤¸®¸ÕÆ® ¾ÆÀÌµð ¼ø¹ø ex> menu1, menu2, .. ¿¡¼­ 1, 2
function JS_showHideAllLayers(name, id) {
	var o_layers;
	var i = 1;
	while (o_layers = document.getElementById(name+String(i))) {
		o_layers.style.visibility = 'hidden';
		i++;
	} 
	
	if (id != 'undefined') {
		document.getElementById(name+id).style.visibility = 'visible';
	}
}

// ¿ëµµ : Ã¼Å©¹Ú½º ÀüÃ¼ ¼±ÅÃ/ÇØÁ¦
// ÀÎÀÚ : obj - Ã¼Å©¹Ú½º °³Ã¼
function JS_checkedAllYN(name) {
	var obj = document.getElementsByName(name);

	flag = false;
	for (var i=0; i<obj.length; i++) {
		if (!obj[i].checked) {
			flag = true;
			break;
		}
	}

	for (var i=0; i<obj.length; i++) {
		obj[i].checked = flag;
	}
}


function JS_copy2clipboard(data) {
	window.clipboardData.setData('Text', data);
	alert('º¹»çµÇ¾ú½À´Ï´Ù.\nCtrl + v ·Î ¿øÇÏ´Â °÷¿¡ ºÙ¿©³Ö±â ÇÏ½Ê½Ã¿À.');
}


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_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_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 MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.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')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function checkSelectStr(ObjSelect, strValue) {
for (var intLoop = 0; intLoop < ObjSelect.length; intLoop++) {
    if (ObjSelect.options[intLoop].value == strValue)
       ObjSelect.options[intLoop].selected = true;			
    }    
}

function checkRadio(ObjRadio, strValue) {

for (var intLoop = 0; intLoop < ObjRadio.length; intLoop++) {
 if (ObjRadio[intLoop].value == strValue)
 ObjRadio[intLoop].checked = true;
 }
}


// Á¤ÇØÁø ÀÚ¸® ¼ö ¸¸Å­ ÀÔ·ÂµÇ¸é ´ÙÀ½ ÀÔ·Â»óÀÚ·Î ÀÚµ¿ Æ÷Ä¿½º
function auto_focus(text1,text2,len) {
  if (text1.value.length == len) {
	 text2.focus();
	 return;
  }
}


function engnum_check(obj) {
  for (var i=0; i<obj.value.length; i++) {
	var chr=obj.value.substr(i, 1);
	if ((chr<'0'||chr>'9') && (chr<'a'||chr>'z')) {
	  return false;
	}
  }

  return true;
}

// ÁÖ¹Îµî·Ï¹øÈ£ À¯È¿¼º Ã¼Å©
function valid_juminNo(birth, code) {
	if (isNaN(birth) || isNaN(code)) {
		return false;
	}
	
	if (birth.length<6 || code.length<7) {
		return false;
	}

	var a1=birth.substring(0,1)   //ÁÖ¹Î¹øÈ£ °è»ê¹ý
	var a2=birth.substring(1,2)          
	var a3=birth.substring(2,3)
	var a4=birth.substring(3,4)
	var a5=birth.substring(4,5)
	var a6=birth.substring(5,6)
	var checkdigit=a1*2+a2*3+a3*4+a4*5+a5*6+a6*7
	var b1=code.substring(0,1)
	var b2=code.substring(1,2)
	var b3=code.substring(2,3)
	var b4=code.substring(3,4)
	var b5=code.substring(4,5)
	var b6=code.substring(5,6)
	var b7=code.substring(6,7)
	var checkdigit=checkdigit+b1*8+b2*9+b3*2+b4*3+b5*4+b6*5 
	checkdigit = checkdigit%11
	checkdigit = 11 - checkdigit
	checkdigit = checkdigit%10
	if (checkdigit != b7) {
		return false;
	} else {
		return true;
	}
}

function get_juminYear(birth, code) {
	var res;
	//»ý³â¿ùÀÏ ±âº»°ª Ã³¸®
	if (birth.replace(/ /g, '')!='' && code.replace(/ /g, '')!='') {
		var yy = birth.substr(0, 2);
		var sex = code.substr(0, 1);
		if (sex=='1' || sex=='2' || sex=='5' || sex=='6') {
			res = '19'+yy;
		} else if (sex=='3' || sex=='4' || sex=='7' || sex=='8') {
			res = '20'+yy;
		} else if (sex=='9' || sex=='0') {
			res = '18'+yy;
		}
		
		return res;
	} else {
		return false;
	}
}

function get_juminSex(code) {
	var res;
	if (code.replace(/ /g, '')!='') {
		var sex = code.substr(0, 1);
		if (sex=='1' || sex=='3' || sex=='5' || sex=='7' || sex=='9') {
			res='m';
		} else {
			res='f';
		}
		return res;
	} else {
		return false;
	}
}


// 3ÀÚ¸®¸¶´Ù , Âï±â..
function Incredit_comma(vv)
{
 var  s = parseFloat(String(vv).replace(/\,/g,""));
 var ns = s.toString();
 var dp;
 
 if(isNaN(ns))
  return "";
  
 dp = ns.search(/\./);
 
 if(dp<0) 
  dp = ns.length;
  
 dp-=3;
 while(dp>0)
 {
  ns = ns.substr(0,dp)+","+ns.substr(dp);
  dp-=3;
 }

 return ns;
}

function _ws_(id) 
{ 
        var _object = id.innerHTML; 
        _object = _object.replace("<!--", ""); 
        _object = _object.replace("-->" , ""); 
        document.write(_object); id.id=""; 
}

function flash_contents(file,width,height){
	document.writeln("<object id='flash_contents' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='"+width+"' height='"+height+"' align=''>");
	document.writeln("<PARAM NAME=movie value='"+file+"' />");
	document.writeln("<PARAM NAME=quality VALUE=high />");
	document.writeln("<PARAM NAME=wmode VALUE=transparent />");
	document.writeln("<embed src='"+file+"' quality='high' bgcolor='#FFFFFF' width='"+width+"' height='"+height+"' name='flash_contents' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'  wmode=\"transparent\"/>");
	document.writeln("</object>");
}

/*
function print_objectAudio(filepath) {
	document.write('<object id='audio' classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" height=25>');
	document.write('<param name=AutoStart value=0>');
	document.write('<param name=TransparentAtStart value=1>');
	document.write('<param name=ShowControls value=1>');
	document.write('<param name=ShowDisplay value=0>');
	document.write('<param name=ShowStatusBar value=0>');
	document.write('<param name=ShowPositionControls value=0>');
	document.write('<param name=AutoSize value=1>');
	document.write('<param name=AnimationAtStart value=0>');
	document.write('<param name=FileName value="'+filepath+'">');
	document.write('</object>');
}
*/

function print_objectVideo(url) {
	document.write("<object classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'  id='MediaPlayer' width='600' height='400' standby='Loading Microsoft Windows Media Player components...'>");
	document.write("<param NAME='URL' VALUE='"+url+"'>");   
	document.write("<param name='AllowScan' value='-1'>");
	document.write("<param name='AllowChangeDisplaySize' value='-1'>");
	document.write("<param name='AnimationAtStart' value='0'>");
	document.write("<param name='AudioStream' value='-1'>");
	document.write("<param name='AutoStart' value='-1'>");
	document.write("<param Name='AutoSize' Value='1'>");
	document.write("<param name='AutoResize' value='-1'>");
	document.write("<param name='AutoRewind' value='0'>");
	document.write("<param name='Balance' value='0'>");
	document.write("<param name='BaseURL'>");
	document.write("<param name='BufferingTime' value='5'>");
	document.write("<param name='CaptioningID'>");
	document.write("<param name='ClickToPlay' value='-1'>");
	document.write("<param name='CursorType' value='0'>");
	document.write("<param name='CurrentPosition' value='-1'>");
	document.write("<param name='CurrentMarker' value='0'>");
	document.write("<param name='DefaultFrame'>");
	document.write("<param name='DisplayBackColor' value='0'>");
	document.write("<param name='DisplayForeColor' value='16777215'>");
	document.write("<param name='DisplayMode' value='0'>");
	document.write("<param name='DisplaySize' value='4'>");
	document.write("<param name='Enabled' value='-1'>");
	document.write("<param name='EnableContextMenu' value='0'>");
	document.write("<param name='EnablePositionControls' value='-1'>");
	document.write("<param name='EnableFullScreenControls' value='-1'>");
	document.write("<param name='EnableTracker' value='-1'>");
	document.write("<param name='InvokeURLs' value='-1'>");
	document.write("<param name='Language' value='-1'>");
	document.write("<param name='PlayCount' value='1'>");
	document.write("<param name='PreviewMode' value='0'>");
	document.write("<param name='Rate' value='1'>");
	document.write("<param name='SAMILang'>");
	document.write("<param name='SAMIStyle'>");
	document.write("<param name='SAMIFileName' value=''>");
	document.write("<param name='SelectionStart' value='-1'>");
	document.write("<param name='SelectionEnd' value='-1'>");
	document.write("<param name='SendOpenStateChangeEvents' value='-1'>");
	document.write("<param name='SendWarningEvents' value='-1'>");
	document.write("<param name='SendErrorEvents' value='-1'>");
	document.write("<param name='SendKeyboardEvents' value='0'>");
	document.write("<param name='SendMouseClickEvents' value='0'>");
	document.write("<param name='SendMouseMoveEvents' value='0'>");
	document.write("<param name='SendPlayStateChangeEvents' value='-1'>");
	document.write("<param name='ShowCaptioning' value='0'>");
	document.write("<param name='ShowControls' value='-1'>");
	document.write("<param name='ShowAudioControls' value='-1'>");
	document.write("<param name='ShowDisplay' value='0'>");
	document.write("<param name='ShowGotoBar' value='0'>");
	document.write("<param name='ShowPositionControls' value='-1'>");
	document.write("<param name='ShowStatusBar' value='-1'>");
	document.write("<param name='ShowTracker' value='-1'>");
	document.write("<param name='TransparentAtStart' value='-1'>");
	document.write("<param name='VideoBorderWidth' value='0'>");
	document.write("<param name='VideoBorderColor' value='0'>");
	document.write("<param name='VideoBorder3D' value='0'>");
	document.write("<param name='WindowlessVideo' value='0'>");
	document.write("<param  NAME='stretchToFit'  VALUE='1'>");
	document.write("</object>");
}


function flashMenu(val) {
	var men_name = [
							'menu_10', 'menu_11','menu_12','menu_13','menu_14','menu_15','menu_16',
							'menu_20', 'menu_21','menu_22','menu_23','menu_24','menu_25','menu_26',
							'menu_30', 'menu_31','menu_32','menu_33','menu_34','menu_35','menu_36',
							'menu_40', 'menu_41','menu_42',
							'menu_50', 'menu_51','menu_52','menu_53','menu_54','menu_55','menu_56',
							'menu_60', 'menu_61','menu_62','menu_63','menu_64','menu_65','menu_66','menu_67','menu_68',
							'menu_7']; 
	var men_url = [
						'/news/','/news/','/news/s2_notice_list.php','/news/s3_event_list.php','/news/s4_basketballnews_list.php','/news/s5_sponsornews_list.php','/news/s6_pds_wallpaper.php',
						'/community/', '/community/','/community/s2_column_list.php','/community/s3_toon_list.php','/community/s7_photostory_list.php','/community/s4_supporters.php','/community/s5_qna_list.php',
						'/game_ticket/', '/game_ticket/s1_game.php','/game_ticket/s2_record.php','/game_ticket/s3_ticket.php','/game_ticket/s4_groupviewing_list.php','/game_ticket/s5_messaging_list.php','http://kbl.or.kr/fan/dictionary/dic_list.asp',
						'/slamershop', '/slamershop/s1_shopping_list.php','/slamershop/s2_auction_list.php',
						'/player/', '/player/s1_schedule.php','/player/s2_coachingstaff.php','/player/s3_player.php','/player/s6_front.php','/player/s4_cheer.php','/player/s5_family.php',
						'/blackslamer/', '/blackslamer/s1_greeting.php','/blackslamer/s2_history.php','/blackslamer/s3_stadium.php','/blackslamer/s4_training.php','/blackslamer/s5_ci.php','/blackslamer/s6_sponsor.php','/blackslamer/s7_link.php','/blackslamer/s8_bshistory.php',
						'http://junior.etblackslamer.co.kr/'];

	for (i=0; i<men_name.length; i++)
	{
		if (val==men_name[i])
		{
			if (val=="menu_7" ||val=="menu_36")
			{
				window.open(men_url[i]);
			} else {
				location.href=men_url[i];
			}
		}
	}
}


function confirm_login(loc) {
	if(confirm('·Î±×ÀÎÀ» ÇÏ½Å ÈÄ¿¡ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.\n\nÁö±Ý ·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?')) {
		if (!loc) {
			loc = '';
		}		

		location.href = '/member/login.php?loc='+loc;
		return true;
	} else {
		return false;
	}
}


function cancelEvent() {
	window.event.returnValue = false;
}


// ·Ñ¿À¹ö ÀÌ¹ÌÁö Ã³¸®..
function img_rollover(obj, evt) {
	obj.filters.blendTrans.stop(); 
	obj.filters.blendTrans.Apply(); 
	if (evt == "over") {
		obj.src = obj.src.replace("_off", "_on");
	} else {
		obj.src = obj.src.replace("_on", "_off");
	}
	obj.filters.blendTrans.Play(); 
}


// ¼­¼­È÷ º¸¿©ÁÖ±â
function do_slowShow(id, step, delay) {
	if (step < 5) {
		document.getElementById(id).style.opacity = "."+ (step*2);
		document.getElementById(id).style.filter = "alpha(opacity="+ (step*20) +")";
		setTimeout("do_slowShow('"+ id +"', "+ (step+1) +", "+ delay +")", delay);
	} else {
		document.getElementById(id).style.opacity = "";
		document.getElementById(id).style.filter = "";
	}
}


//===== ¾ÆÀÌµðÀúÀå - ½ÃÀÛ =====
// ÀúÀåÇÒ º¯¼ö¸í, ÀúÀåÇÒ °ª, ÀÏÀÚ  (1:1ÀÏ, 2:2ÀÏ, 365:ÀÏ³â)
function setCookie (name, value, expiredays)
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";";
}

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 setID(chk)
{
	var fm = document.loginForm;
	if (chk.checked == true)
	{
		setCookie ('member_id', fm.id.value, 365);
	} else {
		setCookie ('member_id', '', 1);
	}
}

function getID()
{
	try {
		var fm = document.loginForm;
		var v_uid = getCookie('member_id');
		if (v_uid != '') {
			fm.save_id.checked = true;
			//fm.id.style.background = '';
			fm.id.value = v_uid;
			return true;
		}
		return false;
	}	catch (e) {
		return false;
	}
}

//===== ¾ÆÀÌµð ÀúÀå - ³¡ =====


// ¼­Æ÷ÅÍÁî °¡ÀÔÃ¢
function click_supportersApp() {
	window.open("/popup/supporters/gaip.php", "supportersApp", "scrollbars=yes, resizable=yes, width=625, height=500, left=1, top=1");
}

// ¼­Æ÷ÅÍÁî ¸®½ºÆ®
function click_supportersApp_list() {
	window.open("/popup/supporters/supporters_list.php", "supportersApp", "scrollbars=yes, resizable=yes, width=625, height=500, left=1, top=1");
}

// Ä«Å×°í¸® ÀÔ·ÂÃ¢
function pop_category(menuname, subname) {
	v_winstyle = 'width=650, height=450, top=100, left=100, scrollbars=yes, resizable=no';
	window.open('/_bbs/category_list.php?menuname='+menuname+'&subname='+subname, 'category_list', v_winstyle);
}

// ¿ìÆí¹øÈ£ °Ë»ö
function search_zip(w_name) {
   var Wnd;
   Wnd=window.open("/_common/search_zip.php",w_name, "width=340,height=320,scrollbars=0,resizable=0,status=no");
   Wnd.focus();
}

// ÆÄ¿ïÀû¿ëÃ¢ ¶ç¿ì±â
function click_foul(idx, menu, sub, etc) {
	window.open("/_bbs/foul.php?idx="+idx+"&menu="+menu+"&sub="+sub+"&etc="+etc, "pop_foul", "toolbar=no,location=no,directories=no,width=510,height=300,status=no,menubar=no,scrollbars=yes,resizable=no,left=300,top=300");	
}

// ÃßÃµ Àû¿ëÇÏ±â
function click_recommend(idx, menu, sub, type) {
	location.href = "/_bbs/recommend.php?menu="+menu+"&sub="+sub+"&type="+type+"&idx="+idx;
}

//½ÃÁð¼±ÅÃ
function setChange1(obj)
{
	var sseason = obj.options[obj.selectedIndex].value;
	location.replace("/game_ticket/s2_record.php?season="+sseason);
}

//³¯Â¥¼±ÅÃ
function setChange2(obj)
{
	var sseason = document.all.season.options[document.all.season.selectedIndex].value;
	var sdate = obj.options[obj.selectedIndex].value;
	if(sdate)
	{
		location.replace("/game_ticket/s2_record.php?season="+sseason+"&date="+sdate);
	}
}

// °ü¸®ÀÚ ½ÃÁð¼±ÅÃ
function setChange1_wm(obj)
{
	var sseason = obj.options[obj.selectedIndex].value;
	location.replace("/game_ticket/s2_record_wm.php?season="+sseason);
}

// °ü¸®ÀÚ ³¯Â¥¼±ÅÃ
function setChange2_wm(obj)
{
	var sseason = document.all.season.options[document.all.season.selectedIndex].value;
	var sdate = obj.options[obj.selectedIndex].value;
	if(sdate)
	{
		location.replace("/game_ticket/s2_record_wm.php?season="+sseason+"&date="+sdate);
	}
}


//»õÃ¢¶ç¿ì±â

	function Open_Win(files,name,Width,Height,Scroll) 
	{ 
	  var win_width = (screen.availwidth)/2 - Math.ceil(Width/2); 
	  var win_height = (screen.availheight)/2 - Math.ceil(Height/2); 
	  window.open(files,name,'menubar=0, status=0 locationbar=0,scrollbars='+Scroll+',resizable=0,left='+win_width+',top='+win_height+',width='+Width+',height='+Height); 
	}

//-->