// JavaScript Document

/******首页所有切换********/
/*****头部菜单切换******/
/*function menu_qh(id,id2,tag,tag2,num){
var $ = function(id){return typeof id==='string'?document.getElementById(id):id;};
var $$ = function(tagname,obj){return (this.$(obj)||document).getElementsByTagName(tag)};
var tag2 = $$(tag2,id2);
var tag1 = $$(tag,id);
for(var i=0;i<5;i++)
{
if(i==num)
{
tag1.className = "over_"+i;
alert(tag1.className);
}
}
	
}*/

function link(sel) {
    if (sel) {
        var op = sel[sel.selectedIndex];
        if (op && op.value) {
            window.open(op.value, op.text);
        }
    }
}

function qh() { }
qh.lm = function() {
    jQuery(document).ready(function() {
        jQuery(".mune_onemenu>ul").children("li").mouseover(function() {
            var t = jQuery(this).index();
            jQuery(this).children("a").addClass(function() { return "over_" + t });
            jQuery("#menu_all>div").eq(t).css("display", "block").siblings().css("display", "none");
            for (var i = 0; i < 5; i++) {
                if (i != t)
                { jQuery(".mune_onemenu>ul").children("li").eq(i).children("a").removeClass(function() { return "over_" + i }) }
            }

        })
        /*****新闻中心*****/
        jQuery("#i_news>ul").children("li:even").mouseover(function() {
            var l = jQuery(this).index();
            jQuery(this).addClass("font_W").siblings().removeClass("font_W");
            jQuery("#i_new_box>ul").eq(l).css("display", "block").siblings().css("display", "none");
        })
        /*****政府文件*****/
        jQuery("#i_zwwjbox_boxx>ul").children("li").mouseover(function() {
            var l = jQuery(this).index();
            jQuery(this).addClass("over").siblings().removeClass("over");
            jQuery("#i_zwwjbox_child_boxx>ul").eq(l).css("display", "block").siblings().css("display", "none");
            var livalue = jQuery(this).html();
            var cids = jQuery("#i_zwwjbox_boxx").children("a").attr("id");
            var cid = 0;
            if (livalue.indexOf("政府文件") >= 0) {
                if ('' != cids && cids.split('|').length > 0) {
                    cid = cids.split('|')[0];
                }
                jQuery("#i_zwwjbox_boxx").children("a").attr("href", "http://www.jieyang.gd.cn/List.aspx?q_cid=" + cid);
            }
            else {
                if ('' != cids && cids.split('|').length > 1) {
                    cid = cids.split('|')[1];
                }
                jQuery("#i_zwwjbox_boxx").children("a").attr("href", "http://www.jieyang.gd.cn/List.aspx?q_cid=" + cid);
            }
        })
        /*****政策法规*****/
        jQuery("#i_zwwjbox_box2>ul").children("li").mouseover(function() {
            var l = jQuery(this).index();
            jQuery(this).addClass("over").siblings().removeClass("over");
            jQuery("#i_zwwjbox_child_box2>ul").eq(l).css("display", "block").siblings().css("display", "none");
            var livalue = jQuery(this).html();
            var cids = jQuery("#i_zwwjbox_box2").children("a").attr("id");
            var cid = 0;
            if (livalue.indexOf("政策法规") >= 0) {
                if ('' != cids && cids.split('|').length > 0) {
                    cid = cids.split('|')[0];
                }
                jQuery("#i_zwwjbox_box2").children("a").attr("href", "http://www.jieyang.gd.cn/List.aspx?q_cid=" + cid);
            }
            else {
                if ('' != cids && cids.split('|').length > 1) {
                    cid = cids.split('|')[1];
                }
                jQuery("#i_zwwjbox_box2").children("a").attr("href", "http://www.jieyang.gd.cn/List.aspx?q_cid=" + cid);
            }
        })
        /*****政务邮箱*****/
        jQuery("#i_maillogin_box>ul").children("li").mouseover(function() {
            var l = jQuery(this).index();
            jQuery(this).addClass("over").siblings().removeClass("over");
            jQuery("#i_maillogin_child_box>ul").eq(l).css("display", "block").siblings().css("display", "none");
        })
        /*****视频*****/
        jQuery("#i_video_box>ul").children("li").mouseover(function() {
            var l = jQuery(this).index();
            jQuery(this).addClass("over").siblings().removeClass("over");
            jQuery("#i_video_child_box>ul").eq(l).css("display", "block").siblings().css("display", "none");
        })
        /*****网上调查*****/
        jQuery("#i_zwgg_box>h2").children("span").mouseover(function() {
            var l = jQuery(this).index();
            jQuery(this).addClass("over").siblings().removeClass("over");
            jQuery("#i_zwgg_child_box>ul").eq(l).css("display", "block").siblings().css("display", "none");
            var livalue = jQuery(this).html();
            if (livalue.indexOf("网上") >= 0) {
                jQuery("#i_zwgg_box>h2").children("a").attr("href", "http://www.jieyang.gd.cn/SurveyList.aspx?q_sta=0");
            }
            else {
                jQuery("#i_zwgg_box>h2").children("a").attr("href", "http://www.jieyang.gd.cn/CollectList.aspx?q_sta=0");
            }
        })
        /*****市政府连接*****/
        jQuery("#i_links_box>ul").children("li").mouseover(function() {
            var l = jQuery(this).index();
            jQuery(this).addClass("over").siblings().removeClass("over");
            jQuery("#i_links_child_box2>ul").eq(l).css("display", "block").siblings().css("display", "none");
        })
        /*****案例选登*****/
        jQuery("#i_xfxibox_box>ul").children("li").mouseover(function() {
            var l = jQuery(this).index();
            jQuery(this).addClass("over").siblings().removeClass("over");
            jQuery("#i_xfxibox_child_box>ul").eq(l).css("display", "block").siblings().css("display", "none");
            var livalue = jQuery(this).html();
            if (livalue.indexOf("案例") >= 0) {
                jQuery("#i_xfxibox_box>span").children("a").attr("href", "http://xfw.jieyang.gd.cn/List.aspx?action=alxd");
            }
            else {
                jQuery("#i_xfxibox_box>span").children("a").attr("href", "http://xfw.jieyang.gd.cn/List.aspx?action=jyxd");
            }
        })
        /*****zmhd案例选登*****/
        jQuery("#xd>h2").children("span").mouseover(function() {
            var l = jQuery(this).index();
            var h = l - 1;
            jQuery("#zmhd_xf_box>table").eq(h).css("display", "block").siblings().css("display", "none");
        })
        /*****信箱*****/
        jQuery("#zmhd_box_box>span").mouseover(function() {
            var l = jQuery(this).index();
            jQuery(this).addClass("over").siblings().removeClass("over");
            jQuery("#zmhd_box_child_box>ul").eq(l).css("display", "block").siblings().css("display", "none");
        })
        /*****在线调查*****/
        jQuery("#zmhd_box2>span").mouseover(function() {
            var l = jQuery(this).index();
            jQuery(this).addClass("over").siblings().removeClass("over");
            jQuery("#zmhd_child_box2>ul").eq(l).css("display", "block").siblings().css("display", "none");
        })
        /*****英文版左边*****/
        jQuery("#Eleft_menu>ul li p").click(function() {
            var l = jQuery(this).index();
            jQuery(this).siblings("div").css("display", "block").parent().siblings().children("div").css("display", "none");
        })
        /*****文字版揭阳概况左边*****/
        jQuery("#wz_Ljygk_box>div.wz_jygm").each(function(i) {
            jQuery(".wz_jygm").eq(i).children("h2").click(function() {
                jQuery(this).siblings("ul").css("display", "block").parent().siblings().children("ul").css("display", "none");
            })
        })
        /**********政务公开单独页**********/
        jQuery("#LL_zwgk_box>li").children("a").click(function() {
            var l = jQuery(this).index();
            jQuery(this).siblings("ul").css("display", "block").parent().siblings().children("ul").css("display", "none");
        })
    })
}
qh.lm();

