/* *** PLAYLIST *** */
//Resulta que en JS multiples IF son más eficientes que un Switch. Ver para creer.
function selectPlaylist(index)
{
	$(".divTopBarTitle").html("");

	if (index == 0)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>En portada</p>");
	}
	else if (index == 1)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Directos</p>");
	}
	else if (index == 2)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Plan Made in/by Spain</p>");
	}
	else if (index == 3)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>ICEX Ofrece</p>");
	}
	else if (index == 4)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Apoyo a la inversi&oacute;n</p>");
	}
	else if (index == 5)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Becas</p>");
	}
	else if (index == 6)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Cursos y Seminarios</p>");
	}
	else if (index == 7)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Ferias</p>");
	}
	else if (index == 8)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Iniciaci&oacute;n a la exportaci&oacute;n</p>");
	}
	else if (index == 9)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Promoci&oacute;n sectorial</p>");
	}
	else if (index == 10)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>C&aacute;rnicos</p>");
	}
	else if (index == 11)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Hortofrut&iacute;cula</p>");
	}
	else if (index == 12)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Vinos</p>");
	}
	else if (index == 13)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>H&aacute;bitat</p>");
	}
	else if (index == 14)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Industrias Culturales</p>");
	}
	else if (index == 15)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Moda</p>");
	}
	else if (index == 16)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Ocio</p>");
	}
	else if (index == 17)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Biotecnolog&iacute;a</p>");
	}
	else if (index == 18)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Energ&iacute;as renovables</p>");
	}
	else if (index == 19)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Maquinaria</p>");
	}
	else if (index == 20)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Multisectorial</p>");
	}
	else if (index == 21)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Tecnolog&iacute;as de la informaci&oacute;n</p>");
	}
	else if (index == 22)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Telecomunicaciones</p>");
	}
	else if (index == 23)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Servicios audiovisuales</p>");
	}
	else if (index == 24)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Dise&ntilde;o</p>");
	}
	else if (index == 25)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Salud</p>");
	}
	else if (index == 26)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Educaci&oacute;n</p>");
	}
	else if (index == 27)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Servicios a empresas</p>");
	}
	else if (index == 28)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Arquitectura</p>");
	}
	else if (index == 29)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Am&eacute;rica</p>");
	}
	else if (index == 30)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Asia y Ocean&iacute;a</p>");
	}
	else if (index == 31)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Europa</p>");
	}
	else if (index == 32)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Primeros pasos</p>");
	}
	else if (index == 33)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Institucional</p>");
	}
	else if (index == 34)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Archivo de noticias</p>");
	}
	
	return 0;
}

//Resulta que en JS multiples IF son más eficientes que un Switch. Ver para creer.
function selectTitle(index)
{
	$(".divTopBarTitle").html("");

	if (index == 596)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>En portada</p>");
	}
	else if (index == 597)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Directos</p>");
	}
	else if (index == 598)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Plan Made in/by Spain</p>");
	}
	else if (index == 599)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>ICEX Ofrece</p>");
	}
	else if (index == 600)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Apoyo a la inversi&oacute;n</p>");
	}
	else if (index == 601)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Becas</p>");
	}
	else if (index == 602)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Cursos y Seminarios</p>");
	}
	else if (index == 603)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Ferias</p>");
	}
	else if (index == 604)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Iniciaci&oacute;n a la exportaci&oacute;n</p>");
	}
	else if (index == 605)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Promoci&oacute;n sectorial</p>");
	}
	else if (index == 606)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>C&aacute;rnicos</p>");
	}
	else if (index == 607)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Hortofrut&iacute;cula</p>");
	}
	else if (index == 608)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Vinos</p>");
	}
	else if (index == 609)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>H&aacute;bitat</p>");
	}
	else if (index == 610)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Industrias Culturales</p>");
	}
	else if (index == 611)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Moda</p>");
	}
	else if (index == 612)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Ocio</p>");
	}
	else if (index == 613)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Biotecnolog&iacute;a</p>");
	}
	else if (index == 614)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Energ&iacute;as renovables</p>");
	}
	else if (index == 615)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Maquinaria</p>");
	}
	else if (index == 616)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Multisectorial</p>");
	}
	else if (index == 617)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Tecnolog&iacute;as de la informaci&oacute;n</p>");
	}
	else if (index == 618)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Telecomunicaciones</p>");
	}
	else if (index == 619)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Servicios audiovisuales</p>");
	}
	else if (index == 620)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Dise&ntilde;o</p>");
	}
	else if (index == 621)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Salud</p>");
	}
	else if (index == 622)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Educaci&oacute;n</p>");
	}
	else if (index == 623)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Servicios a empresas</p>");
	}
	else if (index == 624)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Arquitectura</p>");
	}
	else if (index == 625)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Am&eacute;rica</p>");
	}
	else if (index == 626)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Asia y Ocean&iacute;a</p>");
	}
	else if (index == 627)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Europa</p>");
	}
	else if (index == 628)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Primeros pasos</p>");
	}
	else if (index == 629)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Institucional</p>");
	}
	else if (index == 630)
	{
		$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Archivo de noticias</p>");
	}
	
	return 0;
}

