﻿

$(function(){
    $.fn.extend({
        scrolling:function(jsonCSS){
            var jq_this=$(this);
            jq_this.css({"position":"absolute","z-index":"999","top":"0px"});
            if(jsonCSS) jq_this.css(jsonCSS);
            var pos=jq_this.position();
            var top=pos.top;
           
            setInterval(
                function(){
                    var topDistance=document.documentElement.scrollTop+top+"px";
                    jq_this.animate(
                        {"top":topDistance}
                    );
                },
                500
            );
        }
       
    });
});//联系方式滚动

$(function() {

    //$(".topmenu li").eq(4).addClass("new");
if($("wrapfix1").length)//首页四大版块
{

    $('#wrapfix1 li').hover(function() {
        $(this).siblings().find("a").removeClass('ui-tscure');
        $(this).find("a").addClass('ui-tscure');

        var liid = $(this).attr("id");
        var id = "#ul" + liid;
        $("#tabs1 > ul").hide("fast");

        $(id).show(500);
    });


    $('#wrapfix2 li').hover(function() {
        $(this).siblings().find("a").removeClass('ui-tscure');
        $(this).find("a").addClass('ui-tscure');

        var liid = $(this).attr("id");
        var id = "#ul" + liid;
        $("#tabs2 > ul").slideUp("fast");
        $(id).slideDown(500);
    });



    $('#wrapfix3 li').hover(function() {
        $(this).siblings().find("a").removeClass('ui-tscure');
        $(this).find("a").addClass('ui-tscure');

        var liid = $(this).attr("id");
        var id = "#ul" + liid;
        $("#tabs3 > ul").fadeOut("fast");
        $(id).fadeIn(500);
    });


    $('#wrapfix4 li').hover(function() {
        $(this).siblings().find("a").removeClass('ui-tscure');
        $(this).find("a").addClass('ui-tscure');

        var liid = $(this).attr("id");
        var id = "#ul" + liid;
        $("#tabs4 > ul").fadeOut("fast");
        $(id).fadeIn(500);
    });
    
    }
    
    
  if($(".article_top").length)//顶砸排行榜
  {
    $(".article_top").tabs();
  }
  
   if($("#Appreciate1_Rpt").length)///首页相册效果开始
  {
   
   $("#Appreciate1_Rpt a").fancybox({
	            'transitionIn': 'elastic',
	            'transitionOut': 'elastic',
	            'titlePosition': 'over',
	            'titleFormat': function(title, currentArray, currentIndex, currentOpts) {
	                return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
	            }
	        });
	        }//首页相册效果开始
	        
	        
	        
	        if($("#teacher").length)///首页相册效果开始
  {
   
   $("#teacher a[rel='xy']").fancybox({
	            'transitionIn': 'elastic',
	            'transitionOut': 'elastic',
	            'titlePosition': 'over',
	            'titleFormat': function(title, currentArray, currentIndex, currentOpts) {
	                return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
	            }
	        });
	        }//首页相册效果开始
	        
  
  
  if($(".imglist").length)///相册效果开始
  {
   $(".imglist a").fancybox({
	            'transitionIn': 'elastic',
	            'transitionOut': 'elastic',
	            'titlePosition': 'over',
	            'titleFormat': function(title, currentArray, currentIndex, currentOpts) {
	                return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
	            }
	        });
	        }//相册效果开始
$("#float").show().scrolling({"left":"30px","top":"350px"});//联系方式滚动

if($(".news").length)
{
    $(".news").hover(
        function(){
            $(".topli",$(this)).find("a").css("color","#db1c00");
            $(".word",$(this)).find("a").css("color","#db1c00");
            $(this).css("background-color","#fff");
            
        },
        function(){
            $(".topli",$(this)).find("a").css("color","");
            $(".word",$(this)).find("a").css("color","");
            $(this).css("background-color","");
        }
        
    );
}
 
    
    


}





);
//新闻文字大小变换
function font(obj, size) {
   
    $(obj).css("color", "#e62900");
    $(obj).siblings().css("color", "");
    $("#TxtContent").css("font-size", size + "px").css("line-height", size * 2 + "px");
}