// JavaScript Document
// itmedia Javascript ÅëÇÕº»
// ÀÛ¼º : ¹ÚÃ¢¹Î
// »ç¿ë±Ç : ÀÌ ÇÁ·Î±×·¥ÀÇ »ç¿ë±ÇÀº ÀÌºñÄ¿¹Â´ÏÄÉÀÌ¼Ç(ÁÖ)¿¡ ÀÖ½À´Ï´Ù.

/////////////////±¤°í °ü·Ã
function adlines()
{
	this.el = new Array;
	this.ad_cnt = 0;
	this.top_pos = 0;
	this.cur_adline = 0;
	this.name = "";
	
	this.set_name = function(fn_name)
	{
		this.name = fn_name;
	}
	
	this.set_adline = function(el_name)
	{
		this.el[this.ad_cnt] = document.getElementById(el_name);
		this.ad_cnt++;
	}
	
	this.move_str = function()
	{
		var interval = 100;
		if(this.cur_adline >= this.ad_cnt)
			this.cur_adline = 0;
		
		if(this.top_pos < -16)
		{
			this.top_pos = 0;
			this.el[this.cur_adline].style.top = this.top_pos;
			this.cur_adline++;
			if(this.cur_adline >= this.ad_cnt)
				interval = 2000;
		}
		else
		{
			this.top_pos -= 2;
			this.el[this.cur_adline].style.top = this.top_pos;
		}

		window.setTimeout(this.name+".move_str()",interval);
	}
}

