﻿// JScript 文件
var pool = new AjaxPool(ajaxFactory);
var layerLogin, nowPath;

var actionRowNum = 0;
var actionColNum = 0;
var lastRowNum = 0;
var lastColNum = 0;
function ReadCatList(adType,catID,rowNum,colNum)
{
    actionRowNum = rowNum;
    actionColNum = colNum;
    
	var lastTitleObj = document.getElementById('tdBC_' + lastRowNum + '_' + lastColNum);
	lastTitleObj.style.backgroundColor = '#FFFFFF';
	lastTitleObj.tag = "0";
	//lastTitleObj.childNodes[0].className = 'BlankLink';
	var lastDivObj = document.getElementById('tdBCDiv_' + lastRowNum + '_' + lastColNum);
	if(actionRowNum==lastRowNum&&actionColNum==lastColNum)
	{}
	else
	lastDivObj.style.display = "none";
	var lastImgTagObj = document.getElementById('imgTag_' + lastRowNum + '_' + lastColNum);
	lastImgTagObj.src = "images/ico_hidden.gif";
	
	var titleObj = document.getElementById('tdBC_' + actionRowNum + '_' + actionColNum);
	titleObj.style.backgroundColor = '#C6DDF4';
	titleObj.tag = "1";
	//titleObj.childNodes[0].className = 'BlankBold14Link';
	var divObj = document.getElementById('tdBCDiv_' + actionRowNum + '_' + actionColNum);
	if(actionRowNum==lastRowNum&&actionColNum==lastColNum)
	{}
	else
	divObj.style.display = "block";
	var imgTagObj = document.getElementById('imgTag_' + actionRowNum + '_' + actionColNum);
	imgTagObj.src = "images/ico_show.gif";
	
	if(divObj.innerHTML == '')
	{
        var parameter = "adType=" + adType + "&pCode=" + catID;
        RequestBrowse(parameter);
    }
    else
    {
        if(actionRowNum==lastRowNum&&actionColNum==lastColNum)
	    {
    	    if(divObj.style.display == 'block')
	        {
	            divObj.style.display = 'none';
	            imgTagObj.src = "images/ico_hidden.gif";
	        }
	        else
	        {
	            divObj.style.display = 'block';
	            imgTagObj.src = "images/ico_show.gif";
	        }
	    }
    }
    
    lastRowNum = rowNum;
    lastColNum = colNum;
}

function RequestBrowse(parameter)
{
    var ajax = pool.borrowAjax(CallBackBrowse, FaildBrowse);
    
    var divObj = document.getElementById("tdBCDiv_" + actionRowNum + "_" + actionColNum);
    divObj.style.display = "block";
    divObj.align = "center";
    //divObj.style.height = "150px";
    divObj.style.padding = "30px 0px 30px 0px";
    divObj.style.backgroundColor = "#C6DDF4";
    //divObj.cssName = "ScrollList";
    divObj.innerHTML = '<img src="images/ajax-loader.gif" />';
    //ajax.elementLoad = divObj;
    
    var rpURL = 'actionpage/GetCatListByParentCode.aspx?' + parameter;
    ajax.go(rpURL, 'GET', null);
}

function CallBackBrowse(sender)
{
    var divObj = document.getElementById("tdBCDiv_" + actionRowNum + "_" + actionColNum);
    
    var xmlDoc = sender.req.responseXML;
    var msg = xmlDoc.selectSingleNode('MeihuaNet/Message').text;
    
    if(msg == "OK")
    {
        layerLogin = xmlDoc.selectSingleNode('MeihuaNet/LayerLogin').text;
        nowPath = xmlDoc.selectSingleNode('MeihuaNet/NowPath').text;
        
        divObj.align = "";
        //divObj.style.height = "150px";
        divObj.style.padding = "0px 0px 0px 0px";
        //divObj.className = "ScrollList";
        
        var sCategory = xmlDoc.selectNodes('MeihuaNet/Category/SencondCategory');
        var adType = xmlDoc.selectSingleNode('MeihuaNet/AdType').text;
        
        if(sCategory.length>0)
            divObj.innerHTML = CreateCategoryInfo(sCategory,adType);
        else
        {
            divObj.align = "center";
            divObj.style.height = "";
            divObj.style.padding = "30px 0px 30px 0px";
            divObj.innerHTML = '暂无子分类';
        }
    }
    else
    {
        divObj.innerHTML = "";
        alert('数据加载失败!');
    }
}