function switchPlaylist(index)
{
	currentPlaylist  = playlists[index];
	
	$(".jspPane").html("");
	$(".jspPane").html("Cargando...");
	
	selectPlaylist(index);
	
	if(currentPlaylist == ""){return;}

	$.ajax({
		type: "POST",
		url: "vzService/contentajax.php",
		data: "playlistID="+currentPlaylist+"",
		contentType: CONTENT_TYPE,
		success: function(msg)
		{
			try{
				eval(msg);
				if(contentArray[0].Title != "")
				{
					currentlyShowing = 'content';   
					buildPlaylistContent();
					//playVideo(0, currentlyShowing);
					
				}
				else
				{
					alert("No hay resultados que mostrar.");
				}
			}catch(exception){
				//alert("No hay resultados que mostrar. Error:" + exception);
				$(".jspPane").html("");
				$(".jspPane").html("<p>No existen elementos en esta categor&iacute;a.</p>");
			}
		}
	});	
}

function highlightPlaylistItem(index) 
{
	var high_item = "#boxtitle_"+index;
	var abs_item = "#rptUVL_ctl_"+index+"_Abs";
	var img_item = "#rptUVL_ctl_"+index+"_Info";
	var desc_item = "#rptUVL_ctl_"+index+"_Details";
	
	var tamano = 0;
	
	if(currentlyShowing == 'content'){ tamano = contentArray.length; }
	if(currentlyShowing == 'search'){ tamano = searchContentArray.length; }
	
	for (i=0;i<tamano;i++)
	{
		$("#boxtitle_"+i).removeClass("chosen"); //remove all the previous playlist highlights
		$("#boxtitle_"+i).css('color','#999999');
		$("#rptUVL_ctl_"+i+"_Abs").css('color','#999999');
		$("#rptUVL_ctl_"+i+"_Info").attr("src",baseurl+"img/item_info_open_over.png");
		$("#rptUVL_ctl_"+i+"_Details").attr("src",baseurl+"img/item_desc.png");
	}

	try
	{
		$(high_item).addClass("chosen"); // find which playlist item to highlight
		$(high_item).css('color','#000000');
		$(abs_item).css('color','#000000');
		$(img_item).attr("src",baseurl+"img/item_info_open_over_selected.png");
		$(desc_item).attr("src",baseurl+"img/item_desc_selected.png");

		if(index > 0)
		{		
			if (contentArray.length== 3 || contentArray.length== 2 ||contentArray.length== 1 || searchContentArray.length== 3 || searchContentArray.length== 2 ||searchContentArray.length== 1)
			{
          		//si sólo hay 1 2 ó 3 vídeos no hagas scroll para centrar el highlight en la playlist 
          		api.scrollToY(1*index);
            }
            else
            {
				//numero de pixeles del salto
				api.scrollToY(150*index);
          	}							                                
		}
		else if (index == 0)
		{
			api.scrollToY(0);
		}
	}
	catch(ex)
	{
		// we might not be have to highlight this, if it's an advert.
	}
}

