/**
 * Æ÷ÀÎÆ®¼¥ Àü¿ë SNS¼­ºñ½º¿¡ ¸Þ½ÃÁö º¸³»±â
 */
/**
 * Æ®À§ÅÍ¿¡ ¸Þ½ÃÁö º¸³»±â
 * 
 * @param msg	¸Þ½ÃÁö
 * @param url	¸µÅ©ÁÖ¼Ò
 * @return
 */
function sendTwitter(msg,url) {
	var href = "http://twitter.com/home?status=" + encodeURIComponent(msg) + " " + encodeURIComponent(url);
	var a = window.open(href, 'dlgWnd_twitter', '');
	if ( a ) {
		a.focus();
	}
}
/**
 * ¹ÌÅõµ¥ÀÌ¿¡ ¸Þ½ÃÁö º¸³»±â
 * 
 * @param msg	¸Þ½ÃÁö
 * @param url	¸µÅ©ÁÖ¼Ò
 * @param tag	ÅÂ±×(ÄÞ¸¶·Î ±¸ºÐ)
 * @return
 */
function sendMe2Day(msg,url,tag) {
	var href = "http://me2day.net/posts/new?new_post[body]=" + encodeURIComponent(msg) + " " + encodeURIComponent(url) + "&new_post[tags]=" + encodeURIComponent(tag);
	var a = window.open(href, 'dldWnd_me2Day', '');
	if ( a ) {
		a.focus();
	}
}
/**
 * ÆäÀÌ½ººÏ¿¡ º¸³»±â
 * @param msg	¸Þ½ÃÁö
 * @param url	¸µÅ©ÁÖ¼Ò
 * @return
 */
function sendFaceBook(msg,url) {
	var href = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(url) + "&t=" + encodeURIComponent(msg);
	var a = window.open(href, 'dldWnd_facebook', '');
	if ( a ) {
		a.focus();
	}
}
/**
 * C°ø°¨ ¸Þ½ÃÁö º¸³»±â
 * 
 * @param summary		¸Þ½ÃÁö
 * @param link			¸µÅ©ÁÖ¼Ò 
 * @param writer		±Û¾´ÀÌ
 * @param thumbnail		Ã·ºÎ ÀÛÀº±×¸²(url·Î µî·Ï)
 * @return
 */
function sendCLog(summary,link,writer,thumbnail) {	
    var href = "http://csp.cyworld.com/bi/bi_recommend_pop.php?url="
            + encodeURIComponent( window.location.href )
            + "&thumbnail=" + encodeURIComponent(thumbnail)
            + "&area="      + ''
            + "&title_nobase64="     + encodeURI(window.document.title)
            + "&summary_nobase64="   + encodeURIComponent(summary)
            + "&writer="    + encodeURIComponent(writer);
    var a = window.open(href, 'dlgWnd_clog', 'width=400,height=364');
    if ( a ) {
        a.focus();
    }
}
/**
 * ´ÙÀ½¿äÁò¿¡ ¸Þ½ÃÁö º¸³»±â
 * @param prefix	¸Þ½ÃÁö ÂªÀº±Û
 * @param link		¸µÅ©ÁÖ¼Ò
 * @param params	¸Þ½ÃÁö ±ä±Û
 * @return
 */
function sendYozmDaum(prefix,link,params) {
	var href = "http://yozm.daum.net/api/popup/prePost?link=" + encodeURIComponent(link) + "&prefix=" + encodeURIComponent(prefix) + "&parameter=" + encodeURIComponent(params);
	var a = window.open(href, 'dlgWnd_yozm', 'width=466, height=356');
	if ( a ) {
		a.focus();
	}
}

function sendNateOnPost(msg,link)
{
	var dom = "http://api.nateon.nate.com";	
	var url = dom+"/web/note/SendNote.do?msg="+encodeURIComponent(msg)+"&lurl="+encodeURIComponent(link);
	
	window.open(url, "note", "width=500, height=540");	
}

/**
 * SNS¿¡ ¸Þ½ÃÁö º¸³»±â
 * @param t		Á¾·ù
 * @param msg	¸Þ½ÃÁö
 * @param link	¸µÅ©ÁÖ¼Ò
 * @return
 */
function sendSNS(t,msg,link,tag)
{
	switch( t ) {
	case 'twitter':
		sendTwitter(msg,link);
		break;
	case 'facebook':
		sendFaceBook(msg,link);
		break;
	case 'me2day':
		sendMe2Day(msg,link,tag);
		break;
	case 'clog':
		sendCLog(msg,link,'','');
		break;
	case 'yozm':
		sendYozmDaum(msg,link,msg);
		break;
	case 'nateonpost':
		sendNateOnPost(msg,link);
		break;
	default:
		alert( t + ' is not support!' );
		break;
	}
}

/**
 * ´ÜÃàURL±â´É¿¡¼­ URLº¹»ç±â´É
 */
function __psShortUrlCopy()
{
	var s = $F('shorturl');
	if ( window.clipboardData.setData( 'Text', s ) ) {
		alert( '´ÜÃàURL ¹Ù·ÎÁ¢¼ÓÁÖ¼Ò\n\n' + s + ' ¸¦ º¹»çÇß½À´Ï´Ù.\n\n¸Þ½ÅÀú, ³×ÀÌÆ®¿Âµî¿¡¼­ ºÙ¿©³Ö±â ÇÏ½Ç¶§ Ctrl+V Å°¸¦ ´­·¯ ÁÖ½Ã¸é Æí¸®ÇÕ´Ï´Ù.' );
		$('id_dlg_shorturl_cp').hide();
	} else {
		alert( 'Å¬¸³º¸µå ¾×¼¼½º¸¦ Çã¿ëÇÏ¼Å¾ß º¹»ç µË´Ï´Ù.\n\nF5Å°¸¦ ´­·¯ »õ·Î°íÄ§ÈÄ ´Ù½Ã ½ÃµµÇØ ÁÖ½Ê½Ã¿À.' );
	}
}
