function getTime(){
	Digital=new Date();
	return(Digital.getTime())
}

function draw_tab(){
  tmpst='';
  sttabactive='<td class="m1"></td><td class="m2"><span class="m2f">&nbsp;%title%&nbsp;</span></td><td class="m3"></td>';
  sttabinactive='<td class="m4"></td><td class="m5"><b class="m5f">&nbsp;</b><a href="%dest%"><span class="m5f">%title%</span></a><b class="m5f">&nbsp;</b></td><td class="m6"></td>';
  maxtabwidth=180;
  docwidth = document.all ? document.body.clientWidth : window.innerWidth;
  baristab=new Array();

  colcount=Math.floor(docwidth/maxtabwidth);
  rowcount=Math.ceil(t.length/colcount);
  colcount=Math.round(t.length/rowcount);
  j=-1;

  for (i=0; i<t.length; i++){
	if (i%colcount==0) {
	  if (i>0) baristab[j] += '</table>'
	  j++;
	  baristab[j] = '<table border="0" cellpadding="0" cellspacing="0"';
	  if (rowcount>1) baristab[j]+=' width="100%"><tr>';
	  else baristab[j]+=' width="100%"><tr>';
	}
	if (i==activetab) tmpst=sttabactive;
	else tmpst=sttabinactive;
	tmpst=tmpst.replace(/\%title\%/, t[i]);
	tmpst=tmpst.replace(/\%dest\%/, _u[i])
	//tmpst=tmpst.replace(/\%_idx\%/, _i[i])
	baristab[j] += tmpst;
  }
  if (rowcount==1) {
	  baristab[j]+='<td class="m7" width="' + Math.round(docwidth-2*maxtabwidth*colcount) + 'px"></td>';
  }
  baristab[j]+='</table>';
  activerow=Math.floor(activetab/colcount);
  for (i=0; i<rowcount; i++){
	document.write(baristab[(i+activerow+1) % rowcount]);
  }
}

function draw_tab_narrow(){
  tmpst='';
  sttabactive='<td class="m1"></td><td class="m2"><span class="m2f">&nbsp;%title%&nbsp;</span></td><td class="m3"></td>';
  sttabinactive='<td class="m4"></td><td class="m5"><b class="m5f">&nbsp;</b><a href="%dest%"><span class="m5f">%title%</span></a><b class="m5f">&nbsp;</b></td><td class="m6"></td>';
  maxtabwidth=40;
  docwidth = document.all ? document.body.clientWidth : window.innerWidth;
  baristab=new Array();

  colcount=Math.floor(docwidth/maxtabwidth);
  rowcount=Math.ceil(t.length/colcount);
  colcount=Math.round(t.length/rowcount);
  j=-1;

  for (i=0; i<t.length; i++){
	if (i%colcount==0) {
	  if (i>0) baristab[j] += '</table>'
	  j++;
	  baristab[j] = '<table border="0" cellpadding="0" cellspacing="0"';
	  if (rowcount>1) baristab[j]+=' width="100%"><tr>';
	  else baristab[j]+=' width="100%"><tr>';
	}
	if (i==activetab) tmpst=sttabactive;
	else tmpst=sttabinactive;
	tmpst=tmpst.replace(/\%title\%/, t[i]);
	tmpst=tmpst.replace(/\%dest\%/, _u[i])
	//tmpst=tmpst.replace(/\%_idx\%/, _i[i])
	baristab[j] += tmpst;
  }
  if (rowcount==1) {
	  baristab[j]+='<td class="m7" width="' + Math.round(docwidth-2*maxtabwidth*colcount) + 'px"></td>';
  }
  baristab[j]+='</table>';
  activerow=Math.floor(activetab/colcount);
  for (i=0; i<rowcount; i++){
	document.write(baristab[(i+activerow+1) % rowcount]);
  }
}



function draw_button(name, desc, type) {	
		var st="";
        if (type==0) // ordinary image
                st += "<img";
        else if (type==1) // input type=image
                st += "<input type='image'";
        st += " align='absmiddle' border='0' alt=\""+desc+"\" src='/properties/images/"+name+".gif' onmouseover='this.src=\"/properties/images/"+name+"_on.gif\"' onmouseout='this.src=\"/properties/images/"+name+".gif\"' />";
        document.write(st);
}
