﻿/**
* jQuery cycle plugin
*/
(function(g) { var h = "2.32"; var c = g.browser.msie && /MSIE 6.0/.test(navigator.userAgent); function d() { if (window.console && window.console.log) { window.console.log("[cycle] " + Array.prototype.join.call(arguments, "")) } } g.fn.cycle = function(j) { if (this.length == 0) { d("terminating; zero elements found by selector" + (g.isReady ? "" : " (DOM not ready)")); return this } var k = arguments[1]; return this.each(function() { if (j === undefined || j === null) { j = {} } if (j.constructor == String) { switch (j) { case "stop": if (this.cycleTimeout) { clearTimeout(this.cycleTimeout) } this.cycleTimeout = 0; g(this).data("cycle.opts", ""); return; case "pause": this.cyclePause = 1; return; case "resume": this.cyclePause = 0; if (k === true) { j = g(this).data("cycle.opts"); if (!j) { d("options not found, can not resume"); return } if (this.cycleTimeout) { clearTimeout(this.cycleTimeout); this.cycleTimeout = 0 } b(j.elements, j, 1, 1) } return; default: j = { fx: j} } } else { if (j.constructor == Number) { var s = j; j = g(this).data("cycle.opts"); if (!j) { d("options not found, can not advance slide"); return } if (s < 0 || s >= j.elements.length) { d("invalid slide index: " + s); return } j.nextSlide = s; if (this.cycleTimeout) { clearTimeout(this.cycleTimeout); this.cycleTimeout = 0 } b(j.elements, j, 1, s >= j.currSlide); return } } if (this.cycleTimeout) { clearTimeout(this.cycleTimeout) } this.cycleTimeout = 0; this.cyclePause = 0; var y = g(this); var t = j.slideExpr ? g(j.slideExpr, this) : y.children(); var o = t.get(); if (o.length < 2) { d("terminating; too few slides: " + o.length); return } var l = g.extend({}, g.fn.cycle.defaults, j || {}, g.metadata ? y.metadata() : g.meta ? y.data() : {}); if (l.autostop) { l.countdown = l.autostopCount || o.length } y.data("cycle.opts", l); l.container = this; l.elements = o; l.before = l.before ? [l.before] : []; l.after = l.after ? [l.after] : []; l.after.unshift(function() { l.busy = 0 }); if (l.continuous) { l.after.push(function() { b(o, l, 0, !l.rev) }) } if (c && l.cleartype && !l.cleartypeNoBg) { e(t) } var A = this.className; l.width = parseInt((A.match(/w:(\d+)/) || [])[1]) || l.width; l.height = parseInt((A.match(/h:(\d+)/) || [])[1]) || l.height; l.timeout = parseInt((A.match(/t:(\d+)/) || [])[1]) || l.timeout; if (y.css("position") == "static") { y.css("position", "relative") } if (l.width) { y.width(l.width) } if (l.height && l.height != "auto") { y.height(l.height) } if (l.startingSlide) { l.startingSlide = parseInt(l.startingSlide) } if (l.random) { l.randomMap = []; for (var p = 0; p < o.length; p++) { l.randomMap.push(p) } l.randomMap.sort(function(B, w) { return Math.random() - 0.5 }); l.randomIndex = 0; l.startingSlide = l.randomMap[0] } else { if (l.startingSlide >= o.length) { l.startingSlide = 0 } } var r = l.startingSlide || 0; t.css({ position: "absolute", top: 0, left: 0 }).hide().each(function(w) { var B = r ? w >= r ? o.length - (w - r) : r - w : o.length - w; g(this).css("z-index", B) }); g(o[r]).css("opacity", 1).show(); if (g.browser.msie) { o[r].style.removeAttribute("filter") } if (l.fit && l.width) { t.width(l.width) } if (l.fit && l.height && l.height != "auto") { t.height(l.height) } if (l.containerResize) { var u = 0, n = 0; for (var p = 0; p < o.length; p++) { var m = g(o[p]), x = m.outerWidth(), q = m.outerHeight(); u = x > u ? x : u; n = q > n ? q : n } y.css({ width: u + "px", height: n + "px" }) } if (l.pause) { y.hover(function() { this.cyclePause++ }, function() { this.cyclePause-- }) } var z = g.fn.cycle.transitions[l.fx]; if (g.isFunction(z)) { z(y, t, l) } else { if (l.fx != "custom") { d("unknown transition: " + l.fx) } } t.each(function() { var w = g(this); this.cycleH = (l.fit && l.height) ? l.height : w.height(); this.cycleW = (l.fit && l.width) ? l.width : w.width() }); l.cssBefore = l.cssBefore || {}; l.animIn = l.animIn || {}; l.animOut = l.animOut || {}; t.not(":eq(" + r + ")").css(l.cssBefore); if (l.cssFirst) { g(t[r]).css(l.cssFirst) } if (l.timeout) { l.timeout = parseInt(l.timeout); if (l.speed.constructor == String) { l.speed = g.fx.speeds[l.speed] || parseInt(l.speed) } if (!l.sync) { l.speed = l.speed / 2 } while ((l.timeout - l.speed) < 250) { l.timeout += l.speed } } if (l.easing) { l.easeIn = l.easeOut = l.easing } if (!l.speedIn) { l.speedIn = l.speed } if (!l.speedOut) { l.speedOut = l.speed } l.slideCount = o.length; l.currSlide = r; if (l.random) { l.nextSlide = l.currSlide; if (++l.randomIndex == o.length) { l.randomIndex = 0 } l.nextSlide = l.randomMap[l.randomIndex] } else { l.nextSlide = l.startingSlide >= (o.length - 1) ? 0 : l.startingSlide + 1 } var v = t[r]; if (l.before.length) { l.before[0].apply(v, [v, v, l, true]) } if (l.after.length > 1) { l.after[1].apply(v, [v, v, l, true]) } if (l.click && !l.next) { l.next = l.click } if (l.next) { g(l.next).bind("click", function() { return i(o, l, l.rev ? -1 : 1) }) } if (l.prev) { g(l.prev).bind("click", function() { return i(o, l, l.rev ? 1 : -1) }) } if (l.pager) { a(o, l) } l.addSlide = function(B, C) { var w = g(B), D = w[0]; if (!l.autostopCount) { l.countdown++ } o[C ? "unshift" : "push"](D); if (l.els) { l.els[C ? "unshift" : "push"](D) } l.slideCount = o.length; w.css("position", "absolute"); w[C ? "prependTo" : "appendTo"](y); if (C) { l.currSlide++; l.nextSlide++ } if (c && l.cleartype && !l.cleartypeNoBg) { e(w) } if (l.fit && l.width) { w.width(l.width) } if (l.fit && l.height && l.height != "auto") { t.height(l.height) } D.cycleH = (l.fit && l.height) ? l.height : w.height(); D.cycleW = (l.fit && l.width) ? l.width : w.width(); w.css(l.cssBefore); if (l.pager) { g.fn.cycle.createPagerAnchor(o.length - 1, D, g(l.pager), o, l) } if (typeof l.onAddSlide == "function") { l.onAddSlide(w) } }; if (l.timeout || l.continuous) { this.cycleTimeout = setTimeout(function() { b(o, l, 0, !l.rev) }, l.continuous ? 10 : l.timeout + (l.delay || 0)) } }) }; function b(o, j, n, q) { if (j.busy) { return } var m = j.container, s = o[j.currSlide], r = o[j.nextSlide]; if (m.cycleTimeout === 0 && !n) { return } if (!n && !m.cyclePause && ((j.autostop && (--j.countdown <= 0)) || (j.nowrap && !j.random && j.nextSlide < j.currSlide))) { if (j.end) { j.end(j) } return } if (n || !m.cyclePause) { if (j.before.length) { g.each(j.before, function(p, t) { t.apply(r, [s, r, j, q]) }) } var k = function() { if (g.browser.msie && j.cleartype) { this.style.removeAttribute("filter") } g.each(j.after, function(p, t) { t.apply(r, [s, r, j, q]) }) }; if (j.nextSlide != j.currSlide) { j.busy = 1; if (j.fxFn) { j.fxFn(s, r, j, k, q) } else { if (g.isFunction(g.fn.cycle[j.fx])) { g.fn.cycle[j.fx](s, r, j, k) } else { g.fn.cycle.custom(s, r, j, k, n && j.fastOnEvent) } } } if (j.random) { j.currSlide = j.nextSlide; if (++j.randomIndex == o.length) { j.randomIndex = 0 } j.nextSlide = j.randomMap[j.randomIndex] } else { var l = (j.nextSlide + 1) == o.length; j.nextSlide = l ? 0 : j.nextSlide + 1; j.currSlide = l ? o.length - 1 : j.nextSlide - 1 } if (j.pager) { g.fn.cycle.updateActivePagerLink(j.pager, j.currSlide) } } if (j.timeout && !j.continuous) { m.cycleTimeout = setTimeout(function() { b(o, j, 0, !j.rev) }, f(s, r, j, q)) } else { if (j.continuous && m.cyclePause) { m.cycleTimeout = setTimeout(function() { b(o, j, 0, !j.rev) }, 10) } } } g.fn.cycle.updateActivePagerLink = function(j, k) { g(j).find("a").removeClass("activeSlide").filter("a:eq(" + k + ")").addClass("activeSlide") }; function f(n, l, m, k) { if (m.timeoutFn) { var j = m.timeoutFn(n, l, m, k); if (j !== false) { return j } } return m.timeout } function i(j, k, n) { var m = k.container, l = m.cycleTimeout; if (l) { clearTimeout(l); m.cycleTimeout = 0 } if (k.random && n < 0) { k.randomIndex--; if (--k.randomIndex == -2) { k.randomIndex = j.length - 2 } else { if (k.randomIndex == -1) { k.randomIndex = j.length - 1 } } k.nextSlide = k.randomMap[k.randomIndex] } else { if (k.random) { if (++k.randomIndex == j.length) { k.randomIndex = 0 } k.nextSlide = k.randomMap[k.randomIndex] } else { k.nextSlide = k.currSlide + n; if (k.nextSlide < 0) { if (k.nowrap) { return false } k.nextSlide = j.length - 1 } else { if (k.nextSlide >= j.length) { if (k.nowrap) { return false } k.nextSlide = 0 } } } } if (k.prevNextClick && typeof k.prevNextClick == "function") { k.prevNextClick(n > 0, k.nextSlide, j[k.nextSlide]) } b(j, k, 1, n >= 0); return false } function a(k, l) { var j = g(l.pager); g.each(k, function(m, n) { g.fn.cycle.createPagerAnchor(m, n, j, k, l) }); g.fn.cycle.updateActivePagerLink(l.pager, l.startingSlide) } g.fn.cycle.createPagerAnchor = function(m, n, k, l, o) { var j = (typeof o.pagerAnchorBuilder == "function") ? o.pagerAnchorBuilder(m, n) : '<a href="#">' + (m + 1) + "</a>"; if (!j) { return } var p = g(j); if (p.parents("body").length == 0) { p.appendTo(k) } p.bind(o.pagerEvent, function() { o.nextSlide = m; var r = o.container, q = r.cycleTimeout; if (q) { clearTimeout(q); r.cycleTimeout = 0 } if (typeof o.pagerClick == "function") { o.pagerClick(o.nextSlide, l[o.nextSlide]) } b(l, o, 1, o.currSlide < m); return false }); if (o.pauseOnPagerHover) { p.hover(function() { o.container.cyclePause++ }, function() { o.container.cyclePause-- }) } }; function e(l) { function k(m) { var m = parseInt(m).toString(16); return m.length < 2 ? "0" + m : m } function j(o) { for (; o && o.nodeName.toLowerCase() != "html"; o = o.parentNode) { var m = g.css(o, "background-color"); if (m.indexOf("rgb") >= 0) { var n = m.match(/\d+/g); return "#" + k(n[0]) + k(n[1]) + k(n[2]) } if (m && m != "transparent") { return m } } return "#ffffff" } l.each(function() { g(this).css("background-color", j(this)) }) } g.fn.cycle.custom = function(u, o, j, l, k) { var t = g(u), p = g(o); p.css(j.cssBefore); var m = k ? 1 : j.speedIn; var s = k ? 1 : j.speedOut; var n = k ? null : j.easeIn; var r = k ? null : j.easeOut; var q = function() { p.animate(j.animIn, m, n, l) }; t.animate(j.animOut, s, r, function() { if (j.cssAfter) { t.css(j.cssAfter) } if (!j.sync) { q() } }); if (j.sync) { q() } }; g.fn.cycle.transitions = { fade: function(k, l, j) { l.not(":eq(" + j.startingSlide + ")").css("opacity", 0); j.before.push(function() { g(this).show() }); j.animIn = { opacity: 1 }; j.animOut = { opacity: 0 }; j.cssBefore = { opacity: 0 }; j.cssAfter = { display: "none" }; j.onAddSlide = function(m) { m.hide() } } }; g.fn.cycle.ver = function() { return h }; g.fn.cycle.defaults = { fx: "fade", timeout: 4000, timeoutFn: null, continuous: 0, speed: 1000, speedIn: null, speedOut: null, next: null, prev: null, prevNextClick: null, pager: null, pagerClick: null, pagerEvent: "click", pagerAnchorBuilder: null, before: null, after: null, end: null, easing: null, easeIn: null, easeOut: null, shuffle: null, animIn: null, animOut: null, cssBefore: null, cssAfter: null, fxFn: null, height: "auto", startingSlide: 0, sync: 1, random: 0, fit: 0, containerResize: 1, pause: 0, pauseOnPagerHover: 0, autostop: 0, autostopCount: 0, delay: 0, slideExpr: null, cleartype: 0, nowrap: 0, fastOnEvent: 0} })(jQuery); (function(a) { a.fn.cycle.transitions.scrollUp = function(c, d, b) { c.css("overflow", "hidden"); b.before.push(function(g, e, f) { a(this).show(); f.cssBefore.top = e.offsetHeight; f.animOut.top = 0 - g.offsetHeight }); b.cssFirst = { top: 0 }; b.animIn = { top: 0 }; b.cssAfter = { display: "none"} } })(jQuery);


