
function hide_image (imageObj) {
   imageObj.src="http://img.etnews.com/Buzz/img/blank.gif";
   imageObj.width=0;
   imageObj.height=0;
}

function go_image ( WI ) 
{

    var temp_image_array = new Array();
    temp_image_array = WI.split("/1_");

/*
	if(temp_image_array[2]) 
	{
	    WI = temp_image_array[0]+"/"+temp_image_array[1]+"/1_"+temp_image_array[2];	
	} 
    else 
	{
	    WI = temp_image_array[0]+"/"+temp_image_array[1];
    }
*/

	if(temp_image_array[1]) 
	{
	    WI = temp_image_array[0]+"/"+temp_image_array[1];	
	} 
    else 
	{
	    WI = temp_image_array[0];
    }

    var WO = "";
    for(i=0;i<WI.length;i++) {
        if ( WI.charAt(i) == unescape('%1b') ) {
            WO = WO+'\%';
        } else {
            WO = WO+WI.charAt(i);
        }
    }


    var IMG = new Image();
    IMG.src = WO;
    var w = IMG.width + 28;
    var h = IMG.height + 9;

    // XPÀÎ °æ¿ì height 29 Ãß°¡
    if( window.navigator.userAgent.indexOf("SV1") != -1 ) {
       h += 29;
    }

    if (h > 600) { h = 600; }
	if (w > 600) { w = 600; }
    //NewWin=window.open('','MWindow','width='+w+',height='+h+',resizable=yes,scrollbars=yes,toolbar=no,menubar=no');
    NewWin=window.open('','MWindow','top=10,width=600,height=600,resizable=yes,scrollbars=yes,toolbar=no,menubar=no');
    NewWin.document.open();
	NewWin.document.write("<html>                                                                                                               ");
	NewWin.document.write("<head>                                                                                                               ");
	NewWin.document.write("<title>ÀÌ¹ÌÁö º¸±â</title>                                                                                   ");
	NewWin.document.write("<script>                                                                                                             ");
	NewWin.document.write("function setSize()                                                                                                   ");
	NewWin.document.write("{                                                                                                                    ");
	NewWin.document.write("	window.resizeTo(document.getElementById('photpimg').width + 40, document.getElementById('photpimg').height + 65);");
	NewWin.document.write("}                                                                                                                    ");
	NewWin.document.write("</script>                                                                                                            ");
	NewWin.document.write("</head>                                                                                                              ");
	NewWin.document.write("<body topmargin=5 leftmargin=5 marginwidth=5 marginheight=5 onLoad='setSize()'>                                      ");
	NewWin.document.write("<a href='JavaScript:onClick=this.close()'><img src='"+WO+"' name='photpimg' id='photpimg' border='0'></a></body>            ");
	NewWin.document.write("</html>                                                                                                              ");

	/*
	NewWin.document.write("<html><head><title>ÀÌ¹ÌÁö º¸±â</title></head>");
    NewWin.document.write("<body marginwidth=0 marginheight=0 topmargin=0 leftmargin=0>");
    NewWin.document.write("<table width=100% ><tr><td align=center valign=middle>");
    NewWin.document.write("<a href='JavaScript:onClick=this.close()'><img name=newspic src=\"" +WO+ "\" border=0></a></td></tr></table>");
    NewWin.document.write("<script language=JavaScript>");
    NewWin.document.write("		var h=document.newspic.height+40;");
    NewWin.document.write("		var w=document.newspic.width+40;");
    NewWin.document.write("		if( window.navigator.userAgent.indexOf('SV1') != -1 ) h += 29; ");
    NewWin.document.write("		if (h > 800) h=800;");
    NewWin.document.write("		if (w > 800) w=800;");
    NewWin.document.write("		window.resizeTo(w,h);");
    NewWin.document.write("</script>");
    NewWin.document.write("</body>");
    NewWin.document.write("</html>");
	*/
    NewWin.document.close();

}


