jQuery.extend({easing: {easein: function(x, t, b, c, d) {return c*(t/=d)*t + b; },easeinout: function(x, t, b, c, d) {if (t < d/2) return 2*c*t*t/(d*d) + b;var ts = t - d/2;	return -2*c*ts*ts/(d*d) + 2*c*ts/d + c/2 + b;},easeout: function(x, t, b, c, d) {return -c*t*t/(d*d) + 2*c*t/d + b;},expoin: function(x, t, b, c, d) {var flip = 1;if (c < 0) {flip *= -1;c *= -1;}return flip * (Math.exp(Math.log(c)/d * t)) + b;},expoout: function(x, t, b, c, d) {var flip = 1;if (c < 0) {flip *= -1;c *= -1;}return flip * (-Math.exp(-Math.log(c)/d * (t-d)) + c + 1) + b;},expoinout: function(x, t, b, c, d) {var flip = 1;if (c < 0) {flip *= -1;c *= -1;}if (t < d/2) return flip * (Math.exp(Math.log(c/2)/(d/2) * t)) + b;return flip * (-Math.exp(-2*Math.log(c/2)/d * (t-d)) + c + 1) + b;},bouncein: function(x, t, b, c, d) {return c - jQuery.easing['bounceout'](x, d-t, 0, c, d) + b;},bounceout: function(x, t, b, c, d) {if ((t/=d) < (1/2.75)) {return c*(7.5625*t*t) + b;} else if (t < (2/2.75)) {return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;} else if (t < (2.5/2.75)) {return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;} else {return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;}},bounceinout: function(x, t, b, c, d) {if (t < d/2) return jQuery.easing['bouncein'] (x, t*2, 0, c, d) * .5 + b;return jQuery.easing['bounceout'] (x, t*2-d,0, c, d) * .5 + c*.5 + b;},elasin: function(x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;if (a < Math.abs(c)) { a=c; var s=p/4; }else var s = p/(2*Math.PI) * Math.asin (c/a);return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;},elasout: function(x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;if (a < Math.abs(c)) { a=c; var s=p/4; }else var s = p/(2*Math.PI) * Math.asin (c/a);return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;},elasinout: function(x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);if (a < Math.abs(c)) { a=c; var s=p/4; }else var s = p/(2*Math.PI) * Math.asin (c/a);if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;},backin: function(x, t, b, c, d) {var s=1.70158;return c*(t/=d)*t*((s+1)*t - s) + b;},backout: function(x, t, b, c, d) {var s=1.70158;return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;},backinout: function(x, t, b, c, d) {var s=1.70158;if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;},linear: function(x, t, b, c, d) {return c*t/d + b; }}});
(function($){$.fn.extend({Scroll:function(opt,callback){if(!opt) {var opt={}; }var _this=this.eq(0).find("ul:first"); var lineH=_this.find("li:first").height();var line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10);var speed=opt.speed?parseInt(opt.speed,10):500; var timer=opt.timer?parseInt(opt.timer,10):3000; if(line==0){ line=1;}var upHeight=0-line*lineH; scrollUp=function(){_this.animate({marginTop:upHeight},speed,function(){for(i=1;i<=line;i++){_this.find("li:first").appendTo(_this);}_this.css({marginTop:0});});};_this.hover(function(){clearInterval(timerID);},function(){timerID=setInterval("scrollUp()",timer);}).mouseout();}        })})(jQuery);
function initAceImgBoxIE6()
{
	var optNav="";
	$(".ace_imgviewbox a").each(function(i){
			if(i==0)
			{
				optNav='<a href="javascript:void(0);" class="'+$(this).attr("ncls")+' activeSlide" title="'+$(this).attr("title")+'" onclick="IE6Switch('+i+')"></a>';
			}
			else
			{
				optNav+='<a href="javascript:void(0);"  class="'+$(this).attr("ncls")+'" title="'+$(this).attr("title")+'" onclick="IE6Switch('+i+')"></a>';
			}
	});
	$(".ace_imgnavbox").html(optNav);
	$(".ace_imgviewbox a:gt(0)").hide();
	totalSwitchNum=$(".ace_imgviewbox a").length;
	IE6Timer=setTimeout("IE6AutoSwitch()",5000);
	setTimeout("initToop();",1000);
}
var IE6Timer;
var now=0;
var totalSwitchNum=0;
function IE6AutoSwitch()
{
	id=now;
	id++;
	if(id<totalSwitchNum)
	{
	}
	else
	{
		id=0;
		
	}
	
	IE6Switch(id);
	
}
function IE6Switch(id)
{
	
	if(id!=now)
	{
		clearTimeout(IE6Timer);
		$(".ace_imgnavbox a").removeClass("activeSlide");
		$(".ace_imgnavbox a").eq(id).addClass("activeSlide");
		$(".ace_imgviewbox a").eq(now).fadeOut("fast",function(){
			now=id;
			$(".ace_imgviewbox a").eq(id).fadeIn("slow");			
			IE6Timer=setTimeout("IE6AutoSwitch()",5000);
		});
	}
	
}
function RefreshImage(valImageId) {
	var objImage = document.getElementById(valImageId);
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}
function switchM(id)
{
	var t=6;
	for(i=1;i<=t;i++)
	{
		if(id==i)
		{
			$("#secM"+i).show();
		}
		else
		{
			$("#secM"+i).hide();
		}
	}
}