function displayPlayingItem(index, showing)
{
	var playingItem;
	currentlyShowing = showing;

	videoPlayer_ControlBar = 'over';

	if(currentlyShowing == 'content'){ playingItem = contentArray[index]; }
	if(currentlyShowing == 'search'){ playingItem = searchContentArray[index]; }
}

function cierraBusqueda(){
	$("#searchResults").html(""); //clear contents. Para el boton cerrar resultados de busqueda
}

//Build Playlist.
function buildPlaylistContent()
{	
	if (queryPlayList !== 0)
	{
		selectTitle(queryPlayList);
		queryPlayList = 0;
	}

	//Limpio pane
	$(".jspPane").html("");
	api.getContentPane();
	
	var playingItem = '';
	var playlistContentBuilder = '';
	var i = 0;
	var j = 0;
	var thumbnailpath = '';
	var title = '';
	var doNotShowInPlaylist = 'false';
	var adTag = '';
	var shortDesc = '';
	var longDesc ='';
	var someImage = '';
	var duration;
	var authoringtime = '';
	var URLenviar = '';
	var URLdescargar = '';
	var mywindow = "mywindow";
	var estilo = "location=1,status=1,scrollbars=1,width=370,height=350";
	var link = '';
	var meta = '';
	var videopath = '';
	var minVar;
	var secVar;

	if (currentlyShowing === 'content')
	{	
	 	contentLength = 0;
	  	contentLength = contentArray.length; 

		for (i=0;i < contentLength;i++)
		{
			thumbnailpath = '';
			title = '';
			doNotShowInPlaylist = 'false';
			adTag = '';
			shortDesc = '';
			longDesc ='';
		
    		playingItem = contentArray[i]; 
			thumbnailpath = playingItem.ThumbnailPath;
			title = playingItem.Title;
			atitle = title.replace(":", "");
			aatitle = atitle.replace("\"", "");
			aaatitle = aatitle.replace("\"", "");
			shortDesc = playingItem.ShortDesc; 
    		doNotShowInPlaylist = playingItem.DoNotShowInPlaylist;
			adTag = playingItem.AdTag;
			longDesc = playingItem.LongDesc;
			meta = playingItem.ContentMetaDataID;
			videopath = playingItem.VideoPath;
			authoringtime = playingItem.MetaData_AuthoringDateTime;
			authoringtime = authoringtime.split("T");
			authoringtime = authoringtime[0];
			authoringtime = authoringtime.split("-");
			authoringtime = authoringtime[2]+"/"+authoringtime[1]+"/"+authoringtime[0];
			
			link = baseurl+"index.php?MetaDataID="+meta;
			
			URLenviar = baseurl+"enviar.php?title="+aaatitle+"&link="+link;
			URLdescargar = baseurl+"download.php?file="+videopath;
			
			URLdescargar = URLdescargar.replace("http://icex.vidzapper.com/","");
			
			duration = playingItem.Duration;
			// minutes and seconds for duration (comes from Lenght all in seconds)		
			minVar = Math.floor(duration/60);  // minutes
	    	secVar = duration % 60;              //  seconds
	      
	      	// add a zero to the seconds   
	      	secVarS = secVar+''; // turn integer into string for .length to work
	      	secVarS = secVarS.length; // how many characters?
	      	
	      	if (secVarS==1) //if it has just one decimal, just one charater
	      	{
	        	secVar= secVarS*10; //add a zero 
	      	}
		
			// deal with missing thumbnails
			if(thumbnailpath == ""){ thumbnailpath = THUMBNAIL_MISSING; }

			if(doNotShowInPlaylist == 'false')
			{
				someImage += "<div class='uvlItemBox uvlNormal' id='rptUVL_ctl_"+i+"_Item' >";
				
				someImage += "<img id='rptUVL_ctl_"+i+"_Thumb' style='height:58px;width:299px;border-width:0px;' src='"+thumbnailpath+"' class='uvlThumb uvlNormal' title='"+aaatitle+"' onclick=\"playVideo("+i+",'"+currentlyShowing+"'); _gaq.push(['_trackEvent', 'Video', '"+aaatitle+"']);\"/>";
				
				someImage += "<a href='"+URLdescargar+"' onclick='_gaq.push([\"_trackEvent\", \"Herramientas\", \"Descargar\", \""+aaatitle+"\"]);'><img id='rptUVL_ctl_"+i+"_Details' style='height:18px;width:99px;border-width:0px;' src='"+baseurl+"img/item_desc_selected.png' class='uvlDetailsDesc uvlNormal' title='Haz clic para descargar el v&iacute;deo' /></a>";
				
				someImage += "<img id='rptUVL_ctl_"+i+"_Info' style='height:18px;width:51px;border-width:0px;' src='"+baseurl+"img/item_info_open_over.gif' class='uvlItemInfoOpen' title='Haz clic para ver la informaci&oacute;n de este v&iacute;deo, y envi&aacute;rselo a un amigo' onclick='window.open(\""+URLenviar+"\",\""+mywindow+"\",\""+estilo+"\"); _gaq.push([\"_trackEvent\", \"Herramientas\", \"Enviar\", \""+aaatitle+"\"]);' />";
				
				someImage += "<img id='rptUVL_ctl_"+i+"_No' style='height:18px;width:99px;border-width:0px;' src='"+baseurl+"img/item_detail_normal_open.gif' class='uvlDetails uvlNormal' title='Mostrar o esconder cap&iacute;tulos dentro de este v&iacute;deo' />";
				
				someImage += "<div class='uvlTextBox'><a href='javascript:playVideo("+i+",\""+currentlyShowing+"\");' onclick='_gaq.push([\"_trackEvent\", \"Video\", \""+aaatitle+"\"]);' id='boxtitle_"+i+"' class='uvlTitle uvlNormal' title='"+aaatitle+"'>"+aaatitle+"</a>&nbsp;<p><span class='uvlDurationLabel'>Duraci&oacute;n:</span><span class='uvlNormal uvlDuration' id='rptUVL_ctl_"+i+"_Duration'>"+minVar+":"+secVar+"</span><span class='uvlNormal uvlEventDate' id='rptUVL_ctl_"+i+"_EventDate'>"+authoringtime+"</span></p><span class='uvlAbstract uvlNormal' id='rptUVL_ctl_"+i+"_Abs'>"+longDesc+"</span><span class='sep'>/</span></div>";
				
				someImage += "</div>";
			}
			api.reinitialise();
  		} //final for
  		
  		$(".jspPane").html(someImage);
  		api.getContentPane();			
		api.reinitialise();
  	}
	else
	{ //*****************SEARCH MODE**************************
		contentLength = 0;
	  	contentLength = searchContentArray.length;
	  	
	  	$(".divTopBarTitle").html("<p id='imgUVLIcon' class='videoTitle'>Buscador</p>"); 

		for (i=0;i < contentLength;i++)
		{
			thumbnailpath = '';
			title = '';
			doNotShowInPlaylist = 'false';
			adTag = '';
			shortDesc = '';
			longDesc ='';
		
    		playingItem = searchContentArray[i]; 
			thumbnailpath = playingItem.ThumbnailPath;
			title = playingItem.Title;
			atitle = title.replace(":", "");
			aatitle = atitle.replace("\"", "");
			aaatitle = aatitle.replace("\"", "");
			shortDesc = playingItem.ShortDesc; 
    		doNotShowInPlaylist = playingItem.DoNotShowInPlaylist;
			adTag = playingItem.AdTag;
			longDesc = playingItem.LongDesc;
			
			meta = playingItem.ContentMetaDataID;
			videopath = playingItem.VideoPath;
			authoringtime = playingItem.MetaData_AuthoringDateTime;
			authoringtime = authoringtime.split("T");
			authoringtime = authoringtime[0];
			authoringtime = authoringtime.split("-");
			authoringtime = authoringtime[2]+"/"+authoringtime[1]+"/"+authoringtime[0];
			
			link = baseurl+"index.php?MetaDataID="+meta;
			
			URLenviar = baseurl+"enviar.php?title="+aaatitle+"&link="+link;
			URLdescargar = baseurl+"download.php?file="+videopath;
			
			URLdescargar = URLdescargar.replace("http://icex.vidzapper.com/","");
			
			duration = playingItem.Duration;
			// minutes and seconds for duration (comes from Lenght all in seconds)		
			minVar = Math.floor(duration/60);  // minutes
	    	secVar = duration % 60;              //  seconds
	      
	      	// add a zero to the seconds   
	      	secVarS = secVar+''; // turn integer into string for .length to work
	      	secVarS = secVarS.length; // how many characters?
	      	
	      	if (secVarS==1) //if it has just one decimal, just one charater
	      	{
	        	secVar= secVarS*10; //add a zero 
	      	}
		
			// deal with missing thumbnails
			if(thumbnailpath == ""){ thumbnailpath = THUMBNAIL_MISSING; }
	
			if(doNotShowInPlaylist == 'false')
			{
				someImage += "<div class='uvlItemBox uvlNormal' id='rptUVL_ctl_"+i+"_Item' >";
				
				someImage += "<img id='rptUVL_ctl_"+i+"_Thumb' style='height:58px;width:299px;border-width:0px;' src='"+thumbnailpath+"' class='uvlThumb uvlNormal' title='"+aaatitle+"' onclick=\"playVideo("+i+",'"+currentlyShowing+"'); _gaq.push(['_trackEvent', 'Video', '"+aaatitle+"']);\"/>";
				
				someImage += "<a href='"+URLdescargar+"'; onclick='_gaq.push([\"_trackEvent\", \"Herramientas\", \"Descargar\", \""+aaatitle+"\"]);'><img id='rptUVL_ctl_"+i+"_Details' style='height:18px;width:99px;border-width:0px;' src='"+baseurl+"img/item_desc_selected.png' class='uvlDetailsDesc uvlNormal' title='Mostrar o esconder cap&iacute;tulos dentro de este v&iacute;deo' /></a>";
				
				someImage += "<img id='rptUVL_ctl_"+i+"_Info' style='height:18px;width:51px;border-width:0px;' src='"+baseurl+"img/item_info_open_over.gif' class='uvlItemInfoOpen' title='Click to pop-up information about this item, and email it to a friend' onclick='window.open(\""+URLenviar+"\",\""+mywindow+"\",\""+estilo+"\"); _gaq.push([\"_trackEvent\", \"Herramientas\", \"Enviar\", \""+aaatitle+"\"]);' />";
				
				someImage += "<img id='rptUVL_ctl_"+i+"_No' style='height:18px;width:99px;border-width:0px;' src='"+baseurl+"img/item_detail_normal_open.gif' class='uvlDetails uvlNormal' title='Mostrar o esconder cap&iacute;tulos dentro de este v&iacute;deo' />";
				
				someImage += "<div class='uvlTextBox'><a href='javascript:playVideo("+i+",\""+currentlyShowing+"\");' onclick='_gaq.push([\"_trackEvent\", \"Video\", \""+aaatitle+"\"]);' id='boxtitle_"+i+"' class='uvlTitle uvlNormal' title='"+aaatitle+"'>"+aaatitle+"</a>&nbsp;<p><span class='uvlDurationLabel'>Duraci&oacute;n:</span><span class='uvlNormal uvlDuration' id='rptUVL_ctl_"+i+"_Duration'>"+minVar+":"+secVar+"</span><span class='uvlNormal uvlEventDate' id='rptUVL_ctl_"+i+"_EventDate'>"+authoringtime+"</span></p><span class='uvlAbstract uvlNormal' id='rptUVL_ctl_"+i+"_Abs'>"+longDesc+"</span><span class='sep'>/</span></div>";
				
				someImage += "</div>";
			}
			api.reinitialise();
  		} //final for
  		
  		$(".jspPane").html(someImage);
  		api.getContentPane();			
		api.reinitialise();
  	}
}//final funcion 

