//取消函数
function checknone(f)
{
  for (var i=0;i<f.elements.length;i++)
  {
      f.elements[i].checked = false;
  }
}

//删除按钮检查
function checkone(f)
{
    for (var i=0;i<f.elements.length;i++)
    {
       if(f.elements[i].checked) return true;
    }
    alert(LANGUAGE_19);
    return false;
}

//全选函数
function CheckAll(f)
{
    for (var i=0;i<f.elements.length;i++)
    f.elements[i].checked = true;
}
//反选函数
function InvCheck(f)
{
  for (var i=0;i<f.elements.length;i++)
  {
     f.elements[i].checked = !f.elements[i].checked;
  }
}


//函数名：fucCheckLength
//功能介绍：检查字符串的长度
//参数说明：要检查的字符串
//返回值：长度值
function fucCheckLength(strTemp)
{
    var i,sum;
    sum=0;
    for(i=0;i<strTemp.length;i++)
    {
        if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
		{
            sum=sum+1;
		}
        else
		{
            sum=sum+2;
		}
    }
    return sum;
}

//函数名：chkdate    (YYYY-MM-DD)
//功能介绍：检查是否为日期
//参数说明：要检查的字符串
//返回值：0：不是日期  1：是日期
function chkdate(datestr)
{
    var lthdatestr;
    if (datestr != ""){
        lthdatestr= datestr.length;
	}
    else
	{
        lthdatestr=0;
	}
    var tmpy="";
    var tmpm="";
    var tmpd="";
    var status;
    status=0;
    if (lthdatestr==0)
	{
        return 0;
	}
    for (i=0;i<lthdatestr;i++)
    {    
		if (datestr.charAt(i)== '-')
        {
            status++;
        }
        if (status>2)
        {
            return 0;
        }
        if ((status==0) && (datestr.charAt(i)!='-'))
        {
            tmpy=tmpy+datestr.charAt(i);
        }
        if ((status==1) && (datestr.charAt(i)!='-'))
        {
            tmpm=tmpm+datestr.charAt(i);
        }
        if ((status==2) && (datestr.charAt(i)!='-'))
        {
            tmpd=tmpd+datestr.charAt(i);
        }

    }
    year=new String(tmpy);
    month=new String(tmpm);
    day=new String(tmpd);
    if ((tmpy.length!=4) || (tmpm.length>2) || (tmpd.length>2))
    {
        //alert("Invalid format of date!");
        return 0;
    }
    if (!((1<=month) && (12>=month) && (31>=day) && (1<=day)))
    {
        //alert ("Invalid month or day!");
        return 0;
    }
    if (!((year % 4)==0) && (month==2) && (day==29))
    {
        //alert ("This is not a leap year!");
        return 0;
    }
    if ((month<=7) && ((month % 2)==0) && (day>=31))
    {
        //alert ("This month is a small month!");
        return 0;

    }
    if ((month>=8) && ((month % 2)==1) && (day>=31))
    {
        //alert ("This month is a small month!");
        return 0;
    }
    if ((month==2) && (day==30))
    {
        //alert("The Febryary never has this day!");
        return 0;
    }

    return 1;
}
//函数名：chkemail
//功能介绍：检查是否为Email Address
//参数说明：要检查的字符串
//返回值：0：不是  1：是
function chkemail(email)
{    
 var pattern = /^([a-zA-Z0-9._*-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
 flag = pattern.test(email);
 if(!flag){
  return 0;
 }else{
  return 1;
 }
}
//函数名：fucCheckNUM
//功能介绍：检查是否为数字
//参数说明：要检查的数字
//返回值：1为是数字，0为不是数字
function fucCheckNUM(NUM)
{
    var i,j,strTemp;
    strTemp="0123456789";
    if ( NUM.length== 0)
	{
		return 0;
	}
    for (i=0;i<NUM.length;i++)
    {
        j=strTemp.indexOf(NUM.charAt(i));
        if (j==-1)
        {
            //说明有字符不是数字
            return 0;
        }
    }
    //说明是数字
    return 1;
}
//函数名：fucCheckTEL
//功能介绍：检查是否为电话号码
//参数说明：要检查的字符串
//返回值：1为是合法，0为不合法
function fucCheckTEL(TEL)
{
    var i,j,strTemp;
    strTemp="0123456789-()# ";
    for (i=0;i<TEL.length;i++)
    {
        j=strTemp.indexOf(TEL.charAt(i));
        if (j==-1)
        {
        //说明有字符不合法
            return 0;
        }
    }
    //说明合法
    return 1;
}

//函数名：fucChecktwopass
//功能介绍：
//参数说明：要检查的字符串
//返回值：1为是合法，0为不合法
function fucChecktwopass(PAS1, PAS2)
{
    if (PAS1 != PAS2)
	{
		 return 0;
	}
          
    return 1;
}


function checkPassWordLevel(pass,passlen) {
   var n=0;
   if (/\d/.test(pass)) n ++;//包含数字
   if (/[a-z]/.test(pass)) n ++;//包含小写字母
   if (/[A-Z]/.test(pass)) n ++;//包含大写字母
   if (/\W/.test(pass)) n ++;//包含其他字符
   if (pass.length<passlen) n=0;//长度小于5位
   //alert(n);
   return n;
}




//函数名：fucOneCheck
//功能介绍：检查是否有选中
//参数说明：表单名和字段串
//返回值：1为是有，0为没

function fucOneCheck(f,chkStr)
{
    var flag=0;
    for (var i=0;i<f.elements.length;i++)
    {
         if(f.elements[i].name.indexOf(chkStr) == 0 && f.elements[i].checked)
         {
              flag = 1;
              break;
         }
    }
    if(flag == 0)
             return 0;

    return 1;
}



//两个列表框选择
function mysubmit1(form,verb)
{
    with(form)
	{
        v.value=verb;
        selectValue.value='';
        for(i=1; i<s2.length; i++)
		{
            selectValue.value+=s2.options[i].value+',';
		}
    }
    return true;
}

function selectContent(src,des)
{
    var oindex=src.selectedIndex;
    var olength=des.length;
    if(oindex>0)
	{
        var otext=src.options[oindex].text;
        var ovalue=src.options[oindex].value;
        if(ovalue=="0") return;
        var tag=0;
        for(i=0; i<olength; i++)
		{
                if(otext==des.options[i].text) {tag=1; break;}
        }
        if(tag==0) 
		{
                src.options[oindex]=null;
                des.options[olength]=new Option(otext,olength);
                des.options[olength].value=ovalue;
                src.selectedIndex=-1;
        }
        if(!setup) setup=true;
        }
}

function insertNew(obj)
{
        for(var i=0;i<document.shezhi.s1.length;i++)
        {
                if(document.shezhi.s1.options[i].value==obj)
                {
                        document.shezhi.s1.options[i].selected=true;
                        selectContent(document.shezhi.s1,document.shezhi.s2);
                        return false;
                }
        }
        //alert(LANGUAGE_20);
        return false;
}


//列表框排序用
function moveUpDown(form)
{
    with(form)
	{
        selectValue.value='';
        for(i=1;i<s1.length;i++){
            selectValue.value+=s1.options[i].value+',';
		}
    }
    form.submit();
}

function moveUp(obj)
{
    with (obj){
        if(selectedIndex==1)
		{
                options[length]=new Option(options[1].text,options[1].value);
                options[1]=null;
                selectedIndex=length-1;
        }
        else {
			if(selectedIndex>1) moveG(obj,-1);
		}

    }

}


function moveDown(obj)
{
    with (obj){
        if(selectedIndex==length-1)
		{
                var otext=options[selectedIndex].text;
                var ovalue=options[selectedIndex].value;
                for(i=selectedIndex; i>1; i--)
				{
                        options[i].text=options[i-1].text;
                        options[i].value=options[i-1].value;
                }
                options[i].text=otext;
                options[i].value=ovalue;
                selectedIndex=1;
                }
        else {
			if(selectedIndex>0 && selectedIndex<length-1) moveG(obj,+1);
		}
    }
}

function moveG(obj,offset)
{
    with (obj)
	{
        desIndex=selectedIndex+offset;
        var otext=options[desIndex].text;
        var ovalue=options[desIndex].value;
        options[desIndex].text=options[selectedIndex].text;
        options[desIndex].value=options[selectedIndex].value;
        options[selectedIndex].text=otext;
        options[selectedIndex].value=ovalue;
        selectedIndex=desIndex;
    }
}


function Create_ContnetTables(height,columncount,sortcolumn)
{
    var height = 30*height+30;
	var tableWidgetObj = new SHBDHTML.tableWidget();
	tableWidgetObj.setTableId('webmailtablecontent');
	//tableWidgetObj.setNoCssLayout();
	tableWidgetObj.setTableWidth('100%');
	height=parent.document.getElementById('welcome').height-220//取高度
	if(height<=0){
		height=300;
	}
	//alert(height);
	tableWidgetObj.setTableHeight(height);
    
    
    if(columncount==2)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S'));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S'));
	}else if(columncount==3)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S'));
	}else if(columncount==4)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S'));
		
	}else if(columncount==5)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S'));
		
	}else if(columncount==6)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S'));
		
	}else if(columncount==7)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S'));
		
	}else if(columncount==8)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S'));
		
	}else if(columncount==9)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S'));
		
	}else if(columncount==10)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==11)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==12)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==13)
	{
   	  tableWidgetObj.setColumnSort(Array(false,false,'S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==14)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==15)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}
	tableWidgetObj.init();
	tableWidgetObj.sortTableByColumn(0);
	//tableWidgetObj.updateTableHeader(sortcolumn,'ascending');
    //addTableRolloverEffect('webmailtablecontent','tableRollOverEffect1','tableRowClickEffect1');

}


function Create_ContnetTables_FLZY(height,columncount,sortcolumn)
{
    var height = 30*height+30;
	var tableWidgetObj = new SHBDHTML.tableWidget();
	tableWidgetObj.setTableId('webmailtablecontent');
	//tableWidgetObj.setNoCssLayout();
	tableWidgetObj.setTableWidth('100%');
	//height=parent.parent.document.getElementById('welcome').height-300//取高度
	//if(height<=0){
		height=220;
	//}
	//alert(height);
	tableWidgetObj.setTableHeight(height);
    
    
    if(columncount==2)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S'));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S'));
	}else if(columncount==3)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S'));
	}else if(columncount==4)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S'));
		
	}else if(columncount==5)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S'));
		
	}else if(columncount==6)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S'));
		
	}else if(columncount==7)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S'));
		
	}else if(columncount==8)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S'));
		
	}else if(columncount==9)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S'));
		
	}else if(columncount==10)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==11)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==12)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==13)
	{
   	  tableWidgetObj.setColumnSort(Array(false,false,'S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==14)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==15)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}
	tableWidgetObj.init();
	tableWidgetObj.sortTableByColumn(0);
	//tableWidgetObj.updateTableHeader(sortcolumn,'ascending');
    //addTableRolloverEffect('webmailtablecontent','tableRollOverEffect1','tableRowClickEffect1');

}


function Create_ContnetTables_Tabs(height,columncount,sortcolumn)
{
    var height = 30*height+30;
	var tableWidgetObj = new SHBDHTML.tableWidget();
	tableWidgetObj.setTableId('webmailtablecontent');
	//tableWidgetObj.setNoCssLayout();
	tableWidgetObj.setTableWidth('100%');
	height=parent.parent.document.getElementById('welcome').height-220//取高度
	if(height<=0){
		height=300;
	}
	//alert(height);
	tableWidgetObj.setTableHeight(height);
    
    
    if(columncount==2)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S'));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S'));
	}else if(columncount==3)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S'));
	}else if(columncount==4)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S'));
		
	}else if(columncount==5)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S'));
		
	}else if(columncount==6)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S'));
		
	}else if(columncount==7)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S'));
		
	}else if(columncount==8)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S'));
		
	}else if(columncount==9)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S'));
		
	}else if(columncount==10)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==11)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==12)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==13)
	{
   	  tableWidgetObj.setColumnSort(Array(false,false,'S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==14)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==15)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}
	tableWidgetObj.init();
	tableWidgetObj.sortTableByColumn(0);
	//tableWidgetObj.updateTableHeader(sortcolumn,'ascending');
    //addTableRolloverEffect('webmailtablecontent','tableRollOverEffect1','tableRowClickEffect1');

}

/*
function Create_ContnetTables(height,columncount,sortcolumn)
{
    var height = 15*height;
	var tableWidgetObj = new SHBDHTML.tableWidget();
	tableWidgetObj.setTableId('webmailtablecontent');
	//tableWidgetObj.setNoCssLayout();
	tableWidgetObj.setTableWidth('100%');
	height=parent.document.getElementById('welcome').height-220//取高度
	if(height<=0){
		height=300;
	}
	tableWidgetObj.setTableHeight(height);
    //alert(height);
    
    if(columncount==2)
	{
	  initTableWidget('webmailtablecontent','100%',height,Array(false,'S'));
	}else if(columncount==3)
	{
	  initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S'));
	}else if(columncount==4)
	{
	  initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S'));
		
	}else if(columncount==5)
	{
	  initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S'));
		
	}else if(columncount==6)
	{
	  initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S'));
		
	}else if(columncount==7)
	{
	  initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S'));
		
	}else if(columncount==8)
	{
	  initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S'));
		
	}else if(columncount==9)
	{
	  initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S'));
		
	}else if(columncount==10)
	{
	  initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==11)
	{
 	  initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==12)
	{
	  initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==13)
	{
	  initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==14)
	{
	  initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==15)
	{
	  initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}
	//tableWidgetObj.init();
	//tableWidgetObj.sortTableByColumn(0);
	//tableWidgetObj.updateTableHeader(sortcolumn,'ascending');
    addTableRolloverEffect('webmailtablecontent','tableRollOverEffect1','tableRowClickEffect1');

}
*/
function read_messages(fname)
{
         window.open(fname,'','top=20,left=15,width=600,height=450,scrollbars=yes,resizable=no,status=no,toolbar=no');
}

//table sort start

	var tableWidget_tableCounter = 0;
	var tableWidget_arraySort = new Array();
	var tableWidget_okToSort = true;
	var activeColumn = new Array();
	var arrowImagePath = "../images14/";	// Path to arrow images
	function addEndCol(obj)
	{
		if(document.all)return;
		var rows = obj.getElementsByTagName('TR');
		for(var no=0;no<rows.length;no++){
			var cell = rows[no].insertCell(-1);
			cell.innerHTML = '&nbsp;';
			cell.style.width = '13px';
			cell.width = '13';
 
		}	
		
	}
	
	function highlightTableHeader()
	{
		this.className='tableWigdet_headerCellOver';
		if(document.all){	// I.E fix for "jumping" headings
			var divObj = this.parentNode.parentNode.parentNode.parentNode;
			this.parentNode.style.top = divObj.scrollTop + 'px';
 
		}
			
	}
	
	function deHighlightTableHeader()
	{
		this.className='tableWidget_headerCell';		
	}
	
	function mousedownTableHeader()
	{
		this.className='tableWigdet_headerCellDown';
		if(document.all){	// I.E fix for "jumping" headings
			var divObj = this.parentNode.parentNode.parentNode.parentNode;
			this.parentNode.style.top = divObj.scrollTop + 'px';
		}		
	}
	
	function sortNumeric(a,b){
		
		a = a.replace(/,/,'.');
		b = b.replace(/,/,'.');
		a = a.replace(/[^\d\-\.\/]/g,'');
		b = b.replace(/[^\d\-\.\/]/g,'');
		if(a.indexOf('/')>=0)a = eval(a);
		if(b.indexOf('/')>=0)b = eval(b);
		return a/1 - b/1;
	}
	
 
	function sortString(a, b) {
 
	  if ( a.toUpperCase() < b.toUpperCase() ) return -1;
	  if ( a.toUpperCase() > b.toUpperCase() ) return 1;
	  return 0;
	}	
	function cancelTableWidgetEvent()
	{
		return false;
	}
	
	function sortTable()
	{
		if(!tableWidget_okToSort)return;
		tableWidget_okToSort = false;
		/* Getting index of current column */
		var obj = this;
		var indexThis = 0;
		while(obj.previousSibling){
			obj = obj.previousSibling;
			if(obj.tagName=='TD')indexThis++;		
		}
		var images = this.getElementsByTagName('IMG');
		
		if(this.getAttribute('direction') || this.direction){
			direction = this.getAttribute('direction');
			if(navigator.userAgent.indexOf('Opera')>=0)direction = this.direction;
			if(direction=='ascending'){
				direction = 'descending';
				this.setAttribute('direction','descending');
				this.direction = 'descending';	
			}else{
				direction = 'ascending';
				this.setAttribute('direction','ascending');		
				this.direction = 'ascending';		
			}
		}else{
			direction = 'ascending';
			this.setAttribute('direction','ascending');
			this.direction = 'ascending';
		}
		
		
		
		if(direction=='descending'){
			images[0].style.display='inline';
			images[0].style.visibility='visible';
			images[1].style.display='none';
		}else{
			images[1].style.display='inline';
			images[1].style.visibility='visible';
			images[0].style.display='none';		
		}
 
		
		var tableObj = this.parentNode.parentNode.parentNode;
		var tBody = tableObj.getElementsByTagName('TBODY')[0];
		
		var widgetIndex = tableObj.id.replace(/[^\d]/g,'');
		var sortMethod = tableWidget_arraySort[widgetIndex][indexThis]; // N = numeric, S = String
		if(activeColumn[widgetIndex] && activeColumn[widgetIndex]!=this){
			var images = activeColumn[widgetIndex].getElementsByTagName('IMG');
			images[0].style.display='none';
			images[1].style.display='inline';
			images[1].style.visibility = 'hidden';
			if(activeColumn[widgetIndex])activeColumn[widgetIndex].removeAttribute('direction');			
		}
 
		activeColumn[widgetIndex] = this;
		
		var cellArray = new Array();
		var cellObjArray = new Array();
		for(var no=1;no<tableObj.rows.length;no++){
			var content= tableObj.rows[no].cells[indexThis].innerHTML+'';
			cellArray.push(content);
			cellObjArray.push(tableObj.rows[no].cells[indexThis]);
		}
		
		if(sortMethod=='N'){
			cellArray = cellArray.sort(sortNumeric);
		}else{
			cellArray = cellArray.sort(sortString);
		}
		
		if(direction=='descending'){
			for(var no=cellArray.length;no>=0;no--){
				for(var no2=0;no2<cellObjArray.length;no2++){
					if(cellObjArray[no2].innerHTML == cellArray[no] && !cellObjArray[no2].getAttribute('allreadySorted')){
						cellObjArray[no2].setAttribute('allreadySorted','1');	
						tBody.appendChild(cellObjArray[no2].parentNode);				
					}				
				}			
			}
		}else{
			for(var no=0;no<cellArray.length;no++){
				for(var no2=0;no2<cellObjArray.length;no2++){
					if(cellObjArray[no2].innerHTML == cellArray[no] && !cellObjArray[no2].getAttribute('allreadySorted')){
						cellObjArray[no2].setAttribute('allreadySorted','1');	
						tBody.appendChild(cellObjArray[no2].parentNode);				
					}				
				}			
			}				
		}
		
		for(var no2=0;no2<cellObjArray.length;no2++){
			cellObjArray[no2].removeAttribute('allreadySorted');		
		}
 
		tableWidget_okToSort = true;
		
		
	}
	
	function initTableWidget(objId,width,height,sortArray)
	{
		width = width + '';
		height = height + '';
		var obj = document.getElementById(objId);
		obj.parentNode.className='widget_tableDiv';
		if(navigator.userAgent.indexOf('MSIE')>=0){
			obj.parentNode.style.overflowY = 'auto';
		}
		tableWidget_arraySort[tableWidget_tableCounter] = sortArray;
		if(width.indexOf('%')>=0){
			obj.style.width = width;
			obj.parentNode.style.width = width;
		}else{
			obj.style.width = width + 'px';
			obj.parentNode.style.width = width + 'px';
		}
		
		if(height.indexOf('%')>=0){
	
			obj.parentNode.style.height = height;			
			
		}else{
 
			obj.parentNode.style.height = height + 'px';
		}
		obj.id = 'tableWidget' + tableWidget_tableCounter;
		addEndCol(obj);
		
		obj.cellSpacing = 0;
		obj.cellPadding = 0;
		obj.className='tableWidget';
		var tHead = obj.getElementsByTagName('THEAD')[0];
		var cells = tHead.getElementsByTagName('TD');
		for(var no=0;no<cells.length;no++){
			cells[no].className = 'tableWidget_headerCell';
			cells[no].onselectstart = cancelTableWidgetEvent;
			if(no==cells.length-1){
				cells[no].style.borderRight = '0px';	
			}
			if(sortArray[no]){
				cells[no].onmouseover = highlightTableHeader;
				cells[no].onmouseout =  deHighlightTableHeader;
				cells[no].onmousedown = mousedownTableHeader;		
				cells[no].onmouseup = highlightTableHeader;		
				cells[no].onclick = sortTable;	
				
				var img = document.createElement('IMG');
				img.src = arrowImagePath + 'arrow_up.gif';
				cells[no].appendChild(img);	
				img.style.visibility = 'hidden';
				
				var img = document.createElement('IMG');
				img.src = arrowImagePath + 'arrow_down.gif';
				cells[no].appendChild(img);	
				img.style.display = 'none';
				
				
			}else{
				cells[no].style.cursor = 'default';	
			}
			
			
		}		
		var tBody = obj.getElementsByTagName('TBODY')[0];
		if(document.all && navigator.userAgent.indexOf('Opera')<0){
			tBody.className='scrollingContent';
			tBody.style.display='block';			
		}else{
			tBody.className='scrollingContent';
			if(tBody.offsetHeight>(tBody.parentNode.parentNode.offsetHeight - 50)) { 
				tBody.style.height = (obj.parentNode.clientHeight-tHead.offsetHeight) + 'px'; 
			}else{ 
				tBody.style.overflow='hidden'; 
			} 
			if(navigator.userAgent.indexOf('Opera')>=0){
				obj.parentNode.style.overflow = 'auto';
			}
		}
		
		for(var no=1;no<obj.rows.length;no++){
			obj.rows[no].onmouseover = highlightDataRow;
			obj.rows[no].onmouseout = deHighlightDataRow;
			for(var no2=0;no2<sortArray.length;no2++){	/* Right align numeric cells */
				if(sortArray[no2] && sortArray[no2]=='N')obj.rows[no].cells[no2].style.textAlign='right';
			}
		}
		for(var no2=0;no2<sortArray.length;no2++){	/* Right align numeric cells */
			if(sortArray[no2] && sortArray[no2]=='N')obj.rows[0].cells[no2].style.textAlign='right';
		}		
		
		tableWidget_tableCounter++;
	}
	
	function highlightDataRow()
	{
		if(navigator.userAgent.indexOf('Opera')>=0)return;
		this.className='tableWidget_dataRollOver';
		if(document.all){	// I.E fix for "jumping" headings
			var divObj = this.parentNode.parentNode.parentNode;
			var tHead = divObj.getElementsByTagName('TR')[0];
			tHead.style.top = divObj.scrollTop + 'px';
			
		}	
	}
	
	function deHighlightDataRow()
	{
		if(navigator.userAgent.indexOf('Opera')>=0)return;
		this.className=null;
		if(document.all){	// I.E fix for "jumping" headings
			var divObj = this.parentNode.parentNode.parentNode;
			var tHead = divObj.getElementsByTagName('TR')[0];
			tHead.style.top = divObj.scrollTop + 'px';
		}			
	}
	
	
	
//table stort end


//select table start

	var arrayOfRolloverClasses = new Array();
	var arrayOfClickClasses = new Array();
	var activeRow = false;
	var activeRowClickArray = new Array();
	
	function highlightTableRow()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

		if(this!=activeRow){
			this.setAttribute('origCl',this.className);
			this.origCl = this.className;
		}
		this.className = arrayOfRolloverClasses[tableObj.id];
		
		activeRow = this;
		
	}
	
	function clickOnTableRow()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;		
		
		if(activeRowClickArray[tableObj.id] && this!=activeRowClickArray[tableObj.id]){
			activeRowClickArray[tableObj.id].className='';
		}
		this.className = arrayOfClickClasses[tableObj.id];
		
		activeRowClickArray[tableObj.id] = this;
				
	}
	
	function resetRowStyle()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

		if(activeRowClickArray[tableObj.id] && this==activeRowClickArray[tableObj.id]){
			this.className = arrayOfClickClasses[tableObj.id];
			return;	
		}
		
		var origCl = this.getAttribute('origCl');
		if(!origCl)origCl = this.origCl;
		this.className=origCl;
		
	}
		
	function addTableRolloverEffect(tableId,whichClass,whichClassOnClick)
	{
		arrayOfRolloverClasses[tableId] = whichClass;
		arrayOfClickClasses[tableId] = whichClassOnClick;
		
		var tableObj = document.getElementById(tableId);
		var tBody = tableObj.getElementsByTagName('TBODY');
		if(tBody){
			var rows = tBody[0].getElementsByTagName('TR');
		}else{
			var rows = tableObj.getElementsByTagName('TR');
		}
		for(var no=0;no<rows.length;no++){
			rows[no].onmouseover = highlightTableRow;
			rows[no].onmouseout = resetRowStyle;
			
			if(whichClassOnClick){
				rows[no].onclick = clickOnTableRow;	
			}
		}
		
	}
