﻿// childname内容的id，childshow内容显示样式，childhide内容不可见样式，cursel当前数字，n总数字
// columnname栏目的id, colshow栏目显示的样式, colhide栏目隐藏的样式


function setTab(childname, childshow, childhide, cursel, n, columnname, colshow, colhide) {
    for (i = 1; i <= n; i++) {
        var childmenu = document.getElementById(childname + i);
        var childcon = document.getElementById(childname + i);
        var columnmenu = document.getElementById(columnname + i);
        var columncon = document.getElementById(columnname + i);
        if (childcon) {
            childmenu.className = i == cursel ? childshow : childhide;
            childcon.style.display = i == cursel ? "block" : childhide;
            
        }
        if (columncon) {
            columnmenu.className = i == cursel ? colshow : colhide;
            // columncon.style.display = i == cursel ?  colshow : colhide;
        }
        
        
        
    }
}

// 输出 排序号并到一定数字改变数字的样式
// num 当前数字 , changnum 到达这个数字时改变数字的样式, control 输出控件, minclassname 未改变数字前的样式, bigclassname改变数字后的样式
function OutNum(num,  minclassname, bigclassname,changnum, control) {
    if (num < changnum)
        document.write('<' + control + ' class="' + minclassname + '" >' + num + '</' + control + '>');
    else
        document.write('<' + control + ' class="' + bigclassname + '"  >' + num + '</' + control + '>');
}

function showhide(idchild, childshow, childhide, i, idcol, colshow, colhide) {

    var childmenu = document.getElementById(idcol + i);
    var childcon = document.getElementById(idchild + i);
    var hide = document.getElementById("Hidden" + i);
    if (childcon) {
        if (childcon.className == childshow) {
            childcon.className = childhide;
            childmenu.className = colhide;
           // hide.value = 0;
                   }
        else {
            childcon.className = childshow;
            childmenu.className = colshow;
          //  hide.value = 1;
                   }

    }
}

function ChangUnit(oldunit)
{
var newunit="元/㎡";
if(oldunit=="元/平方米")
 document.write(newunit);
else
  document.write(oldunit);
}

 function ChangFontSize(controlid,size)
{
    var controlid;
    controlid = document.getElementById(controlid);
    controlid.style.cssText = "font-size:"+size+"px;";

}
    
 