function viewTalk(num, id)
{	
	//alert(location.href);
	//alert(num + "/"+id);
	if(location.href.indexOf("/intermission/notice_081030.aspx") > -1) 
	{
		//¹øÈ£|Å¸ÀÌÆ²|Á¶È¸¼ö|³¯Â¥|³»¿ë
		document.all.lbl_num2.innerText = eval("document.all.lbl_number_"+ num).innerText;
		document.all.lbl_title.innerText = eval("document.all.lbl_t"+ num).innerText;
		document.all.lbl_cnt.innerText   = parseInt(eval("document.all.lbl_cnt_"+ num).innerText) +1;
		document.all.lbl_date.innerText  = eval("document.all.lbl_r"+ num).innerText;
		document.all.lbl_content.innerHTML = eval("document.all.lbl_c"+ num).innerHTML;			

		document.all.lbl_num.innerText   = num;	
		//Ä«¿îÆ®Áõ°¡
		eval("document.all.lbl_cnt_"+ num).innerText = parseInt(eval("document.all.lbl_cnt_"+ num).innerText) +1;
		
		document.all.div_top.style.display = "";
		document.all.txt_num.value = num;
	}
	else 
	{
		//alert(eval("document.all.lbl_c"+ num).innerHTML);
		//¹øÈ£|Å¸ÀÌÆ²|ÀÌ¸§|´Þ±Û¼ö|Á¶È¸¼ö|³¯Â¥|³»¿ë
		document.all.lbl_num2.innerText = eval("document.all.lbl_number_"+ num).innerText;
		document.all.lbl_title.innerText = eval("document.all.lbl_t"+ num).innerText;
		document.all.lbl_name33.innerText = eval("document.all.lbl_n"+ num).innerText;
		document.all.lbl_recnt.innerText = eval("document.all.lbl_recount_"+ num).innerText;
		document.all.lbl_cnt.innerText   = parseInt(eval("document.all.lbl_cnt_"+ num).innerText) +1;
		document.all.lbl_date.innerText  = eval("document.all.lbl_r"+ num).innerText;
		document.all.lbl_content.innerHTML = eval("document.all.lbl_c"+ num).innerHTML;			
		
		document.all.lbl_name.innerText  = id; 
		document.all.lbl_num.innerText   = num;	
		
		//Ä«¿îÆ®Áõ°¡
		eval("document.all.lbl_cnt_"+ num).innerText = parseInt(eval("document.all.lbl_cnt_"+ num).innerText) +1;
		
		document.all.div_top.style.display = "";
		document.all.txt_num.value = num;
		//¸®ºä	
		frm_comment.document.URL = "/intermission/parity.aspx?num="+ num +"&part="+document.all.lbl_part.innerText + "&tbname="+ document.all.lbl_tbname.innerText +"&flag=0"; //ÄÚ¸àÆ®
	}
	
	//document.all.lbl_play.innerText  = eval("document.all.lbl_p"+ num).innerText;
	//document.all.img_star.src = imgSrc;
	
	frm_function.location.href = "/intermission/bbs_function.aspx?tbname="+ document.all.lbl_tbname.innerText +"&num="+ num;	
}

//°øÁö»çÇ× view 
function viewTalk_1(num, id)
{	
	//alert();
	//¹øÈ£|Å¸ÀÌÆ²|ÀÌ¸§|´Þ±Û¼ö|Á¶È¸¼ö|³¯Â¥|³»¿ë
	document.all.lbl_num2.innerText = eval("document.all.lbl_number_1_"+ num).innerText;
	document.all.lbl_title.innerText = eval("document.all.lbl_t1_"+ num).innerText;
	document.all.lbl_name33.innerText = eval("document.all.lbl_n1_"+ num).innerText;
	document.all.lbl_recnt.innerText = eval("document.all.lbl_recount_1_"+ num).innerText;
	document.all.lbl_cnt.innerText   = parseInt(eval("document.all.lbl_cnt_1_"+ num).innerText) +1;
	document.all.lbl_date.innerText  = eval("document.all.lbl_r1_"+ num).innerText;
	document.all.lbl_content.innerHTML = eval("document.all.lbl_c1_"+ num).innerHTML;			
	
	document.all.lbl_name.innerText  = id; 
	document.all.lbl_num.innerText   = num;	
	
	//Ä«¿îÆ®Áõ°¡
	eval("document.all.lbl_cnt_1_"+ num).innerText = parseInt(eval("document.all.lbl_cnt_1_"+ num).innerText) +1;
	
	document.all.div_top.style.display = "";
	document.all.txt_num.value = num;
	//¸®ºä	
	frm_comment.document.URL = "/intermission/parity.aspx?num="+ num +"&part="+document.all.lbl_part.innerText + "&tbname="+ document.all.lbl_tbname.innerText +"&flag=1"; //ÄÚ¸àÆ®
	frm_function.location.href = "/intermission/bbs_function.aspx?tbname="+ document.all.lbl_tbname.innerText +"&num="+ num;	
}

