$(document).ready(function(){
		$ (".pic_list img").hover(function(){clearInterval(_play)}, function(){play()});	
		$ (".pic_title > li").hover(function(){
							clearInterval(_play);
							_num = $ (".pic_title > li").index(this);
							change(_num);
										}, function(){play()});
		
		$ (".sch_pics img").hover(function(){clearInterval(_play2)}, function(){play2()});	
		$ (".sch_title > li").hover(function(){
							clearInterval(_play2);
							_num2 = $ (".sch_title > li").index(this);
							change2(_num2);
										}, function(){play2()});
		
    play();
	play2();
	
});
var _num = _play = 0;
var _num2 = _play2 = 0;
var _tm = null;
var _tm2 = null;
function play(){ _play = setInterval("auto()", 3000);}
function play2(){ _play2 = setInterval("auto2()", 3000);}
function change(num)
{
    $ (".pic_title > li").attr('class','').eq(num).attr('class','select').blur();
    //$ (".pic_list img").hide().eq(num).slideDown('slow');
	var h = $ (".pic_list img")[0].height;
	var t = $ (".pic_list img").length;
	$ (".pic_list img").eq(0).animate({marginTop:-h*num}, {duration:500});
	if(num >= t-1){
		_tm = setTimeout(function(){
							  $ (".pic_list img").eq(0).animate({marginTop:0}, {duration:500});
							  },2500);
	}else if(_tm != null){
		clearTimeout(_tm);
		_tm = null;
	}
}
function change2(num)
{
    $ (".sch_title > li").attr('class','').eq(num).attr('class','select').blur();
    //$ (".sch_pics a").hide().eq(num).fadeIn('slow');
	
	var h = $ (".sch_pics a").get(num).offsetHeight;
	var t = $ (".sch_pics a").length;
	
	$ (".sch_pics a").eq(0).animate({marginTop:-h*num}, {duration:500});
	if(num >= t-1){
		_tm2 = setTimeout(function(){
							  $ (".sch_pics a").eq(0).animate({marginTop:0}, {duration:500});
							  },2500);
	}else if(_tm2 != null){
		clearTimeout(_tm2);
		_tm2 = null;
	}
}
function auto()
{    
	_num = _num > 3 ? 0 : _num + 1;
	change(_num);
}
function auto2()
{    
    _num2 = _num2 > 4 ? 0 : _num2 + 1;
    change2(_num2);
}