function FaildBrowse(sender)
{
    //document.getElementById("").innerHTML = 'Search Error:' + sender.req.status + '  ' + sender.req.statusText + '<br />';
    pool.returnAjax(sender);
}

function CreateCatUrl(searchType, categoryCode, categoryName)
{
    if(layerLogin == "true")
    {
        return "<a href=\"###\" onclick=\"Login('" + nowPath + "actionpage/QuerySearch.aspx?searchType=" + searchType + "&browse=category&catID=" + categoryCode + "&catName=" + escape(categoryName) + "');\" class=\"BlankLink\">" + categoryName + "</a>";
    }
    else
    {
        return "<a href=\"actionpage/QuerySearch.aspx?searchType=" + searchType + "&browse=category&catID=" + categoryCode + "&catName=" + escape(categoryName) + "\" class=\"BlankLink\">" + categoryName + "</a>";
    }
}
        
function CreateCategoryInfo(sCategory,adType)
{
    var allNum = sCategory.length;
    var rowNum = Math.floor(allNum/3+(allNum%3==0?0:1));
    
    var html = '';
    
    switch(adType)
    {
        case "NAD":
        html += '<table width="100%" border="0" cellspacing="8" cellpadding="0">';
        for(var i=0;i<rowNum;i++)
        {
            html += '<tr>';
            for(var j=0;j<3;j++)
            {
                var width = "33%";
                if(j == 1)
                    width = "34%";
                    
                var nodeCount = i*3+j;
                if(nodeCount<allNum)
                {
                    var catCode = sCategory[nodeCount].selectSingleNode('catCode').text;
                    var catName = sCategory[nodeCount].selectSingleNode('catName').text;
                    
                    //var url = '<a href="actionpage/QuerySearch.aspx?searchType=NAD&browse=category&catID=' + catCode + '&catName=' + escape(catName) + '" class="BlankLink">' + catName + '</a>';
                    var url = CreateCatUrl('NAD',catCode,catName);
                    
                    html += '<td width="'+ width +'" valign="top">';
                    
                    //获取子类
                    var tCategory = sCategory[nodeCount].selectNodes('ThirdCategory');
                    html += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
                    html += '<tr>';
                    html += '<td width="20"><img src="images/ig_treeXPFolderOpen.gif" /></td>';
                    html += '<td valign="baseline">'+ url +'</td>';
                    html += '</tr>';
                    
                    if(tCategory.length>0)
                    {
                        html += '<tr>';
                        html += '<td>&nbsp;</td>';
                        html += '<td>';
                        
                        html += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
                        for(var m=0;m<tCategory.length;m++)
                        {
                            catCode = tCategory[m].selectSingleNode('catCode').text;
                            catName = tCategory[m].selectSingleNode('catName').text;
                            //url = '<a href="actionpage/QuerySearch.aspx?searchType=NAD&browse=category&catID=' + catCode + '&catName=' + escape(catName) + '" class="BlankLink">' + catName + '</a>';
                            url = CreateCatUrl('NAD',catCode,catName);
                            
                            html += '<tr>';
                            html += '<td width="20"><img src="images/ig_treeXPFolderOpen.gif" /></td>';
                            html += '<td valign="baseline">'+ url +'</td>';
                            html += '</tr>';
                        }
                        html += '</table>';
                        
                        html += '</td>';
                        html += '</tr>';
                    }
                    
                    html += '</table>';
                    
                    html += '</td>';
                }
                else
                {
                    html += '<td width="'+ width +'">&nbsp;</td>';
                }
            }
            html += '</tr>';
        }
        html += '</table>';
        break;
        case "TVC":
        html += '<table width="100%" border="0" cellspacing="8" cellpadding="0">';
        for(var i=0;i<rowNum;i++)
        {
            html += '<tr>';
            for(var j=0;j<3;j++)
            {
                var width = "33%";
                if(j == 1)
                    width = "34%";
                    
                var nodeCount = i*3+j;
                if(nodeCount<allNum)
                {
                    var catCode = sCategory[nodeCount].selectSingleNode('catCode').text;
                    var catName = sCategory[nodeCount].selectSingleNode('catName').text;
                    //var url = '<a href="actionpage/QuerySearch.aspx?searchType=TVC&browse=category&catID=' + catCode + '&catName=' + escape(catName) + '" class="BlankLink">' + catName + '</a>';
                    var url = CreateCatUrl('TVC',catCode,catName);
                    html += '<td width="'+ width +'">';
                    
                    html += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
                    html += '<tr>';
                    html += '<td width="20"><img src="images/ig_treeXPFolderOpen.gif" /></td>';
                    html += '<td valign="baseline">'+ url +'</td>';
                    html += '</tr>';
                    html += '</table>';
                    
                    html += '</td>';
                }
                else
                {
                    html += '<td width="'+ width +'">&nbsp;</td>';
                }
            }
            html += '</tr>';
        }
        html += '</table>';
        break;
        case "ODG":
        html += '<table width="100%" border="0" cellspacing="8" cellpadding="0">';
        for(var i=0;i<rowNum;i++)
        {
            html += '<tr>';
            for(var j=0;j<3;j++)
            {
                var width = "33%";
                if(j == 1)
                    width = "34%";
                    
                var nodeCount = i*3+j;
                if(nodeCount<allNum)
                {
                    var catCode = sCategory[nodeCount].selectSingleNode('catCode').text;
                    var catName = sCategory[nodeCount].selectSingleNode('catName').text;
                    //var url = '<a href="actionpage/QuerySearch.aspx?searchType=ODG&browse=category&catID=' + catCode + '&catName=' + escape(catName) + '" class="BlankLink">' + catName + '</a>';
                    var url = CreateCatUrl('ODG',catCode,catName);
                    html += '<td width="'+ width +'">';
                    
                    html += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
                    html += '<tr>';
                    html += '<td width="20"><img src="images/ig_treeXPFolderOpen.gif" /></td>';
                    html += '<td valign="baseline">'+ url +'</td>';
                    html += '</tr>';
                    html += '</table>';
                    
                    html += '</td>';
                }
                else
                {
                    html += '<td width="'+ width +'">&nbsp;</td>';
                }
            }
            html += '</tr>';
        }
        html += '</table>';
        break;
        case "IAD":
        html += '<table width="100%" border="0" cellspacing="8" cellpadding="0">';
        for(var i=0;i<rowNum;i++)
        {
            html += '<tr>';
            for(var j=0;j<3;j++)
            {
                var width = "33%";
                if(j == 1)
                    width = "34%";
                    
                var nodeCount = i*3+j;
                if(nodeCount<allNum)
                {
                    var catCode = sCategory[nodeCount].selectSingleNode('catCode').text;
                    var catName = sCategory[nodeCount].selectSingleNode('catName').text;
                    //var url = '<a href="actionpage/QuerySearch.aspx?searchType=IAD&browse=category&catID=' + catCode + '&catName=' + escape(catName) + '" class="BlankLink">' + catName + '</a>';
                    url = CreateCatUrl('IAD',catCode + '&catType=M',catName);
                    html += '<td width="'+ width +'" valign="top">';
                    
                    //获取子类
                    var tCategory = sCategory[nodeCount].selectNodes('ThirdCategory');
                    html += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
                    html += '<tr>';
                    html += '<td width="20"><img src="images/ig_treeXPFolderOpen.gif" /></td>';
                    html += '<td valign="baseline">'+ url +'</td>';
                    html += '</tr>';
                    
                    if(tCategory.length>0)
                    {
                        html += '<tr>';
                        html += '<td>&nbsp;</td>';
                        html += '<td>';
                        
                        html += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
                        for(var m=0;m<tCategory.length;m++)
                        {
                            catCode = tCategory[m].selectSingleNode('catCode').text;
                            catName = tCategory[m].selectSingleNode('catName').text;
                            //url = '<a href="actionpage/QuerySearch.aspx?searchType=IAD&browse=category&catID=' + catCode + '&catName=' + escape(catName) + '" class="BlankLink">' + catName + '</a>';
                            url = CreateCatUrl('IAD',catCode + '&catType=S',catName);
                            
                            html += '<tr>';
                            html += '<td width="20"><img src="images/ig_treeXPFolderOpen.gif" /></td>';
                            html += '<td valign="baseline">'+ url +'</td>';
                            html += '</tr>';
                        }
                        html += '</table>';
                        
                        html += '</td>';
                        html += '</tr>';
                    }
                    
                    html += '</table>';
                    
                    html += '</td>';
                }
                else
                {
                    html += '<td width="'+ width +'">&nbsp;</td>';
                }
            }
            html += '</tr>';
        }
        html += '</table>';
        break;
        case "POS":
        html += '<table width="100%" border="0" cellspacing="8" cellpadding="0">';
        for(var i=0;i<rowNum;i++)
        {
            html += '<tr>';
            for(var j=0;j<3;j++)
            {
                var width = "33%";
                if(j == 1)
                    width = "34%";
                    
                var nodeCount = i*3+j;
                if(nodeCount<allNum)
                {
                    var catCode = sCategory[nodeCount].selectSingleNode('catCode').text;
                    var catName = sCategory[nodeCount].selectSingleNode('catName').text;
                    //var url = '<a href="actionpage/QuerySearch.aspx?searchType=POS&browse=category&catID=' + catCode + '&catName=' + escape(catName) + '" class="BlankLink">' + catName + '</a>';
                    url = CreateCatUrl('POS',catCode,catName);
                    
                    html += '<td width="'+ width +'" valign="top">';
                    
                    //获取子类
                    var tCategory = sCategory[nodeCount].selectNodes('ThirdCategory');
                    html += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
                    html += '<tr>';
                    html += '<td width="20"><img src="images/ig_treeXPFolderOpen.gif" /></td>';
                    html += '<td valign="baseline">'+ url +'</td>';
                    html += '</tr>';
                    
                    if(tCategory.length>0)
                    {
                        html += '<tr>';
                        html += '<td>&nbsp;</td>';
                        html += '<td>';
                        
                        html += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
                        for(var m=0;m<tCategory.length;m++)
                        {
                            catCode = tCategory[m].selectSingleNode('catCode').text;
                            catName = tCategory[m].selectSingleNode('catName').text;
                            //url = '<a href="actionpage/QuerySearch.aspx?searchType=POS&browse=category&catID=' + catCode + '&catName=' + escape(catName) + '" class="BlankLink">' + catName + '</a>';
                            url = CreateCatUrl('POS',catCode,catName);
                            
                            html += '<tr>';
                            html += '<td width="20"><img src="images/ig_treeXPFolderOpen.gif" /></td>';
                            html += '<td valign="baseline">'+ url +'</td>';
                            html += '</tr>';
                        }
                        html += '</table>';
                        
                        html += '</td>';
                        html += '</tr>';
                    }
                    
                    html += '</table>';
                    
                    html += '</td>';
                }
                else
                {
                    html += '<td width="'+ width +'">&nbsp;</td>';
                }
            }
            html += '</tr>';
        }
        html += '</table>';
        break;
        default:
        break;
    }
    
    return html;
}


