// JavaScript Document
var FoctsAuto;

function caseListImg(){
	var $bigImgDiv,$smlImgDiv;
	$bigImgDiv = $('#caseList .caseBigImg');
	$smlImgDiv = $('#caseList .caseSmallImg img');
	$smlImgDiv.mouseover(function(){
		$bigImgDiv.stop();
		var bigImgWidth = $bigImgDiv.find('img').eq(0).width();
		var smlImgIndex = $(this).attr('name');
		var scrollValue = bigImgWidth*smlImgIndex;
		$(this).parent().find('img').removeClass('this');
		$(this).addClass('this');
		$(this).parent().prevAll('.caseBigImg').animate({scrollTop:scrollValue},'slow');
	
	})	
}

function infoImg(){
	var $imgList = $('#imgList');
	var liNUm = $imgList.find('li').length;
	var liWidth = $imgList.find('li').outerWidth();
	$imgList.find('ul').width(liNUm*liWidth);
	$('#imgAttLeft a').click(function(){
		//$imgList.stop();
		$imgList.animate({scrollLeft:$imgList.scrollLeft() - liWidth *3},'slow');
		return false;
	});
	$('#imgAttRight a').click(function(){
		//$imgList.stop();
		$imgList.animate({scrollLeft:$imgList.scrollLeft() + liWidth *3},'slow');
		return false;
	});
	viewAll();
}

function viewAll(){
	var ulWidth;
	$('#viewAll').toggle(function(){
		ulWidth = $('#imgList>ul').width();
		$('#imgList').css({height:'auto',overflow:'auto'}).find('ul').css('width','auto');
		$('#viewAll').text('返回滚动');
		return false;
	},function(){
		$('#imgList').css({height:'170px',overflow:'hidden'}).find('ul').css({width:ulWidth},'slow');
		$('#viewAll').text('全部显示');
		return false;
	})	
}
var $proDD,$proDL;
function productView(){
	$proDD = $('#content .contentLeftMenu dd');
	$proDL = $('#productView dl');
	$proDD.mouseover(function(){
		var thisNum = $(this).attr('name');
		$proDD.find('a').removeClass('this')
		$(this).find('a').addClass('this');
		$proDL.hide();
		$proDL.eq(thisNum-1).fadeIn();
	});
	$proMinImg = $('#productView dl dd a');
	$proMinImg.mouseover(function(){
		var thisNum = $(this).attr('name');
		$(this).parent().nextAll('dt').hide();
		$(this).parent().nextAll('dt').eq(thisNum-1).show();
	})
}
function TwoClass(){
	var TwoClassId ='#' + $('body').attr('class');
	if($('#leftMenu').find(TwoClassId).find('a').length < 1){
		return false;
	}else{
		setTimeout(function(){$('#leftMenu').find(TwoClassId).slideDown("slow")},600);
	};
	
	//alert($TwoClassId);
}
function bodyHeight(){
	//var bodyHeightVal = $('body').height() - 34;
	//$('#bodys').height(bodyHeightVal).show();
}
function TuiJianClass(){
	var $TuiJianClassItem = $('#banner').find('.focusTit'),$TuiJianNR = $('#TuiJianNR');
	//alert($TuiJianClassItem.length);
	$TuiJianClassItem.find('a').hover(
		function(){if($(this).attr('class') == 'this'){
				return false;
			}else{
				$(this).animate({height:'38px',lineHeight:'38px',marginTop:'22px'},'fast')
			}
		},
		function(){if($(this).attr('class') == 'this'){
				return false;
			}else{
				$(this).animate({height:'32px',lineHeight:'32px',marginTop:'28px'},'fast',function(){$(this).removeAttr('style')});
			}
		}
	);
	$TuiJianClassItem.find('a').click(
		function(){
			$TuiJianClassItem.find('a').removeClass('this');
			$(this).addClass('this');
			$TuiJianClassItem.find('a').removeAttr('style');
			$TuiJianNR.animate({scrollLeft:$TuiJianClassItem.find('a').index($(this))*598},'slow');
			return false;
		}
	);
}