﻿/// <reference path="../Studio/resources/Scripts/mootools.js" />
/// <reference path="../Studio/resources/Scripts/MooStudio.js" />
/*  BizSite 3.0 系统通用脚本  */

$import("UI.Tab.js");

if (!window["UI"]) window["UI"] = new Object();

// 页面上的事件绑定
var Bind = {
    // Tab 切换事件
    Tab: function () {
        $$("div.NewsBlock").each(function (item) {
            var lnks = item.getElements(".title > .tit");
            var navs = item.getElements("ul");

            if (lnks.length > 0 && lnks.length == navs.length) {
                new UI.Tab({
                    lnks: lnks,
                    navs: navs,
                    cssName: "current"
                });
                lnks.addEvent("mouseover", function () {
                    var title = this.get("title");
                    if (title == null) return;
                    this.getNext("a.more").set("href", title);
                });
            }
        });
    },
    // Form 设定服务器端控件使用当前页面作为Action
    Form: function () {
        if ($("aspnetForm") != null) {
            $("aspnetForm").set("action", location.href);
        }
    }
};

window.addEvent("domready", function () {
    Bind.Tab();
    Bind.Form();
});