//nad Medium
var lastMedium = 0;
function ChangeMediumNADTab(mediumType)
{
    if(mediumType == "1")
    {
        if(lastMedium == mediumType)
        {
	        var divObj = document.getElementById('tdBCDiv_1');
	        var imgTagObj = document.getElementById('imgTag_1');
	        if(divObj.style.display == 'block')
	        {
	            divObj.style.display = 'none';
	            imgTagObj.src = "images/ico_hidden.gif";
	        }
	        else
	        {
	            divObj.style.display = 'block';
	            imgTagObj.src = "images/ico_show.gif";
	        }
        }
        else
        {
            var lastTitleObj = document.getElementById('tdBC_2');
	        lastTitleObj.style.backgroundColor = '#FFFFFF';
	        lastTitleObj.tag = "0";
	        //lastTitleObj.childNodes[0].className = 'BlankLink';
	        var lastDivObj = document.getElementById('tdBCDiv_2');
	        lastDivObj.style.display = "none";
	        var lastImgTagObj = document.getElementById('imgTag_2');
	        lastImgTagObj.src = "images/ico_hidden.gif";
    	    
	        var titleObj = document.getElementById('tdBC_1');
	        titleObj.style.backgroundColor = '#C6DDF4';
	        titleObj.tag = "1";
	        //titleObj.childNodes[0].className = 'BlankBold14Link';
	        var divObj = document.getElementById('tdBCDiv_1');
	        divObj.style.display = "block";
	        var imgTagObj = document.getElementById('imgTag_1');
	        imgTagObj.src = "images/ico_show.gif";
	    }
    }
    else
    {
        if(lastMedium == mediumType)
        {
	        var divObj = document.getElementById('tdBCDiv_2');
	        var imgTagObj = document.getElementById('imgTag_2');
	        if(divObj.style.display == 'block')
	        {
	            divObj.style.display = 'none';
	            imgTagObj.src = "images/ico_hidden.gif";
	        }
	        else
	        {
	            divObj.style.display = 'block';
	            imgTagObj.src = "images/ico_show.gif";
	        }
        }
        else
        {
            var lastTitleObj = document.getElementById('tdBC_1');
	        lastTitleObj.style.backgroundColor = '#FFFFFF';
	        lastTitleObj.tag = "0";
	        //lastTitleObj.childNodes[0].className = 'BlankLink';
	        var lastDivObj = document.getElementById('tdBCDiv_1');
	        lastDivObj.style.display = "none";
	        var lastImgTagObj = document.getElementById('imgTag_1');
	        lastImgTagObj.src = "images/ico_hidden.gif";
    	    
	        var titleObj = document.getElementById('tdBC_2');
	        titleObj.style.backgroundColor = '#C6DDF4';
	        titleObj.tag = "1";
	        //titleObj.childNodes[0].className = 'BlankBold14Link';
	        var divObj = document.getElementById('tdBCDiv_2');
	        divObj.style.display = "block";
	        var imgTagObj = document.getElementById('imgTag_2');
	        imgTagObj.src = "images/ico_show.gif";
	    }
    }
    
    lastMedium = mediumType;
}

