{"size": 2333, "ext": "js", "max_stars_repo_path": "resources/korea-sns/korea_sns.js", "max_stars_repo_name": "kimdoyeonsa/index3", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "resources/korea-sns/korea_sns.js", "max_issues_repo_name": "kimdoyeonsa/index3", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "resources/korea-sns/korea_sns.js", "max_forks_repo_name": "kimdoyeonsa/index3", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.9222222222, "max_line_length": 118, "alphanum_fraction": 0.4804972139}
var g_bInitKakao = false;

function InitKakao(strkey){
	if( !g_bInitKakao ){
		Kakao.init(strkey);
		g_bInitKakao = true;
	}
}

function SendSNS(sns,title,url)
{
    var o;
    var _url = encodeURIComponent(url);
    var _title = encodeURIComponent(title);


    var _br  = encodeURIComponent('\r\n');

    switch(sns)
    {
        case 'facebook':
            o = {
                method:'popup',
                height:600,
                width:600,
                url:'http://www.facebook.com/sharer/sharer.php?u=' + _url+'&t='+title
            };
            break;

        case 'twitter':
            o = {
                method:'popup',
                height:600,
                width:600,
                url:'http://twitter.com/intent/tweet?text=' + _title + '&url=' + _url
            };
            break;


        case 'naverband':
            o = {
                method:'web2app',
                param:'create/post?text=' + _title + _br + _url,
                a_store:'itms-apps://itunes.apple.com/app/id542613198?mt=8',
                g_store:'market://details?id=com.nhn.android.band',
                a_proto:'bandapp://',
                g_proto:'scheme=bandapp;package=com.nhn.android.band'
            };
            break;

        case 'naverblog':
        		o = {
                method:'popup',
                height:600,
                width:600,
                url:'http://blog.naver.com/openapi/share?url=' + _url + '&title=' + _title
            };
      break;

        default:
            return false;
    }

    switch(o.method)
    {
	    case 'popup':
	    	if( o.height > 0 && o.width > 0 ){
		    	window.open(o.url,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height='+o.height+',width='+o.width);
	    	}
	    	else{
		    	 window.open(o.url);
	    	}

	      break;

	    case 'web2app':
	      if(navigator.userAgent.match(/android/i)){
	          setTimeout(function(){ location.href = 'intent://' + o.param + '#Intent;' + o.g_proto + ';end'}, 100);
	      }
	      else if(navigator.userAgent.match(/(iphone)|(ipod)|(ipad)/i)){
	          setTimeout(function(){ location.href = o.a_store; }, 200);
	          setTimeout(function(){ location.href = o.a_proto + o.param }, 100);
	      }
	      else{
	          swal('Only mobile');
	      }
	      break;
    }
}
