function AutoScroll(obj){
        $(obj).find("ul:first").animate({
                marginTop:"-32px"
        	},500,function(){
                $(this).css({marginTop:"0px"}).find("li:first").appendTo(this);
        });
}
function play_brand(){
	$("#brand").load("/ajax/brand_v3.asp");
}
$(document).ready(function(){
	$("#brand").load("/ajax/brand_v3.asp");
	setInterval('AutoScroll("#board")',3000);
	setInterval('play_brand()',8000);




	/*---------------div ÏÔÒþ------------------*/
	$("#product_btn ul li:first").addClass("cur");
	$("#product_list .product:not(:first)").hide();
	$("#product_title div:not(:first)").hide();
	
	$("#product_btn ul li").click(function(){
		$("#product_list .product").hide();
		$("#product_btn ul li").removeClass("cur");
		$(this).addClass("cur");
		var oid = $(this).attr("lang");
		$("#"+oid).show();
		$("#product_title div").hide();
		$("#k_"+oid).show();
	});
	/*--------------------------------------------*/



	$("#skin a b").click(function(){
		$("#menu").removeClass();
		$("#menu").addClass("box");
		$("#menu").addClass($(this).attr("class"));
		$("menu").load("/ajax/skin.asp?skin="+$(this).attr("class"));
	});
	$("#skin a").click(function(){
		$("#skin a").removeClass("cur");
		$(this).addClass("cur");
	});
	$("#btn_login,#login form .lt a").click(function(){$("#login form").toggleClass("hide");});
	$("#factory table tbody tr:odd").addClass("even");
	$("#sub_job table tr:even,#sub_user table tr:even").addClass("even");
	$("#sub_job table tr,#sub_user table tr").mouseover(function(){
		$(this).addClass("msov").mouseout(function(){
			$(this).removeClass("msov");
		});
	});
	
	$(".auto select").change(function(){
		$("#"+$(this).attr("lang")).val($(this).val());
	});
});

jQuery.fn.ImageAutoSize = function(width){
	$("img",this).each(function(){
		var image = $(this);
		if(image.width()>width)
		{
			image.width(width);
			image.height(width/image.width()*image.height());
		}
	});
} 
$(function(){
	$(".help").ImageAutoSize(660);
	$("#picture").ImageAutoSize(916);
}); 