var actionRow = new Array();
var actionCol = new Array();
var lastRow = new Array();
lastRow[1] = 0;
lastRow[2] = 0;
var lastCol = new Array();
lastCol[1] = 0;
lastCol[2] = 0;
function ReadMedium(adType,mediumType,code,rowNum,colNum)
{
    actionRow[mediumType] = rowNum;
    actionCol[mediumType] = colNum;
    
	var lastTitleObj = document.getElementById('tdBC_' + mediumType + '_' + lastRow[mediumType] + '_' + lastCol[mediumType]);
	lastTitleObj.style.backgroundColor = '#FFFFFF';
	lastTitleObj.tag = "0";
	//lastTitleObj.childNodes[0].className = 'BlankLink';
	var lastDivObj = document.getElementById('tdBCDiv_'+ mediumType + '_'  + lastRow[mediumType] + '_' + lastCol[mediumType]);
	if(actionRow[mediumType]==lastRow[mediumType]&&actionCol[mediumType]==lastCol[mediumType])
	{}
	else
	lastDivObj.style.display = "none";
	var lastImgTagObj = document.getElementById('imgTag_'+ mediumType + '_'  + lastRow[mediumType] + '_' + lastCol[mediumType]);
	lastImgTagObj.src = "images/ico_hidden.gif";
	
	
	var titleObj = document.getElementById('tdBC_'+ mediumType + '_'  + actionRow[mediumType] + '_' + actionCol[mediumType]);
	titleObj.style.backgroundColor = '#C6DDF4';
	titleObj.tag = "1";
	//titleObj.childNodes[0].className = 'BlankBold14Link';
	var divObj = document.getElementById('tdBCDiv_'+ mediumType + '_'  + actionRow[mediumType] + '_' + actionCol[mediumType]);
	if(actionRow[mediumType]==lastRow[mediumType]&&actionCol[mediumType]==lastCol[mediumType])
	{}
	else
	divObj.style.display = "block";
	var imgTagObj = document.getElementById('imgTag_'+ mediumType + '_'  + actionRow[mediumType] + '_' + actionCol[mediumType]);
	imgTagObj.src = "images/ico_show.gif";
	
	if(divObj.innerHTML == '')
	{
        var parameter = "adType=" + adType + "&type=" + mediumType + "&" + "code=" + code;
        RequestMediumBrowse(parameter,mediumType);
    }
    else
    {
        if(actionRow[mediumType]==lastRow[mediumType]&&actionCol[mediumType]==lastCol[mediumType])
	    {
    	    if(divObj.style.display == 'block')
	        {
	            divObj.style.display = 'none';
	            imgTagObj.src = "images/ico_hidden.gif";
	        }
	        else
	        {
	            divObj.style.display = 'block';
	            imgTagObj.src = "images/ico_show.gif";
	        }
	    }
    }
    
    lastRow[mediumType] = rowNum;
    lastCol[mediumType] = colNum;
}