function go_image2 ( WI ) 
{

    var WO = "";
    for(i=0;i<WI.length;i++) {
        if ( WI.charAt(i) == unescape('%1b') ) {
            WO = WO+'\%';
        } else {
            WO = WO+WI.charAt(i);
        }
    }


    var IMG = new Image();
    IMG.src = WO;
    var w = IMG.width + 28;
    var h = IMG.height + 9;

    // XPÀÎ °æ¿ì height 29 Ãß°¡
    if( window.navigator.userAgent.indexOf("SV1") != -1 ) {
       h += 29;
    }

    if (h > 600) { h = 600; }
	if (w > 600) { w = 600; }
    //NewWin=window.open('','MWindow','width='+w+',height='+h+',resizable=yes,scrollbars=yes,toolbar=no,menubar=no');
    NewWin=window.open('','MWindow','top=10,width=600,height=600,resizable=yes,scrollbars=yes,toolbar=no,menubar=no');
    NewWin.document.open();
	NewWin.document.write("<html>                                                                                                               ");
	NewWin.document.write("<head>                                                                                                               ");
	NewWin.document.write("<title>ÀÌ¹ÌÁö º¸±â</title>                                                                                   ");
	NewWin.document.write("<script>                                                                                                             ");
	NewWin.document.write("function setSize()                                                                                                   ");
	NewWin.document.write("{                                                                                                                    ");
	NewWin.document.write("	window.resizeTo(document.getElementById('photpimg').width + 40, document.getElementById('photpimg').height + 65);");
	NewWin.document.write("}                                                                                                                    ");
	NewWin.document.write("</script>                                                                                                            ");
	NewWin.document.write("</head>                                                                                                              ");
	NewWin.document.write("<body topmargin=5 leftmargin=5 marginwidth=5 marginheight=5 onLoad='setSize()'>                                      ");
	NewWin.document.write("<a href='JavaScript:onClick=this.close()'><img src='"+WO+"' name='photpimg' id='photpimg' border='0'></a></body>            ");
	NewWin.document.write("</html>                                                                                                              ");

	/*
	NewWin.document.write("<html><head><title>ÀÌ¹ÌÁö º¸±â</title></head>");
    NewWin.document.write("<body marginwidth=0 marginheight=0 topmargin=0 leftmargin=0>");
    NewWin.document.write("<table width=100% ><tr><td align=center valign=middle>");
    NewWin.document.write("<a href='JavaScript:onClick=this.close()'><img name=newspic src=\"" +WO+ "\" border=0></a></td></tr></table>");
    NewWin.document.write("<script language=JavaScript>");
    NewWin.document.write("		var h=document.newspic.height+40;");
    NewWin.document.write("		var w=document.newspic.width+40;");
    NewWin.document.write("		if( window.navigator.userAgent.indexOf('SV1') != -1 ) h += 29; ");
    NewWin.document.write("		if (h > 800) h=800;");
    NewWin.document.write("		if (w > 800) w=800;");
    NewWin.document.write("		window.resizeTo(w,h);");
    NewWin.document.write("</script>");
    NewWin.document.write("</body>");
    NewWin.document.write("</html>");
	*/
    NewWin.document.close();

}


// °£´ÜÇÑ ¼­Ä¡
function search_left_check() {
    var m=document.buzz_left_search;

    if (m.ps_ques.value.length == "") {
       alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À");
       m.ps_ques.focus();
       return false;
    }
}

function search_top_check() {
    var m=document.buzz_top_search;

    if (m.ps_ques.value.length == "") {
       alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À");
       m.ps_ques.focus();
       return false;
    }
}

// ¸®ÇÃ
function buzz_reply_check() {
var m=document.buzz_reply;

    if (m.nick_name.value.length < 2) {
        alert("ÇÊ¸íÀ» ÀÔ·Â ÇÏ¿© ÁÖ½Ê½Ã¿À");
        m.nick_name.focus();
        return false;
    }

    if (m.user_pwd.value.length < 2) {
        alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·Â ÇÏ¿© ÁÖ½Ê½Ã¿À");
        m.user_pwd.focus();
        return false;
    }

    if (m.reply_body.value.length < 2) {
        alert("³»¿ëÀ» ÀÔ·Â ÇÏ¿© ÁÖ½Ê½Ã¿À");
        m.reply_body.focus();
        return false;
    }

}

// »õÃ¢ ¿­±â ±âº» ½ºÅ©¸³Æ®

function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';

  newWin= window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}


var p_sel_num = 0;
var p_sel_poid = 0;

// ¼³¹®Á¶»ç °ü·Ã !! 
function poll_select_radio(num,poid) {
   p_sel_poid =  poid;
   p_sel_num =  num;
}

