var http_request = false; var url='/Main.php?do=RootClip'; var tag_bgcolor_on='yellow'; var tag_bgcolor_off='#F3F3F3'; function push(bk_id,uid) { var url='/Main.php?do=Push&bk_id=' + bk_id + '&uid=' + uid; http_request = false; if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Giving up :( Cannot create an XMLHTTP instance'); return false; } http_request.onreadystatechange = alertContents; http_request.open('GET', url, true); http_request.send(null); } function alertContents() { if (http_request.readyState == 4) { if (http_request.status == 200) { var data=http_request.responseText; var temp=new Array(); temp=data.split(' '); var pushclip='ClipPush' + temp[0]; var ispushed='ispushed' + temp[0]; var nopushed='nopushed' + temp[0]; var push_img='push_img' + temp[0]; document.all.item(pushclip).innerHTML = temp[1]; //alert(ispushed); document.all.item(ispushed).innerHTML = ' 已推文<\/span>'; //document.all.item(ispushed).style.visibility='hidden'; //document.all.item(nopushed).style.visibility='visible'; //alert(ispushed); document.all.item(push_img).src="\/images\/icon_pushed.gif"; } else { alert('There was a problem with the request.'); } } } function delbookmark(id) { if (confirm('是否確定刪除本書籤?')) document.location='/Main.php?do=DelClip&bk_id=' + id; } function delmybookmark(id,myid) { if (confirm('是否確定刪除本書籤?')) document.location='/Main.php?do=DelClip&bk_id=' + id + '&my_id=' + myid; } function display_reply(flag,mesgid,close) { var reply_str=''; if (close == '1') { reply_str = ''; document.getElementById('Flag' + mesgid).name='nodisplay'; } else { if (flag.name == 'nodisplay') { flag.name = 'display'; formname="ReplyCommandSubmit" + mesgid; reply_str= "回覆本留言

"; } else { reply_str = ''; flag.name = 'nodisplay'; } } //alert(reply_str); document.getElementById('Reply' + mesgid).innerHTML=reply_str; return; } function check_reply_content(theForm) { theForm.msg_content.value=document.getElementById('reply_content').value; if (theForm.msg_content.value == '') { alert ('留言內容不可空白'); return(false); } else theForm.submit(); } function check_msg_content(theForm) { if (theForm.msg_content.value == '') { alert ('留言內容不可空白'); return(false); } else { theForm.submit(); retrun(true); } } function check_msg1_content(theForm) { if (theForm.msg_content.value == '') { alert ('留言內容不可空白'); return(false); } else { retrun(true); } } function check_keyword(theForm) { if (theForm.keyword.value == '') { alert ('請輸入查詢關鍵字!'); return(false); } else { retrun(true); } } function addtag(obj,tag) { if (obj.name == 'on') { s = new String(document.all.item('my_tag').value); del_tag = tag + ' '; x=s.replace(del_tag,''); document.all.item('my_tag').value = x; obj.style.background='#F3F3F3'; obj.name='off'; } else { document.all.item('my_tag').value += tag + ' '; obj.style.background='yellow'; obj.name='on'; } } function addmytag(obj,tag) { if (obj.name == 'on') { s = new String(document.all.item('my_tag').value); del_tag = tag + ' '; re=new RegExp(del_tag, "gi") x=s.replace(re,''); document.all.item('my_tag').value = x; obj.style.background=tag_bgcolor_off; obj.name='off'; } else { document.all.item('my_tag').value += tag + ' '; obj.style.background=tag_bgcolor_on; obj.name='on'; } } function addtag(obj,tag) { if (obj.name == 'on') { s = new String(document.all.item('bk_tag').value); del_tag = tag + ' '; re=new RegExp(del_tag, "gi") x=s.replace(re,''); document.all.item('bk_tag').value = x; obj.style.background=tag_bgcolor_off; obj.name='off'; } else { document.all.item('bk_tag').value += tag + ' '; obj.style.background=tag_bgcolor_on; obj.name='on'; } } function CheckCliip(form) { if (! form.bk_url.value) { alert('請輸入鏈結網址!'); return(false); } if (! form.bk_subject.value) { alert('請輸入書籤標題!(請勿空白或超過200個字元)'); return(false); } //if (! form.RootCode.value) { alert('請輸入書籤屬性!'); return(false); } //if (! form.code.value) { alert(document.all.item('code').value); alert('請輸入書籤屬性及分類!'); return(false); } retrun(true); }