function RequestMediumBrowse(parameter,mediumType)
{
    var ajax = pool.borrowAjax(CallBackMediumBrowse, FaildMediumBrowse);
    
    var divObj = document.getElementById("tdBCDiv_" + mediumType + '_' + actionRow[mediumType] + "_" + actionCol[mediumType]);
    divObj.style.display = "block";
    divObj.align = "center";
    //divObj.style.height = "150px";
    divObj.style.padding = "30px 0px 30px 0px";
    divObj.style.backgroundColor = "#C6DDF4";
    //divObj.cssName = "ScrollList";
    divObj.innerHTML = '<img src="images/ajax-loader.gif" />';
    //ajax.elementLoad = divObj;
    
    var rpURL = 'actionpage/GetMediumList.aspx?' + parameter;
    ajax.go(rpURL, 'GET', null);
}

function CallBackMediumBrowse(sender)
{
    var xmlDoc = sender.req.responseXML;
    var msg = xmlDoc.selectSingleNode('MeihuaNet/Message').text;
    var adType = xmlDoc.selectSingleNode('MeihuaNet/AdType').text;
    var mediumType = xmlDoc.selectSingleNode('MeihuaNet/MediumType').text;
    
    var divObj = document.getElementById("tdBCDiv_" + mediumType + "_" + actionRow[mediumType] + "_" + actionCol[mediumType]);
    
    if(msg == "OK")
    {
        layerLogin = xmlDoc.selectSingleNode('MeihuaNet/LayerLogin').text;
        nowPath = xmlDoc.selectSingleNode('MeihuaNet/NowPath').text;
        
        divObj.align = "";
        //divObj.style.height = "150px";
        divObj.style.padding = "0px 0px 0px 0px";
        //divObj.className = "ScrollList";
        
        var tMedium = xmlDoc.selectNodes('MeihuaNet/Medium/ThirdMedium');
        
        if(tMedium.length>0)
            divObj.innerHTML = CreateMediumInfo(tMedium,mediumType,adType);
        else
        {
            divObj.align = "center";
            divObj.style.height = "";
            divObj.style.padding = "30px 0px 30px 0px";
            divObj.innerHTML = '暂无子分类';
        }
    }
    else
    {
        divObj.innerHTML = "";
        alert('数据加载失败!');
    }
}