//select table end











function Create_ContnetTables_cxzyzss(height,columncount,sortcolumn,tablename)
{
    var height = 30*height+30;
	var tableWidgetObj = new SHBDHTML.tableWidget();
	tableWidgetObj.setTableId(tablename);
	//tableWidgetObj.setNoCssLayout();
	tableWidgetObj.setTableWidth('100%');
	height=parent.document.getElementById('welcome').height-220//取高度
	if(height<=0){
		height=300;
	}
	//alert(height);
	tableWidgetObj.setTableHeight(height);
    
    
    if(columncount==2)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S'));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S'));
	}else if(columncount==3)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S'));
	}else if(columncount==4)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S'));
		
	}else if(columncount==5)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S'));
		
	}else if(columncount==6)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S'));
		
	}else if(columncount==7)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S'));
		
	}else if(columncount==8)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S'));
		
	}else if(columncount==9)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S'));
		
	}else if(columncount==10)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==11)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==12)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==13)
	{
   	  tableWidgetObj.setColumnSort(Array(false,false,'S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==14)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==15)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}
	tableWidgetObj.init();
	tableWidgetObj.sortTableByColumn(0);
	//tableWidgetObj.updateTableHeader(sortcolumn,'ascending');
    //addTableRolloverEffect('webmailtablecontent','tableRollOverEffect1','tableRowClickEffect1');

}



function Create_ContnetTables_OperateLog(height,columncount,sortcolumn,tablename)
{
    var height = 30*height+30;
	var tableWidgetObj = new SHBDHTML.tableWidget();
	tableWidgetObj.setTableId(tablename);
	//tableWidgetObj.setNoCssLayout();
	tableWidgetObj.setTableWidth('100%');
	height=parent.parent.document.getElementById('welcome').height-220//取高度
	if(height<=0){
		height=300;
	}
	//alert(height);
	tableWidgetObj.setTableHeight(height);
    
    
    if(columncount==2)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S'));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S'));
	}else if(columncount==3)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S'));
	}else if(columncount==4)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S'));
		
	}else if(columncount==5)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S'));
		
	}else if(columncount==6)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S'));
		
	}else if(columncount==7)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S'));
		
	}else if(columncount==8)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S'));
		
	}else if(columncount==9)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S'));
		
	}else if(columncount==10)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==11)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==12)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==13)
	{
   	  tableWidgetObj.setColumnSort(Array(false,false,'S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==14)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==15)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}
	tableWidgetObj.init();
	tableWidgetObj.sortTableByColumn(0);
	//tableWidgetObj.updateTableHeader(sortcolumn,'ascending');
    //addTableRolloverEffect('webmailtablecontent','tableRollOverEffect1','tableRowClickEffect1');

}






function Create_ContnetTables_TY1(height,columncount,sortcolumn,tablename)
{
    //var height = 30*height+30;
	var tableWidgetObj = new SHBDHTML.tableWidget();
	tableWidgetObj.setTableId('webmailtablecontent');
	//tableWidgetObj.setNoCssLayout();
	tableWidgetObj.setTableWidth('100%');
	//height=parent.document.getElementById('welcome').height-220//取高度
	if(height<=0){
		height=300;
	}
	//alert(height);
	tableWidgetObj.setTableHeight(height);
    
    
    if(columncount==2)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S'));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S'));
	}else if(columncount==3)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S'));
	}else if(columncount==4)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S'));
		
	}else if(columncount==5)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S'));
		
	}else if(columncount==6)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S'));
		
	}else if(columncount==7)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S'));
		
	}else if(columncount==8)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S'));
		
	}else if(columncount==9)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S'));
		
	}else if(columncount==10)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==11)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==12)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==13)
	{
   	  tableWidgetObj.setColumnSort(Array(false,false,'S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==14)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==15)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}
	tableWidgetObj.init();
	tableWidgetObj.sortTableByColumn(0);
	//tableWidgetObj.updateTableHeader(sortcolumn,'ascending');
    //addTableRolloverEffect('webmailtablecontent','tableRollOverEffect1','tableRowClickEffect1');

}


function Create_ContnetTables_TY(height,columncount,sortcolumn,tablename)
//function Create_ContnetTables(height,columncount,sortcolumn)
{
	//var tableWidgetObj = new SHBDHTML.tableWidget();
	//tableWidgetObj.setTableId('webmailtablecontent');
	//tableWidgetObj.setNoCssLayout();
	//tableWidgetObj.setTableWidth('100%');
	//tableWidgetObj.setTableHeight(height);
    var height = 33*height+30;
    
    if(columncount==2)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S'));
	}else if(columncount==3)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S'));
	}else if(columncount==4)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S'));
		
	}else if(columncount==5)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S'));
		
	}else if(columncount==6)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S'));
		
	}else if(columncount==7)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S'));
		
	}else if(columncount==8)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S'));
		
	}else if(columncount==9)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S'));
		
	}else if(columncount==10)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==11)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==12)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==13)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S'));
      
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S'));
      //alert(height);
		
	}else if(columncount==14)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==15)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}else if(columncount==16)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}else if(columncount==17)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}else if(columncount==18)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}else if(columncount==19)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}else if(columncount==20)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}else if(columncount==21)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}else if(columncount==22)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}else if(columncount==23)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}else if(columncount==24)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}else if(columncount==25)
	{
   	  //tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	  initTableWidget(tablename,'100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}
	//tableWidgetObj.init();
	//tableWidgetObj.updateTableHeader(sortcolumn,'ascending');
}