function viewContent(num,intnum)  
{
	alert(_num+"|"+ intnum);
	
	if(document.all.txt_num.value != "")
	{
		eval("document.all.div_"+document.all.txt_num.value).style.display = "none";
		if(document.all.txt_num.value == num)
		{
			document.all.txt_num.value = ""; 
			return;
		}	
	}

	eval("document.all.div_"+ num).style.display = "";
	eval("document.all.lbl_n"+ num).innerText = parseInt(eval("document.all.lbl_n"+ num).innerText)+1;
	frm_function.location.href = "/community/bbs_function.aspx?tbname="+ document.all.lbl_tbname.innerText +"&num="+ num;
	document.all.txt_num.value = num;	

}



function viewControl(page)
{				
	if(document.all.txt_id.value == "" && page != "l")
	{
		alert("·Î±×ÀÎ ÇÏ½ÅÈÄ »ç¿ë ÇÏ¼¼¿ä.");
		//bcLoginCheck();
		TmLoginCheck();
		//location.href = "http://plounz.bccard.com/bccard/login_070813.aspx";
		return;
	}
	
	else 
	{
		if(page == "l")
		{
			
			document.all.btn_w.style.display = "none";
			document.all.btn_e.style.display = "none";
		}
		else eval("document.all.btn_"+ page).style.display = "";
		
		document.all.txt_title.value = "";	
		//document.all.txt_content.value = "";
		
		if(document.all.ccwebEditor != null)
		{
			document.all.htmlCode.value = "";
			ccwebEditor.document.body.innerHTML = "";
		}
		else document.all.txt_content.value = "";
	}
	
	if(document.all.ccwebEditor != null) iniEditor(ccwebEditor.document);
	if(document.all.dd_section != null && window.location.href.indexOf("/community/afternote_080530.aspx") > -1) viewControlImage();
		
	if(page == "e" || page == "r")
	{
		
		if(document.all.txt_num.value == ""){alert("¿øº» ±ÛÀ» ¼±ÅÃÇÏ¼¼¿ä");return;}
		if(page == "e")
		{
			document.all.txt_title.value = eval("lbl_t"+ document.all.txt_num.value).innerText;
			
			if(lbl_name.innerText != document.all.txt_id.value) {alert(' º»ÀÎ ±Û¸¸ ¼öÁ¤µË´Ï´Ù.');return;}
			else
			{
				//document.all.tbl_play.style.display = "none";
				document.all.txt_title.value = eval("lbl_t"+ document.all.txt_num.value).innerText;
				//document.all.txt_content.value = eval("lbl_c"+ document.all.txt_num.value).innerText;
				lbl_id.innerText = document.all.txt_id.value;
			}
			
			if(document.all.ccwebEditor != null)
			{
				if(document.all.dd_section != null) 
				{
					document.all.dd_section.style.display = "none";
					//document.all.span_section.innerText = eval("lbl_1_"+ document.all.txt_num.value).innerText;
				}
				document.all.htmlCode.value = eval("document.all.lbl_c"+ document.all.txt_num.value).innerHTML;
				ccwebEditor.document.body.innerHTML = eval("document.all.lbl_c"+ document.all.txt_num.value).innerHTML;
			}
			else 
			{
				document.all.txt_content.value = eval("lbl_c"+ document.all.txt_num.value).innerText;
				document.all.txt_name.value = eval("lbl_m"+ document.all.txt_num.value).innerText;
			}
			
		}
		else document.all.txt_name.value = document.all.txt_name1.value;
	}
	if(page == "w") 
	{
		//°ø¿¬°Ë»ö
		//document.all.tbl_play.style.display = "";
		document.all.lbl_id.innerText = document.all.txt_id.value;
	}
	
	if(page == "l")
	{
		document.all.div_main.style.display = "";
		document.all.div_sub.style.display = "none";
		document.all.div_top.style.display = "none";
	}	
	else
	{
		document.all.div_top.style.display = "none";
		document.all.div_main.style.display = "none";
		document.all.div_sub.style.display = "";
	}
}

