/*图片轮换*/
$(document).ready(function () {
	if($(".changeBox_a1").length){
		$('#change_3 .a_bigImg img').soChange({
			thumbObj:'#change_3 .ul_change_a2 span',//导航为数字形式，选择器指向包含数字的span对象
			thumbNowClass:'on',//自定义导航对象当前class为on
			changeTime:4000//自定义切换时间为4000ms
		});	
	}
});

/*当前时间*/
$(function getTime() {
	if ($('#time').length) {
		var d=["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
		var today=new Date();
		var myweekday=d[today.getDay()];
		var mymonth=today.getMonth()+1;
		var myday= today.getDate();
		var myyear= today.getFullYear();
		$('#time').html(myyear+"年"+mymonth+"月"+myday+"日 "+myweekday);  
	}
});
/*文字大中小*/
$(function () {
	if($(".newsInfo span").length){
		$(".fSize1").click(function () {
		//alert("a");
			$(".editorOutput").css({"font-size":"16px"});
		});
		$(".fSize2").click(function () {
			$(".editorOutput").css({"font-size":"14px"});
		});
		$(".fSize3").click(function () {
			$(".editorOutput").css({"font-size":"12px"});
		});
	}
});

$(function(){
	if($(".indService").length){
		var a = $(".indService h2.a2 a");
		a.each(function(i){
			$(this).mouseover(function(){
				a.removeClass("now");
				$(this).addClass("now");
				$(".indService .tab").hide();
				$(".indService .tab").eq(i).show();
			});
		});
	}

	if($(".culture").length){
		var a = $(".culture h2.a6");
		a.eq(0).addClass("now");
		$(".culture .tabCon").hide();
		$(".culture .tabCon").eq(0).show();
		a.each(function(i){
			$(this).mouseover(function(){
				a.removeClass("now");
				$(this).addClass("now");
				$(".culture .tabCon").hide();
				$(".culture .tabCon").eq(i).show();
			});
		});
		
		var url = location.href;
		var url2 = url.charAt(url.length-1);
		if(Number(url2)){
			a.removeClass("now");
			a.eq(url2).addClass("now");
			$(".culture .tabCon").hide();
			$(".culture .tabCon").eq(url2).show();
		}
	}
	
	if($(".career").length){
		var titles = $(".career h2.a5");
		var boxs = $(".career .posContent");
		boxs.hide();
		$(".posContent:last").show();
		titles.each(function(i) {
			$(this).click(function(){
				boxs.hide();
				boxs.eq(i).slideDown();
			});
		});
	}
});

//11#####
	$.extend({
		AddFavorite:function(sURL, sTitle){
			try{
				window.external.addFavorite(sURL, sTitle);
			}
			catch (e){
				try{
					window.sidebar.addPanel(sTitle, sURL, "");
				}
				catch (e){
					alert("加入收藏失败，请使用Ctrl+D进行添加");
				}
			}
		},
		SetHome:function(obj,vrl){
			try{
                obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
			}
			catch(e){
					if(window.netscape) {
							try {
									netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
							} 
							catch (e) { 
									alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'"); 
							}
							var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
							prefs.setCharPref('browser.startup.homepage',vrl);
					 }
			}
		}
	});


	//#AddFavorite | 添加收藏
$(document).ready(function(){
	$(".tn1 a").click(function(){$.AddFavorite(window.location,document.title)});
});

//
//#SetHome | 设为首页
//#用法 | $("a#setHome").click(function(){$.SetHome(this,window.location)});
