function copy_url(trb) {
    var IE=(document.all)?true:false;
    if (IE) {
        if(confirm("이 글의 주소를 클립보드에 복사하시겠습니까?"))
        window.clipboardData.setData("Text", trb);
    } else {
       temp = prompt("이 글의 주소입니다. Ctrl+C를 눌러 클립보드로 복사하세요", trb);
    }
}

function twitter(twt){
	if(twt.checked){
		new Ajax.Request(
			"/twitter/check",{
				method : "post",
				evalScript : true,
				requestHeaders: {Accept: 'application/json'},
				onComplete : function(r){
					var res = r.responseText;
					j = res.evalJSON(true);
					if(j.result=="loginFailure"){
						if(confirm(j.message)) {
							location.href="/login/?requestURI=" + encodeURIComponent(location.href);
						}
						twt.checked = false;
					} else if(j.result=="failure"){
						window.open(j.message,"twitterPop","width=800px,height=400px");
						return;
					}
				}
			}
		);
	}
}

function login(){
	if(confirm("로그인 후에 등록하실 수 있습니다. 로그인하겠습니까?")) {
		location.href="/login/?requestURI=" + encodeURIComponent(location.href);
	}
}
