/*
 * 隱藏已來過訪客的迴響輸入欄位
 * http://blog.joytown.tw
 * Date: 2009-03-24
 */

jQuery.noConflict();
jQuery(document).ready(function() {   //開始
if(jQuery('input#author[value!=""]').length>0){   //判斷訪客欄位是否有值
jQuery("#author_info").css('display','none');   //將id為author_info對象的display屬性設為none，即隱藏
var change='<span  id="show_author_info" style="cursor: pointer; color:#2970A6;">change &raquo;</span>';  //定義change，style是定義CSS樣式，讓他有超鏈接的效果，color要根據你自己的來改，當然你也可以在CSS中定義#show_author_info來實現，這樣是為了不用再去修改style.css而已！
var close='<span  id="hide_author_info" style="cursor: pointer;color: #2970A6;">cancel &raquo;</span>';   //定義close
jQuery('#guest').append(change);   //在ID為welcome對象裡加入剛剛定義的change
jQuery('#guest').append(close);    // 加入close
jQuery('#hide_author_info').css('display','none');   //隱藏close
jQuery('#show_author_info').click(function() {   //滑鼠點擊change時發生的事件
jQuery('#author_info').slideDown('slow')   //訪客輸入欄向下滑出
jQuery('#show_author_info').css('display','none');   //隱藏change
jQuery('#hide_author_info').css('display','inline');  //顯示close
jQuery('#hide_author_info').click(function() {  // 滑鼠點擊close時發生的事件
jQuery('#author_info').slideUp('slow')    //訪客輸入欄向上滑
jQuery('#hide_author_info').css('display','none');  //隱藏close
jQuery('#show_author_info').css('display','inline'); })})}})  //顯示change