//FAQ open,close (Á¦¸ñID,´äº¯ID,¾ÆÀÌÄÜID,ÃÑ°¹¼ö)
function qnaView(obj,layer,ico,totalcnt){	
	for(i=1;i<=totalcnt;i++){
		try{
			if(layer == "answ_"+i){
				if(document.getElementById(layer).style.display == "block"){
				
					document.getElementById("qna_t"+i).className="";
					document.getElementById("answ_"+i).style.display="none";
					document.getElementById("qna_ico"+i).src="/images/icon/q_off2.gif";
				}
				else{
					document.getElementById(obj).className="choice";
					document.getElementById(layer).style.display="block";
					document.getElementById(ico).src="/images/icon/q_off.gif";
				}
			}
			else{
				document.getElementById("qna_t"+i).className="";
				document.getElementById("answ_"+i).style.display="none";
				document.getElementById("qna_ico"+i).src="/images/icon/q_off2.gif";
			}
		}catch(exception){}
	}
}

//Æ®À§ÅÍ api¿¬µ¿
function openTweet(strSubject){
	strSubject = strSubject.replace("&","£¦");
	strSubject = strSubject.replace("#","££");
	strSubject=encodeURI(strSubject);
	strSubject+="+"+encodeURI(location.href);
	window.open("http://twitter.com/intent/tweet?text="+strSubject,"twittersend","width=800 height=600");
}

//Æ®À§ÅÍ api¿¬µ¿ 2
function openTweetPost(strSubject,designateURL){
	strSubject=encodeURI(strSubject);
	strSubject+="+"+designateURL;
	window.open("http://twitter.com/intent/tweet?text="+strSubject,"twittersend","width=800 height=600");
}

//ÇöÀç ÆäÀÌÁö urlº¹»ç
function copyCurUrl()
{
	 try
	 {
	  var bResult = false;
		  if( window.clipboardData )  // IE
		  {
			  var url = location.href;
			  bResult = window.clipboardData.setData("Text",url );
		  }
		  else
		  {
			   alert( "URL º¹»ç´Â IE ¿¡¼­¸¸ »ç¿ë °¡´ÉÇÏ½Ê´Ï´Ù.");
			   return;
		  }
		  if( bResult == true)
		  {
			   alert("°Ô½Ã¹° ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.\nCtrl+V ·Î ºÙ¿©³Ö±â ÇÒ ¼ö ÀÖ½À´Ï´Ù.");
			   return;
		  }  
	 }
	 catch (e)
	 {
	  alert( e.description );
	 }
}

//ÇöÀç ÆäÀÌÁö urlº¹»ç (¾ÆÄ«µ¥¹Ì ÀÏ¹Ý°úÁ¤, Æ¯°­ ¿ë)
function copyCurUrl00()
{
	 try
	 {
	  var bResult = false;
		  if( window.clipboardData )  // IE
		  {
			  text = document.getElementById("locationURL").value;
			  bResult = window.clipboardData.setData("Text",text );
		  }			  
		  else
		  {
			   alert( "URL º¹»ç´Â IE ¿¡¼­¸¸ »ç¿ë °¡´ÉÇÏ½Ê´Ï´Ù.");
			   return;
		  }
		  if( bResult == true)
		  {
			   alert("°Ô½Ã¹° ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.\nCtrl+V ·Î ºÙ¿©³Ö±â ÇÒ ¼ö ÀÖ½À´Ï´Ù.");
			   return;
		  }  
	 }
	 catch (e)
	 {
	  alert( e.description );
	 }
}

//rss urlº¹»ç
function copyCurUrl2()
{
	 try
	 {
	  var bResult = false;
		  if( window.clipboardData )  // IE
		  {
			  var url = document.getElementById("rss_url").value;
			  bResult = window.clipboardData.setData("Text",url );
		  }
		  else
		  {
			   alert( "URL º¹»ç´Â IE ¿¡¼­¸¸ »ç¿ë °¡´ÉÇÏ½Ê´Ï´Ù.");
			   return;
		  }
		  if( bResult == true)
		  {
			   alert("ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.\nCtrl+V ·Î ºÙ¿©³Ö±â ÇÒ ¼ö ÀÖ½À´Ï´Ù.");
			   return;
		  }  
	 }
	 catch (e)
	 {
	  alert( e.description );
	 }
}

//½ºÅ©·¦º¹»ç
function copyScrap(){
	try
	 {
	  var bResult = false;
		  if( window.clipboardData )  // IE
		  {
			 text = document.getElementById("testarea").value;
			  bResult = window.clipboardData.setData("Text",text );

		  }
		  else
		  {
			   alert( "URL º¹»ç´Â IE ¿¡¼­¸¸ »ç¿ë °¡´ÉÇÏ½Ê´Ï´Ù.");
			   return;
		  }
		  if( bResult == true)
		  {
			   alert("³»¿ëÀÌ º¹»çµÇ¾ú½À´Ï´Ù.\nCtrl+V ·Î ºÙ¿©³Ö±â ÇÒ ¼ö ÀÖ½À´Ï´Ù.");
			   return;
		  }  
	 }
	 catch (e)
	 {
	  alert( e.description );
	 }
}


function ViewsPage(frm)
{	
		jQuery.noConflict();

		jQuery(frm).modal();
}

function pop_rss(popid,rss_url){
		popid = "#"+popid;
		document.getElementById("rss_url").value = "http://sangsangmadang.com"+rss_url;
		ViewsPage(popid);
}

function pop_module(popid,id,boardkind){
		popid = "#"+popid;
		jQuery.ajax({
		   type: "POST", 
		   url: "jquery_db.asp", 
		   data: "seq="+id+"&boardkind="+boardkind, 
		   success: function(msg2){ 
				document.getElementById("moddiv").innerHTML = msg2;
		   } 
		}); 
		ViewsPage(popid);
		//document.getElementById("rss_url").value = "http://192.168.1.245:2079"+rss_url;
		
}

function div_open(id){
	if(document.getElementById(id).style.display == "none"){
		document.getElementById(id).style.display = "block";
	}
}

function div_close(id){
	if(document.getElementById(id).style.display == "block"){
		document.getElementById(id).style.display = "none";
	}
}


// »ó»ó¸¶´ç ¸®´º¾ó ÈÄ ÀÌº¥Æ®¿¡¼­ ÆË¾÷ ¶ç¿ï ¶§ »ç¿ë..
function popupPollevents(pseq){
	window.open("/popup/poll/write.asp?pseq="+pseq,"winPopupPollname",'scrollbars=no,toolbar=no,location=no,resizable=no,status=no,menubar=no,width=400,height=673,left=300,top=200');
}
