/*新增公共函数库*/
document.write("<script src=\"http://www.cali-light.com/templets/led2011/script/common.201112.js\"></script>");
/*图片渐现*/
document.write("<script src=\"http://www.cali-light.com/templets/led2011/script/lazyload.js\"></script>");

var index201112 = {
	'emaildy' : function(){
		$('#emaildyform').bind('submit',function(){
			$('.mailInput #to').val($('#emaildy').val());
			$('.mailInput form').eq(0).submit();
			return false;
		});
	},
	'topnewyearad' : function(){
		if($('.newyearad').size()==0){
			$('<div>').html('<a href="http://www.cali-light.com/zt/zts/baichideng/" target="_blank"><img src="http://www.cali-light.com/templets/led2011/images/top.jpg"/></a>').addClass('newyearad').insertAfter('.topnav').addClass('newyearad_big');
			//延时显示大图
			window.setTimeout(function(){
					//显示大图
					$('.newyearad').animate({'height':'150px','marginTop':'2px'},600,function(){
						//延时收缩
						window.setTimeout(function(){
							$('.newyearad').animate({'height':'0px'},600,function(){
								$(this).find('img').attr('src','http://www.cali-light.com/templets/led2011/images/top2.png');
								$('.newyearad').animate({'height':'35px'},200,function(){
									//$('body').addClass('bodybg');
								});
							});
						},8000);
					});
			},2000);
		}
	}
}


$(document).ready(function(){
	//检测登录
	common201112.checklogin();
	//搜索关键词
	common201112.inputFocusBlur('#keyword','请输入你要查找的内容');
	//Email订阅
	common201112.inputFocusBlur('#emaildy','请输入您的邮箱');
	//广告位A1切换
	//opacityv.init('.ad1ppt',6000);
	//导航条搜索Tab切换
	common201112.searchtab();
	common201112.mainnav();
	common201112.boxnav('.zmyx');
	common201112.boxnav('.calinews');
	common201112.frlinknav();
	common201112.b2bcate();
	common201112.underpptbox();
	common201112.weiboscr();
	common201112.goTopfun();
	//Email订阅
	index201112.emaildy();
	//庆元旦-迎新年
	index201112.topnewyearad();

	//图片渐现
	$("img").lazyload({
		placeholder : "/images/s.gif",
		effect      : "fadeIn",
		threshold : 100,
		failurelimit: 10
	});


});




