function getTime(){
	Digital=new Date()
	return(Digital.getTime())
}

function search(pucid){
	window.open('publicportal.cgi?.diff='+getTime()+'&.iscontentonly=1&.destpophid=51210054&.pucid='+pucid,'search','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizeable=1,width=600,height=500')
}

function searchApp(pucid){
	window.open('publicportal.cgi?.diff='+getTime()+'&.iscontentonly=1&.destpophid=51210055&.pucid='+pucid,'search','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizeable=1,width=600,height=500')
}

function layoutPage(mid){
	window.location='publicportal.cgi?.diff='+getTime()+'&.destjumphid=10003085&.sucid='+mid
}

function managePage(mid){
	window.location='publicportal.cgi?.diff='+getTime()+'&.destjumphid=10000005&.sucid='+mid
}

function helpChannel(ucid){
	window.open('publicportal.cgi?.diff='+getTime()+'&.iscontentonly=1&.destpophid=50513080&.sucid='+ucid+'&.langid='+langId,'help','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizeable=1,width=600,height=500')
}

function showHelp(ucid, cid){
	window.location = 'publicportal.cgi?.diff='+getTime()+'&.ucid='+ucid+'&.scid='+cid+'&.langid='+langId
}

function hideChannel(ucid, mid){
	if (confirm(eb_getmlang('JS_PORTAL_HIDE_CHANNEL'))) window.location='publicportal.cgi?.diff='+getTime()+'&.isform=1&.desthid=10020004&.sucid='+ucid+'&.ucid='+mid
}

function deleteChannel(ucid, mid){
	if (confirm(eb_getmlang('JS_PORTAL_DEL_CHANNEL'))) window.location='publicportal.cgi?.diff='+getTime()+'&.isform=1&.desthid=10020004&.sucid='+ucid+'&.ucid='+mid+'&.del=1'
}

function newPage(ucid){
	do {
		bener=0
	   pagename=prompt(eb_getmlang('JS_PORTAL_NEW_PAGE'), eb_getmlang('JS_PORTAL_DEFAULT_PAGE'))
		if (pagename && pagename.length<=30) bener=1
	} while (!bener && pagename)
	if (bener) { 
		var tmp=''
		for (i=0; i<pagename.length; i++) 
			tmp += escape(pagename.charAt(i)) 
		window.location='publicportal.cgi?.diff='+getTime()+'&.isform=1&.desthid=10020006&.sucid='+ucid+'&.destjumphid=10000005&.op=new&.pagename='+tmp
	}
}

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="publicportal.cgi?.diff='+getTime()+'&.ucid=%ucid%"><span class="m5f">%title%</span></a><b class="m5f">&nbsp;</b></td><td class="m6"></td>'
  maxtabwidth=60
  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)
  /*
  if (rowcount>1 && (t.length%colcount)<rowcount-1) {
	colcount++;
	rowcount--;
  }*/
  //colwidth=docwidth/colcount
  j=-1;
  //document.write('<table border="0" cellpadding="0" cellspacing="1" width="100%">')
  for (i=0; i<t.length; i++){
	if (i%colcount==0) {
	  if (i>0) baristab[j] += '</table>' //</td></tr>
	  j++;
	  //baristab[j]  = '<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td height="1px"><img height="1px" src="/ebhtml/images/b.gif" border=0></td></tr></table>'
	  //baristab[j]  = '<tr><td width="100%">'
	  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(/\%ucid\%/, u[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])
  }
  //document.write('</table>')
}

//window.onresize=alert('sd')
