// JavaScript Document
/*
	dojo.map(data, function (itm) {
		tooltips(displaydiv+'_'+itm.program_id,itm.fulldesc);
	});
	*/

function tooltips(id, content){
//	alert(id+'    '+content);
/*var node = document.createElement('span');
node.innerHTML = content;
	var tip = new dijit.Tooltip({ connectId:id,},node);	
	tip.startup();	*/
	
	var tip = new dijit.Tooltip({label:'<table width="307"><tr><td>'+content+'</td></tr></table>', connectId:[id],showDelay:100});

}


function videotooltips_text(data)
{ 

var	result='<table>';
	var itm = new Array();
	for(i=0;i<data.length;i++)
		itm[  data[i]['type']  ] = data[i]['txt'];
	data = itm;
	if(typeof(data['channel'])!="undefined" && trim(data['channel']) !='')
		result += '<tr><td nowrap valign="top">頻道︰</td><td>'+data['channel']+'</td></tr>';
	if(typeof(data['cat'])!="undefined" && trim(data['cat']) !='')
		result += '<tr><td nowrap valign="top">類別︰</td><td>'+data['cat']+'</td></tr>';
	if(typeof(data['subject'])!="undefined" && trim(data['subject']) !='')
		result += '<tr><td nowrap valign="top">主題︰</td><td>'+data['subject']+'</td></tr>';
	if(typeof(data.host)!="undefined" && trim(data['host']) !='')
		result += '<tr><td nowrap valign="top">主持︰</td><td>'+data['host']+'</td></tr>';
	if(typeof(data.guest)!="undefined" && trim(data['guest']) !='')
		result += '<tr><td nowrap valign="top">嘉賓︰</td><td>'+data['guest']+'</td></tr>';
	if(typeof(data.food)!="undefined" && trim(data['food']) !='')
		result += '<tr><td nowrap valign="top">菜式︰</td><td>'+data['food']+'</td></tr>';
	if(typeof(data.cook)!="undefined" && trim(data['cook']) !='')
		result += '<tr><td nowrap valign="top">廚師︰</td><td>'+data['cook']+'</td></tr>';
	if(typeof(data.expert)!="undefined" && trim(data['expert']) !='')
		result += '<tr><td nowrap valign="top">專家︰</td><td>'+data['expert']+'</td></tr>';
	if(typeof(data.desc)!="undefined" && trim(data['desc']) !='')
		result += '<tr><td nowrap valign="top">簡介︰</td><td>'+data['desc']+'</td></tr>';
	if(typeof(data.date)!="undefined" && trim(data['date']) !='')
		result += '<tr><td nowrap valign="top">日期︰</td><td>'+data['date']+'</td></tr>';
	/*
	dojo.map(data, function (itm) {
	if (trim(itm.txt) !=''){
		result +='<tr><td nowrap valign="top">';
		if (itm.type =='channel'){	result +='頻道';}
		if (itm.type =='cat'){	result +='類別';}
		if (itm.type =='subject'){	result +='主題';}
		if (itm.type =='host'){	result +='主持';}
		if (itm.type =='guest'){	result +='嘉賓';}
		if (itm.type =='food'){	result +='菜式';}
		if (itm.type =='cook'){	result +='廚師';}
		if (itm.type =='expert'){	result +='專家';}
		if (itm.type =='desc'){	result +='簡介';}
		if (itm.type =='date'){	result +='日期';}
		result +='︰</td><td>'+itm.txt+'</td></tr>';
		}
	});
	*/
	
	result +='</table>';
	return result;
}


