	var userAgent = navigator.userAgent.toLowerCase();

	var browser = {
		msie    : /msie/.test( userAgent ) && !/opera/.test( userAgent ),
		safari  : /webkit/.test( userAgent ),
		firefox : /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ),
		opera   : /opera/.test( userAgent )
	};

	if( browser.msie ){ //IE
		//alert("ie");
		document.write('<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">')
		//  document.write('IEmeta')
	} else if ( browser.safari ){ //Chrome || Safari
		// alert("Chrome Safari");
		document.write('<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">')
	} else if ( browser.opera ){ // Opera
		// alert("opera");
		document.write('<meta name="viewport" content="user-scalable=no, initial-scale=0.75, maximum-scale=0.75, minimum-scale=0.75" />')
	} else { 
		// alert("etc");
		document.write('<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">')
	}
	
	function goTwitter(msg,url) {	
//		var href = "http://twitter.com/home?status=" + encodeURIComponent(msg) + " " + encodeURIComponent(url);
		var href = "http://twitter.com/intent/tweet?text=" + encodeURIComponent(msg) + " " + encodeURIComponent(url);
		var a = window.open(href, 'twitter', '');
		if ( a ) {
			a.focus();
		}
	}
	
	function goMe2Day(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, 'me2Day', '');
		if ( a ) {
			a.focus();
		}
	}
/*	
	function goFaceBook(msg,url) {
		var href = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(url) + "&t=" + encodeURIComponent(msg);
		var a = window.open(href, 'facebook', '');
		if ( a ) {
			a.focus();
		}
	}
*/
	function goFaceBook(title,url) {	
				var wp = window.open("http://www.facebook.com/sharer.php?u=" + encodeURIComponent(url) + "&t="+encodeURIComponent(title),'facebook', '');
				if(wp) {
					wp.focus();
				}
	}


	function goCyWorld(xml, url, tag,Vurl) {//alert(xml);
		tag = tag.replace(/[+]/gi,"＋")
		var params = escape(xml+"?tag="+escape(tag)+"&url="+ Vurl + "&img=" + url +"/images/img.jpg");
	
		var href = "http://api.cyworld.com/openscrap/post/v1/?xu="+ params +"&amp;sid=mJFEkJN1jiBJ8MBbzYeS2TNGFUQ6Rp4d";
		var a = window.open(href, 'cyopenscrap', 'width=450,height=410');
		if ( a ) {
			a.focus();
		}
	}

	function goCyWorld2(xml, url, tag) {

		tag = tag.replace(/[+]/gi,"＋")
		var params = escape(xml+"?tag="+escape(tag)+"&url="+url + "&img=" + url +"/images/img2.jpg");

		//var href = "http://api.cyworld.com/openscrap/post/v1/?xu="+xml+"?url="+ url +"&amp;tag="+ tag +"&amp;sid=mJFEkJN1jiBJ8MBbzYeS2TNGFUQ6Rp4d";
		var href = "http://api.cyworld.com/openscrap/post/v1/?xu="+ params  +"&amp;sid=mJFEkJN1jiBJ8MBbzYeS2TNGFUQ6Rp4d";
		var a = window.open(href, 'cyopenscrap', 'width=450,height=410');
		if ( a ) {
			a.focus();
		}
	}

	function goEmail(imgUrl, msg, tag, url) { 
		imgUrl=escape(imgUrl);
		url=escape(url);
		msg=escape(msg);
		tag=escape(tag);
		var href = "/popup/sendmail/SendMail.asp?imgUrl="+ imgUrl + "&amp;msg=" + msg + "&amp;tag=" + tag + "&amp;url=" + url;

		var a = window.open(href, 'Email', 'width=560,height=420');

		if ( a ) {
			a.focus();
		}
	}

	function goSourceCopy(param, eveVal){

		if(eveVal == "event"){
			alert("소스가 복사되었습니다.");
		}else{
			alert("고객님의 내 소문 링크가 복사되었습니다. \n블로그나 게시판, 메신저로 Ctrl+V로 붙여넣기 하세요.");
		}
	
		var p = document.createElement('p'); // P element를 임시로 만들고
		p.style.display = 'none'; // 안보이게
		p.innerText =param;
		document.body.appendChild(p); // body에 넣은다음

	   var text = document.body.createTextRange();
	   text.moveToElementText(p);
	   text.execCommand('Copy'); // 복사

	   document.body.removeChild(p); // 임시로 만든 P 삭제	   
	}


	function goYozm(msg,url) { //http://m.yozm.daum.net/user/message/post - 모바일 웹

		var href = "http://yozm.daum.net/api/popup/prePost?link=" + url + "&amp;prefix=" + encodeURIComponent(msg);
		var a = window.open(href, 'yozm', 'width=450,height=350,scrollbars=no,status=0');
		if ( a ) {
			a.focus();
		}
	}


	function goCLog(msg,url) { 

		var href = "http://csp.cyworld.com/bi/bi_recommend_pop.php?url=" + url + "&amp;&title_nobase64=" + encodeURIComponent(msg);//+"&amp;thumbnail=bin.gif";
		var a = window.open(href, 'recom_icon_pop', 'width=400,height=364,scrollbars=no,status=0');
		if ( a ) {
			a.focus();
		}
		
	}