function poll_submit_vote(poid,ps_rurl) {
   if (p_sel_num == 0) {
      alert('¼³¹® ´äº¯Áß¿¡¼­ 1°³¸¦ ¼±ÅÃÇÏ½ÅÈÄ [ÅõÇ¥ÇÏ±â] ¹öÆ°À» ´­·¯ÁÖ¼¼¿ä.');
      return;
   }

   if (p_sel_poid != poid) {
      alert('´Ù¸¥ ¼³¹®À» Ã¼Å© ÇÏ¼Ì½À´Ï´Ù.');
      return;
   }

   document.location.href = "./buzz_poll_ok.html?ps_mode=poll_vote&ps_poid="+poid+"&num="+p_sel_num+"&ps_rurl="+ps_rurl;
}

var s_sel_num = 0;
// ¹öÁîÁö¼ö °ü·Ã 
function score_select_radio(num) {
   s_sel_num =  num;
}

function score_submit_vote(ccid,spid,user_id) {
   if (s_sel_num == 0) {
      alert('Á¡¼öÁß ÇÑ°³¸¦ ¼±ÅÃÇÏ½ÅÈÄ [Æò°¡ÇÏ±â] ¹öÆ°À» ´­·¯ÁÖ¼¼¿ä.');
      return;
   }

   if(!user_id) {
      alert('·Î±×ÀÎÈÄ ÀÌ¿ë ÇÏ¿© ÁÖ½Ê½Ã¿À');
      return;
   }

   document.location.href = "../content/buzz_score_ok.html?ps_mode=score_write&ps_ccid="+ccid+"&ps_spid="+spid+"&ps_score="+s_sel_num;
}

function score_submit_vote2(ccid,spid,user_id) {
   if (s_sel_num == 0) {
      alert('Á¡¼öÁß ÇÑ°³¸¦ ¼±ÅÃÇÏ½ÅÈÄ [Æò°¡ÇÏ±â] ¹öÆ°À» ´­·¯ÁÖ¼¼¿ä.');
      return;
   }

   if(!user_id) {
      alert('·Î±×ÀÎÈÄ ÀÌ¿ë ÇÏ¿© ÁÖ½Ê½Ã¿À');
      return;
   }

   document.location.href = "./buzz_score_ok.html?ps_mode=score_write&ps_mode2=popup&ps_ccid="+ccid+"&ps_spid="+spid+"&ps_score="+s_sel_num;
}

