﻿// JScript 文件

function CheckWidthHeigth(Img,MaxWidth,MaxHeight)
{
    var ImgObj;
    if(!document.getElementById)
    {
        return;
    }
    ImgObj = document.getElementById(Img);
    if(!ImgObj.width||!ImgObj.height)
    {
         return;
    }
    if(ImgObj.width>MaxWidth)
    {
        ImgObj.width = MaxWidth;
    }
    if(ImgObj.height>MaxHeight)
    {
        ImgObj.Height = MaxHeight;
    }
}

function GreenTextBox(TargetContainer,TargetClassName ,HoverClassName)
{
    var list = document.getElementById(TargetContainer);
    var lists = list.getElementsByTagName("input");
    for(var i=0;i<lists.length;i++)
    {
        if(lists[i].className==TargetClassName)
        {
            lists[i].onmouseover = function(){this.className=HoverClassName;}
            lists[i].onmouseout = function(){this.className=TargetClassName;}
        }
    }
    lists = list.getElementsByTagName("textarea");
    for(var i=0;i<lists.length;i++)
    {
        if(lists[i].className==TargetClassName)
        {
            lists[i].onmouseover = function(){this.className=HoverClassName;}
            lists[i].onmouseout = function(){this.className=TargetClassName;}
        }
    }
}

function OpenVIP(TargetUrl,OwnerID)
{
    var formatstring = "height=680, width=950, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no";
    var URL = "VIP/ControlPanel.aspx?OwnerID="+OwnerID+"&URL="+TargetUrl;
    window.open(URL,"",formatstring);
}
function OpenVIPINVIP(TargetUrl,OwnerID)
{
    var formatstring = "height=680, width=950, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no";
    var URL = "ControlPanel.aspx?OwnerID="+OwnerID+"&URL="+TargetUrl;
    window.open(URL,"",formatstring);
}
function OpenVIPINVIPT(TargetUrl,OwnerID)
{
    var formatstring = "height=680, width=950, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no";
    var URL = "../Vip/ControlPanel.aspx?OwnerID="+OwnerID+"&URL="+TargetUrl;
    window.open(URL,"",formatstring);
}
function ShowPop(Obj)
{
    Obj.style.display="block";
}
function HiddenPop(Obj)
{
    Obj.style.display="none";
}

function PasswordOnLoad(obj)
{
    var NoTiString = '请输入密码';
    if(obj.value==""||obj.value==NoTiString)
    {
        //obj.value = NoTiString;
        //obj.setAttribute("Type","Text");
    }
}
function PasswordOnFocus(obj)
{
    //obj.setAttribute("type","Text");
    //alert(obj.type);
}
