// JavaScript Document
$(window).load(function(){
						
$("#map > li > ul").addClass("top_menu_2nd");
$(".plist_po > ul").addClass("i_tab_aa1listrp");
$("#map > li > ul")
$("#map > li:eq(1) > ul").addClass("p2");
$("#map > li:eq(2) > ul").addClass("p3");
$("#map > li:eq(5) > ul").addClass("p5");
//产品分类
$(".p_hide > ul").addClass("p4")
$(".p_hide > ul").addClass("top_menu_2nd");
var m2 = $(".p2");
var m3 = $(".p3");
var m5 = $(".p5");
$("#map_ar ul li ul").removeClass("top_menu_2nd");


//产品分类显隐(点击)
var oldhref = $(".i_tab_aa1listrp > li > ul > li > a").attr("href");
var newhref = "javascript:void(0);"
$(".i_tab_aa1listrp > li > ul > li").hover(
		  function () {
			var my_element=$("ul",this);//定义是否存在分类
			if(my_element.length == 0)//判断
			{}else{$("a",this).eq(0).attr("href",newhref);};//存在则清除链接

		  $(this).click( function () {//展开状态
		  $(".i_tab_aa1listrp > li > ul > li > ul").hide();
		  $("ul",this).show();
})
		  },function () { 
		  }
		);



//产品分类显隐(鼠标经过)
/*$(".i_tab_aa1listrp > li > ul > li").hover(
		  function () { 
		  $(".i_tab_aa1listrp > li > ul > li > ul").hide();
		  $("ul",this).show();
		  },
		  function () {
		  }
		);*/
$(".siderbar_lmin > ul > li > ul").show();

	$(".nav02").hover(
		  function () { 
		  $(".top_menu_2nd").hide();
			$(this).append(m2);
			//控制2级菜单宽度end
			$(".top_menu_2nd",this).show();
		  },
		  function () {
			$(".top_menu_2nd",this).hide();
		  }
		);
	$(".nav02_hover").hover(
		  function () {
			  $(".top_menu_2nd").hide();
			$(this).append(m2);
			//控制2级菜单宽度end
			$(".top_menu_2nd",this).show();
		  },
		  function () {
			$(".top_menu_2nd",this).hide();
		  }
		);

		$(".nav03").hover(
		  function () { 
		  $(".top_menu_2nd").hide();
			$(this).append(m3);
			//控制2级菜单宽度end
			$(".top_menu_2nd",this).show();
		  },
		  function () {
			$(".top_menu_2nd",this).hide();
		  }
		);
	$(".nav03_hover").hover(
		  function () {
			  $(".top_menu_2nd").hide();
			$(this).append(m3);
			//控制2级菜单宽度end
			$(".top_menu_2nd",this).show();
		  },
		  function () {
			$(".top_menu_2nd",this).hide();
		  }
		);
	
	

/*$("#marquee4").kxbdSuperMarquee({
				isAuto:false,
				distance:947,
				btnGo:{left:"#goL2",right:"#goR2"},
				direction:'left'
			});
$("#marquee5").kxbdSuperMarquee({
				isAuto:false,
				distance:947,
				btnGo:{left:"#goL3",right:"#goR3"},
				direction:'left'
			});*/

//在选项卡上的运用
	$(".tabdiv").soChange({
		thumbObj:"#change_6 h3",
		slideTime:0,
		thumbOverEvent:true,
		autoChange:false,//自动切换为 false，默认为true
		changeTime:10000, //对象自动切换时间，默认为5000ms，即5秒
    	delayTime:200//鼠标经过时对象切换迟滞时间，推荐值为300ms
	});


});
//图片按比例缩放
var flag=false;
function DrawImage(ImgD,iwidth,iheight){
    //参数(图片,允许的宽度,允许的高度)
    var image=new Image();
    image.src=ImgD.src;
    if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= iwidth/iheight){
        if(image.width>iwidth){  
        ImgD.width=iwidth;
        ImgD.height=(image.height*iwidth)/image.width;
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        //ImgD.alt=image.width+"×"+image.height;
        }
    else{
        if(image.height>iheight){  
        ImgD.height=iheight;
        ImgD.width=(image.width*iheight)/image.height;        
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        //ImgD.alt=image.width+"×"+image.height;
        }
    }
}