function writeFlashPlayer(url,width,height,param)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" align="middle">');
	document.write('<param name="movie" value="'+url+'">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="FlashVars" value="'+param+'">');
	document.write('<embed src="'+url+'" quality="high" width="'+width+'" height="'+height+'" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

function setCookie(name, value, expires)
{
	document.cookie = name+"="+escape(value)+"; path=/"+((expires == null)?"":";expires="+expires.toGMTString());
}

function close_banner(id_name, type)
{
	var el = document.getElementById(id_name);

	if(type == "today")
	{
		var exp = new Date();
		exp.setTime(exp.getTime() + (1000*60*60*24));
		setCookie("popup_cookie","no",exp);
		el.style.visibility = "hidden";
	}
	else
	{
		el.style.visibility = "hidden";
	}
}

function show_banner(id_name)
{
	if(id_name == "sub_menu1" || id_name == "sub_menu1_1") {
		document.getElementById('sub_menu4').style.visibility = "hidden";
		document.getElementById('sub_menu4_1').style.visibility = "hidden";
	} else if(id_name == "sub_menu4" || id_name == "sub_menu4_1") {
		document.getElementById('sub_menu1').style.visibility = "hidden";
		document.getElementById('sub_menu1_1').style.visibility = "hidden";
	}
	var el = document.getElementById(id_name);
	el.style.visibility = "visible";
}
//////////////////////////////////////////////////////////////

//////////////////////°Ô½ÃÆÇ °ü·Ã
function check_qna(form_name)
{
	var formname = "document."+form_name;
	var tform = eval(formname);
	if(tform.title.value == "")
	{
		alert("Á¦¸ñÀ» ¾²¼Å¾ß ÇÕ´Ï´Ù.");
		tform.title.focus();
		return false;
	}
	
	if(tform.qna.value == "")
	{
		alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä");
		return false;
	}
	
	return true;
}

function check_free(form_name)
{
	var formname = "document."+form_name;
	var tform = eval(formname);

	var editor_data = CKEDITOR.instances.editor_v2.getData();

	if(tform.title.value == "")
	{
		alert("Á¦¸ñÀ» ¾²¼Å¾ß ÇÕ´Ï´Ù.");
		tform.title.focus();
		return false;
	}
	
	if(editor_data <= 0)
	{
		alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä");
		return false;
	}
	
	return true;
}

function login_please()
{
	if(confirm("·Î±×ÀÎ ÈÄ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù. \r\n\r\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?"))
	{
		var s = location.href;
		var url = "/member/member_login.php?refer="+s;
		window.location = url;
	}
}

function confirm_delete_qna(num, qna_num)
{
	if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
	{
		var url = "delete_qna.php?num="+num+"&qna_num="+qna_num;
		window.location = url;
	}
}

function confirm_delete_freeboard(num, qna_num)
{
	if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
	{
		var url = "delete_freeboard.php?num="+num+"&qna_num="+qna_num;
		window.location = url;
	}
}

function confirm_delete_pblog(num, qna_num)
{
	if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
	{
		var url = "delete_pblog.php?num="+num+"&qna_num="+qna_num;
		window.location = url;
	}
}

function confirm_delete_oawboard(num, qna_num)
{
	if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
	{
		var url = "board_del.php?num="+num+"&qna_num="+qna_num;
		window.location = url;
	}
}

function confirm_delete_isboard(num, qna_num)
{
	if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?c"))
	{
		var url = "/isboard/delete_isboard.php?num="+num+"&qna_num="+qna_num;
		window.location = url;
	}
}

function delete_tail_qna(tail_num, curpage, listapage)
{
	var url = "/qna/del_tail_confirm.php?tail_num="+tail_num+"&curpage="+curpage+"&listapage="+listapage;
	var win = window.open(url,"del_tail","width=196,height=100");
	win.focus();
}

function delete_tail_gamemeca(tail_num, curpage, listapage)
{
	var url = "/gamemeca/del_tail_confirm.php?tail_num="+tail_num+"&curpage="+curpage+"&listapage="+listapage;
	var win = window.open(url,"del_tail","width=196,height=100");
	win.focus();
}

function delete_tail_freeboard(tail_num, curpage, listapage)
{
	var url = "/freeboard/del_tail_confirm.php?tail_num="+tail_num+"&curpage="+curpage+"&listapage="+listapage;
	var win = window.open(url,"del_tail","width=196,height=100");
	win.focus();
}

function delete_tail_pblog(tail_num, curpage, listapage)
{
	var url = "/it/del_pblog_tail_confirm.php?tail_num="+tail_num+"&curpage="+curpage+"&listapage="+listapage;
	var win = window.open(url,"del_tail","width=196,height=100");
	win.focus();
}

function delete_tail_oawboard(tail_num)
{
	var url = "/oaw/board_tail_confirm.php?tail_num="+tail_num;
	var win = window.open(url,"del_oaw","width=166,height=100");
	win.focus();
}

function delete_gallery(num, curpage)
{
	var url = "/nolruwa/del_gallery_confirm.php?num="+num+"&curpage="+curpage;
	var win = window.open(url,"del_gallery","width=196,height=100");
	win.focus();
}

function delete_tail_gallery(tail_num, curpage, listapage)
{
	var url = "/nolruwa/del_gallery_tail_confirm.php?tail_num="+tail_num+"&curpage="+curpage+"&listapage="+listapage;
	var win = window.open(url,"del_gallery_tail","width=196,height=100");
	win.focus();
}

function delete_tail_rank(tail_num, curpage, listapage)
{
	var url = "/nolruwa/del_rank_tail_confirm.php?tail_num="+tail_num+"&curpage="+curpage+"&listapage="+listapage;
	var win = window.open(url,"del_rank_tail","width=196,height=100");
	win.focus();
}

function delete_tail_isboard(tail_num, curpage, listapage)
{
	var url = "/isboard/del_tail_confirm.php?tail_num="+tail_num+"&curpage="+curpage+"&listapage="+listapage;
	var win = window.open(url,"del_tail","width=196,height=100");
	win.focus();
}

function delete_tail_event(tail_num, curpage, listapage)
{
	var url = "/event/del_tail_confirm.php?tail_num="+tail_num+"&curpage="+curpage+"&listapaginpae="+listapage;
	var win = window.open(url,"del_tail","width=196,height=100");
	win.focus();
}

function find_equip() {
	var url = "/sm/find_equip.php";
	var win = window.open(url,"del_tail","width=600,height=585");
	win.focus();
}

function open_win(url, name, opt)
{
	nw = window.open(url, name, opt);
	nw.focus();
}
//////////////////////////////////////////////////////////

////////////////////////// ÄÁÅÙÃ÷
function BigImageOpen(width,height,img,explan)
{
	var opensize;
	var open_width,open_height,scroll;
	open_width=width;
	open_height=height;
	scroll="";

	if (width>1024) { open_width=1024; scroll=",scrollbars=1"; }
	if (height>750) { open_height=750; scroll=",scrollbars=1"; }

	if (explan=="") opensize="width="+open_width+",height="+open_height+",top="+(screen.height-open_height)/2+",left="+(screen.width-open_width)/2+scroll;
	else opensize="width="+open_width+",height="+(parseInt(open_height)+25)+",top="+(screen.height-parseInt(open_height)-80)/2+",left="+(screen.width-open_width)/2+scroll;
	
	window.open("/include/show_img_pop.php?img="+img+"&width="+width+"&height="+height+"&explan="+explan,'bigimage',opensize);
}

function show_big_img(img_num)
{
	var url = "/content_img/show_big_img.php?num="+img_num;
	var win = window.open(url,"bigImg","width=300,height=300,scrollbars=yes");
	win.focus();
}

function content_view()
{
	this.tab_el = new Array;
	this.tab_cnt = 0;
	
	this.view_page2 = function(body_type, content_num, curpage, totpage, gotop)
	{
		//alert(body_type+":"+curpage+":"+content_num);
		if(body_type == "image2")
		{
			var param = "content_num="+content_num
			var el = document.getElementById("content_viewer");
			set_page_design(el, "image_viewer", param);
		}
		else
		{
			var param = "body_type="+body_type+"&curpage="+curpage+"&content_num="+content_num+"&totpage="+totpage;
			page_design_print("content_viewer", param);
		}
		//param = "content_num="+content_num+"&curpage=1&listapage=10";
		//page_design_print("content_tail_list",param);
		//ÅÇ ÀÌ¹ÌÁö º¯°æ
		var src_on_off = "";
		var tab_name = "tab_"+body_type;
		var curtab_el = null;
		for(var i=0;i<this.tab_cnt;i++)
		{
			if(tab_name == this.tab_el[i])
				src_on_off = this.tab_el[i]+"_on";
			else
				src_on_off = this.tab_el[i]+"_off";
			curtab_el = document.getElementById(this.tab_el[i]);
			if(curtab_el)
			{
				curtab_el.src = "/img/it/"+src_on_off+".jpg";
				//alert("/img/it/"+src_on_off+".jpg");
			}
		}
		//alert(param);
		if(gotop == "y")
			document.location = "#";
	}
	
	this.add_tab = function(el_name)
	{
		this.tab_el[this.tab_cnt] = el_name;
		this.tab_cnt++;
	}
}

function change_img_630(fpath, furl, fname, w, h)
{
	var el = document.getElementById("img_630");
	var url = "/content_img/view_img_540.php?fpath="+fpath+"&furl="+furl+"&fname="+fname+"&w="+w+"&h="+h;
	el.src = url;
}

function change_page_select(body_type, content_num, totpage, content_view_name)
{
	var curpage = document.change_page.page_num.value;
	//alert(curpage);
	eval(content_view_name).view_page2(body_type, content_num, curpage, totpage);
}

function change_page_img(content_num, curpage)
{
	var param = "content_num="+content_num+"&curpage="+curpage;
	var el = document.getElementById("content_viewer");
	set_page_design(el, "image_viewer", param);
}

function delete_tail(tail_num, curpage, listapage)
{
	var url = "/it/del_tail_confirm.php?tail_num="+tail_num+"&curpage="+curpage+"&listapage="+listapage;
	//showModalDialog(url,"del_tail","dialogHeight:200px; dialogWidth:200px; resizable:no; help:no; status:no; scroll:no;");
	var win = window.open(url,"del_tail","width=196,height=100");
	//var win = showModalDialog(url, "delete", "dialogHeight:86px;dialogWidth:196px;resizable: no; help: no; status: no; scroll: no;");
	win.focus();
}

function delete_user_tail(tail_num, curpage, listapage)
{
	var url = "/it/del_ureview_tail_confirm.php?tail_num="+tail_num+"&curpage="+curpage+"&listapage="+listapage;
	//showModalDialog(url,"del_tail","dialogHeight:200px; dialogWidth:200px; resizable:no; help:no; status:no; scroll:no;");
	var win = window.open(url,"del_tail","width=196, height=100");
	win.focus();
}

function delete_wiki_tail(tail_num, curpage, listapage)
{
	var url = "/wiki/del_wiki_tail_confirm.php?tail_num="+tail_num+"&curpage="+curpage+"&listapage="+listapage;
	var win = window.open(url,"del_tail","width=196, height=100");
	win.focus();
}

function delete_tip_tail(tail_num, content_num)
{
	if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
	{
		var url = "del_tail.php?tail_num="+tail_num+"&content_num="+content_num;
		window.location = url;
	}
}

function change_point(ptype, point)
{
	var el = null;
	var el_name = "";
	var el_src = "";
	for(var i=1;i<=10;i++)
	{
		el_name = "point_bar_"+ptype+"_"+i;
		el = document.getElementById(el_name);
		if(i<=point)
			el_src = "/img/tail/point_bar_"+i+".gif";
		else
			el_src = "/img/tail/point_bar_gray.gif";
		//alert(el_name+"="+el_class);
		el.src = el_src;
	}
	eval("document.point_form.point_"+ptype).value = point;
	
	var tot_point = Number(document.point_form.point_f.value) + Number(document.point_form.point_d.value) + Number(document.point_form.point_p.value);
	var avg_point = Math.round((tot_point / 3) * 10);
	//alert(avg_point);
	var avg_str = String(avg_point);
	//alert(avg_str.substr(0,1)+"."+avg_str.substr(1,1));
	document.getElementById("no_first").src = "/img/it/no_"+avg_str.substr(0,1)+".gif";
	document.getElementById("no_second").src = "/img/it/no_"+avg_str.substr(1,1)+".gif";
	if(avg_point == 100)
		document.getElementById("no_dot").src = "/img/it/no_dot_empty.gif";
	else
		document.getElementById("no_dot").src = "/img/it/no_dot.gif";
}

function print_page(content_num)
{
	var url = "/include/print_page.php?content_num="+content_num;
	var win = window.open(url,"print","width=670,height=700,scrollbars=yes");
	win.focus();
}

function rolling_view()
{
	this.item_cnt = 0;
	this.item_height = 74;
	this.item_el = new Array();
	this.item_top = new Array();
	this.name = "";
	
	this.set_fn_name = function(fn_name)
	{
		this.name = fn_name;
	}
	
	this.add_item = function(el_name)
	{
		this.item_el[this.item_cnt] = document.getElementById(el_name);
		this.item_cnt++;
	}
	
	this.show_item = function()
	{
		for(var i=0;i<this.item_cnt;i++)
		{
			this.item_top[i] = i * this.item_height;
			this.item_el[i].style.top = this.item_top[i];
		}
		window.setTimeout(this.name+'.move_item()',3000);
	}
	
	this.move_item = function()
	{
		var new_reset = 0;
		for(var i=0;i<this.item_cnt;i++)
		{
			this.item_top[i] -= 1;
			if(this.item_top[i] <= (0 - this.item_height))
			{
				this.item_top[i] = this.item_height * (this.item_cnt - 1);
				new_reset = 1;
				//alert(this.item_left[i]);
			}
			this.item_el[i].style.top = this.item_top[i];
		}
		if(new_reset == 1)
			window.setTimeout(this.name+'.move_item()',3000);
		else
			window.setTimeout(this.name+'.move_item()',20);
	}
}
//////////////////////////////////////////////////////////////////////

////////////À¯Àú ¸®ºä//////////////////
function open_img_pop()
{
	var url = "/file_uploader/upload_form_ureview.php";
	var win = window.open(url,"ureview","width=500,height=150");
}

function open_img_pop2(a)
{
	var url = "/file_uploader/upload_form_ureview.php?review_num="+a;
	var win = window.open(url,"ureview","width=500,height=150");
}

////////////À¯Àú ¸®ºä//////////////////
function open_img_pop_wiki()
{
	var url = "/file_uploader/upload_form_wiki.php";
	var win = window.open(url,"ureview","width=500,height=150");
}

function check_ureview(fname)
{
	var tform = eval("document."+fname);
	if(tform.title.value == "")
	{
		alert("Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä");
		return false;
	}
	if(tform.thumbnail_name.value == "")
	{
		alert("ÀÌ¹ÌÁö¸¦ ¿Ã·ÁÁÖ¼Å¾ß ÇÕ´Ï´Ù.");
		return false;
	}
	if(tform.brief.value == "")
	{
		alert("¿ä¾à Á¤º¸¸¦ ¿Ã·ÁÁÖ¼¼¿ä");
		return false;
	}
	if(tform.ureview.value == "")
	{
		alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
		return false;
	}
	return true;
}

function check_tip(fname)
{
	var formname = "document."+form_name;
	var tform = eval("document."+fname);
	if(tform.title.value == "")
	{
		alert("Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä");
		return false;
	}
	if(editor_data <= 0)
	{
		alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä");
		return false;
	}
	return true;
}

function confirm_delete_ureview(num)
{
	if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
	{
		var url = "del_ureview.php?num="+num;
		window.location = url;
	}
}
///////////////////////////////////////

//////////////////////// ¿ÞÂÊ ¹Ù/
function hot_new_on(ontype, menu_history)
{
	if(ontype == "hot")
	{
		document.left_hot_tab.src = "/img/main/main5_hoton.gif";
		document.left_new_tab.src = "/img/main/main5_newoff.gif";
		page_design_print("hot_new_list", "ontype=hot&menuhistory="+menu_history);
	}
	else if(ontype == "new")
	{
		document.left_hot_tab.src = "/img/main/main5_hotoff.gif";
		document.left_new_tab.src = "/img/main/main5_newon.gif";
		page_design_print("hot_new_list", "ontype=new&menuhistory="+menu_history);
	}
}

function login_chk()
{
	var f = document.loginf;
	if(f.uid.value == "")
	{
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		return false;
	}
	if(f.passwd.value == "")
	{
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		return false;
	}
	
	return true;
}

function tv_login_process()
{
     document.tvform.submit();       
}

function goSearchID()
{
	//window.open("https://secure.pcbee.co.kr/member/search_id.html","searchid","width=403,height=250");
	var url = "/member/find_id_form.php";
	var win = window.open(url,"id_find","width=300,height=206");
	win.focus();
}
/////////////////////////////////////////////////////////////

///////////////////////////// ¸ÞÀÎ ÆäÀÌÁö/////////
var main_news_flag = "y";
var main_news_id = 1;
function main_news_scroll()
{
	if(main_news_flag == "y")
	{
		if(main_news_id == 1)
		{
			var el1 = document.getElementById("pcbee_news_1");
			var el2 = document.getElementById("pcbee_news_2");
			main_news_id = 2;
		}
		else
		{
			var el1 = document.getElementById("pcbee_news_2");
			var el2 = document.getElementById("pcbee_news_1");
			main_news_id = 1;
		}
		el1.style.display = "block";
		el2.style.display = "none";
	}
}

function main_news_scroll_seed()
{
	window.setInterval("main_news_scroll()",5000);
}

function start_news_scroll()
{
	main_news_flag = "y";
}

function stop_news_scroll()
{
	main_news_flag = "n";
}

function main_rt_view()
{
	this.item_cnt = 0;
	this.item_height = 74;
	this.item_el = new Array();
	this.item_top = new Array();
	this.name = "";
	
	this.set_fn_name = function(fn_name)
	{
		this.name = fn_name;
	}
	
	this.add_item = function(el_name)
	{
		this.item_el[this.item_cnt] = document.getElementById(el_name);
		this.item_cnt++;
	}
	
	this.show_item = function()
	{
		for(var i=0;i<this.item_cnt;i++)
		{
			this.item_top[i] = i * this.item_height;
			this.item_el[i].style.top = this.item_top[i];
		}
		window.setTimeout(this.name+'.move_item()',3000);
	}
	
	this.move_item = function()
	{
		var new_reset = 0;
		for(var i=0;i<this.item_cnt;i++)
		{
			this.item_top[i] -= 1;
			if(this.item_top[i] <= (0 - this.item_height))
			{
				this.item_top[i] = this.item_height * (this.item_cnt - 1);
				new_reset = 1;
				//alert(this.item_left[i]);
			}
			this.item_el[i].style.top = this.item_top[i];
		}
		if(new_reset == 1)
			window.setTimeout(this.name+'.move_item()',3000);
		else
			window.setTimeout(this.name+'.move_item()',20);
	}
}
///////////////////////////////////////////////////////////

///////////////ÀÌº¥Æ®////////////////
function send_event_mail(event_num)
{
	var url = "/event/send_email.php?event_num="+event_num;
	var win = window.open(url,"event_email","width=450,height=330");
	win.focus();
}
/////////////////////////////////////

////////////ÂÊÁö/////////////////
function paper_read(num, stype)
{
	var url = "/paper/pop_read.php?num="+num+"&stype="+stype;
	var win = window.open(url,"paper_read","width=408,height=385,scrollbars=no");
	win.focus();
}

function paper_close()
{
	var el = document.getElementById("paper_list");
	el.style.visibility = "hidden";
}
//////////////////////////////////

///////////////ºÏ¸¶Å©//////////////
function show_bookmark()
{
	var el = document.getElementById("bookmark_div");
	el.innerHTML = "<table cellspacing='6' cellpadding='0' bgcolor='#DDDDDD'><tr><td><table cellspacing='4' cellpadding='0' bgcolor='#985964'><tr><td bgcolor='#FFFFFF'><div><img src='/img/bookmark/title_top.jpg' width='547' height='57'><a href=\"javascript:hide_bookmark();\"><img src='/img/bookmark/close_top.jpg' width='33' height='57' border='0'></a></div><iframe width='580' height='450' src='/bookmark/' frameborder='0' scrolling='yes'></iframe></td></tr></table></td></tr></table>";
}

function hide_bookmark()
{
	var el = document.getElementById("bookmark_div");
	el.innerHTML = "";
}
////////////////////////////////////

//--------------- add by ghpark 08-05-22 -------------------

function get_popup_window() {
	NewWindow=window.open("/award/award_poll_200801.php","Award_Poll",'width=610,height=650,toobar=no,scrollbars=yes,menubar=no,status=no,directories=no');
}

function delete_tail_award(tail_num, curpage, listapage)
{
	var url = "/award/del_tail_confirm.php?tail_num="+tail_num+"&curpage="+curpage+"&listapage="+listapage;
	var win = window.open(url,"del_tail","width=196,height=100");
	win.focus();
}

function get_udea_event_popup() {
	NewWindow=window.open("/event/udea_eventPage.php","udea300w",'width=603,height=648,toobar=no,scrollbars=no,menubar=no,status=no,directories=no');
}

// Å¬¸¯ Å×µÎ¸® ¾ø¾Ö±â
function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG"||event.srcElement.tagName=="AREA") document.body.focus();
}
document.onfocusin=bluring;

