/*------------------------------------------------------------------------------
DEFINICION DE VARIABLES GLOBALES
- tiempo_ocultar_capa: Esta variable global es utilizada para determinar el tiempo 
que debe transcurrir antes de que una capa se oculte. Utilizada en la funcion setTimeout(),
cuando se llama la funcion dyaplay_element(id_capa).

- tiempo_salir_pagina_error: Esta variable global es utilizada para que salga de 
la pagina error.php (Error 001: error de inicio de sesion) y regrese al sitio de
inicio de sesion.
------------------------------------------------------------------------------*/
var nav4 = window.Event ? true : false;
var tiempo_salir_pagina_error;
var form_global;//Especifica el formulario actual en el que se estan haciendo operaciones
var obj_lis_global;//Especifica la lista desplegable actual en el que se estan haciendo operaciones
var obj_lis_pri;
var pos_lis_des_global;//Especifica la pocision de la opcion que se selecciono de una lista desplegable.
var tiempo_ocultar_capa;
 tiempo_ocultar_capa 		= "10000";//Ejemplo: 4 Segundos = 4000
 tiempo_salir_pagina_error 	= "10000";
 obj_lis_pri 				= "";
/*------------------------------------------------------------------------------------------------*/
/*	PUBLICIDAD EN LOS SECRETOS	*/
var consupermiso = '<a href="http://consupermiso.com/regcobranded.asp?ref=ingjuanfelipe@gmail.com" target="_blank"><img border="0" src="imagenes/cashbanner468.gif"></a>';
var mercadolibre = '<iframe src="http://pmssrv.mercadolibre.com.co/jm/PmsSrv?tool=5513284&creativity=53801&new=Y&ovr=Y" '+
						'width="468" height="60" scrolling="no" frameborder="0" marginheight="0" marginwidth="0">'+
					'</iframe>';
/*------------------------------------------------------------------------------------------------*/


////////////////////////////////////////////////////////////////////////
/*	Esta funcion permite la administracion de los mensajes 
	que se muestran en las interfaces.
 */
var elemProload;
var proload;
 function aviso_interfaz(capa, error){
	proload.style.display = "none";//Mostramos el boton que inicio el evnto en AJAX
	proload.innerHTML = elemProload;
	document.getElementById(capa).innerHTML = error;
	document.getElementById(capa).style.display = "block";
	setTimeout('dyaplay_element("'+capa+'");',tiempo_ocultar_capa);//Pasado 4 segundos se cambia el valor del atributo [display:none] - dyaplay_element(): Esta funcio se encuentra en el archivo sdv_basic.js

}
function preload(capa, css, gif){//Muestra un loading cuando se publican comentarios
	proload = document.getElementById(capa);//Resource de la capa
	elemProload = proload.innerHTML;//Contenido de la capa
	proload.innerHTML = "<img src='imagenes/"+gif+"' class='"+css+"'>";
}
////////////////////////////////////////////////////////////////////////

function cambiar_txt_emo(texto) //Cambia los caracteres especiales por Emoticons en un secreto o comentario
{
theText = texto;
// replace 
theText = theText.replace(";)","<img src=\"imagenes/emoticons/wink.gif\" alt=\";)\" />");
theText = theText.replace(";-)","<img src=\"imagenes/emoticons/wink.gif\" alt=\";-)\" />");
theText = theText.replace(":D","<img src=\"imagenes/emoticons/biggrin.gif\" alt=\":D\" />");
theText = theText.replace(":d","<img src=\"imagenes/emoticons/biggrin.gif\" alt=\":d\" />");
theText = theText.replace(":-D","<img src=\"imagenes/emoticons/biggrin.gif\" alt=\":-D\" />");
theText = theText.replace("B)","<img src=\"imagenes/emoticons/cool.gif\" alt=\"B)\" />");
theText = theText.replace("B-\)","<img src=\"imagenes/emoticons/cool.gif\" alt=\"B-)\" />");
theText = theText.replace(":x","<img src=\"imagenes/emoticons/mad.gif\" alt=\":x\" />");
theText = theText.replace(":X","<img src=\"imagenes/emoticons/mad.gif\" alt=\":X\" />");
theText = theText.replace(":-x","<img src=\"imagenes/emoticons/mad.gif\" alt=\":-x\" />");
theText = theText.replace(":-X","<img src=\"imagenes/emoticons/mad.gif\" alt=\":-X\" />");
theText = theText.replace(":-\(","<img src=\"imagenes/emoticons/sad.gif\" alt=\":-(\" />");
theText = theText.replace(":(", "<img src=\"imagenes/emoticons/sad.gif\" alt=\":(\" />");
theText = theText.replace(":o","<img src=\"imagenes/emoticons/ohmy.gif\" alt=\":o\" />");
theText = theText.replace(":O","<img src=\"imagenes/emoticons/ohmy.gif\" alt=\":O\" />");
theText = theText.replace(":-o","<img src=\"imagenes/emoticons/ohmy.gif\" alt=\":-o\" />");
theText = theText.replace(":-O","<img src=\"imagenes/emoticons/ohmy.gif\" alt=\":-O\" />");
theText = theText.replace(":p","<img src=\"imagenes/emoticons/tongue.gif\" alt=\":p\" />");
theText = theText.replace(":-p","<img src=\"imagenes/emoticons/tongue.gif\" alt=\":-p\" />");
theText = theText.replace(":-P","<img src=\"imagenes/emoticons/tongue.gif\" alt=\":-P\" />");
theText = theText.replace(":P","<img src=\"imagenes/emoticons/tongue.gif\" alt=\":P\" />");
theText = theText.replace(":)","<img src=\"imagenes/emoticons/smile.gif\" alt=\":)\" />");
theText = theText.replace(":-)","<img src=\"imagenes/emoticons/smile.gif\" alt=\":-)\" />");
theText = theText.replace(":$","<img src=\"imagenes/emoticons/com-oops.gif\" alt=\":$\" />");
theText = theText.replace(":-$","<img src=\"imagenes/emoticons/com-oops.gif\" alt=\":-$\" />");
theText = theText.replace(":s","<img src=\"imagenes/emoticons/com-confuso.gif\" alt=\":s\" />");
theText = theText.replace(":S","<img src=\"imagenes/emoticons/com-confuso.gif\" alt=\":S\" />");
theText = theText.replace(":-S","<img src=\"imagenes/emoticons/com-confuso.gif\" alt=\"-S:\" />");
theText = theText.replace(":-s","<img src=\"imagenes/emoticons/com-confuso.gif\" alt=\":-s\" />");
theText = theText.replace(":I","<img src=\"imagenes/emoticons/com-neutral.gif\" alt=\":I\" />");
theText = theText.replace(":|","<img src=\"imagenes/emoticons/com-neutral.gif\" alt=\":|\" />");
theText = theText.replace(":-|","<img src=\"imagenes/emoticons/com-neutral.gif\" alt=\":-|\" />");
theText = theText.replace(":'(","<img src=\"imagenes/emoticons/com-cry.gif\" alt=\":'(\" />");

return theText;
}