function dataSave(data)
{
	if(document.all.txt_id.value == "") {alert("·Î±×ÀÎ ÇÏ½ÅÈÄ »ç¿ë ÇÏ¼¼¿ä.");return;}
	else 
	{
			if(data == "w") 				
			{
				//if(document.all.txt_play.value == "" || document.all.txt_playtitle.value == "" ) alert("°ø¿¬À» °Ë»öÇÏ¿© ÁÖ¼¼¿ä");
				//else 
				if(document.all.txt_title.value == "") alert("Á¦¸ñÀ» ÀÔ·Â ÇÏ¼¼¿ä."); 
				//else if(document.all.txt_content.value == "") alert("³»¿ëÀ» ÀÔ·Â ÇÏ¼¼¿ä.");
				else if(document.all.ccwebEditor != null)
				{
					document.all.htmlCode.value = ccwebEditor.document.body.innerHTML;
					if(document.all.htmlCode.value == "") alert("³»¿ëÀ» ÀÔ·Â ÇÏ¼¼¿ä.");
					else 
					{
						chk();
						__doPostBack('lbtn_submit','');
					}
				}
				/*
				else
				{
					
					//if(document.all.txt_content.value == "") alert("³»¿ëÀ» ÀÔ·Â ÇÏ¼¼¿ä.");
					//else __doPostBack('lbtn_submit','');
				}
				*/
			}
			else if(data == "r") 
			{
				if(document.all.txt_num.value == "") alert("¿øº» ±ÛÀ» ¼±ÅÃ ÇÏ¼¼¿ä.");
				else if(document.all.txt_title.value == "") alert("Á¦¸ñÀ» ÀÔ·Â ÇÏ¼¼¿ä."); 
				else if(document.all.ccwebEditor != null)
				{
					document.all.htmlCode.value = ccwebEditor.document.body.innerHTML;
					if(document.all.htmlCode.value == "") alert("³»¿ëÀ» ÀÔ·Â ÇÏ¼¼¿ä.");
					else 
					{
						chk();
						__doPostBack('lbtn_submit2','');
					}
				}
				else 
				{
					//if(document.all.txt_content.value == "") alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
					//else __doPostBack('lbtn_submit2','');
				}
			}
			else if(data == "e") 
			{
				if(document.all.txt_num.value == "") alert("¿øº» ±ÛÀ» ¼±ÅÃ ÇÏ¼¼¿ä.");
				else if(document.all.txt_id.value != lbl_name.innerText) alert("º»ÀÎ±Û¸¸ ¼öÁ¤ µË´Ï´Ù.");
				else if(document.all.txt_title.value == "") alert("Á¦¸ñÀ» ÀÔ·Â ÇÏ¼¼¿ä."); 
				else if(document.all.ccwebEditor != null)
				{
					document.all.htmlCode.value = ccwebEditor.document.body.innerHTML;
					if(document.all.htmlCode.value == "") alert("³»¿ëÀ» ÀÔ·Â ÇÏ¼¼¿ä.");
					else 
					{
						chk();
						__doPostBack('lbtn_submit1','');
					}
				}
				else
				{
					//if(document.all.txt_content.value == "") alert("³»¿ëÀ» ÀÔ·Â ÇÏ¼¼¿ä.");
					//else __doPostBack('lbtn_submit1','');
				}
				
			}
			else if(data == "d") 
			{		
				if(document.all.txt_num.value == "") alert("¿øº» ±ÛÀ» ¼±ÅÃ ÇÏ¼¼¿ä.");
				else if(document.all.txt_name1.value == "¿î¿µÀÚ")  __doPostBack('lbtn_submit2','');
				else if(document.all.txt_id.value != lbl_name.innerText) alert("º»ÀÎ±Û¸¸ »èÁ¦ µË´Ï´Ù.");
				else __doPostBack('lbtn_submit2','');
			}
	}	
}

