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 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; }
}

if (document.all)
{
	layerRef='document.all'
	styleRef='.style.'
}
else if (document.layers)
{
	layerRef='document.layers'
	styleRef='.'
}
	
function showLayer(stat,member,lname)
{
	if(stat =="N" && member=="T")
	{
		showDisplay(lname);
	}
}

function hideLayer(lname) 
{ 
		eval(layerRef+'["'+lname+'"]'+styleRef+'display="none"') ; 
		clearForms(lname); 
}
//div º¸¿©ÁÖ±â
function showDisplay(lname)
{
	eval(layerRef+'["'+lname+'"]'+styleRef+'display="block"') ; 
}

//div ¼û±â±â
function hideDisplay(lname)
{
	eval(layerRef+'["'+lname+'"]'+styleRef+'display="none"') ; 
}

function show_hidden(sname, hname)
{
	eval(layerRef+'["'+sname+'"]'+styleRef+'display="block"') ; 
	eval(layerRef+'["'+hname+'"]'+styleRef+'display="none"') ; 
}

function showMenu(arg)
{
	hideDisplay('mainbar_0');
	hideDisplay('mainbar_1');
	hideDisplay('mainbar_2');
	hideDisplay('mainbar_3');
	hideDisplay('mainbar_4');
	hideDisplay('mainbar_5');
	
	if(arg==1) {
		showDisplay('mainbar_1');
	} else if(arg==2) {
		showDisplay('mainbar_2');
	} else if(arg==3) {
		showDisplay('mainbar_3');
	} else if(arg==4) {
		showDisplay('mainbar_4');
	} else if(arg==0) {
		showDisplay('mainbar_0');
	} else if(arg==5) {
		showDisplay('mainbar_5');
	}
}

function showProductMenu(title,img)
{
	if (eval(title+".style.display")=="none") 
	{
		eval(title+".style.display='block'");
		eval("document."+img+".src='/img/left/icon_minus.gif'");
	}
	else 
	{
		eval(title+".style.display='none'");
		eval("document."+img+".src='/img/left/icon_plus.gif'");
	}
}

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

function fnValidate()
{
	if(delSpace(document.login.uid.value)=="")
	{
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä");
		document.login.uid.focus();
		return false;
	}
	
	if(delSpace(document.login.passwd.value)=="")
	{
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä");
		document.login.passwd.focus();
		return false;
	}

	document.login.submit();
}

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++;
		}
	}
	count = parseInt(count/2);
	item.value=count;

}

function openETV(thread,kind) {
	window.open("/etv/view.html?thread="+thread+"&kind="+kind,"etv","width=1000,height=638,top=20,left=20");
}

function webTV(thread,kind) {
	window.open("/webtv/webtv.html?thread="+thread+"&kind="+kind,"WeBTV","width=790,height=542,top=20,left=20");
}

function popLogin(returnurl)
{
	window.open("/common/inc/login_pop.html?returnurl="+returnurl,"ssl_login","width=297,height=282");
}

function popLoginEc(returnurl,jbcode)
{
	window.open("/common/inc/login_pop_ec.html?jbcode="+jbcode+"&returnurl="+returnurl,"ssl_login","width=297,height=282");
}

function delSpace(str) 
{
	var temp = "";
	str = '' + str;
	splitStr = str.split(" ");
	
	for(i = 0; i < splitStr.length; i++)
	{
		temp += splitStr[i];
	}
	return temp;
}

function Size(form) 
{
	var char;
	var count;
	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++;
		}
	}
	
	return count;
}

function BigImageOpen(width,height,img,explan)
{
	var opensize;
	var open_width,open_height,scroll;
	open_width=width;
	open_height=height;
	scroll="";

	if (width>950) { open_width=950; scroll=",scrollbars=1"; }
	if (height>700) { open_height=700; 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("/common/inc/bigimage.html?img="+img+"&width="+width+"&height="+height+"&explan="+explan,'bigimage',opensize);
}

function ContentsEmail(thread,kind)
{
	window.open('/common/inc/email.html?thread='+thread+"&kind="+kind,'email','width=500,height=130,top='+(screen.height-105)/2+',left='+(screen.width-420)/2);
}

function ContentsPrint(thread,kind)
{
	window.open('/common/inc/print.html?thread='+thread+"&kind="+kind,'print','width=630,height=600,scrollbars=1,top='+(screen.height-630)/2+',left='+(screen.width-600)/2);
}

function ContentsScrap(thread,kind) {
	window.open('/common/inc/scrap.html?thread='+thread+"&kind="+kind,'bookmark','width=300,height=140,top='+(screen.height-140)/2+',left='+(screen.width-300)/2);
}

function sendPaper(uid)
{
	//window.open('/mybee/mypaper_write.html?pid='+uid,'send_paper','width=350,height=400,top=100,left='+(screen.width-150)/2);
	var url = "http://www2.pcbee.co.kr/paper/pop_write.php?tid="+uid;
	window.open(url,'paper','width=408,height=385');
}

function openPopup(url, option)
{
	var win = window.open(url,"pop", option);
	win.focus();
}


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 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_20090525.html','','width=400,height=630'); // ÆË¾÷À©µµ¿ìÀÇ °æ·Î¿Í Å©±â¸¦ ¼³Á¤ ÇÏ¼¼¿ä
}
*/