//
// Copyright 2006 Nelson Daza. nelson.daza@gmail.com. All rights reserved.
// DOM HTML 
// ----------------------------------------------------
//
// Tips.js
//
//	version 1.0.1.2 major.minor[.revision[.build]]

	/* START ToolTips Script */
	
	/**
	 *	This Script needs function.js
	**/

	function searchColfuturo(searchFields, results, idParentRestrict, namefunction, idFolderRestrict){
		var options = new Array();
		var params = new Array();
		options = searchFields.split(",");	
		params["idParent"] = idParentRestrict;
		if ( idFolderRestrict && idFolderRestrict != 'undefined' ){
			params["idFolderRestrict"] = idFolderRestrict;
		}
		startSearch = false;
		for (i=0;i<options.length;i++){
			var valueSearch = "";
			if ('name'==options[i]){
				var object = document.getElementById('search'+options[i]);
				if (object.value != ""){
					valueSearch = object.value; 
					startSearch = true;
				}
			}
			else if ('source'==options[i]){
				var object = document.getElementById('search'+options[i]);
				if (object.value != ""){
					valueSearch = object.value; 
					startSearch = true;
				}
			}
			else if ('all'==options[i]){
				var object = document.getElementById('search'+options[i]);
				if (object.value != ""){
					valueSearch = object.value; 
					startSearch = true;
				}
			}
			else {
				var object = document.getElementById('search'+options[i]);
				if (object && object.selectedIndex>0){
					valueSearch = object[object.selectedIndex].value; 
					startSearch = true;
				}
			}
			if (valueSearch != ""){
				params[options[i]] = valueSearch;
			}
		}
		if (!startSearch){
			alert ("necesita algun parametro para poder buscar");
			return false;
		}
		document.getElementById(results).innerHTML = "<div class='buscadorprograma'>Buscando...<\/div>";
		var result = dojo.io.bind( 
			{
				url: searchpath + "servlet/SearchContent.php",
				method: "post",
				content: params,
				error: function ( type, error ){
					document.getElementById(results).innerHTML = "<div class='buscadorprograma'>Se presento un error en la bùsqueda<\/div>";
				},
				handler: function (type, data, evt) {	
					var html;
					switch(namefunction){
						case "restoreUniversity":
							html = restoreUniversity (data);
							break;
						case "restoreArticulos":
							html = restoreArticulos (data);
							break;
						case "restorePostgraduate":
							html = restorePostgraduate (data);
							break;
						case "restorePublication":
							html = restorePublication (data);
							break;							
						case "restoreClipping":
							html = restoreClipping (data);
							break;							
						default:
							html = "<div class='buscadorprograma'>Buscador no Soportado<\/div>";
							break;						
					}					 
					document.getElementById(results).innerHTML = html;
				}, 			
				mimetype: "text/xml"
			} 
		)	
		
	}

	var actualsearchpage=0;
	var maxpage=4;
	function restoreUniversity( originalRequest ){
		var data = originalRequest;
		var result = data.getElementsByTagName("result");
		if (result.length > 0){		
			var object = result[0].getElementsByTagName("object");
			if (object.length > 0){
				var html = "<table width='100%' cellpadding='0' cellspacing='0' border='0' id='resultspage1' style='display:block'>";
				var resultspanel = "";				
				pages=1;
				actualsearchpage = 1;
				for (var i=0; i<object.length;i++){
					resultado = object[i];
					var id = unescape(resultado.getAttribute('id'));
					var name = unescape(resultado.getAttribute('name'));
					var properties = resultado.getElementsByTagName("properties");
					var intro = "";
					for (var j=0; j<properties.length;j++){
						property = properties[j];
						if  (unescape(property.getAttribute('name')) == 'País') pais = unescape(property.getAttribute('value'));
						else if (property.getAttribute('name') == 'intro') intro = unescape(property.getAttribute('value'));
					}
					if (i>0 && i%maxpage==0){
						resultspanel += "<a href='#' class='buscadorprograma' onclick='changeResultPage("+pages+");return false;' id='page"+ pages +"' style='color:"+((pages==1)?"#000000":"#FFFFFF")+"'>"+pages + "</a>&nbsp;";
						pages ++;
						html +="</table>";	
						html += "<table width='100%' cellpadding='0' cellspacing='0' border='0' id='resultspage"+ pages +"' style='display:none'>";						
					}
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td width='5' align='center' height='20' style='border-bottom:1px solid #CCCCCC'></td>";
					html += "<td align='center' style='border-bottom:1px solid #CCCCCC;cursor:pointer' onClick=\"gotoContent("+id+", 'complete')\"><b>"+ name +"</b></td>";
					html += "<td width='5' style='border-bottom:1px solid #CCCCCC'></td>";
					html += "</tr>";
					html +="<tr height='20'>";
					html +="<td></td>";
					html +="<td class='buscadorprograma' align='left'>"+ intro +"<br>&nbsp;</td>";
					html +="<td></td>";
					html +="</tr>";
				}
				if (pages > 1){
					resultspanel += "<a href='#' class='buscadorprograma' onclick='changeResultPage("+pages+");return false;' id='page"+ pages +"' style='color:"+((pages==1)?"#000000":"#FFFFFF")+"'>"+pages + "</a>&nbsp;";
				}
				resultspanel += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
				document.getElementById('resultspanel').innerHTML = resultspanel;
				html +="</table>";	
			} else {
				html = "<div class='buscadorprograma'>No se retorno ningun Resultado<\/div>";
			}
		} else {
			html = "<div class='buscadorprograma'>No se retorno ningun Resultado<\/div>";
		}

		return html;
	}

	function restoreArticulos( originalRequest ){
		var maxpage=10;		
		var data = originalRequest;
		var result = data.getElementsByTagName("result");
		if (result.length > 0){		
			var object = result[0].getElementsByTagName("object");
			if (object.length > 0){
				var html = "<table cellpadding='0' cellspacing='0' border='0' id='resultspage1' style='display:block' width='100%'>";
				var resultspanel = "";				
				pages=1;
				actualsearchpage = 1;
				for (var i=0; i<object.length;i++){
					resultado = object[i];
					var id = unescape(resultado.getAttribute('id'));
					var name = unescape(resultado.getAttribute('name'));
					var properties = resultado.getElementsByTagName("properties");
					var date = "";
					var source = "";
					for (var j=0; j<properties.length;j++){
						property = properties[j];
						if (property.getAttribute('name') == 'date') date = unescape(property.getAttribute('value'));
					}
					if (i>0 && i%maxpage==0){
						resultspanel += "<a href='#' class='buscadorprograma' onclick='changeResultPage("+pages+");return false;' id='page"+ pages +"' style='color:"+((pages==1)?"#000000":"#FFFFFF")+"'>"+pages + "</a>&nbsp;";
						pages ++;
						html +="</table>";	
						html += "<table cellpadding='0' cellspacing='0' border='0' id='resultspage"+ pages +"' style='display:none' width='100%'>";						
					}
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td width='5' align='center' height='20' style='border-bottom:1px solid #CCCCCC'></td>";
					html += "<td align='left' style='border-bottom:1px solid #CCCCCC;cursor:pointer' onClick=\"gotoContent("+id+", 'complete')\">"+ name +" (" + date + ")</td>";
					html += "<td width='5' style='border-bottom:1px solid #CCCCCC'></td>";
					html += "</tr>";
				}
				if (pages > 1){
					resultspanel += "<a href='#' class='buscadorprograma' onclick='changeResultPage("+pages+");return false;' id='page"+ pages +"' style='color:"+((pages==1)?"#000000":"#FFFFFF")+"'>"+pages + "</a>&nbsp;";
				}
				resultspanel += "&nbsp;";
				document.getElementById('resultspanel').innerHTML = resultspanel;
				html +="</table>";	
			} else {
				html = "<div class='buscadorprograma'>No se retorno ningun Resultado<\/div>";
			}
		} else {
			html = "<div class='buscadorprograma'>No se retorno ningun Resultado<\/div>";
		}

		return html;
	}	
	
	
	function restoreClipping( originalRequest ){
		maxpage = 8;
		var data = originalRequest;
		var result = data.getElementsByTagName("result");
		if (result.length > 0){					
			var object = result[0].getElementsByTagName("object");
			if (object.length > 0){
				var html = "<table cellpadding='0' cellspacing='0' border='0' id='resultspage1' style='display:block' width='100%'>";
				var resultspanel = "";				
				pages=1;
				actualsearchpage = 1;
				for (var i=0; i<object.length;i++){
					resultado = object[i];
					var id = unescape(resultado.getAttribute('id'));
					var name = unescape(resultado.getAttribute('name'));
					var properties = resultado.getElementsByTagName("properties");
					var date = "";
					var source = "";
					for (var j=0; j<properties.length;j++){
						property = properties[j];
						if (property.getAttribute('name') == 'date') date = unescape(property.getAttribute('value'));
						if (property.getAttribute('name') == 'source') source = unescape(property.getAttribute('value'));
					}
					if (i>0 && i%maxpage==0){
						resultspanel += "<a href='#' class='buscadorprograma' onclick='changeResultPage("+pages+");return false;' id='page"+ pages +"' style='color:"+((pages==1)?"#000000":"#FFFFFF")+"'>"+pages + "</a>&nbsp;";
						pages ++;
						html +="</table>";	
						html += "<table cellpadding='0' cellspacing='0' border='0' id='resultspage"+ pages +"' style='display:none' width='100%'>";						
					}
					if ( i%2==0 ){
						html += "<tr class='buscadorprograma' height='20'>";
					}
					html += "<td width='5' align='center' height='20' style='border-bottom:1px solid #CCCCCC'></td>";
					html += "<td align='center' style='border-bottom:1px solid #CCCCCC'><a href='/colfuturo/servlet/ShowImage.php?idFile="+id+"' onclick='showLightbox(this); return false;' rel='lightbox' title='"+name+"'><img src='http:servlet/ShowImage.php?idFile="+id+"&boundWidth=50&boundHeight=50' border='0'></a></td>";
					html += "<td width='5' style='border-bottom:1px solid #CCCCCC'></td>";
					html += "<td align='left' style='border-bottom:1px solid #CCCCCC'>" + source + "<br>"+ name +" (" + date + ")</td>";
					html += "<td width='5' style='border-bottom:1px solid #CCCCCC'></td>";
					if ( i%2!=0 ){
						html += "</tr>";
					}
				}
				if (pages > 1){
					resultspanel += "<a href='#' class='buscadorprograma' onclick='changeResultPage("+pages+");return false;' id='page"+ pages +"' style='color:"+((pages==1)?"#000000":"#FFFFFF")+"'>"+pages + "</a>&nbsp;";
				}
				resultspanel += "&nbsp;";
				document.getElementById('resultspanel').innerHTML = resultspanel;
				html +="</table>";	
			} else {
				html = "<div class='buscadorprograma'>No se retorno ningun Resultado<\/div>";
			}
		} else {
			html = "<div class='buscadorprograma'>No se retorno ningun Resultado<\/div>";
		}

		return html;
	}	
	
	function restorePostgraduate( originalRequest ){
		var data = originalRequest;
		var result = data.getElementsByTagName("result");
		if (result.length > 0){		
			var object = result[0].getElementsByTagName("object");
			if (object.length > 0){
				var html = "<table cellpadding='0' cellspacing='0' border='0' id='resultspage1' style='display:block;width:460px'>";
				var resultspanel = "";				
				pages=1;
				actualsearchpage = 1;
				for (var i=0; i<object.length;i++){
					resultado = object[i];
					var id = unescape(resultado.getAttribute('id'));
					var name = unescape(resultado.getAttribute('name'));
					var properties = resultado.getElementsByTagName("properties");
					var pais = "";
					var topico = "";
					var url = "";
					var universidad = "";
					for (var j=0; j<properties.length;j++){
						property = properties[j];
						if (unescape(property.getAttribute('name')) == 'País') pais = unescape(property.getAttribute('value'));
						else if (property.getAttribute('name') == 'topico') topico = unescape(property.getAttribute('value'));
						else if (property.getAttribute('name') == 'Universidad') universidad = unescape(property.getAttribute('value'));
						else if (property.getAttribute('name') == 'url') url = unescape(property.getAttribute('value'));
					}
					if (i>0 && i%maxpage==0){
						resultspanel += "<a href='#' class='buscadorprograma' onclick='changeResultPage("+pages+");return false;' id='page"+ pages +"' style='color:"+((pages==1)?"#000000":"#FFFFFF")+"'>"+pages + "</a>&nbsp;";
						pages ++;
						html +="</table>";	
						html += "<table cellpadding='0' cellspacing='0' border='0' id='resultspage"+ pages +"' style='display:none;width:460px'>";						
					}
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td width='5' align='center' height='20' style='border-bottom:1px solid #CCCCCC'></td>";
					html += "<td align='center' colspan='3' style='border-bottom:1px solid #CCCCCC; cursor:pointer' onclick=\"gotoContent(" + id + ", 'complete')\" ><b>"+ name +"</b></td>";
					html += "<td width='70' style='border-bottom:1px solid #CCCCCC' align='right' valign='bottom'>";
					if (url != "")
						html += "<img src='imagenes/colfuturo/buscador/url.jpg' width='70' height='21' style='cursor:pointer' onclick=\"openPage('" + url + "')\" onMouseOver=\"this.src='imagenes/colfuturo/buscador/url2.jpg'\" onMouseOut=\"this.src='imagenes/colfuturo/buscador/url.jpg'\"/>"
					html += "</td>";
					html += "<td width='5' style='border-bottom:1px solid #CCCCCC'></td>";
					html += "</tr>";
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td></td>";
					html += "<td align='right' width='150'><b>&Aacute;rea de Estudio</b></td>";
					html += "<td width='10' align='center' height='20'></td>";
					html += "<td align='left'  >"+ topico +"</td>";
					html += "<td align='right' rowspan='3' width='70' valign='top'>";
					html += "<img src='imagenes/colfuturo/buscador/descripcion.jpg' width='70' height='21' style='cursor:pointer' onclick=\"gotoContent(" + id + ", 'complete')\" onMouseOver=\"this.src='imagenes/colfuturo/buscador/descripcion2.jpg'\" onMouseOut=\"this.src='imagenes/colfuturo/buscador/descripcion.jpg'\"/>";
					html += "</td>";					
					html += "<td></td>";
					html +="</tr>";
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td></td>";
					html += "<td align='right'><b>Universidad</b></td>";
					html += "<td width='10' align='center' height='20'></td>";
					html += "<td align='left'>"+ universidad +"</td>";
					html += "<td></td>";
					html +="</tr>";
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td></td>";
					html += "<td align='right'><b>Pa&iacute;s</b></td>";
					html += "<td width='10' align='center' height='20' ></td>";
					html += "<td align='left' >"+ pais +"</td>";
					html += "<td></td>";
					html +="</tr>";
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td colspan='5' style='height:10px;width:460px'></td>";
					html +="</tr>";
				}
				if (pages > 1){
					resultspanel += "<a href='#' class='buscadorprograma' onclick='changeResultPage("+pages+");return false;' id='page"+ pages +"' style='color:"+((pages==1)?"#000000":"#FFFFFF")+"'>"+pages + "</a>&nbsp;";
				}
				resultspanel += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
				document.getElementById('resultspanel').innerHTML = resultspanel;
				html +="</table>";	
			} else {
				html = "<div class='buscadorprograma'>No se retorno ningun Resultado<\/div>";
			}
		} else {
			html = "<div class='buscadorprograma'>No se retorno ningun Resultado<\/div>";
		}

		return html;
	}	
	
	function restorePublication( originalRequest ){
		var data = originalRequest;
		var result = data.getElementsByTagName("result");
		if (result.length > 0){		
			var object = result[0].getElementsByTagName("object");
			if (object.length > 0){
				var html = "<table cellpadding='0' cellspacing='0' border='0' id='resultspage1' style='display:block;width:460px'>";
				var resultspanel = "";				
				pages=1;
				actualsearchpage = 1;
				for (var i=0; i<object.length;i++){
					resultado = object[i];
					var id = unescape(resultado.getAttribute('id'));
					var name = unescape(resultado.getAttribute('name'));
					var properties = resultado.getElementsByTagName("properties");
					var autor = "";
					var universidad = "";
					var formato = "";
					var annio = "";
					var promocion = "";
					var topico = "";
					var tipo = "";
					var url = "";
					var url2 = "";
					for (var j=0; j<properties.length;j++){
						property = properties[j];
						if (property.getAttribute('name') == 'autor') autor = unescape(property.getAttribute('value'));
						else if (property.getAttribute('name') == 'universidad') universidad = unescape(property.getAttribute('value'));
						else if (property.getAttribute('name') == 'formato') formato = unescape(property.getAttribute('value'));
						else if (property.getAttribute('name') == 'año') annio = unescape(property.getAttribute('value'));
						else if (property.getAttribute('name') == 'promocion') promocion = unescape(property.getAttribute('value'));
						else if (property.getAttribute('name') == 'tipo_publicacion') tipo = unescape(property.getAttribute('value'));
						else if (property.getAttribute('name') == 'url') url = unescape(property.getAttribute('value'));
						else if (property.getAttribute('name') == 'url_adicional') url2 = unescape(property.getAttribute('value'));
						else if (property.getAttribute('name') == 'topico') topico = unescape(property.getAttribute('value'));
					}
					if (i>0 && i%maxpage==0){
						resultspanel += "<a href='#' class='buscadorprograma' onclick='changeResultPage("+pages+");return false;' id='page"+ pages +"' style='color:"+((pages==1)?"#000000":"#FFFFFF")+"'>"+pages + "</a>&nbsp;";
						pages ++;
						html +="</table>";	
						html += "<table cellpadding='0' cellspacing='0' border='0' id='resultspage"+ pages +"' style='display:none;width:460px'>";						
					}
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td width='5' align='center' height='20' style='border-bottom:1px solid #CCCCCC'></td>";
					html += "<td align='center' colspan='3' style='border-bottom:1px solid #CCCCCC'><b>"+ name +"</b></td>";
					html += "<td width='70' style='border-bottom:1px solid #CCCCCC' align='right' valign='bottom'>";
					if (url != "")
						html += "<img src='imagenes/colfuturo/buscador/resumen.jpg' width='70' height='21' style='cursor:pointer' onclick=\"openPage('" + url + "')\" onMouseOver=\"this.src='imagenes/colfuturo/buscador/resumen2.jpg'\" onMouseOut=\"this.src='imagenes/colfuturo/buscador/resumen.jpg'\"/>"
					html += "</td>";
					html += "<td width='5' style='border-bottom:1px solid #CCCCCC'></td>";
					html += "</tr>";
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td></td>";
					html += "<td align='right' width='150'><b>Autor</b></td>";
					html += "<td width='10' align='center' height='20'></td>";
					html += "<td align='left'  >"+ autor +"</td>";
					html += "<td align='right' rowspan='3' width='70' valign='top'>";
					if (url2 != "")
						html += "<img src='imagenes/colfuturo/buscador/documento.jpg' width='70' height='21' style='cursor:pointer' onclick=\"openPage('" + url2 + "')\" onMouseOver=\"this.src='imagenes/colfuturo/buscador/documento2.jpg'\" onMouseOut=\"this.src='imagenes/colfuturo/buscador/documento.jpg'\"/>";
					html += "</td>";					
					html += "<td></td>";
					html +="</tr>";
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td></td>";
					html += "<td align='right'><b>Universidad</b></td>";
					html += "<td width='10' align='center' height='20'></td>";
					html += "<td align='left'>"+ universidad +"</td>";
					html += "<td></td>";
					html +="</tr>";
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td></td>";
					html += "<td align='right'><b>Formato</b></td>";
					html += "<td width='10' align='center' height='20' ></td>";
					html += "<td align='left' >"+ formato +"</td>";
					html += "<td></td>";
					html +="</tr>";
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td></td>";
					html += "<td align='right'><b>Tema</b></td>";
					html += "<td width='10' align='center' height='20' ></td>";
					html += "<td align='left' >"+ topico +"</td>";
					html += "<td></td>";
					html +="</tr>";
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td></td>";
					html += "<td align='right'><b>A&ntilde;o de Publicaci&oacute;n</b></td>";
					html += "<td width='10' align='center' height='20' ></td>";
					html += "<td align='left' >"+ annio +"</td>";
					html += "<td></td>";
					html +="</tr>";
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td></td>";
					html += "<td align='right'><b>A&ntilde;o de Promoci&oacute;n</b></td>";
					html += "<td width='10' align='center' height='20' ></td>";
					html += "<td align='left' >"+ promocion +"</td>";
					html += "<td></td>";
					html +="</tr>";
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td></td>";
					html += "<td align='right'><b>Tipo de Publicaci&oacute;n</b></td>";
					html += "<td width='10' align='center' height='20' ></td>";
					html += "<td align='left' >"+ tipo +"</td>";
					html += "<td></td>";
					html +="</tr>";
					html += "<tr class='buscadorprograma' height='20'>";
					html += "<td colspan='5' style='height:10px;width:460px'></td>";
					html +="</tr>";
				}
				if (pages > 1){
					resultspanel += "<a href='#' class='buscadorprograma' onclick='changeResultPage("+pages+");return false;' id='page"+ pages +"' style='color:"+((pages==1)?"#000000":"#FFFFFF")+"'>"+pages + "</a>&nbsp;";
				}
				resultspanel += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
				document.getElementById('resultspanel').innerHTML = resultspanel;
				html +="</table>";	
			} else {
				html = "<div class='buscadorprograma'>No se retorno ningun Resultado<\/div>";
			}
		} else {
			html = "<div class='buscadorprograma'>No se retorno ningun Resultado<\/div>";
		}

		return html;
	}	
	
	function changeResultPage ( id ){
		if (actualsearchpage>0){
			var page = document.getElementById('resultspage'+actualsearchpage);
			page.style.display="none";
			page = document.getElementById('page'+actualsearchpage);
			page.style.color="#FFFFFF";
		}
		actualsearchpage = id;
		var page = document.getElementById('resultspage'+id);
		page.style.display="block";
		page = document.getElementById('page'+id);
		page.style.color="#000000";
	}
	
	function openPage( url ){
		window.open(url,'thepagewindow','width=400,height=200,toolbar=yes, location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes, resizable=yes');
	}
	
	
	function popup ( url, name, width, height, posx, posy, features )	{
		if ( typeof( posx ) == 'undefined' )
			posx = 'center';
		if ( typeof( posy ) == 'undefined' )
			posy = 'middle';
		if ( typeof( features ) == 'undefined' )
			features = '';

		if ( posx.toLowerCase ( ) == 'center' )
			posx = ( screen.width - width ) / 2;
		else if ( posx.toLowerCase ( ) == 'right' )
			posx = (screen.width - width - 30);
		else if ( posx < 0 )
			posx = screen.width - width + posx;
		else 
			posx = 0;
	
		if ( posy.toLowerCase ( ) == 'middle' )
			posy = ( screen.height - height ) / 2;
		else if ( posy.toLowerCase ( ) == 'bottom' )
			posy = ( screen.height - height - 60 );
		else if ( posy < 0 )
			posx = screen.height - height - posy - 30;
		else 
			posy = 0;
	
		if ( typeof( name ) == 'undefined' || typeof( width ) == 'undefined' || typeof( height ) == 'undefined' )
			open( url );
		else
			open( url, name, 'width=' + width + ',height=' + height + ',screenX=' + posx + ',left=' + posx + ',screenY=' + posy + ',top=' + posy + ',' + features );
		return;
	}
	
	function changeNotice (id){
		var selecteditem = document.getElementById("comentar");
		selecteditem.style.background= (id=="comentar") ? "#EEEEEE" : "#FFFFFF" ;
		selecteditem = document.getElementById("comentarios");
		selecteditem.style.background= (id=="comentarios") ? "#EEEEEE" : "#FFFFFF" ;

		selecteditem = document.getElementById("comentar_content");
		selecteditem.style.display= (id=="comentar") ? "block" : "none" ;
		selecteditem = document.getElementById("comentarios_content");
		selecteditem.style.display= (id=="comentarios") ? "block" : "none" ;

	}
	
	function submitComment(){
		var result = dojo.io.bind( 
			{
				url: searchpath + "servlet/ComentarDoc.php",
				method: "post",
				formNode:document.getElementById('commentForm'),
				content: { },
				handler: function (type, data, evt) {					
					if (type == "error") {
						var div = document.getElementById('resultadosComentario'); 
						div.innerHTML = 'Error al guardar el comentario.';
					} else {
						var div = document.getElementById('resultadosComentario'); 
						div.innerHTML = 'Se ha insertado su comentario correctamente.';
						var div = document.getElementById('comentarios_destacados'); 
						div.innerHTML = data;
					}
				}, 						
				mimetype: "text/html"
			} 
		)					
	}
	
		
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;		