/*
debut js
 */
jQuery(document).ready(function($){

	/*链接平移*/
$('.title a').hover(function() {$(this).stop().animate({'left': '13px'}, 'fast');}, function() {$(this).stop().animate({'left': '0px'}, 'fast');});
$('#contactme a').hover(function() {$(this).stop().animate({'top': '5px'}, 'fast');}, function() {$(this).stop().animate({'top': '0px'}, 'fast');});
	/*随机一句话*/
var say=$('#philna_say');
	say.click(function(){
	$.ajax({
	url: window.location.href,
	type:'POST',
	data: "refresh=philna_say",
	dataType:'html',
	beforeSend:function(){
	say.css('color','#1E947D').hide('slow');
	setTimeout(function(){say.html('<span id="sayload"></span>').show('fast');},500);},
	error:function(request){
	say.html('噢！抱歉，出了点小问题，再试一次！O(∩_∩)O~~');},success:function(data){
	setTimeout(function(){say.hide();say.html(data).show('slow');},1500);
	say.css('color','#1E947D');}
})
});
$('.addcomments').click(function(){
	$('html,body').animate({scrollTop:jQuery('#respond').offset().top}, 'slow');return false;
});
$('.title').click(function(){ 
	if($(this).next().next().is(':visible')){ 
		$(this).children().text('页面载入中……'); 
		window.location = $(this).children().attr('href'); }else{ 
		$(this).next().next().slideToggle(300);
		return false;}
});
$('.title:lt(3)').click();

var browser_ver = $.browser.version;
var accurate_value = browser_ver.substr(0,1);
  $(function() {
	if( browser_ver && accurate_value == '6'){
   $("#cmbgmid").hide();
	}})

/* Sidebar Tab*/
$('#tab-title span').mouseover(function(){ 
	$(this).addClass("current").siblings().removeClass(); 
	$("."+$(this).attr("id")).show().siblings().hide();
});

$(function() {
var author = $('#author').val();
$('#authorData').hide();
if( author !='' && $('#email').val() !='' ) {
 $('#authorData').before('<div id="welcome">嘿，又是你, <strong>' + author + '</strong>！ <a href="#">换个马甲？ &raquo;</a></div>')
}else{$('#authorData').before('<div id="welcome">嗨，朋友,你现在是 <strong>游客 </strong>身份，<a href="#">填写您的大名才能发言!&raquo;</a></div>')}
 $('#welcome a').toggle(
 function() {
 $('#authorData').show(300);
 $(this).html('填写您的大名才能发言! &raquo;');
 return false;},
 function() {
 $('#authorData').hide(300);
 $(this).html('填写您的大名才能发言!&raquo;');
 return false; });
});
/*唠叨*/
$(".laodao span:first").show();
$("#prev").click(function() {
$(".laodao span:visible").toggle(200,function() {
 if ($(this).prev().is("span")) {
     $(this).prev().toggle()} else {
     $(".laodao span:last").toggle()}
   })
 });
 $("#next").click(function() {
  $(".laodao span:visible").toggle(200,function() {
   if ($(this).next().is("span")) {
    $(this).next().toggle()} else {
    $(".laodao span:first").toggle()}
})
});
  var b,a = function() {
  $("#next").trigger("click");
  b = setTimeout(a, 4000)};
  $(".laodao").hover(function() {clearTimeout(b);
  $("#prev,#next").fadeIn("fast")},function() {
  b = setTimeout(a, 4000);
  $("#prev,#next").fadeOut("fast")});
  b = setTimeout(a, 4000);
})

