jQuery(document).ready(function($) {

// 消除鏈接虛線
$('a,input[type="submit"],button[type="button"],object').bind('focus',function(){if(this.blur){ this.blur();}});

$('#up').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);}); 
//点击id="shang"对象时，滑动至相对浏览器滚动条为0px（即顶部），时间为800毫秒
$('#comt').click(function(){$('html,body').animate({scrollTop:$('#respond').offset().top}, 800);});
//点击id="comt"对象时，滑动至id="comment"相对浏览器滚动条的距离，时间为800毫秒
$('#down').click(function(){$('html,body').animate({scrollTop:$('#footer').offset().top}, 800);});

$(".linkp a").each(function(e){
	$(this).prepend("<img src=http://www.google.com/s2/favicons?domain="+this.href.replace(/^(http:\/\/[^\/]+).*$/, '$1').replace( 'http://', '' )+" style=float:left;padding:5px;>");
});

$('#content p a').each(function(){
  var a_href = $(this).attr('href').toLowerCase();
  var file_type = a_href.substring(a_href.lastIndexOf('.'));
  if (file_type == '.jpg'){$(this).addClass('thickbox')};
});
});// end jQ


// 貼圖
function EmbedImages() {var URL = prompt('请输入图片的 URL 地址:', 'http://');if (URL) {document.getElementById('comment').value = document.getElementById('comment').value + '[img]' + URL + '[/img]';}}

// 表情伸縮
function EmbedSmiley() {jQuery('#smiley').slideToggle();}

// 表情文字替換圖片
function grin(tag) { var myField; tag = ' ' + tag + ' '; if (document.getElementById('comment') && document.getElementById('comment').type == 'textarea') { myField = document.getElementById('comment'); } else { return false; } if (document.selection) { myField.focus(); sel = document.selection.createRange(); sel.text = tag; myField.focus(); } else if (myField.selectionStart || myField.selectionStart == '0') { var startPos = myField.selectionStart; var endPos = myField.selectionEnd; var cursorPos = endPos; myField.value = myField.value.substring(0, startPos) + tag + myField.value.substring(endPos, myField.value.length); cursorPos += tag.length; myField.focus(); myField.selectionStart = cursorPos; myField.selectionEnd = cursorPos; } else { myField.value += tag; myField.focus();}}