//获取地址栏参数  sorStr:  document.location.search
function GetQueryValue(sorStr,panStr){     
 var vStr="";    
 if (sorStr==null || sorStr==""  || panStr==null || panStr=="")  return  vStr;    
 sorStr = sorStr.toLowerCase();  
 panStr += "=";    
 var itmp=sorStr.indexOf(panStr);    
 if (itmp<0){return  vStr;}    
 sorStr  =  sorStr.substr(itmp  +  panStr.length);    
 itmp=sorStr.indexOf("&");    
 if (itmp<0)  
 {
 return  sorStr;    
 }
 else{
 sorStr=sorStr.substr(0,itmp);
 return  sorStr;
 }
}


/**************************************************************************************/
var isIE = !(navigator.userAgent.indexOf('MSIE') == -1);
//兼容获取子对象写法
function GetMyChildrenNodes(node, tag) {
    var c = new Array();
    for (var i = 0; i < node.length; i++) {
        if (node[i].nodeName.toLowerCase() == tag.toLowerCase())
            c.push(node[i]);
    }
    return c;
}

//选项卡式的切换内容
function jsFunChangeCssForTab(objOrTabId, tabTagName, cssOff, cssOn, objOrConId, conTagName, crtIndex) {
    var oTab = null;
    var oCon = null;
    if (typeof objOrTabId == 'object') oTab = objOrTabId; else oTab = document.getElementById(objOrTabId);
    if (typeof objOrConId == 'object') oCon = objOrConId; else oCon = document.getElementById(objOrConId);

    //tab控制
    if (oTab != null) {

        //var _tabChilds=oTab.getElementsByTagName(tabTagName);
        var _tabChilds = GetMyChildrenNodes(oTab.childNodes, tabTagName);
        var _conChilds = null;
        if (oCon != null) {
            _conChilds = GetMyChildrenNodes(oCon.childNodes, conTagName);
            //if(isIE){ _conChilds=oCon.childNodes;}else{_conChilds=GetMyChildrenNodes(oCon.childNodes,conTagName);}
        }

        /**/
        //fix:max crtIndex
        if (crtIndex < 0) { crtIndex = 0; }
        //else if(crtIndex>=_tabChilds.length){crtIndex=_tabChilds.length-1;}

        if (_tabChilds == null || _tabChilds.length == 0) {
            alert("找不到定义选项卡[" + objOrTabId + "]，请检查参数.");
        }
        //        alert("_tabChilds:" + _tabChilds);
        //        alert("_conChilds:" + _conChilds);
        //        alert("_conChilds.outerHTML:" + _conChilds.outerHTML);
        //        alert("_tabChilds.length:" + _tabChilds.length);

        for (var i = 0; i < _tabChilds.length; i++) {
            var _childT = _tabChilds[i];
            _childT.setAttribute("ind", i);
            if (i == crtIndex) { _childT.className = cssOn; } else { _childT.className = cssOff; }
            _childT.onmouseover = function() {
                jsFunChangeCssForTab(objOrTabId, tabTagName, cssOff, cssOn, objOrConId, conTagName, this.getAttribute("ind"))
            }
            _childT.onmouseout = function() {
                jsFunChangeCssForTab(objOrTabId, tabTagName, cssOff, cssOn, objOrConId, conTagName, this.getAttribute("ind"))
            }
           
            //同步切换内容
            if (_conChilds != null) {
                var _childC = _conChilds[i];
                if (_childC != null) {
                    _childC.setAttribute("ind", i);
                    if (i == crtIndex) { _childC.style.display = "block"; } else { _childC.style.display = "none"; }
                }
            }
        }
        //fix:tab超过con时，显示最后一次的tab
        if (_conChilds != null) {
            var minL = _conChilds.length;
            if (_conChilds != null && _conChilds.length > 0 && crtIndex >= minL && _tabChilds.length > minL) {
                _tabChilds[minL - 1].className = cssOn;
                _conChilds[minL - 1].style.display = "block";
            }
        }
        _tabChilds = null;
        _conChilds = null;
    }
    oTab = null;
    oCon = null;
}


/**********************/
function jsAddFavorite() {
    if (document.all) {
        window.external.addFavorite('http://www.lygfdc.com', '连云港房地产网');
    }
    else if (window.sidebar) {
        window.sidebar.addPanel('连云港房地产网', 'http://www.lygfdc.com', "");
    }
}

function jsSetHomepage() {
    if (document.all) 
    {
        document.body.style.behavior = 'url(#default#homepage)';
        document.body.setHomePage('http://www.lygfdc.com');
    }
    else if (window.sidebar) {
        if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            }
            catch (e) {
                alert("该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");
            }
        }
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage', 'http://www.lygfdc.com');
    }
}