/*
function get_popup_window(popurl, popname, w, h, sc)
{
	if(sc == 'y') {
		alert(w+h);
		window.open(popurl,popname,"width="+w,"height="+h,"toobar=no,scrollbars=yes,menubar=no,status=no,directories=no");
		NewWindow=window.open(popurl,popname,'width=600,height=600,toobar=no,scrollbars=auto,menubar=no,status=no ,directories=no,');
	} else {
		alert('aaaaa');
		var popup_win = window.open(popurl,popname,"width="+w,"height="+h);
	}
}
*/


// ¸®½ºÆ® ÀüÃ¼ ¼±ÅÃ, ÇØÁ¦ ½ºÅ©¸³Æ® add by ghpark
function check_set(n) {
    temp = document.Flist.elements.length  ;
    for (i=0; i < temp; i++) {   
        document.Flist.elements[i].checked=n;
    }

	document.getElementById('chk_view01').style.display = "none";
	document.getElementById('chk_view02').style.display = "inline";
} 

function check_Invers(){
    temp = document.Flist.elements.length ;
    for (i=0; i < temp; i++){
        if(document.Flist.elements[i].checked == 1){document.Flist.elements[i].checked = 0;}
            else {document.Flist.elements[i].checked = 1}
    }
	
	document.getElementById('chk_view01').style.display = "inline";
	document.getElementById('chk_view02').style.display = "none";
}