function FaildMediumBrowse(sender)
{
    //document.getElementById("").innerHTML = 'Search Error:' + sender.req.status + '  ' + sender.req.statusText + '<br />';
    pool.returnAjax(sender);
}

function CreateMediumInfo(tMedium,mediumType,adType)
{
    var allNum = tMedium.length;
    var rowNum = Math.floor(allNum/3+(allNum%3==0?0:1));
    
    var html = '';
    
    html += '<table width="100%" border="0" cellspacing="8" cellpadding="0">';
    for(var i=0;i<rowNum;i++)
    {
        html += '<tr>';
        for(var j=0;j<3;j++)
        {
            var width = "33%";
            if(j == 1)
                width = "34%";
                
            var nodeCount = i*3+j;
            if(nodeCount<allNum)
            {
                var mediumCode = tMedium[nodeCount].selectSingleNode('mediumCode').text;
                var mediumName = tMedium[nodeCount].selectSingleNode('mediumName').text;
                var url = '';
                var IsValid = tMedium[nodeCount].attributes[0].text;
                var classTextDecoration = '';
                var infoTextDecoration = '';
                if(IsValid == "4")
                {
                    classTextDecoration = 'class="TextDecoration"';
                    infoTextDecoration = ' [停止监测]';
                }
                else if(IsValid == "5")
                {
                    classTextDecoration = 'class="TextDecoration"';
                    infoTextDecoration = ' [停刊]';
                }
                //Jay 2009-6-29 取消失效媒体的搜索
                if(true)
                {
                    if(layerLogin == "true")
                        url = '<a href="###" onclick="Login(\'' + nowPath + 'actionpage/QuerySearch.aspx?searchType='+ adType +'&mediumID=' + mediumCode + '&mediumName=' + escape(mediumName) + '\');" class="BlankLink"><span '+ classTextDecoration +'>' + mediumName + '</span></a>' + infoTextDecoration;
                    else
                        url = '<a href="actionpage/QuerySearch.aspx?searchType='+ adType +'&mediumID=' + mediumCode + '&mediumName=' + escape(mediumName) + '" class="BlankLink"><span '+ classTextDecoration +'>' + mediumName + '</span></a>' + infoTextDecoration;
                }
                else
                    url = '<span class="TextDecoration">'+ mediumName +'</span>';
                    
                html += '<td width="'+ width +'" valign="top">';
                
                html += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
                html += '<tr>';
                html += '<td width="20"><img src="images/ig_treeXPFolderOpen.gif" /></td>';
                html += '<td valign="baseline">'+ url +'</td>';
                html += '</tr>';
                html += '</table>';
                
                html += '</td>';
            }
            else
            {
                html += '<td width="'+ width +'">&nbsp;</td>';
            }
        }
        html += '</tr>';
    }
    
    html += '</table>';
    
    return html;
}