﻿// JScript 파일

/** 
* 팝업
*/
function PopOpen(PageHref,WndName, width, height, configure){
	var left	= (screen.width - width) /2;
	var top		= (screen.height - height) /3;
	configure	= 'width='+width+',height='+ height+',left='+left +',top='+top+','+ configure;
	new_win		= window.open(PageHref,WndName,configure);
	new_win.focus();
}

/**
* sns scrap
**/
var sendUrl,locUrl;
locUrl = window.location.href;
 
function _sns(media, title) {

	switch(media) {
		case "facebook":
			sendUrl = "http://www.facebook.com/sharer.php?u="+encodeURIComponent(document.URL)+"&t="+encodeURIComponent();
			PopOpen(sendUrl,"snsOpen", "600", "500", "scrollbars=no")
			break;
		case "twitter":
			sendUrl = "http://twitter.com/home?status="+encodeURIComponent(title)+":"+escape(locUrl);
			PopOpen(sendUrl,"snsOpen", "1024", "800", "scrollbars=yes") 
			break;
		case "metoday":
			sendUrl = "http://me2day.net/posts/new?new_post[body]=\""+encodeURIComponent(title)+"\":"+escape(locUrl)+"&new_post[tags]=logii";
			PopOpen(sendUrl,"snsOpen", "1024", "800", "scrollbars=yes")
			break;
		case "naver":
			sendUrl = "http://bookmark.naver.com/post?ns=1&title="+encodeURIComponent(title)+"&url="+escape(locUrl);
			PopOpen(sendUrl,"snsOpen", "1024", "800", "scrollbars=yes")
			break;
		case "google":
			sendUrl = "http://www.google.com/bookmarks/mark?op=add&title="+encodeURIComponent(title)+"&bkmk="+escape(locUrl);
			PopOpen(sendUrl,"snsOpen", "1024", "800", "scrollbars=yes")
			break;
        case "cyworld":
			sendUrl = "Http://csp.cyworld.com/bi/bi_recommend_pop.php?url="+encodeURIComponent(locUrl)+"&title_nobase64="+encodeURIComponent(title)+"&summary_nobase64="+encodeURIComponent(document.title)+"&writer=";
			var a = PopOpen(sendUrl,"snsOpen", "1024", "800", "scrollbars=yes")
			if(a){
			    a.focus();
			}
			break;                			
		case "yozm":
			sendUrl = "http://yozm.daum.net/api/popup/prePost?link=" + encodeURIComponent(document.URL) +"&prefix="+ encodeURIComponent(title) +"&parameter=logii";
			var win = window.open(sendUrl, 'yozmSend', 'width=466, height=356');
			if (win) {
				win.focus();
			}
		break;
	}
}