/*幻灯片*/
(function() {
    myFocus = {
        defConfig: { trigger: 'click', txtHeight: 'default', wrap: true, delay: 100 }, pattern: {},
        extend: function() {
            var a = arguments, l = a.length, i = 1, parent = a[0];
            if (l === 1) { i = 0, parent = this.pattern; }
            for (i; i < l; i++) { for (var p in a[i]) if (!(p in parent)) parent[p] = a[i][p]; }
        }
    };
    var DOM = {
        $: function(id) { return typeof id === 'string' ? document.getElementById(id) : id; },
        $$: function(tag, obj) { return (this.$(obj) || document).getElementsByTagName(tag); },
        $$_: function(tag, obj) {
            var arr = [], a = this.$$(tag, obj);
            for (var i = 0; i < a.length; i++) {
                if (a[i].parentNode === obj) arr.push(a[i]);
                i += this.$$(tag, a[i]).length;
            } return arr;
        },
        $c: function(cla, obj) {
            var tags = this.$$('*', obj), cla = cla.replace(/\-/g, '\\-'), reg = new RegExp('(^|\\s)' + cla + '(\\s|$)'), arr = [];
            for (var i = 0, l = tags.length; i < l; i++) { if (reg.test(tags[i].className)) { arr.push(tags[i]); break; } }
            return arr[0];
        },
        $li: function(cla, obj) { return this.$$_('li', this.$c(cla, obj)); },
        wrap: function(arr, cla) {//在arr(数组)外面添加wrap,cla为wrap的class
            var div = document.createElement('div'); div.className = cla; arr[0].parentNode.insertBefore(div, arr[0]);
            for (var i = 0; i < arr.length; i++) div.appendChild(arr[i]);
        },
        wrapIn: function(obj, cla) { obj.innerHTML = '<ul class=' + cla + '>' + obj.innerHTML + '</ul>'; }, //在obj里面添加wrap,cla为wrap的class
        addList: function(obj, cla) {
            var s = [], ul = this.$$('ul', obj)[0], li = this.$$_('li', ul), img, n = li.length, num = cla.length;
            for (var j = 0; j < num; j++) {
                s.push('<ul class=' + cla[j] + '>');
                for (var i = 0; i < n; i++) { img = this.$$('img', li[i])[0]; s.push('<li>' + (cla[j] == 'num' ? ('<a>' + (i + 1) + '</a>') : (cla[j] == 'txt' && img ? li[i].innerHTML.replace(/<img(.|\n|\r)*?(\>\<\/a\>)/i, img.alt + '</a>') + '<p>' + img.getAttribute("text") + '</p>' : (cla[j] == 'thumb' && img ? '<img src=' + (img.getAttribute("thumb") || img.src) + ' />' : ''))) + '<span></span></li>') };
                s.push('</ul>');
            }; obj.innerHTML += s.join('');
        }
    },
	CSS = {
	    style: function(o, attr) { var v = (+[1, ] ? getComputedStyle(o, null) : o.currentStyle)[attr], pv = parseFloat(v); return isNaN(pv) ? v : pv; },
	    setOpa: function(o, val) { o.style.filter = "alpha(opacity=" + val + ")", o.style.opacity = val / 100; },
	    removeClass: function(o, name) { var cla = o.className, reg = "/\\s*" + name + "\\b/g"; o.className = cla ? cla.replace(eval(reg), '') : '' }
	},
	Anim = {
	    animate: function(obj, attr, val, dur, type, fn) {
	        var opa = attr === 'opacity' ? true : false, opacity = this.setOpa, am = typeof val === 'string', st = (new Date).getTime();
	        if (opa && this.style(obj, 'display') === 'none') obj.style.display = 'block', opacity(obj, 0);
	        var os = this.style(obj, attr), b = isNaN(os) ? 1 : os, c = am ? val / 1 : val - b, d = dur || 800, e = this.easing[type || 'easeOut'], m = c > 0 ? 'ceil' : 'floor';
	        if (obj[attr + 'Timer']) clearInterval(obj[attr + 'Timer']);
	        obj[attr + 'Timer'] = setInterval(function() {
	            var t = (new Date).getTime() - st;
	            if (t < d) { opa ? opacity(obj, Math[m](e(t, b * 100, c * 100, d))) : obj.style[attr] = Math[m](e(t, b, c, d)) + 'px'; }
	            else {
	                clearInterval(obj[attr + 'Timer']), opa ? opacity(obj, (c + b) * 100) : obj.style[attr] = c + b + 'px',
					opa && val === 0 && (obj.style.display = 'none'), fn && fn.call(obj);
	            }
	        }, 13); return this;
	    },
	    fadeIn: function(obj, duration, fn) { this.animate(obj, 'opacity', 1, duration == undefined ? 400 : duration, 'linear', fn); return this; },
	    fadeOut: function(obj, duration, fn) { this.animate(obj, 'opacity', 0, duration == undefined ? 400 : duration, 'linear', fn); return this; },
	    slide: function(obj, params, duration, easing, fn) { for (var p in params) this.animate(obj, p, params[p], duration, easing, fn); return this; },
	    stop: function(obj) { for (var p in obj) if (p.indexOf('Timer') !== -1) clearInterval(obj[p]); return this; }, //停止所有运动
	    easing: {
	        linear: function(t, b, c, d) { return c * t / d + b; },
	        swing: function(t, b, c, d) { return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; },
	        easeIn: function(t, b, c, d) { return c * (t /= d) * t * t * t + b; },
	        easeOut: function(t, b, c, d) { return -c * ((t = t / d - 1) * t * t * t - 1) + b; },
	        easeInOut: function(t, b, c, d) { return ((t /= d / 2) < 1) ? (c / 2 * t * t * t * t + b) : (-c / 2 * ((t -= 2) * t * t * t - 2) + b); }
	    }
	},
	Init = {
	    set: function(p, im) {
	        var F = this;
	        p.S = p.pattern + '-' + p.id, F.extend(p, F.pattern[p.pattern].cfg, F.defConfig);
	        function ready() { F.$(p.id).className += ' ' + p.pattern + ' ' + p.S, F.initCSS(p); };
	        function show() { F.pattern[p.pattern](p, F) }
	        if (im) { ready(), show(); return; }
	        if (window.attachEvent) { (function() { try { ready() } catch (e) { setTimeout(arguments.callee, 0) } })(); }
	        else { this.addEvent(document, 'DOMContentLoaded', ready); }
	        this.addEvent(window, 'load', show);
	    },
	    initCSS: function(p) {
	        var css = [], w = p.width, h = p.height || this.$(p.id).offsetHeight, oStyle = document.createElement('style'); oStyle.type = 'text/css';
	        if (p.wrap) this.wrap([this.$(p.id)], p.pattern + '_wrap');
	        if (p.css !== false) css.push('.' + p.S + ' *{margin:0;padding:0;border:0;list-style:none;}.' + p.S + '{position:relative;top:2px;left:2px;width:' + w + 'px;height:' + p.height + 'px;font:12px/1.5 Verdana,Geneva,sans-serif;text-align:left;background:#fff;}.' + p.S + ' .loading{position:absolute;z-index:9999;width:100%;height:100%;color:#666;text-align:center;padding-top:' + 0.3 * h + 'px;background:#fff url(http://nethd.zhongsou.com/wtimg/i_41956/28236-loading.gif) center ' + 0.4 * h + 'px no-repeat;}.' + p.S + ' .pic{position:relative;width:' + w + 'px;height:' + h + 'px;overflow:hidden;}.' + p.S + ' .txt li,.' + p.S + ' .txt li span,.' + p.S + ' .txt-bg{width:' + w + 'px;height:' + p.txtHeight + 'px!important;line-height:' + p.txtHeight + 'px!important;overflow:hidden;}.' + p.S + ' .txt li p a{display:inline;}');
	        if (oStyle.styleSheet) { oStyle.styleSheet.cssText = css.join(''); } else { oStyle.innerHTML = css.join(''); }
	        var oHead = this.$$('head', document)[0]; oHead.insertBefore(oStyle, oHead.firstChild);
	    }
	},
	Method = {
	    switchMF: function(fn1, fn2, isless, d, cont) {
	        return "var _F=myFocus,_ld=_F.$c('loading',box),less=" + isless + ",_turn=true,_dir=" + d + "||'left',_dis=_dir=='left'||_dir=='right'?par.width:par.height,pics=" + cont + "||pics,index=par.index||0,_t=par.time*1000;if(less){pics.style[_dir]=-_dis*n+'px';index+=n;}if(_ld)box.removeChild(_ld);var run=function(idx){(" + fn1 + ")();var prev=index;if(less&&index==2*n-1&&_turn!=1){pics.style[_dir]=-(n-1)*_dis+'px';index=n-1}if(less&&index==0&&_turn!=2){pics.style[_dir]=-n*_dis+'px';index=n}if(!less&&index==n-1&&idx==undefined)index=-1;if(less&&idx!==undefined&&index>n-1&&!_turn) idx+=n;var next=idx!==undefined?idx:index+1;if(" + fn2 + ")(" + fn2 + ")();index=next;_turn=false;};run(index);if(_t&&par.auto!==false)var auto=setInterval(function(){run()},_t);box.onmouseover=function(){if(auto)clearInterval(auto)};box.onmouseout=function(){if(auto)auto=setInterval(function(){run()},_t)};for(var i=0,_lk=_F.$$('a',box),_ln=_lk.length;i<_ln;i++) _lk[i].onfocus=function(){this.blur();}"
	    },
	    bind: function(arrStr, type, delay) {
	        return "for (var j=0;j<n;j++){" + arrStr + "[j].index=j;if(" + type + "=='click'){" + arrStr + "[j].onmouseover=function(){if(this.index!=index)this.className+=' hover'};" + arrStr + "[j].onmouseout=function(){_F.removeClass(this,'hover')};" + arrStr + "[j].onclick=function(){if(this.index!=index) {run(this.index);return false}};}else if(" + type + "=='mouseover'){" + arrStr + "[j].onmouseover=function(){var self=this;if(" + delay + "==0){if(self.index!=index){run(self.index);return false}}else " + arrStr + ".d=setTimeout(function(){if(self.index!=index) {run(self.index);return false}}," + delay + ")};" + arrStr + "[j].onmouseout=function(){clearTimeout(" + arrStr + ".d)};}else{alert('Error Setting : \"'+" + type + "+'\"');break;}}"
	    },
	    toggle: function(obj, cla1, cla2) {
	        return "var _stop=false;" + obj + ".onclick=function(){this.className=this.className=='" + cla1 + "'?'" + cla2 + "':'" + cla1 + "';if(!_stop){clearInterval(auto);auto=null;_stop=true;}else{auto=true;_stop=false;}}"
	    },
	    scroll: function(obj, dir, dis, sn, dur) {
	        return "var scPar={},scDis=" + dis + ",scN=Math.floor(" + sn + "/2),scDir=parseInt(" + obj + ".style[" + dir + "])||0,scIdx=next>=n?next-n:next,scDur=" + dur + "||400,scMax=scDis*(n-" + sn + "),scD=scDis*scIdx+scDir;if(scD>scDis*scN&&scIdx!==n-1) scPar[" + dir + "]='-'+scDis;if(scD<scDis&&scIdx!==0) scPar[" + dir + "]='+'+scDis;if(scIdx===n-1) scPar[" + dir + "]=-scMax;if(scIdx===0) scPar[" + dir + "]=0;_F.slide(" + obj + ",scPar,scDur);"
	    },
	    turn: function(prev, next) { return prev + ".onclick=function(){_turn=1;run(index>0?index-1:n-1);};" + next + ".onclick=function(){_turn=2;var tIdx=index>=2*n-1?n-1:index;run(index==n-1&&!less?0:tIdx+1);}" },
	    alterSRC: function(o, name, del) { var img = this.$$('img', o)[0]; img.src = del ? img.src.replace(eval("/" + name + "\\.(?=[^\\.]+$)/g"), '.') : img.src.replace(/\.(?=[^\.]+$)/g, name + '.') },
	    addEvent: function(obj, type, fn) { var b = !(+[1, ]), e = b ? 'attachEvent' : 'addEventListener', t = (b ? 'on' : '') + type; obj[e](t, fn, false); }
	};
    myFocus.extend(myFocus, DOM, CSS, Anim, Init, Method);
    myFocus.set.params = function(name, p) { myFocus.pattern[name].cfg = p };
})();

