/**
 * @author Alexander Farkas
 * v. 1.02
 */
(function($) {
	$.extend($.fx.step,{
	    backgroundPosition: function(fx) {
            if (fx.state === 0 && typeof fx.end == 'string') {
                var start = $.curCSS(fx.elem,'backgroundPosition');
                start = toArray(start);
                fx.start = [start[0],start[2]];
                var end = toArray(fx.end);
                fx.end = [end[0],end[2]];
                fx.unit = [end[1],end[3]];
			}
            var nowPosX = [];
            nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
            nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
            fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];

           function toArray(strg){
               strg = strg.replace(/left|top/g,'0px');
               strg = strg.replace(/right|bottom/g,'100%');
               strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
               var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
               return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
           }
        }
	});
})(jQuery);




$(function(){

	$('#now_sidebar')
		.css( {backgroundPosition: "-4px 0px"} )


	$('#sidebar_list a')
		.css( {backgroundPosition: "-4px 21px"} )
		.mouseover(function(){

			$(this).stop().animate({backgroundPosition:"(-4px 0px)"}, {duration:300})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(-4px -21px)"}, {duration:300, complete:function(){
				$(this).css({backgroundPosition: "-4px 21px"})
			}})
		})



});

// JavaScript Document
function doZoom(size)
{
var zoom=document.all?document.all['Zoom']:document.getElementById('Zoom');
zoom.style.fontSize=size+'px';
}
function addfavorite()
{
   if (document.all)
   {
      window.external.addFavorite("http://www.xyjt.com","新源集团");
   }
   else if (window.sidebar)
   {
      window.sidebar.addPanel("新源集团", "http://www.xyjt.com", "");
   }
}

function creatediv(src)
{
    var scrollPos;
    var w;
    var zx;
    var t;
    if (typeof document.compatMode != 'undefined' &&      document.compatMode != 'BackCompat')
    {
        scrollPos = document.documentElement.scrollHeight;
        w = document.documentElement.scrollWidth;
    }
    else if (typeof document.body != 'undefined')
    {
        scrollPos = document.body.scrollHeight;
        w = document.body.scrollWidth;
    }
    document.getElementById("ceng").style.height=scrollPos+"px";
    document.getElementById("ceng").style.width=w+"px";
    document.getElementById("ceng").style.display="block";
    document.getElementById("cengMid").style.display="block";
    if (document.documentElement && document.documentElement.scrollTop)
    {
        t = document.documentElement.scrollTop;
    }
    else {
        t = document.body.scrollTop;
    }
    document.getElementById("openimg").src = src ;
    document.getElementById("cengMid").style.top=t + "px";
}
function hideLayer()
	{
		document.getElementById("ceng").style.display="none";
		document.getElementById("cengMid").style.display="none";
	}


//初始化
var def="1";
function mover(object){
  //主菜单
  var mm=document.getElementById("m_"+object);
  mm.className="m_li_a";

  //子菜单
  var ss=document.getElementById("s_"+object);
  ss.style.display="block";
}

function mout(object){
  //主菜单
  var mm=document.getElementById("m_"+object);
  mm.className="m_li";

  //子菜单
  var ss=document.getElementById("s_"+object);
  ss.style.display="none";

}