// ÀüÃ¼ ºí·¯ !! 
function bluring(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 


function open_reply_print(par) {
   open_window('print', par, 40, 40, 670, 550, 0, 0, 0, 1, 0);
}

function open_reply_mailer(par) {
   open_window('mailer', par, 40, 40, 670, 550, 0, 0, 0, 1, 0);
}

function open_reply_delete(par) {
   open_window('delete', par, 400, 400, 300, 150, 0, 0, 0, 0, 0);
}

function open_vod_service(par) {
   vo = open_window('vod', par, 40, 40, 955, 630, 0, 0, 0, 0, 0);
}

function open_buzz_score(par,user_id) {
   if(!user_id) {
      alert('·Î±×ÀÎÈÄ ÀÌ¿ë ÇÏ¿© ÁÖ½Ê½Ã¿À');
      return;
   }
   open_window('score', par, 40, 40, 500, 300, 0, 0, 0, 0, 0);
}

function open_buzz_score_2006(par,user_id) {
   if(!user_id) {
      alert('·Î±×ÀÎÈÄ ÀÌ¿ë ÇÏ¿© ÁÖ½Ê½Ã¿À');
      return;
   }
   open_window('score', par, 40, 40, 420, 255, 0, 0, 0, 0, 0);
}

// ÀÔ·ÂÃ¢ ´Ã¸®±â
function zoomform(zooms){
    if(navigator.appName == 'Netscape') {
        alert("[ÀÔ·ÂÃ¢ ´Ã¸®±â]´Â\n\nÀÍ½ºÇÃ·¯4.0 ÀÌ»óÀÇ ºê¶ó¿ìÀú¸¦ »ç¿ëÇØ¾ß\n\n»ç¿ë °¡´ÉÇÑ ±â´É¹öÆ°ÀÔ´Ï´Ù.\n\n³×½ºÄÉÀÌÇÁ¿¡¼­´Â ÀÌ¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
        return;
    }

    zooms.rows = zooms.rows+5;

    //if(zooms.rows == 3){zooms.rows =  10;}
    //else if(zooms.rows == 10){zooms.rows =  20;}
    //else if(zooms.rows == 15){zooms.rows =  20;}
    //else if(zooms.rows == 20){zooms.rows =  30;}
    //else if(zooms.rows == 30){zooms.rows =  40;}
    //else {zooms.rows =  3;}
}
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 LoginPop(aa){
	tmp = window.open('http://www.ebuzz.co.kr/member/login_pop.html?dm='+aa,'plogin','width=465, height=225, scrollbars=no, resizable = no, menubar = no, top=300 left=300');
	tmp.focus();
}

//test shyun
function LoginPop2(aa){
	tmp = window.open('http://www.ebuzz.co.kr/member/_sh_login_pop.html?dm='+aa,'plogin','width=450, height=320, scrollbars=no, resizable = no, menubar = no, top=300 left=300');
	tmp.focus();
}
//test end


function copy_clip(s)
{
	var clip = document.body.createTextRange();
	clip.moveToElementText(document.all(s));
	clip.select();
	clip.execCommand('copy');
    alert('Å¬¸³º¸µå¿¡ º¹»çµÇ¾ú½À´Ï´Ù');
}

function open_ad_board(par) {
	tmp = window.open('http://www.ebuzz.co.kr/board/buzz_ad.html?gu='+par,'ad_board','width=630, height=500, scrollbars=no, resizable = no, menubar = no, top=300 left=300');
	tmp.focus();
}

 var rSite = new Array();
rSite['18']='http://blog.etnews.co.kr/rss.php?blogid=$$';
rSite['15']='http://blog.rss.naver.com/$$.xml';
rSite['8']='http://tong.nate.com/mytong/mytong.do?action=rssxml&userID=$$';
rSite['13']='http://blog.daum.net/xml/rss/$$';
rSite['10']='http://www.mediamob.co.kr/$$/RSS.aspx';
rSite['12']='http://joblog.scout.co.kr/$$/rss.asp';
rSite['4']='http://cyrss.cyworld.nate.com/$$';
rSite['3']='http://kr.blog.yahoo.com/$$/rss.xml';
rSite['2']='http://blog.empas.com/$$/rss.xml';
rSite['11']='http://blog.ohmynews.com/$$/rss';
rSite['9']='http://$$.egloos.com/index.xml';
rSite['5']='http://blog.joins.com/$$/index.xml';
rSite['14']='http://$$.tistory.com/rss';
rSite['6']='http://blogrss.paran.com/RssView2.do?pmcid=$$';
rSite['7']='http://blog.hanafos.com/getrss.asp?blogerid=$$';

var fPx = 16;
function fontSize(sn){
	if (sn<0) {
		if (fPx<=10)	 tmp_cnt = 10;
		else tmp_cnt = fPx + sn;
	} else
	{
		if (fPx>=20) tmp_cnt = 20;
		else tmp_cnt = fPx + sn;
	}

	fPx = tmp_cnt;

	buzz_content.style.fontSize= fPx+"px";
}



function logout()
{
   location.href="https://www.ebuzz.co.kr/member/logout.html";
}
function myinfo()
{
   location.href="https://www.ebuzz.co.kr/member/update.html";
}
function sitemap()
{
   location.href="http://www.ebuzz.co.kr/etc/sitemap.html";
}
function login()
{
   location.href="https://www.ebuzz.co.kr/member/login_new.html?bc=mb_000_00002";
}
function join()
{
   location.href="https://www.ebuzz.co.kr/member/register.html?bc=mb_000_00003";
} 
 

/* ajax ±â»ç view count Áõ°¡ */
// ÀÛ¾÷ÇØ¾ßÇÔ.
function increase_viewcount(art_code) {
    $.ajax({
        type: "POST",                           /* 'POST' or 'GET' */
        url: "/user/tools/increase_article_count.php",  /* È£ÃâÇÒ ÆäÀÌÁö URL */
        data: "kind=news&art_code=" + art_code, /* ÀÎÀÚ°ª */
        cache: false,                           /* Ä³½¬Àû¿ëÀ»ÇÏÁö ¾ÊÀ½ (Ç×»ó ÃÖ½ÅÆÄÀÏÀ» Àû¿ë) */
        success: function(html) {
        },
        error: function() {
        }
    });
}





