/// <reference path="jquery-1.4.1-vsdoc.js" />

$(document).ready(function(){

	/* Adding a colortip to any tag with a title attribute: */

	$('[title]').colorTip({color:'yellow'});

});



//$(document).ready(function() {
//    $('#adc').cycle({
//        fx: 'scrollUp', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
//		speed:    100, 
//    	timeout:  2000 

//	});
//});



$(document).ready(function () {
    var len = $("#numeric > li").length;
    var index = 1;
    var timer = 4000;

    $("#numeric li").mouseover(function () {
        index = $("#numeric li").index(this);
        rotatorimg(index);
    });

    $("#ad_1000").hover(function () {
        if (interval) {
            clearInterval(interval);
        }
    }, function () {
        interval = setInterval(function () {
            rotatorimg(index)
            index++;
            if (index == len) { index = 0; }
        }, timer);
    });

    var interval = setInterval(function () {
        rotatorimg(index)
        index++;
        if (index == len) { index = 0; }
    }, timer);

    function rotatorimg(i) {
        $("#liehuocnSlider").stop(true, false).animate({ 'opacity': 0.1 }, 300);
        $("#liehuocnSlider").animate({ top: -180 * i }, 1).animate({ 'opacity': 1 }, 500);
        $("#numeric li").eq(i).addClass("on").siblings().removeClass("on");
    }
});