function goRankVote(rnum,inum) {
	document.rank_talk.mode.value = "vote";
	document.rank_talk.tnum.value = inum;
	document.rank_talk.submit();
}


// ·©Å©³îÀÌ »èÁ¦ È®ÀÎ ÇÔ¼ö
function goDel()
{
	if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
	{
		document.delform.submit();
	}
}

/*
// ÆË¾÷ À©µµ¿ì ½ºÅ©¸³Æ®
function notice_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 "";
}
if ( notice_getCookie( "pcbee_Notice" ) != "done" )
{
        window.open('/popup/popup_oaw_20090808.html','','width=400,height=670,top=0, left=0'); // ÆË¾÷À©µµ¿ìÀÇ °æ·Î¿Í Å©±â¸¦ ¼³Á¤ ÇÏ¼¼¿ä
}
*/

function check_mainzine()
{
	var mailform = document.mailForm;
	if(mailform.email.value == "")
	{
		alert("ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		mailform.email.focus();
		return false;
	}
	
	if(mailform.user_name.value == "")
	{
		alert("ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä");
		mailform.user_name.focus();
		return false;
	}

	if(mailform.sindong.checked != true)
	{
		alert('Á¤º¸ ¼öÁý¿¡ µ¿ÀÇ ÇÏ¼Å¾ß ÇÕ´Ï´Ù.');
		return false;
	}
	
	return true;
}


function rolling_view2()
{
	this.item_cnt = 0;
	this.item_height = 190;
	this.item_el = new Array();
	this.item_top = new Array();
	this.name = "";
	
	this.set_fn_name = function(fn_name)
	{
		this.name = fn_name;
	}
	
	this.add_item = function(el_name)
	{
		this.item_el[this.item_cnt] = document.getElementById(el_name);
		this.item_cnt++;
	}
	
	this.show_item = function()
	{
		for(var i=0;i<this.item_cnt;i++)
		{
			this.item_top[i] = i * this.item_height;
			this.item_el[i].style.top = this.item_top[i];
		}
		window.setTimeout(this.name+'.move_item()',3000);
	}
	
	this.move_item = function()
	{
		var new_reset = 0;
		for(var i=0;i<this.item_cnt;i++)
		{
			this.item_top[i] -= 1;
			//alert(this.item_top[i]);
			if(this.item_top[i] <= (0 - this.item_height))
			{
				this.item_top[i] = this.item_height * (this.item_cnt - 1);
				new_reset = 1;
			}
			this.item_el[i].style.top = this.item_top[i];

		}

		if(new_reset == 1)
			window.setTimeout(this.name+'.move_item()',3000);
		else
			window.setTimeout(this.name+'.move_item()',20);
	}
}

function rolling_view3()
{
	this.item_cnt = 0;
	this.item_height = 115;
	this.item_el = new Array();
	this.item_top = new Array();
	this.name = "";
	
	this.set_fn_name = function(fn_name)
	{
		this.name = fn_name;
	}
	
	this.add_item = function(el_name)
	{
		this.item_el[this.item_cnt] = document.getElementById(el_name);
		this.item_cnt++;
	}
	
	this.show_item = function()
	{
		for(var i=0;i<this.item_cnt;i++)
		{
			this.item_top[i] = i * this.item_height;
			this.item_el[i].style.top = this.item_top[i];
		}
		window.setTimeout(this.name+'.move_item()',3000);
	}
	
	this.move_item = function()
	{
		var new_reset = 0;
		for(var i=0;i<this.item_cnt;i++)
		{
			this.item_top[i] -= 1;
			//alert(this.item_top[i]);
			if(this.item_top[i] <= (0 - this.item_height))
			{
				this.item_top[i] = this.item_height * (this.item_cnt - 1);
				new_reset = 1;
			}
			this.item_el[i].style.top = this.item_top[i];

		}

		if(new_reset == 1)
			window.setTimeout(this.name+'.move_item()',3000);
		else
			window.setTimeout(this.name+'.move_item()',20);
	}
}


/* pcbee home, webtv º¯°æ
 * 2010-06-23 
 */

/* ÇÏÀ§ menu */
function init_submenu()
{
	document.getElementById('it').style.display = 'none';
	document.getElementById('review').style.display = 'none';
	document.getElementById('community').style.display = 'none';
	document.getElementById('webtv').style.display = 'none';
}

function show_submenu(current_submenu)
{	
	init_submenu();
	document.getElementById(current_submenu).style.display = 'block';
}
/* end of ÇÏÀ§ menu */

/* item ÀÌÀü, ´ÙÀ½ */
function pre_item(name, result_cnt)
{
	var first_item = document.getElementById(name+'1');
								
	if (first_item.style.display === 'block')
	{
		//alert('Ã³À½');
		return;
	}
	
	for (var i = 1; i <= result_cnt; i++)
	{
		var current_item = document.getElementById(name+i);
		
		if (current_item.style.display === 'block')
		{
			current_item.style.display = 'none';
			document.getElementById(name+(i - 1)).style.display = 'block';
		
			return;	
		}					
	}
}

function next_item(name, result_cnt)
{
	var last_item = document.getElementById(name+result_cnt);
								
	if (last_item.style.display === 'block')
	{
		//alert('¸¶Áö¸·');
		return;
	}
	
	for (var i = 1; i <= result_cnt; i++)
	{
		var current_item = document.getElementById(name+i);
		
		if (current_item.style.display === 'block')
		{
			current_item.style.display = 'none';
			document.getElementById(name+(i + 1)).style.display = 'block';	
		
			return;	
		}			
	}
}	
/* end of item ÀÌÀü, ´ÙÀ½ */

/* hot trend ÀÌÀü, ´ÙÀ½ */			
function pre_hot_trend(result_cnt)
{
	var first_hot_trend = document.getElementById('hot_trend_1');
								
	if (first_hot_trend.style.display === 'block')
	{
		//alert('Ã³À½');
		return;
	}
	
	var chk = 0;
	
	for (var i = result_cnt; i >= 1; i--)
	{
		if (document.getElementById('hot_trend_'+i).style.display === 'block')
		{
			chk++;
		}
		
		if (chk === 3)
		{
			document.getElementById('hot_trend_'+(i + 2)).style.display = 'none';
			document.getElementById('hot_trend_'+(i - 1)).style.display = 'block';	
			
			return;				
		}
	}				
}

function next_hot_trend(result_cnt)
{
	var last_hot_trend = document.getElementById('hot_trend_'+result_cnt);
								
	if (last_hot_trend.style.display === 'block')
	{
		//alert('¸¶Áö¸·');
		return;
	}
	
	var chk = 0;
	
	for (var i = 1; i <= result_cnt; i++)
	{
		if (document.getElementById('hot_trend_'+i).style.display === 'block')
		{
			chk++;
		}
		
		if (chk === 3)
		{
			document.getElementById('hot_trend_'+(i - 2)).style.display = 'none';
			document.getElementById('hot_trend_'+(i + 1)).style.display = 'block';	
			
			return;								
		}
	}
}
/* end of hot trend ÀÌÀü, ´ÙÀ½ */	
			
/* sponsor rollover */					  	
function init_sponsor()
{
	for (i = 1; i <= 5; i++)
	{
		document.getElementById('sponsor_'+i).style.display = 'block';
		document.getElementById('sponsor_img_'+i).style.display = 'none';
	}
}

function show_sponsor_image(ad_num)
{
	init_sponsor();
	
	document.getElementById('sponsor_'+ad_num).style.display = 'none';
	document.getElementById('sponsor_img_'+ad_num).style.display = 'block';
}	

function hidden_sponsor_image()
{
	init_sponsor();
}	
/* end of sponsor rollover */	
								
/* choice rollover */
function init_choice_img()
{
	for (var i = 1; i <= 3; i++)
	{
		document.getElementById('choice_img_'+i).style.display = 'none';	
	}
}

function chg_choice_img(num)
{
	init_choice_img();
	
	document.getElementById('choice_img_'+num).style.display = 'block';
}		
/* end of choice rollover */

// »ó¼¼Á¤º¸ ¿­°í, ´Ý±â			
function show_detail()
{
	var detail		= document.getElementById('detail');
	var detail_open	= document.getElementById('detail_open');
	
	if (detail.style.display === 'none')
	{
		detail.style.display  = 'block';
		detail_open.innerHTML = '[´Ý±â]';
	}
	else
	{
		detail.style.display  = 'none';
		detail_open.innerHTML = '[¿­±â]';
	}
}
		
/* ´ñ±Û °ü·Ã */		
function calcTextLen(form, item)
{						
	var count = 0;
		
	for (i = 0; i < form.value.length; i++)
	{
		char = form.value.charAt(i);

		if (escape(char).length > 4)
		{
			count += 2;
		}
		else if (char != '\r')
		{
			count++;
		}
	}
	
	item.value = parseInt(count / 2);				
}     
	
function talkDelete(num) 
{
	if (confirm("»èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?")) 
	{
		document.talk.mode.value = "delete";
		document.talk.tnum.value = num;
		document.talk.submit();
	}
}

function talkInsert(form) 
{
	if (form.talk.value == "") 
	{
		alert("´ñ±ÛÀÇ ³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		form.talk.focus();
		
		return false;
	}

	if (form.tsize.value > 300) 
	{
		alert("´ñ±ÛÀÇ ³»¿ëÀ» 300(ÇÑ±Û)ÀÚ ÀÌÇÏ·Î ½áÁÖ¼¼¿ä.");
		form.talk.focus();
		
		return false;
	}

	return true;
}
/* end of ´ñ±Û °ü·Ã */	

// inicis
function view_escrow()
{
	window.open('http://www.hanaescrow.com/hnbecc/serviceJoinSrchManagement/escser003l.jsp?shopBsnNo=2208197656&mid=ESelimpcbe', '', 'left=100, top=100, height=560, width=612');
}

/* end of pcbee home, webtv µðÀÚÀÎº¯°æ
 * 2010-06-23 
*/

/***********  ¸®´º¾ó Ãß°¡ ***************/

function bt(id,after) {
  eval(id+'.filters.blendTrans.stop();'); 
  eval(id+'.filters.blendTrans.Apply();'); 
  eval(id+'.src="'+after+'";'); 
  eval(id+'.filters.blendTrans.Play();'); 
}

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(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 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 image_auto_resize(this_s,width,height){ 
 var ta_image = new Image(); 
 ta_image.src = this_s.src; 
  if(!width){this_s.removeAttribute('width'); 
  this_s.style.width='auto';} 
  else if(width < ta_image.width){ 
  this_s.width = width; 
  }else{ 
  this_s.width = ta_image.width; 
  } 
  if(!height){this_s.removeAttribute('height'); 
  this_s.style.height='auto';} 
  else if(height < ta_image.height){ 
  this_s.height = height; 
  }else{ 
  this_s.height = ta_image.height; 
  } 
} 

function image_auto_resize_inarea(this_s,width,height,view){ 
//this_s¾ÈÀÇ ¸ðµç ÀÌ¹ÌÁö´Â ÀÚµ¿ ¸®»çÀÌÁî µÈ´Ù. 
 //alert(this_s.childNodes.length); 

 if(!view){view=true;} 
 if(!this_s){return;} 
 if(this_s.nodeType!=1){return;} 
 for(var i=0,m=this_s.childNodes.length;i<m;i++){ 
  var ta = this_s.childNodes[i]; 
  
  if(ta.nodeName=='IMG'){ 

  image_auto_resize(ta,width,height); 

  if(view){ 
    if(!ta.title){ta.title=ta.src;} 
    if(!ta.onclick){ 
    ta.style.cursor='pointer'; 
    //ta.onclick=function(){js_image_view(this,1);} 
    } 
    if(!ta.onload) 
    ta.onload=function(){image_auto_resize(this,width,height);} 
    if(!ta.onmouseover)  
    ta.onmouseover=function(){image_auto_resize(this,width,height);} 
  } 
  } 
  if(ta.childNodes.length>0){ 
  image_auto_resize_inarea(ta,width,height); 
  } 
 } 
 return; 

} 


// flash(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¹è°æ»ö, À©µµ¿ì¸ðµå, º¯¼ö)
function flash(url,w,h,bg,win,vars){
	var s=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' align='middle'>"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<param name='wmode' value='opaque' />"+
	"<embed src='"+url+"' wmode='"+win+"' menu='false' quality='high' wmode='opaque' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	document.write(s);
}


function close_top_banner() {
	document.getElementById("swf_banner").style.display = "block";
	document.getElementById("img_banner").style.display = "none";
}


