function news_print(URL) {
	window.open(URL,'_jinbo_commune_print','width=610,height:600,scrollbars=yes');
}
function copy_clip_ie(id) {
	var txt = document.body.createTextRange();
	var obj = document.getElementById(id);
	txt.moveToElementText(obj);
	txt.select();
	txt.execCommand("copy");
	document.selection.empty();
	alert("´º½ºÀÇ html ¼Ò½º¸¦ Å¬¸³º¸µå·Î º¹»çÇÏ¿´½À´Ï´Ù.\n¿øÇÏ½Ã´Â °Ô½ÃÆÇÀÌ³ª ºí·Î±×¿¡¼­ ctrl+v·Î º¹»çÇÏ¼¼¿ä.");
}
function copy_clip_mozilla(id) {
	var obj = document.getElementById(id);
	if(obj == null) {
		return;
	}
	var text = obj.value;
	if(text == null || text == "") {
		text = obj.innerHTML;
	}
	if(text == null || text == "") {
		return;
	}

	try {
		netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
	} catch(e) {
		alert("´º½º³»¿ëÀ» º¹»ç¸¦ ÇÒ ¼ö ¾ø½À´Ï´Ù. ºê¶ó¿ìÀú ¼³Á¤À» Á¶Á¤ÇØ ÁÖ¼¼¿ä");
		return;
	}
	var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
	if(str == null) {
		return;
	}
	str.data = text;

	var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
	if(trans == null) {
		return;
	}

	trans.addDataFlavor("text/unicode");
	trans.setTransferData("text/unicode", str, text.length * 2);

	var clipid = Components.interfaces.nsIClipboard;
	var clip = Components.classes["@mozilla.org/widget/clipboard;1"].getService(clipid);
	if(clip == null) {
		return;
	}

	clip.setData(trans, null, clipid.kGlobalClipboard);
	alert("´º½ºÀÇ html ¼Ò½º¸¦ Å¬¸³º¸µå·Î º¹»çÇÏ¿´½À´Ï´Ù.\n¿øÇÏ½Ã´Â °Ô½ÃÆÇÀÌ³ª ºí·Î±×¿¡¼­ ctrl+v·Î º¹»çÇÏ¼¼¿ä.");
}

function copy_clip(id) {
	if(!document.body.createTextRange) {
		copy_clip_mozilla(id);
	} else {
		copy_clip_ie(id);
	}
}

