﻿var loadcnt = 0;

function drawLawyers()
{
    document.write("<table width='80%'  border='0' cellspacing='0' cellpadding='0'>");
    
    for(i=0;i<gOnlineLawyers.length;)
    {
        if(gOnlineLawyers[i] == "") continue;
        
        newRow = (i%2 == 0);
        if(newRow) document.write("<tr height='130'>");
        for(j=0;j<2;j++)
        {
            //alert(i+":"+gOnlineLawyers[i]);
            lawyerinfo = gOnlineLawyers[i].split("|");
            document.write("  <td width='50%' align='"+(j==0?"left":"right")+"'>");
            document.write("  <table width='210' border='0' cellspacing='0' cellpadding='0'>");
            document.write("    <tr>");
            document.write("      <td width='90'>");
            document.write("      <table width='80%'  border='0' cellspacing='0' cellpadding='0'>");
            document.write("        <tr>");
            document.write("          <td height='82'><a href='lawyer.htm?lawyer="+lawyerinfo[1]+"' target='_blank'><img src='lawyer/"+lawyerinfo[1]+"_ol.jpg' width='80' height='80' border='0' title='查看我的简介'></a></td>");
            document.write("        </tr>");
            document.write("        <tr>");
            document.write("          <td height='18' class='bluebox'>"+lawyerinfo[0]+"</td>");
            document.write("        </tr>");
            document.write("      </table>");
            document.write("      </td>");
            document.write("      <td>");
            document.write("      <table width='100%'  border='0' cellpadding='0' cellspacing='0'>");
            document.write("        <tr>");
            document.write("          <td height='30'>");
            if(lawyerinfo[2] != ""){
                document.write("<a href=\"#\" onclick=\"window.open('http://www.365groups.com/ChatWin.aspx?chatIDs="+lawyerinfo[2]+"&ServiceTag=0','"+lawyerinfo[2]+"','width=560,height=490, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no,center=yes')\">");
                document.write("<img border=\"0\"  title=\"义务法律咨询,不需安装客户端\" src=\"http://www.365groups.com/msn_status.aspx?chatIDs="+lawyerinfo[2]+"&style=6\"/>");
                document.write("</a>");
            }else{
                document.write("&nbsp;");
            }
            document.write("          </td>");
            document.write("        </tr>");
            document.write("        <tr>");
            document.write("          <td height='30'>");
            if(lawyerinfo[3] != ""){
                document.write("<a target=blank href=tencent://message/?uin="+lawyerinfo[3]+"&Site=www.zhylf-dl.com&Menu=yes>");
                document.write("<img border=\"0\" src=\"http://wpa.qq.com/pa?p=1:2569855:2\" title=\"义务法律咨询,需要安装QQ或TM\">");
                document.write("</a>");
            }else{
                document.write("&nbsp;");
            }
            document.write("          </td>");
            document.write("        </tr>");
            document.write("        <tr>");
            document.write("          <td height='30'>");
            if(lawyerinfo[4] != ""){
                document.write("<a href=\"skype:trydofor?call\">");
                document.write("<img border=\"0\" src=\"http://mystatus.skype.com/smallclassic/"+lawyerinfo[4]+"\" title=\"义务法律咨询,需要安装Skype\" />");
                document.write("</a>");
            }else{
                document.write("&nbsp;");
            }

            document.write("          </td>");
            document.write("        </tr>");
            document.write("      </table>");
            document.write("      </td>");
            document.write("    </tr>");
            document.write("  </table>");
            document.write("  </td>");
            
            // 
            i++;
            if(i >= gOnlineLawyers.length-1)
            {
                document.write("  <td>&nbsp;</td>");
                i++;
                break;
            }
        }
        if(newRow) document.write("</tr>");
    }
    
    document.write("</table>");

}

function loadingStatus()
{
	loadcnt ++;
    
	readyCont = 0;
	
	for(i=0;i<document.images.length;i++)
		if(document.images[i].complete)
			readyCont ++;
	
	if(loadcnt >20 ||(readyCont / document.images.length > 0.8))
	{
    	changeCss(document.getElementById("LoadMask"),'hidemask')
	}
	else
	{
    	window.setTimeout(loadingStatus,1000);
	}
}

