var CurrentTab = 0;

function CheckForm()
{
    if ($("DDL_ClassID").value == 0)
    {
        alert("请选择栏目！");
        try
        {
            $("DDL_ClassID").focus();
        }
        catch (Error)
		{ }
        return false;
    }
    if ($("TB_GoodsName").value == "")
    {
        alert("名称不能为空！");
        $("TB_GoodsName").focus();
        return false;
    }

    if ($('CE_CE_Content_ID').getHTML() == "")
    {
        alert("内容不能为空！");
        $('CE_CE_Content_ID').FocusDocument();
        return false;
    }
}
function Show1()//常规设置
{
    $("A").style.display = "block";
    $("t_Content").style.display = "block";
    $("B").style.display = "none";
    $("C").style.display = "none";
    $("D").style.display = "none";
    $("E").style.display = "none";
}
function Show2()//高级设置
{
    $("A").style.display = "none";
    $("t_Content").style.display = "none";
    $("B").style.display = "block";
    $("C").style.display = "none";
    $("D").style.display = "none";
    $("E").style.display = "none";
}
function Show3()//摘要
{
    $("A").style.display = "none";
    $("t_Content").style.display = "none";
    $("B").style.display = "none";
    $("C").style.display = "block";
    $("D").style.display = "none";
    $("E").style.display = "none";
}
function Show4()//自定义字段
{
    $("A").style.display = "none";
    $("t_Content").style.display = "none";
    $("B").style.display = "none";
    $("C").style.display = "none";
    $("D").style.display = "block";
    $("E").style.display = "none";
}
function Show5()//图片
{
    $("A").style.display = "none";
    $("t_Content").style.display = "none";
    $("B").style.display = "none";
    $("C").style.display = "none";
    $("D").style.display = "none";
    $("E").style.display = "block";
}
function HideAndDisplay(TabIndex)
{
    $("current").id = "";
    var lis = $("tabs").childNodes[0].childNodes;

    for (i = 0; i < lis.length; i++)
    {
        if (i == TabIndex)
        {
          
            lis[TabIndex].id = "current";
        }
    }
    CurrentTab = TabIndex;
    
    eval("Show" + (TabIndex + 1) + "();");
}


function ColorPalette()
{
    var str = window.showModalDialog("../Images/JS拾色器/JS拾色器.htm", "dialogWidth=190px;dialogHeight=80px");
    if (typeof (str) != "undefined")
    {
        $('TB_ColorStyle').value = str;
        LoadStyle();
    }
}
function LoadStyle()
{
    if ($('TB_ColorStyle') == null)
    {
        return;
    }
    if ($('imgColorStyle') == null)
    {
        return;
    }
    var str = $('TB_ColorStyle').value;
    if (str == "")
    {
        $('imgColorStyle').style.backgroundColor = "#000000";
        //$('TB_Title').style.color = "#000000";
    }
    else
    {
        $('imgColorStyle').style.backgroundColor = str;
        //$('TB_Title').style.color = str;
    }
}

function GetImage()
{
    var str = window.showModalDialog("../window/GetImage.aspx", "up", "dialogWidth=540px;dialogHeight=540px;status=0;scroll=auto");

    if (typeof (str) != "undefined")
        $('TB_PicUrl').value = str;

}
function GetTemplate()
{
    var str = window.showModalDialog("../window/GetTemplate.aspx", "up", "dialogWidth=350px;dialogHeight=320px;status=0;scroll=auto");
    if (typeof (str) != "undefined")
        $('TB_TemplateFileName').value = str;

}
function GetTag()
{
    var str = window.showModalDialog("../window/GetTag.aspx?ModelID=2", "up", "dialogWidth=460px;dialogHeight=440px;status=0;scroll=no");

    if (typeof (str) != "undefined")
    {
        if ($('TB_Key').value == "")
            $('TB_Key').value = str + "|";
        else
            $('TB_Key').value = $('TB_Key').value + str + "|";
    }
}
function ToUnit(Unit)
{
    $("TB_Unit").value = Unit;
    $("TB_Unit").focus();
    return false; 
}


function killerrors()
{
    return true;
}
window.onerror = killerrors; 