
function printData(DB,idname) {
    var i;
	var msg;
	var stripes = false;
	var data=new Array();
	var arrayLength=DB.length;
	var rand_cnt = Math.floor((Math.random()*100)) % arrayLength;

	msg="<table border='0'>";
	msg=msg+"<tr><th width=\"380\" class=\"th-color\">企業</th><th widht=\"200\" class=\"th-color\">連絡先</th></tr>";

	for(i=rand_cnt; i<arrayLength; i++) {
		data=DB[i].split(",");

		if(stripes == false) {			
			msg=msg+"<tr>";
			msg=msg+"<td class=\"light\"><strong><span class=\"mark\">■</span></strong><a href=\""+data[2]+"\">";
			msg=msg+"<strong>"+data[0]+"</strong></a></td>";
    		msg=msg+"<td class=\"light\">"+data[1]+"</td>";
    		msg=msg+"</tr>";
			
			stripes = true;
			
		}
		else if(stripes == true) {
			msg=msg+"<tr>";
			msg=msg+"<td class=\"dark\"><strong><span class=\"mark\">■</span></strong><a href=\""+data[2]+"\">";
			msg=msg+"<strong>"+data[0]+"</strong></a></td>";
    		msg=msg+"<td class=\"dark\">"+data[1]+"</td>";
    		msg=msg+"</tr>";
			
			stripes = false;
		}
	}
	if(rand_cnt != 0){
		for(i=0; i< rand_cnt; i++) {
			data=DB[i].split(",");

			if(stripes == false) {
				msg=msg+"<tr>";
				msg=msg+"<td class=\"light\"><strong><span class=\"mark\">■</span></strong><a href=\""+data[2]+"\">";
				msg=msg+"<strong>"+data[0]+"</strong></a></td>";
    			msg=msg+"<td class=\"light\">"+data[1]+"</td>";
    			msg=msg+"</tr>";
				
				stripes = true;
			}
			else if(stripes == true) {
			msg=msg+"<tr>";
			msg=msg+"<td class=\"dark\"><strong><span class=\"mark\">■</span></strong><a href=\""+data[2]+"\">";
			msg=msg+"<strong>"+data[0]+"</strong></a></td>";
    		msg=msg+"<td class=\"dark\">"+data[1]+"</td>";
    		msg=msg+"</tr>";
			
				stripes = false;
			
			}
		}
	}
	msg=msg+"</table>";
	msg=msg+"<br>";
	document.getElementById(idname).innerHTML=msg;
}