function playList()
{
	document.all.tbl_play2.style.display = "none";
	if(document.all.txt_playtitle.value == "") alert("°ø¿¬¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä");
	else 
	{
		frm_play.location.href ="/community/playlist.aspx?title="+ document.all.txt_playtitle.value;
		document.all.tbl_play2.style.display = "";
	}
}

//°ø¿¬ÈÄ±â ´çÃ·ÀÚ ¹ßÇ¥ ½ºÅ©¸³Æ® ½ÃÀÛ
function Is() {
    var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.ns2 = (this.ns && (this.major == 2));
    this.ns3 = (this.ns && (this.major == 3));
    this.ns4b = (this.ns && (this.major == 4) && (this.minor <= 4.03));
    this.ns4 = (this.ns && (this.major >= 4));
    this.ie   = (agent.indexOf("msie") != -1);
    this.ie3  = (this.ie && (this.major == 2));
    this.ie4  = (this.ie && (this.major >= 4));
    this.op3 = (agent.indexOf("opera") != -1);
}

var is = new Is()

if(is.ns4) {
    doc = "document";
    sty = "";
    htm = ".document"
} else if(is.ie4) {
    doc = "document.all";
    sty = ".style";
    htm = ""
}

var text1  = "";
var text2  = "";
var count  = 0;
var count2 = 0;

function writetext()
{
	if(document.all.lbl_scroll.innerText != "0")
	{
		msg  = new Array();
		for(ii=0; ii<parseInt(document.all.lbl_scroll.innerText); ii++)
		{
			msg[ii] = document.getElementById("div_notice_"+ ii).innerText;
		}
		
		text  = eval('msg['+ count2 +'].split("")');
		text1 ='<tt>'+text2 + '<b style="color:#00ff00;">'+ text[count] +'</b></tt>';
		text2 += text[count];
		
		fillHTML = eval(doc + '["div_notice"]' + htm);
		
		if(is.ns4) 
		{
			fillHTML.write(text1);
			fillHTML.close();
		} 
		else 
		{
			fillHTML.innerHTML = text1;
			fillHTML.innerHTML = text1.replace("´Ô`", "´Ô</font>").replace("`", "<font color='#0000cc'>");		
		}
		
		if(!(count >= text.length-1))
		{
			count += 1;
			setTimeout('writetext()',100);
		}
		else
		{
			count = 0;
			text2 = "";
			if(count2 == parseInt(document.all.lbl_scroll.innerText)-1) count2= -1;
			count2++;
			setTimeout('writetext()',10000);
		}
	}
}


function imgbbsChage(id)
{
	for(i=1; i<9; i++)	eval("document.all.img_"+ i).src = "http://www.clip2u.co.kr/button/btn_edit0"+ i +".gif";
	if(id == "9") return;
	eval("document.all.img_"+ id).src = "http://www.clip2u.co.kr/button/btn_edit0"+ id +"_o.gif";
}



//°Ô½ÃÆÇ ÀÌ¹ÌÁö Ãß°¡ ,
function AddImage(flag) 
{
	scrWidth = (screen.availWidth / 2 ) - 200;
	scrHeight = (screen.availHeight / 2) - 150;
	str="'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=260,height=260,top="+scrHeight+",left="+scrWidth +"'";
	window.open("/community/addimage.aspx?flag="+ flag,"",str);
}

function ShowImg(img_url)
{ 
	/*
	thumbnail = new Image; 
	thumbnail.src = img_url;
	newSize = ( 1000/500 > thumbnail.width/thumbnail.height ) ? 1000 / thumbnail.height : 500 / thumbnail.width; 
	newWidth = thumbnail.width * newSize; 
	if (thumbnail.width > newWidth ) document.tempImg.width = newWidth; 
	else document.tempImg.width = thumbnail.width; 
	*/
}

function viewImg(imgPath)
{
	document.tempImg.src = imgPath;   
}