$(document).ready(function () {
    var adclen = $("#adcnumeric > li").length;
    var adcindex = 0;
    var adctimer = 4000;

    $("#adcnumeric li").mouseover(function () {
        adcindex = $("#adcnumeric li").index(this);
        adcrotatorimg(adcindex);
    });

    $("#adc").hover(function () {
        if (adcinterval) {
            clearInterval(adcinterval);
        }
    }, function () {
        adcinterval = setInterval(function () {
            adcrotatorimg(adcindex)
            adcindex++;
            if (adcindex == adclen) { adcindex = 0; }
        }, adctimer);
    });

    var adcinterval = setInterval(function () {
        adcrotatorimg(adcindex)
        adcindex++;
        if (adcindex == adclen) { adcindex = 0; }
    }, adctimer);

    function adcrotatorimg(i) {
        $("#adc").stop(true, false).animate({ top: -176 * i }, 500);
        $("#adcnumeric li").eq(i).addClass("on").siblings().removeClass("on");
    }
});



    /******变色开始*********/

    var rate = 20;
    var obj;
    var act = 0;
    var elmH = 0;
    var elmS = 128;
    var elmV = 255;
    var clrOrg;
    var TimerID;


    $(document).ready(function () {
        $(".changeColor").each(function () {

            $(this).hover(function () {
                obj = this;
                act = 1;
                //clrOrg = obj.style.color;
                //clrOrg = obj.css("color");
                clrOrg = $(this).css("color");
                TimerID = setInterval("ChangeColor()", 100);
            },

                function () {
                    $(this).css("color", clrOrg);
                    clearInterval(TimerID);
                    act = 0;
                });
        });
    });

    function ChangeColor() {
        //obj.style.color = makeColor();
        //obj.css("color", makeColor());
        $(obj).css("color", makeColor());
    }

    function makeColor() {

        if (elmS == 0) {
            elmR = elmV; elmG = elmV; elmB = elmV;
        }
        else {
            t1 = elmV;
            t2 = (255 - elmS) * elmV / 255;
            t3 = elmH % 60;
            t3 = (t1 - t2) * t3 / 60;
            if (elmH < 60) {
                elmR = t1; elmB = t2; elmG = t2 + t3;
            }
            else if (elmH < 120) {
                elmG = t1; elmB = t2; elmR = t1 - t3;
            }
            else if (elmH < 180) {
                elmG = t1; elmR = t2; elmB = t2 + t3;
            }
            else if (elmH < 240) {
                elmB = t1; elmR = t2; elmG = t1 - t3;
            }
            else if (elmH < 300) {
                elmB = t1; elmG = t2; elmR = t2 + t3;
            }
            else if (elmH < 360) {
                elmR = t1; elmG = t2; elmB = t1 - t3;
            }
            else {
                elmR = 0; elmG = 0; elmB = 0;
            }
        }
        elmR = Math.floor(elmR);
        elmG = Math.floor(elmG);
        elmB = Math.floor(elmB);
        clrRGB = '#' + elmR.toString(16) + elmG.toString(16) + elmB.toString(16);
        elmH = elmH + rate;
        if (elmH >= 360)
            elmH = 0;
        return clrRGB;
    }


    /******变色结束*********/

    var currLink = null;

    $(document).ready(function () {

        $("#changeTab0").hover(function () {
            if (currLink) currLink.style.color = "#333333";
            currLink = this;
            currLink.style.color = "#FF0000";

            $("#newsTop").show()
            $("#newsDeyang").hide();
            $("#newsUnicom").hide();
            $("#newsCommunite").hide();

        }, function () { });

        $("#changeTab1").hover(function () {
            if (currLink) currLink.style.color = "#333333";
            currLink = this;
            currLink.style.color = "#FF0000";

            $("#newsTop").hide();
            $("#newsDeyang").show();
            $("#newsUnicom").hide();
            $("#newsCommunite").hide();
        }, function () { });

        $("#changeTab2").hover(function () {
            if (currLink) currLink.style.color = "#333333";
            currLink = this;
            currLink.style.color = "#FF0000";

            $("#newsTop").css({ "display": "none" });
            $("#newsDeyang").css({ "display": "none" });
            $("#newsUnicom").css({ "display": "block" });
            $("#newsCommunite").css({ "display": "none" });
        }, function () { });

        $("#changeTab3").hover(function () {
            if (currLink) currLink.style.color = "#333333";
            currLink = this;
            currLink.style.color = "#FF0000";

            $("#newsTop").css({ "display": "none" });
            $("#newsDeyang").css({ "display": "none" });
            $("#newsUnicom").css({ "display": "none" });
            $("#newsCommunite").css({ "display": "block" });
         }, function () { });

        currLink = document.getElementById("changeTab0");
        if (currLink) currLink.style.color = "red";
    });



    /*****设为首页*******/
    (function () {
        var o = this, aa = function (a, b, c) {
            a = a.split(".");
            c = c || o;
            !(a[0] in c) && c.execScript && c.execScript("var " + a[0]);
            for (var d; a.length && (d = a.shift()); )
                if (!a.length && b !== undefined)
                    c[d] = b;
                else
                    c = c[d] ? c[d] : c[d] = {}
            };

            //检查浏览器是否有id为a的Element
            var u = function (a) {
                return typeof a == "string" ? document.getElementById(a) : a
            };

            var T = {};
            T.init = function () {
                T.startCheckSetHome()
            };
            T.startCheckSetHome = function () {
                var a = u("SetHome");
                a = T.searchAttributeToRoot(a, "ct");
                var b = document.referrer || "", c = T.isHome(), d = x("My265ScreenWide"), e = x("My265Theme");
                T.sendLog("pv", b, d + " " + e, c, a)
            };
            T.isHome = function () {
                try {
                    var a = location.href, b = u("SetHome");
                    b.style.behavior = "url(#default#homepage)";
                    var c = b.isHomePage(a);
                    c = (c = c || b.isHomePage(a + "/")) || b.isHomePage(a + "/#");
                    return c = "" + c
                } catch (d) {
                    return "unknown"
                }
            };
            T.setHome = function () {
                var a = u("SetHome"), b = location.href, c = "unknown";
                try {
                    a.style.behavior = "url(#default#homepage)";
                    a.setHomePage(b);
                    c = T.isHome();
                    var d = T.searchAttributeToRoot(a, "ct");
                    T.sendLog("hom", "", "", c, d)
                } catch (e) {
                    alert("\u60a8\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u81ea\u52a8\u8bbe\u7f6e\u4e3b\u9875\uff0c\u8bf7\u4f7f\u7528\u6d4f\u89c8\u5668\u83dc\u5355\u624b\u52a8\u8bbe\u7f6e");
                    return "unknown"
                }
                return c
            };
            T.setHomeIfNecessary = function (a) {
                if (T.isHome() != "true")
                    return T.setHome();
                a
                || alert("\u60a8\u5df2\u7ecf\u5c06265\u8bbe\u4e3a\u9996\u9875\uff0c\u8c22\u8c22\u60a8\u5bf9265\u7684\u652f\u6301!");
                return "notexecute"
            };
            T.log = function (a) {
                a = a.srcElement || a.target;
                var b = a.tagName;
                if ("A" != b) {
                    a = a.parentElement || a.parentNode;
                    b = a.tagName
                }
                if ("A" == b) {
                    b = a.href;
                    var c = a.getAttribute("cd");
                    c = c ? c.replace(/\s+/, "") : "";
                    var d = T.searchAttributeToRoot(a, "cad");
                    a = T.searchAttributeToRoot(a, "ct");
                    T.sendLog("sc", b, d, c, a)
                }
            };
            T.searchAttributeToRoot = function (a, b) {
                var c = "";
                try {
                    for (var d = a; d && !c; d = d.parentNode)
                        c = d.getAttribute(b)
                } catch (e) {
                    return ""
                }
                return c
            };
            T.sendLog = function (a, b, c, d, e) {
                if (!(b.indexOf("javascript:") == 0 && c != "theme")) {
                    a = ["/log.html?action=", a, "&url=",
                    (encodeURIComponent || escape)(b), "&cd=", d, "&cad=", c,
                    "&ct=", e].join("");
                    T.sendRequest(a)
                }
            };
            T.sendRequest = function (a) {
                a = [a, "&cacheBust=", Math.random()].join("");
                (new Image).src = a
            };
            var Qa = window;
            Qa.www265com = {};
            window.www265com.logger = T;
            var _g = window.www265com.logger;
            aa("_g", _g, void 0);
        })();


    /****/