// returns true if MathPlayer is installed and can be instantiated
function isMPInstalled(checkname)
{
    try {
		var oMP = new ActiveXObject(checkname);
        //var oMP = new ActiveXObject("SMTPLAYERCONTAINER.SMTPlayerContainerCtrl.1");
        return true;
        
	}
	catch(e) {
        return false;
        
	}
}

// returns True if running on any version of IE Windows
function isIEWindows()
{
    /*
    var Sys = {};
    var ua = navigator.userAgent.toLowerCase();
    var s;

    (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
    (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
    (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
    (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
    (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
    if(Sys.ie == '7.0' || Sys.ie == '6.0' || Sys.ie == '6.0'){
    }
    */


	return( (navigator.appName=="Microsoft Internet Explorer") && 
		(navigator.appVersion.indexOf("Windows") != -1) );
}

// returns version of Internet Explorer
function ieVersion()
{
	var ieVer = 0;
	var start = navigator.appVersion.indexOf("MSIE "); 
	if (start != -1) { 
		ieVer = parseFloat(navigator.appVersion.substring(start+5)); 
	}
	return ieVer;
}


function Check_Install_PlayloadPage(checkname,downloadurl,downtype,linkid,co_id,cl_id,le_id) {
  if(isIEWindows()) {
    if (ieVersion() >= 6.0) {
		if (isMPInstalled(checkname))
        {     
            shbajax_OpenLink(downtype,linkid,co_id,cl_id,le_id,2);//已经安装
            //alert('ok');
		}else{
		    shbajax_OpenLink(downtype,linkid,co_id,cl_id,le_id,3);
		}
    }else{ // notify reader they need to upgrade IE
        if (isMPInstalled(checkname)) 
        {         
           shbajax_OpenLink(downtype,linkid,co_id,cl_id,le_id,2);//已经安装
           //alert('ok');
        }else{
           //alert('error');
           shbajax_OpenLink(downtype,linkid,co_id,cl_id,le_id,3);
        }
     }
  }else{// non-IE browser  
        if (isMPInstalled(checkname)) 
        {         
           //alert('ok');
           shbajax_OpenLink(downtype,linkid,co_id,cl_id,le_id,2);//已经安装
        }else{
           //alert('error');
           shbajax_OpenLink(downtype,linkid,co_id,cl_id,le_id,3);
        }
  }

}