function switchMenu(el,obj)
{
	var stimer;
	$("#"+obj).addClass("swiOn");
	
	$("#"+obj).one("mouseout", function(){stimer=setTimeout('$("#'+el+'").hide();$("#'+obj+'").removeClass("swiOn");',100);});

	var elO=$("#"+obj).offset();
	
	var oH=$("#"+obj).outerHeight();
	$("#"+el).css({"left":""+elO.left+"px","top":""+(elO.top+oH)+"px","opacity":"0.8"}).show().one("mouseover",function(){clearTimeout(stimer);}).menuHover({delay:100,cfunc:'$("#'+obj+'").removeClass("swiOn");'});
	
}
 function FP_jumpMenu(el,frm,sel) {//v1.0
       var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
       if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
        }
function AddFavorite(sURL, sTitle)
{
    try
        {
            window.external.addFavorite(sURL, sTitle);
        }
    catch (e)
    {
        try
            {
                 window.sidebar.addPanel(sTitle, sURL, "");
            }
        catch (e)
            {
                alert("加入收藏失败，请使用Ctrl+D进行添加");
            }
    }
}
function SetHome(obj,vrl){
    try
        {
            obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
        }
    catch(e)
    {
        if(window.netscape) 
        {
            try {
                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
            } 
            catch (e) 
            { 
                 alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'"); 
            }
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage',vrl);
    }
    }
}
(function($) {
	$.fn.menu = function(options) {
		options = $.extend({
			delay: false
		}, options);
		return this.each(function(){
                var ol=$(this);
				
                ol.find('li:has(ul)').each(function(i){
                    if(i>0)
                    {
						
                        $(this).find("a:first").addClass("subul");
                    }
					else
					{
						$(this).find("a:first").addClass("fistsubul");	
					}
                }
                );
		        ol.find('li:has(ul)').hover(

			        function() {

				        var t = $(this);
				        var f=t.css("float");
                        var w=t.width();
				        t.css('position','relative');
				        t.find("a:first").addClass("hoveron").css({'opacity':1});
				        t.data('hide_menu', false);
                       if(f!="left")
                       {
                            t.find('>ul').css({'left': w+'px'});
                       }
				       t.find('>ul').css({'display': 'block','z-index':'999'});

			        },

			        function() {

				        var t = $(this);

				         t.find("a:first").removeClass("hoveron")

				        t.data('hide_menu', true);

				        var hide_menu = function() {

					        if (t.data('hide_menu')) {

						        t.find('>ul').css('display', 'none'); // 可以将词句换成动画效果

					        }

				        };

				        options.delay ? setTimeout(hide_menu, options.delay) 

						        : hide_menu();

			        }

		        );
            });
	    };

    })(jQuery);

function initLeftMenu()
{
	//$(".sec_left").find('li:has(ul)').each(function(){
//		var t = $(this);
//		t.addClass("subu");
//		//t.find("a:first").bind("click",function(){
////						t.find("ul").toggle();
////				  }
////			);
//	});
	try
	{
		$('.sec_leftMenu').menu({delay: 100});
	}
	catch(e){}
}
function initTopBar()
{
	setTimeout(function(){
						$(".topareax").slideUp("fast",function(){$(".toptogglebox").slideDown();});
						},2000)	
}
function goJiSuPingtA()
{
	$("#loaddingGO").html("跳转中... ...请稍候").slideDown("slow",function(){
		 $.post("../ajaxgo.asp", { Action: "post", ActionType:1},
				function (data, textStatus){
					var url=data.result;
					$("#loaddingGO").html("即将跳转至："+url);
					setTimeout(function(){
							$("#loaddingGO").slideUp("slow",function(){
								location.href=url;	
								return false;
									});
						},1000)
				}, "json");																   
	});
}
function initSearchBox()
{
	$(".btop-right-top").hover(function(){$(this).addClass("btop-right-top_hover");},function(){$(this).removeClass("btop-right-top_hover");})
	//$("#sechformboxx").hover()	
}