function CheckImgFormat()
{	
	thumbnail = new Image; 
	thumbnail.src = document.all.filename.value;
	img = document.all.filename.value.substring(document.all.filename.value.lastIndexOf('\\')+1);
		
	numUnicode = img.charCodeAt(0);
	if(img.indexOf(".JPG") == -1 && img.indexOf(".GIF") == -1 && img.indexOf(".gif") == -1 && img.indexOf(".jpg") == -1) alert("Áö¿øÇÏÁö ¾Ê´Â ÆÄÀÏÀÔ´Ï´Ù.");
	else if(thumbnail.width > 650) alert("ÀÌ¹ÌÁöÀÇ ÃÖ´ë °¡·Î »çÀÌÁî´Â 650 ÀÔ´Ï´Ù.");
	else if(44032 <= numUnicode && numUnicode <= 55203) alert("ÇÑ±Û ÀÌ¸§Àº  »ç¿ë ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
	else if(document.all.tempImg.fileSize > 1024*1024) alert("ÀÌ¹ÌÁöÀÇ »çÀÌÁî´Â 1M·Î Á¦ÇÑÇÕ´Ï´Ù.");
    else __doPostBack('lbtn_submit','');
}

function viewFont()
{
	if(document.all.div_font.style.display == "block") document.all.div_font.style.display = "none";
	else document.all.div_font.style.display = "";
}

var curMode = "edit";
function iniEditor(editor) 
{	
	var body = "";
	body += "<style>";
//	body += "P, span, body, tr, td, th, select, div, form, center, option, pre, blockquote { background:#959DA0; margin:0;padding:0;font-family:µ¸¿ò, Dotum, Arial, sans-serif;font-size:11px;color:#ffffff;line-height:16px;}";
	body += "P, span, body, tr, td, th, select, div, form, center, option, pre, blockquote {background:#ffffff; margin:0;padding:0;font-family:µ¸¿ò, Dotum, Arial, sans-serif;font-size:11px;color:#000000;line-height:16px;}";

	body += "</style>";
	body += "<BODY>";
	editor.write(body);
	ccwebEditor.focus();
}

function doIt(arg,itf,value) 
{
	alert(arg + itf + value);
	if(curMode == "edit")
	{
		if(value != "NONE SELECTED") 
		{
			var tt = ccwebEditor.document.selection.createRange();
			tt.execCommand(arg,itf,value);

			if(arg == "ForeColor") viewFont();			
			if(arg == "CreateLink") 
			{
				tt.parentElement().target = '_blank';
				tt.parentElement().onFocus = 'this.blur()';
			}
			
			tt.select();
			ccwebEditor.focus();
		}

	} 
	else alert("html ÆíÁý¸ðµå¿¡¼­¸¸ »ç¿ëÇØÁÖ¼¼¿ä.");
}

function view1Mode(type) 
{
	if (curMode != type) 
	{
		if (type == "edit") 
		{
			document.all.editMode.style.display = "block";
			document.all.previewMode.style.display = "none";
			ccwebEditor.document.body.innerHTML = document.all.htmlCode.value;
		} 
		else if(type == "html") 
		{
			document.all.editMode.style.display = "none";
			document.all.previewMode.style.display = "none";
			document.all.htmlCode.value = ccwebEditor.document.body.innerHTML;
		} 
		else if(type == "preview") 
		{
			document.all.editMode.style.display = "none";
			document.all.previewMode.style.display = "block";
			if(curMode == "html")
			{
				document.all.previewMode.innerHTML = document.all.htmlCode.value;
				document.all.ccwebEditor.document.body.innerHTML = document.all.htmlCode.value;
			} 
			else if(curMode == "edit") 
			{
				document.all.previewMode.innerHTML = ccwebEditor.document.body.innerHTML;
				document.all.htmlCode.value = ccwebEditor.document.body.innerHTML;
			} 
			else return;
		} 
		else return;
		curMode = type;
	} 
	else return;
}

function Edit()
{
	ccwebEditor.document.body.innerHTML = document.all.htmlCode.value;
}


//°ø¿¬ÈÄ±â ´çÃ·ÀÚ ¹ßÇ¥ ½ºÅ©¸³Æ® ³¡
//-->

