using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using xabaraCOM;

public partial class inClude_javascript : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string id = CHAR.htmSafe(Request.QueryString["id"]);

            switch (id)
            {
                case "date":
                    Response.Write("document.write(\"" + datetime.cnTime(1, 1, 1) + "\");");
                    break;

                case "login":
                    {
                        user u = new user();

                        if (u.loginFlag())
                        {
                            Response.Write("document.write(\"你好，" + HttpUtility.UrlDecode(Request.Cookies["XabaraUser"]["userName"].ToString().Trim()) + "！ \");");
                            Response.Write("document.write(\"[<a href='/member/user/my.aspx' target='_top' style='color:#003399;'>个人中心</a>] \");");
                            Response.Write("document.write(\"[<a href='/member/user/exit.aspx' target='_top' style='color:red;'>我要退出</a>]\");");
                        }
                        else
                        {
                            string qq = string.Empty;
                            //QQ快捷登录检查
                            if (!string.IsNullOrEmpty(xml.read("xabara.config", "qqAppID", 180) as string))
                            {
                                qq = "<a href='/member/api/qqLogin.aspx' target='_top'><img src='/member/images/qqMini.png' id='qq' style='vertical-align: middle;' alt='QQ快捷登录' title='QQ快捷登录' /></a>&nbsp;";
                            }
                            Response.Write("document.write(\"您好，欢迎来到" + xml.read("xabara.config", "webName", 180) + "！ \");");
                            Response.Write("document.write(\"<a id='myLogin' href='#' style='font-weight: bold;'>[请登录]</a>&nbsp;" + qq + ",&nbsp;\");");
                            Response.Write("document.write(\"新用户？<a href='/member/user/reg.aspx' target='_top' style='color:red;'>[免费注册]</a>\");");
                        }
                    }
                    break;

                default:
                    Response.Write("document.write(\"" + id + "\");");
                    break;
            }
        }
    }
}