/*Add by Bai Cuiyan*/
jQuery(document).ready(function(){
	  log_in();
	  share_one();
	  flash_one();
	 
});
/*1首页登陆框input提示 header input 焦点 begin*/
jQuery(function(){   
    jQuery("#input_comment").each(function(){ //遍历每个文本框
        var objTextBox=jQuery(this);
        var oldText=jQuery.trim(objTextBox.val());
        objTextBox.css("color","#afafaf");
        objTextBox.focus(function(){
            if(objTextBox.val()!=oldText){
                objTextBox.css("color","#333");
            }
            else{
                objTextBox.val("").css("color","#afafaf");
            }
        });
        objTextBox.blur(function(){
            if(objTextBox.val()==""){
                objTextBox.val(oldText).css("color","#afafaf");
            }else{
				check_oldusermail_isuseful(document.getElementById("input_comment"));
				}
        });
        objTextBox.keydown(function(){
            objTextBox.css("color","#333");
        });
    });
});

/*2首页登录提示 begin*/
function log_in()
{
  jQuery("#log_close2").click(function(){
		jQuery("#log_close1").slideUp(300);
    });
}
/*3首页共享资料 begin*/ 
function share_one()
{
 jQuery('#tabshow li').each(function(index){
		jQuery(this).mouseover(function(){					  
			var saveid = jQuery(this);
			timeout = setTimeout(function(){ 
				jQuery('#show div.show').removeClass('show');
				jQuery('#tabshow li.now').removeClass('now');
				jQuery('#show div').eq(index).addClass('show');
				saveid.addClass('now');
			},100);
		}).mouseout(function(){
			clearTimeout(timeout); 
		});
	});	
};
/*4首页右侧小幻灯片 begin*/
function flash_one()
{
 function tab1(o1,o2,c,e){
		o1.each(function(i){
			jQuery(this).bind(e,function(){
				o2.hide().eq(i).show();
				o1.removeClass(c);
				jQuery(this).addClass(c);
			})
			if (jQuery(this).hasClass(c)) {
				jQuery(this).addClass(c);
				o2.hide().eq(i).show();
			}
		})
	}
	function tab2(o1,o2,c,t1,t2,a,b){
		var count=o1.size()-1;
		var now;
		var TimeInterval;
		o1.each(function(i){
			jQuery(this).mouseover(function(){
				//o2.hide().eq(i).show();
				o2.hide().eq(i).stop().fadeTo(0,a).fadeTo(t2,b);
				o1.removeClass(c);
				jQuery(this).addClass(c);
				window.clearInterval(TimeInterval);
			}).mouseout(function(){
				now = i+1;
				TimeInterval = window.setInterval(changeimage,t1);
			});
			//初始化显示
			if (jQuery(this).hasClass(c)) {
				jQuery(this).addClass(c);
				o2.hide().eq(i).show();
				now = i+1;
			}
		})
		
		TimeInterval = window.setInterval(changeimage,t1);
		function changeimage(){
			if(now>count)now=0;
			o2.hide().eq(now).stop().fadeTo(0,a).fadeTo(t2,b);
			o1.removeClass(c).eq(now).addClass(c);
			now++;
		}
	}
	function tab3(o1,o2,o3,c,e){
		o1.each(function(i){
			jQuery(this).bind(e,function(){
				o2.hide().eq(i).show();
				o3.hide().eq(i).show();
				o1.removeClass(c);
				jQuery(this).addClass(c);
			})
			if (jQuery(this).hasClass(c)) {
				jQuery(this).addClass(c);
				o2.hide().eq(i).show();
				o3.hide().eq(i).show();
			}
		})
	}
	function tab4(o1,o2,o3,c,t1,t2,a,b){
		var count=o1.size()-1;
		var now;
		var TimeInterval;
		o1.each(function(i){
			jQuery(this).mouseover(function(){
				o2.hide().eq(i).show();
				o3.hide().eq(i).show();
				o1.removeClass(c);
				jQuery(this).addClass(c);
				window.clearInterval(TimeInterval);
			}).mouseout(function(){
				now = i+1;

				TimeInterval = window.setInterval(changeimage,t1);
			});
			//初始化显示
			if (jQuery(this).hasClass(c)) {
				jQuery(this).addClass(c);
				o2.hide().eq(i).show();
				o3.hide().eq(i).show();
				now = i+1;
			}
		})
		
		TimeInterval = window.setInterval(changeimage,t1);
		function changeimage(){
			if(now>count)now=0;
			o3.hide().eq(now).show();
			o2.hide().eq(now).stop().fadeTo(0,a).fadeTo(t2,b);
			o1.removeClass(c).eq(now).addClass(c);
			now++;
		}
	}
	//调用函数

	tab2(jQuery(".d2 .aa"),jQuery(".d2 .bb"),"on",7000,1200,0.5,1);
    tab1(jQuery(".d0 .aa"),jQuery(".d0 .bb"),"on","click");
	
}
	

	
	
	
	
	
	
	
	





/*Add by Bai Cuiyan*/
