/*function area*/

/* soChnage1.4 */
(function(c){c.fn.soChange=function(d){return new a(this,d)};var b={thumbObj:null,botPrev:null,botNext:null,thumbNowClass:"now",thumbOverEvent:true,slideTime:1000,autoChange:true,clickFalse:true,overStop:true,changeTime:5000,delayTime:300};c.soChangeLong=function(k,f){this.options=c.extend({},b,f||{});var l=c(k);var m=this.options;var n;var q=l.size();var h=0;var j;var d;var i;l.hide();l.eq(0).show();function g(){if(h!=j){if(m.thumbObj!=null){c(m.thumbObj).removeClass(m.thumbNowClass).eq(j).addClass(m.thumbNowClass)}if(m.slideTime<=0){l.eq(h).hide();l.eq(j).show()}else{l.eq(h).fadeOut(m.slideTime);l.eq(j).fadeIn(m.slideTime)}h=j;if(m.autoChange==true){clearInterval(d);d=setInterval(p,m.changeTime)}}}function p(){j=(h+1)%q;g()}if(m.thumbObj!=null){n=c(m.thumbObj);n.removeClass(m.thumbNowClass).eq(0).addClass(m.thumbNowClass);n.click(function(){j=n.index(c(this));g();if(m.clickFalse==true){return false}});if(m.thumbOverEvent==true){n.mouseenter(function(){j=n.index(c(this));i=setTimeout(g,m.delayTime)});n.mouseleave(function(){clearTimeout(i)})}}if(m.botNext!=null){c(m.botNext).click(function(){if(l.queue().length<1){p()}return false})}if(m.botPrev!=null){c(m.botPrev).click(function(){if(l.queue().length<1){j=(h+q-1)%q;g()}return false})}if(m.autoChange==true){d=setInterval(p,m.changeTime);if(m.overStop==true){l.mouseenter(function(){clearInterval(d)});l.mouseleave(function(){d=setInterval(p,m.changeTime)})}}};var a=c.soChangeLong})(jQuery);


(function ($) {
	$.fn.openSelVal = function (target) {
		var _self = this;
		_self.change(function(){
			if (_self.val()!=0) {
				if (target =='self'){
				window.location=_self.val();
			}else{window.open(_self.val());}
			}
		});
	return _self;
	}

	$.fn.autoImgW = function (imgW) {
		var _self = this;
		var w = (imgW == null)?_self.width():imgW;
		var img = _self.find('img');
		img.each(function (i) {
			var iW = $(this).width();
			var iH = $(this).height();
			var iSrc = $(this).attr('src');
			if(iW>=w){
				$(this).css({width:w,height:iH*(w/iW)}).wrap("<a href="+iSrc+" target='_blank' title='点击在新页面查看大图' ></a>")
			}
		});
	return _self;
	}

})(jQuery);


/*use*/
$(function () {

if ($('.mainNav').length) {
	var aObj = $('.mainNav li a').not('.mainNav li.now a');
	var aChange;
	aObj.css({display:'block',opacity:'0'});
	aObj.mouseenter(function () {
		var _self = $(this);
		aChange = setTimeout(function () {
			_self.animate({opacity:"1"},360);
		},200);
	});
	aObj.mouseleave(function () {
		clearTimeout(aChange);
		$(this).animate({opacity:"0"},360);
	});
}


if ($('.indexCont_b').length) {
	var arr=[];
	var len = $('.indexCont_b .div_thumb img').size();
	arr.push('<ul class="ul_thumbIndex">');
	for (var i = 0; i <len; i++) {
		arr.push('<li>'+i+'</li>');
	};
	arr.push('</ul>');
	$('.indexCont_b .div_thumb').append(arr.join(''));

	$('.indexCont_b .div_thumb img').soChange({
		thumbObj:'.div_thumb .ul_thumbIndex li'
	});

}

if ($('.h4_nowDate').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();
    $('.h4_nowDate').html(myyear+"年"+mymonth+"月"+myday+"日 "+myweekday);
}

if ($('.ul_footerQuick').length) {
	$('.ul_footerQuick .drop').openSelVal();
}

if ($('.jobQuickBox').length) {
new Marquee("ul_jobScroll",2,1,450,22,50,0,0,1);
}

if ($('.editorOutput').length) {
	$(".editorOutput").autoImgW(610);
}

});


