﻿function showSidePanel(id){jQuery(id).addClass("selected");jQuery(id+'_content').fadeIn("slow");var id_combo=id=='#sidel'?'#sider':'#sidel';jQuery(id_combo).removeClass("selected");jQuery(id_combo+'_content').hide();}jQuery(function(){jQuery('#sidel').mouseover(function(){jQuery(this).css("cursor","pointer");}).click(function(){showSidePanel('#sidel');});jQuery('#sider').mouseover(function(){jQuery(this).css("cursor","pointer");}).click(function(){showSidePanel('#sider');});jQuery("input[id='search']").hover(function(){this.src="/wp-content/themes/Ijoel/images/submit_over.png";},function(){this.src="/wp-content/themes/Ijoel/images/submit.png";});jQuery("input[name='s']").focus(function(){if(jQuery(this).val()=='Type text to search here...'){jQuery(this).css({color:"#555"}).val('');}}).blur(function(){if(jQuery(this).val()==''){jQuery(this).css({color:"#999"}).val('Type text to search here...');}});jQuery("input[id='search']").click(function(){if(jQuery("input[name='s']").val()==''||jQuery("input[name='s']").val()=='Type text to search here...'){alert("不输入内容你让我怎么搜?");return false;}else{jQuery(this).submit();}});if(jQuery("input[name='s']").val()==''||jQuery("input[name='s']").val()=='Type text to search here...'){jQuery("input[name='s']").css({color:"#999"}).val('Type text to search here...');}});var id=/^#comment-/;var at=/^@/;jQuery('#commentlist li p a').each(function(){if(jQuery(this).attr('href').match(id)&&jQuery(this).text().match(at)){jQuery(this).addClass('atreply');}});jQuery('.atreply').hover(function(){jQuery(jQuery(this).attr('href')).clone().hide().insertAfter(jQuery(this).parents('li')).attr('id','').addClass('tip').fadeIn(200);},function(){jQuery('.tip').fadeOut(400,function(){jQuery(this).remove();});});jQuery('.atreply').mousemove(function(e){jQuery('.tip').css({left:(40),top:(e.pageY-200)})});jQuery(".re").hide();jQuery("#commentlist li").hover(function(){jQuery(this).find(".re").show().css("cursor","pointer");},function(){jQuery(this).find(".re").hide();});if(jQuery('input#author[value]').length>0){jQuery("#info").css('display','none');var editInfo='<span style=" font-size:14px;cursor:pointer" class="editinfo">&nbsp;&nbsp;&nbsp;&nbsp;Welcome back,edit info?</span>';jQuery('#respond').append(editInfo);jQuery('.editinfo').click(function(){jQuery("#info").slideToggle('slow')})}function rePly(comment_id,author){if(jQuery('#comment').val()!=''){var old=jQuery('#comment').val();jQuery('#comment').val(old+'<a href="#comment-'+comment_id+'">@'+author+':</a>').focus();}else{jQuery('#comment').val('<a href="#comment-'+comment_id+'">@'+author+':</a>').focus();}}

jQuery("a[href*=#]").click(function()
{if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')&& location.hostname == this.hostname)
{var jQuerytarget = jQuery(this.hash);
jQuerytarget = jQuerytarget.length && jQuerytarget || jQuery('[name=' + this.hash.slice(1) +']');
if (jQuerytarget.length)
{var targetOffset = jQuerytarget.offset().top;
jQuery('html,body').animate({scrollTop: targetOffset}, 1000);
return false;
}}
});