function Check_Install_MathMlPlayloadPage(checkname) {
  if(isIEWindows()) {
    if (ieVersion() >= 6.0) {
		if (isMPInstalled(checkname))
        {     
            //已经安装
            //shbajax_DownloadPlayDevice();
            //alert('ok');
		}else{
		    shbajax_DownloadPlayDevice();
		}
    }else{ // notify reader they need to upgrade IE
        if (isMPInstalled(checkname)) 
        {         
           
           //alert('ok');
        }else{
           //alert('error');
           shbajax_DownloadPlayDevice();
        }
     }
  }else{// non-IE browser  
        if (isMPInstalled(checkname)) 
        {         
           //alert('ok');
           
        }else{
           //alert('error');
           shbajax_DownloadPlayDevice();
        }
  }

}


/**
 * @param act：1 全选，2 反选
 * @param dom：checkbox名称
 * selectct 记录被选中的数量
 * 可以传入参数三和参数四；表示checkbox参数三属性值等于参数四时才进行全选、反选，否则跳过。
 */
var selectct=0;
function CheckDoSelect(pagesize,dom)
{    
    selectct=0;
    //alert(pagesize);
    
    var obj=document.getElementsByTagName('input');
    var dom_var;
    for(var i=0;i<obj.length;i++)
    {        
        if(obj[i].type=='checkbox' && obj[i].name=="selectboxname")
        {
            if(obj[i].checked){
                act=1;
            }else{
                act=2;
            }
        } 
        for(var j=0;j<=pagesize;j++)
        {        
            //alert(obj[i].name);
            dom_var=dom+j;
            if(obj[i].type=='checkbox' && obj[i].name==dom_var)
            {
                extraFlag=true;
                if(arguments[2]!=undefined && arguments[3]!=undefined)
                {
                    if(obj[i][arguments[2]]!=arguments[3]){
                        extraFlag=false;
                    }
                }
            
                if(extraFlag)
                {
                    if(act==1){
                        obj[i].checked=true;
                    }else if(act==2){
                        obj[i].checked=!obj[i].checked;
                    }                
                }
                if(obj[i].checked==true)
                {
                    selectct++;
                }
            }
            
            
        }
    }
}