myFocus.extend({
    mF_classicHC: function(par, F) {//*********************经典怀旧系列一--慧聪风格******************
        var box = F.$(par.id); //定义焦点图盒子
        F.addList(box, ['num-bg', 'num']); //添加ul列表
        var pic = F.$li('pic', box), txt = F.$li('par', box), num = F.$li('num', box), ps = F.$c('par', box), p = F.$li('par', box), n = pic.length; //定义焦点图元素
        //CSS
        var txtH = isNaN(par.txtHeight / 1) ? 20 : par.txtHeight; //设置默认的文字高度
        box.style.width = par.width + 'px'; box.style.height = par.height + txtH + 'px';
        F.$c('num-bg', box).style.bottom = F.$c('num', box).style.bottom = txtH - 2 + 'px';
        for (var i = 0; i < n; i++) {
            pic[i].style.display = 'none';
            txt[i].style.cssText = 'display:none;top:' + (par.height) + 'px;width:' + (par.width) + 'px';
        }
        //PLAY
        eval(F.switchMF(function() {
            pic[index].style.display = 'none';
            txt[index].style.display = 'none';
            num[index].className = '';
        }, function() {
            F.fadeIn(pic[next]);
            txt[next].style.display = '';
            num[next].className = 'current';
        }))
        eval(F.bind('num', 'par.trigger', par.delay));
    }
});
/*幻灯片
(function() {
myFocus = {
defConfig: { trigger: 'click', txtHeight: 'default', wrap: true, delay: 100 }, pattern: {},
extend: function() {
var a = arguments, l = a.length, i = 1, parent = a[0];
if (l === 1) { i = 0, parent = this.pattern; }
for (i; i < l; i++) { for (var p in a[i]) if (!(p in parent)) parent[p] = a[i][p]; }
}
};
var DOM = {
$: function(id) { return typeof id === 'string' ? document.getElementById(id) : id; },
$$: function(tag, obj) { return (this.$(obj) || document).getElementsByTagName(tag); },
$$_: function(tag, obj) {
var arr = [], a = this.$$(tag, obj);
for (var i = 0; i < a.length; i++) {
if (a[i].parentNode === obj) arr.push(a[i]);
i += this.$$(tag, a[i]).length;
} return arr;
},
$c: function(cla, obj) {
var tags = this.$$('*', obj), cla = cla.replace(/\-/g, '\\-'), reg = new RegExp('(^|\\s)' + cla + '(\\s|$)'), arr = [];
for (var i = 0, l = tags.length; i < l; i++) { if (reg.test(tags[i].className)) { arr.push(tags[i]); break; } }
return arr[0];
},
$li: function(cla, obj) { return this.$$_('li', this.$c(cla, obj)); },
wrap: function(arr, cla) {//在arr(数组)外面添加wrap,cla为wrap的class
var div = document.createElement('div'); div.className = cla; arr[0].parentNode.insertBefore(div, arr[0]);
for (var i = 0; i < arr.length; i++) div.appendChild(arr[i]);
},
wrapIn: function(obj, cla) { obj.innerHTML = '<ul class=' + cla + '>' + obj.innerHTML + '</ul>'; }, //在obj里面添加wrap,cla为wrap的class
addList: function(obj, cla) {
var s = [], ul = this.$$('ul', obj)[0], li = this.$$_('li', ul), img, n = li.length, num = cla.length;
for (var j = 0; j < num; j++) {
s.push('<ul class=' + cla[j] + '>');
for (var i = 0; i < n; i++) { img = this.$$('img', li[i])[0]; s.push('<li>' + (cla[j] == 'num' ? ('<a>' + (i + 1) + '</a>') : (cla[j] == 'txt' && img ? li[i].innerHTML.replace(/<img(.|\n|\r)*?(\>\<\/a\>)/i, img.alt + '</a>') + '<p>' + img.getAttribute("text") + '</p>' : (cla[j] == 'thumb' && img ? '<img src=' + (img.getAttribute("thumb") || img.src) + ' />' : ''))) + '<span></span></li>') };
s.push('</ul>');
}; obj.innerHTML += s.join('');
}
},
CSS = {
style: function(o, attr) { var v = (+[1, ] ? getComputedStyle(o, null) : o.currentStyle)[attr], pv = parseFloat(v); return isNaN(pv) ? v : pv; },
setOpa: function(o, val) { o.style.filter = "alpha(opacity=" + val + ")", o.style.opacity = val / 100; },
removeClass: function(o, name) { var cla = o.className, reg = "/\\s*" + name + "\\b/g"; o.className = cla ? cla.replace(eval(reg), '') : '' }
},
Anim = {
animate: function(obj, attr, val, dur, type, fn) {
var opa = attr === 'opacity' ? true : false, opacity = this.setOpa, am = typeof val === 'string', st = (new Date).getTime();
if (opa && this.style(obj, 'display') === 'none') obj.style.display = 'block', opacity(obj, 0);
var os = this.style(obj, attr), b = isNaN(os) ? 1 : os, c = am ? val / 1 : val - b, d = dur || 800, e = this.easing[type || 'easeOut'], m = c > 0 ? 'ceil' : 'floor';
if (obj[attr + 'Timer']) clearInterval(obj[attr + 'Timer']);
obj[attr + 'Timer'] = setInterval(function() {
var t = (new Date).getTime() - st;
if (t < d) { opa ? opacity(obj, Math[m](e(t, b * 100, c * 100, d))) : obj.style[attr] = Math[m](e(t, b, c, d)) + 'px'; }
else {
clearInterval(obj[attr + 'Timer']), opa ? opacity(obj, (c + b) * 100) : obj.style[attr] = c + b + 'px',
opa && val === 0 && (obj.style.display = 'none'), fn && fn.call(obj);
}
}, 13); return this;
},
fadeIn: function(obj, duration, fn) { this.animate(obj, 'opacity', 1, duration == undefined ? 400 : duration, 'linear', fn); return this; },
fadeOut: function(obj, duration, fn) { this.animate(obj, 'opacity', 0, duration == undefined ? 400 : duration, 'linear', fn); return this; },
slide: function(obj, params, duration, easing, fn) { for (var p in params) this.animate(obj, p, params[p], duration, easing, fn); return this; },
stop: function(obj) { for (var p in obj) if (p.indexOf('Timer') !== -1) clearInterval(obj[p]); return this; }, //停止所有运动
easing: {
linear: function(t, b, c, d) { return c * t / d + b; },
swing: function(t, b, c, d) { return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; },
easeIn: function(t, b, c, d) { return c * (t /= d) * t * t * t + b; },
easeOut: function(t, b, c, d) { return -c * ((t = t / d - 1) * t * t * t - 1) + b; },
easeInOut: function(t, b, c, d) { return ((t /= d / 2) < 1) ? (c / 2 * t * t * t * t + b) : (-c / 2 * ((t -= 2) * t * t * t - 2) + b); }
}
},
Init = {
set: function(p, im) {
var F = this;
p.S = p.pattern + '-' + p.id, F.extend(p, F.pattern[p.pattern].cfg, F.defConfig);
function ready() { F.$(p.id).className += ' ' + p.pattern + ' ' + p.S, F.initCSS(p); };
function show() { F.pattern[p.pattern](p, F) }
if (im) { ready(), show(); return; }
if (window.attachEvent) { (function() { try { ready() } catch (e) { setTimeout(arguments.callee, 0) } })(); }
else { this.addEvent(document, 'DOMContentLoaded', ready); }
this.addEvent(window, 'load', show);
},
initCSS: function(p) {
var css = [], w = p.width, h = p.height || this.$(p.id).offsetHeight, oStyle = document.createElement('style'); oStyle.type = 'text/css';
if (p.wrap) this.wrap([this.$(p.id)], p.pattern + '_wrap');
if (p.css !== false) css.push('.' + p.S + ' *{margin:0;padding:0;border:0;list-style:none;}.' + p.S + '{position:relative;top:2px;left:2px;width:' + w + 'px;height:' + p.height + 'px;font:12px/1.5 Verdana,Geneva,sans-serif;text-align:left;background:#fff;}.' + p.S + ' .loading{position:absolute;z-index:9999;width:100%;height:100%;color:#666;text-align:center;padding-top:' + 0.3 * h + 'px;background:#fff url(http://nethd.zhongsou.com/wtimg/i_41956/28236-loading.gif) center ' + 0.4 * h + 'px no-repeat;}.' + p.S + ' .pic{position:relative;width:' + w + 'px;height:' + h + 'px;overflow:hidden;}.' + p.S + ' .txt li,.' + p.S + ' .txt li span,.' + p.S + ' .txt-bg{width:' + w + 'px;height:' + p.txtHeight + 'px!important;line-height:' + p.txtHeight + 'px!important;overflow:hidden;}.' + p.S + ' .txt li p a{display:inline;}');
if (oStyle.styleSheet) { oStyle.styleSheet.cssText = css.join(''); } else { oStyle.innerHTML = css.join(''); }
var oHead = this.$$('head', document)[0]; oHead.insertBefore(oStyle, oHead.firstChild);
}
},
Method = {
switchMF: function(fn1, fn2, isless, d, cont) {
return "var _F=myFocus,_ld=_F.$c('loading',box),less=" + isless + ",_turn=true,_dir=" + d + "||'left',_dis=_dir=='left'||_dir=='right'?par.width:par.height,pics=" + cont + "||pics,index=par.index||0,_t=par.time*1000;if(less){pics.style[_dir]=-_dis*n+'px';index+=n;}if(_ld)box.removeChild(_ld);var run=function(idx){(" + fn1 + ")();var prev=index;if(less&&index==2*n-1&&_turn!=1){pics.style[_dir]=-(n-1)*_dis+'px';index=n-1}if(less&&index==0&&_turn!=2){pics.style[_dir]=-n*_dis+'px';index=n}if(!less&&index==n-1&&idx==undefined)index=-1;if(less&&idx!==undefined&&index>n-1&&!_turn) idx+=n;var next=idx!==undefined?idx:index+1;if(" + fn2 + ")(" + fn2 + ")();index=next;_turn=false;};run(index);if(_t&&par.auto!==false)var auto=setInterval(function(){run()},_t);box.onmouseover=function(){if(auto)clearInterval(auto)};box.onmouseout=function(){if(auto)auto=setInterval(function(){run()},_t)};for(var i=0,_lk=_F.$$('a',box),_ln=_lk.length;i<_ln;i++) _lk[i].onfocus=function(){this.blur();}"
},
bind: function(arrStr, type, delay) {
return "for (var j=0;j<n;j++){" + arrStr + "[j].index=j;if(" + type + "=='click'){" + arrStr + "[j].onmouseover=function(){if(this.index!=index)this.className+=' hover'};" + arrStr + "[j].onmouseout=function(){_F.removeClass(this,'hover')};" + arrStr + "[j].onclick=function(){if(this.index!=index) {run(this.index);return false}};}else if(" + type + "=='mouseover'){" + arrStr + "[j].onmouseover=function(){var self=this;if(" + delay + "==0){if(self.index!=index){run(self.index);return false}}else " + arrStr + ".d=setTimeout(function(){if(self.index!=index) {run(self.index);return false}}," + delay + ")};" + arrStr + "[j].onmouseout=function(){clearTimeout(" + arrStr + ".d)};}else{alert('Error Setting : \"'+" + type + "+'\"');break;}}"
},
toggle: function(obj, cla1, cla2) {
return "var _stop=false;" + obj + ".onclick=function(){this.className=this.className=='" + cla1 + "'?'" + cla2 + "':'" + cla1 + "';if(!_stop){clearInterval(auto);auto=null;_stop=true;}else{auto=true;_stop=false;}}"
},
scroll: function(obj, dir, dis, sn, dur) {
return "var scPar={},scDis=" + dis + ",scN=Math.floor(" + sn + "/2),scDir=parseInt(" + obj + ".style[" + dir + "])||0,scIdx=next>=n?next-n:next,scDur=" + dur + "||400,scMax=scDis*(n-" + sn + "),scD=scDis*scIdx+scDir;if(scD>scDis*scN&&scIdx!==n-1) scPar[" + dir + "]='-'+scDis;if(scD<scDis&&scIdx!==0) scPar[" + dir + "]='+'+scDis;if(scIdx===n-1) scPar[" + dir + "]=-scMax;if(scIdx===0) scPar[" + dir + "]=0;_F.slide(" + obj + ",scPar,scDur);"
},
turn: function(prev, next) { return prev + ".onclick=function(){_turn=1;run(index>0?index-1:n-1);};" + next + ".onclick=function(){_turn=2;var tIdx=index>=2*n-1?n-1:index;run(index==n-1&&!less?0:tIdx+1);}" },
alterSRC: function(o, name, del) { var img = this.$$('img', o)[0]; img.src = del ? img.src.replace(eval("/" + name + "\\.(?=[^\\.]+$)/g"), '.') : img.src.replace(/\.(?=[^\.]+$)/g, name + '.') },
addEvent: function(obj, type, fn) { var b = !(+[1, ]), e = b ? 'attachEvent' : 'addEventListener', t = (b ? 'on' : '') + type; obj[e](t, fn, false); }
};
myFocus.extend(myFocus, DOM, CSS, Anim, Init, Method);
myFocus.set.params = function(name, p) { myFocus.pattern[name].cfg = p };
})();

myFocus.extend({
mF_classicHC: function(par, F) {
var box = F.$(par.id); //定义焦点图盒子
F.addList(box, ['num-bg', 'num']); //添加ul列表
var pic = F.$li('pic', box), txt = F.$li('par', box), num = F.$li('num', box), ps = F.$c('par', box), p = F.$li('par', box), n = pic.length; //定义焦点图元素
//CSS
var txtH = isNaN(par.txtHeight / 1) ? 20 : par.txtHeight; //设置默认的文字高度
box.style.width = par.width + 'px'; box.style.height = par.height + txtH + 'px';
F.$c('num-bg', box).style.bottom = F.$c('num', box).style.bottom = txtH - 2 + 'px';
for (var i = 0; i < n; i++) {
pic[i].style.display = 'none';
txt[i].style.cssText = 'display:none;top:' + (par.height) + 'px;width:' + (par.width) + 'px';
}
//PLAY
eval(F.switchMF(function() {
pic[index].style.display = 'none';
txt[index].style.display = 'none';
num[index].className = '';
}, function() {
F.fadeIn(pic[next]);
txt[next].style.display = '';
num[next].className = 'current';
}))
eval(F.bind('num', 'par.trigger', par.delay));
}
});*/
/****点击放大和关闭****/
function $() { return document.getElementById ? document.getElementById(arguments[0]) : eval(arguments[0]); }
function closeWindow(id, evt) {
    if ($(id) != null) {
        $(id).style.display = 'none';
    }
    var e = (evt) ? evt : window.event; //判断浏览器的类型，在基于ie内核的浏览器中的使用cancelBubble
    if (window.event) {
        e.cancelBubble = true;
    } else { //e.preventDefault(); //在基于firefox内核的浏览器中支持做法stopPropagation
        e.stopPropagation();
    }
}
var OverH, OverW, ChangeH = 50, ChangeW = 50;
function OpenDiv(id, tgname) {
    $("Loading").innerHTML = "";
    var ig = new Image();
    ig.src = $(id).getElementsByTagName(tgname)[0].src;
    var _Dh = ig.height;
    var _Dw = ig.width;
    OverH = _Dh; OverW = _Dw;
    $("Loading").style.display = '';
    $("Loading").innerHTML = $(id).innerHTML + '<a onclick=closeWindow("Loading","event")>' + "×" + '</a>';
    if (_Dw > _Dh) { ChangeH = Math.ceil((_Dh - 10) / ((_Dw - 10) / 50)) } else if (_Dw < _Dh) { ChangeW = Math.ceil((_Dw - 10) / ((_Dh - 10) / 50)) }
    $("Loading").style.top = (document.documentElement.clientHeight - 10 + document.documentElement.scrollTop) / 2 + "px";
    $("Loading").style.left = (document.documentElement.clientWidth - 10) / 2 + "px";
    OpenNow()
}
var Nw = 10, Nh = 10;
function OpenNow() {
    if (Nw > OverW - ChangeW) ChangeW = 2;
    if (Nh > OverH - ChangeH) ChangeH = 2;
    Nw = Nw + ChangeW; Nh = Nh + ChangeH;

    if (OverW > Nw || OverH > Nh) {
        if (OverW > Nw) {
            $("Loading").style.width = Nw + "px";
            $("Loading").style.left = (document.documentElement.clientWidth - Nw) / 2 + "px";
        }
        if (OverH > Nh) {
            $("Loading").style.height = Nh + "px";
            $("Loading").style.top = (document.documentElement.clientHeight + document.documentElement.scrollTop) / 2 + "px"
        }
        window.setTimeout("OpenNow()", 10)
    } else {
        Nw = 10; Nh = 10; ChangeH = 50; ChangeW = 50;
    }
}
/****日期时间****/
var week;
var date = new Date();
var today = date.getDay();
var hour = date.getHours();
var minute = date.getMinutes();
if (today == 0) week = "星期日"
if (today == 1) week = "星期一"
if (today == 2) week = "星期二"
if (today == 3) week = "星期三"
if (today == 4) week = "星期四"
if (today == 5) week = "星期五"
if (today == 6) week = "星期六"
if (minute < 10) minute = "0" + minute;