function Create_ContnetTables_xuehai(height,columncount,sortcolumn,tablename)
{
    //var height = 30*height+30;
	var tableWidgetObj = new SHBDHTML.tableWidget();
	tableWidgetObj.setTableId(tablename);
	//tableWidgetObj.setNoCssLayout();
	tableWidgetObj.setTableWidth('100%');
	//height=parent.parent.document.getElementById('welcome').height-220//取高度
	//height=parent.parent.document.getElementById('welcome').height-120//取高度
    //alert(height)
	if(height<=0){
		height=300;
	}
	//alert(height);
	tableWidgetObj.setTableHeight(height);
    
    
    if(columncount==2)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S'));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S'));
	}else if(columncount==3)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S'));
	}else if(columncount==4)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S'));
		
	}else if(columncount==5)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S'));
		
	}else if(columncount==6)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S'));
		
	}else if(columncount==7)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S'));
		
	}else if(columncount==8)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S'));
		
	}else if(columncount==9)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S'));
		
	}else if(columncount==10)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==11)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==12)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==13)
	{
   	  tableWidgetObj.setColumnSort(Array(false,false,'S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==14)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S'));
		
	}else if(columncount==15)
	{
   	  tableWidgetObj.setColumnSort(Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S',false));
	  //initTableWidget('webmailtablecontent','100%',height,Array(false,'S','S','S','S','S','S','S','S','S','S','S','S','S','S'));
	}
	tableWidgetObj.init();
	tableWidgetObj.sortTableByColumn(0);
	//tableWidgetObj.updateTableHeader(sortcolumn,'ascending');
    //addTableRolloverEffect('webmailtablecontent','tableRollOverEffect1','tableRowClickEffect1');

}




