
var sep="@@@@@@@@@@@@@@@@@@@@@@@@@"; // separador para mensajes desde el ajax
var urlLogin="";
var cerrarOtrosTabs=false;

// es
// Español
a2a_localize = {
    Share: "Compartir",
    Save: "Guardar",
    Subscribe: "Subscribirse",
    Email: "Correo electr&#243nico",
    Bookmark: "Marcador",
    ShowAll: "Mostrar todos",
    ShowLess: "Mostrar menos",
    FindServices: "Encontrar servicios",
    FindAnyServiceToAddTo: "Buscar un servicio",
    PoweredBy: "Proporcionado por",
    ShareViaEmail: "Compartir por correo",
    SubscribeViaEmail: "Suscribirse por correo",
    BookmarkInYourBrowser: "Agregar marcador en el navegador",
    BookmarkInstructions: "Presione Ctrl+D o Cmd+D para agregar al marcador",
    AddToYourFavorites: "Agregar a sus favoritos",
    SendFromWebOrProgram: "Enviar desde cualquier direcci&#243;n web o programa de correo electr&#243;nico",
    EmailProgram: "Programa de correo"
};

var a2a_config = a2a_config || {};
a2a_config.onclick = 1;

$(document).ready(function(){
	if (objExiste("#galeriaHidden")){
		$("a[rel='galeria']").colorbox({slideshow:false});
	}
});
	
function mostrar(accion,id){
var capa;
id="#" + id;
id=trim(id);
capa=$(id);

    if (objExiste(capa)){
    if (accion==1){
        capa.fadeIn("fast");
    }else{
        capa.slideToggle("fast");
    }
    }
}

function trim(cadena)
{
 return(cadena.replace(/^\s*|\s*$/g,""));
}

function objExiste(id){
    
    var objE;

    objE=$(id);
    
    if (objE.length != 0){
        return(true);
    }else{
        return(false);
    }

}

/* funciones de maxi */


function trim(cadena)
{
 return(cadena.replace(/^\s*|\s*$/g,""));
}

function count(array){
	return(array.length);
}
function validarnum(numero){
	if (numero==0 || numero=='0' || isNaN(numero)){
		return(false);
}else{
		return(true);
}
}

//* Funciones de fecha
function getFechaBySql(fecha){

	/* recibe una fecha en formato de texto
	 * que sacamos de Mysql y la devolvemos como fecha
	 * de javascript
	*/
	if (fecha!=""){
	var ano=fecha.substr(0,4)
	var mes=fecha.substr(5,2);
	var dia=fecha.substr(8,2);
	var nuevaFecha=new Date(ano,mes,dia);
	
	return(nuevaFecha);
}
}
function obtenerStringMes(numeroMes){

	switch (numeroMes){
		case "01":
			return("Enero");
		break;
		case "02":
			return("Febrero");
		break;
		case "03":
			return("Marzo");
		break;
		case "04":
			return("Abril");
		break;
		case "05":
			return("Mayo");
		break;
		case "06":
			return("Junio");
		break;
		case "07":
			return("Julio");
		break;
		case "08":
			return("Agosto");
		break;
		case "09":
			return("Septiembre");
		break;
		case "10":
			return("Octubre");
		break;
		case "11":
			return("Noviembre");
		break;
		case "12":
			return("Diciembre");
		break;
		default:
			return("El numero es..." + numeroMes);
		break;
	}	
}




function getValue(elemento,tipo){
	
	if (document.getElementById(elemento)){
		if (tipo=="combo"){
			combo= document.getElementById(elemento);
		if (combo){
			//alert(elemento);
			return(combo[combo.selectedIndex].value);
		}else{
			
		}
		
			}else{
				
				return(document.getElementById(elemento).value);
			}
		
	}else{
		return("");
	}
	}
	
	
	function getRadioButtonSelectedValue(ctrl)
{
    for(i=0;i<ctrl.length;i++)
        if(ctrl[i].checked) return ctrl[i].value;
}


function setValue(elemento,valor){
	if (document.getElementById(elemento)){
			document.getElementById(elemento).value=valor;
	}
}
	
	function limpiar(cadena){
		return(encodeURIComponent(cadena));
	}
	
	
	// determina el maximo de caracteres
// en un input text
function max(numero,id){
	
var cajadeTexto=document.getElementById(id);
	var valor = getValue(id,"");
	if (valor.length > numero) {
		cajadeTexto.value=valor.substr(0,numero);
	}
	if (soloNumeros==true){
	var ultimoCaracter=valor.substr(valor.length-1,valor.length);
		if (isNaN(ultimoCaracter)) {

			cajadeTexto.value=valor.substr(0,valor.length-1);
		}
	}
}

// VALIDAMOS UNA DIRECCION DE EMAIL 
//

function isEmailAddress(email)
{
  if( !(/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(email)) ) {
  // alert("El email no es correcto");
  return false;

}
else{
   return true;
}

}


function minimoCaracteres(cadena,minimo){
	var caracteres=cadena.length;
	if (caracteres < minimo){
		return(false);
	}else{
		return(true);
	}
}

function seleccionarItem(controlSelect,cadena){
	
	var obj=document.getElementById(controlSelect);
   if (obj){
	 for (var opcombo=0;opcombo < obj.length;opcombo++){
          if(trim(obj[opcombo].text.toLowerCase())==trim(cadena.toLowerCase())){
          obj.selectedIndex=opcombo;
          }
       } 
      }else{
      	return(-1);
	}
}


function seleccionarItemById(controlSelect,id){
    //alert(controlSelect + " y el id es.." + id);
	var obj=document.getElementById(controlSelect);
	if (!obj){
		return -1;
	}
	
	 for (var opcombo=0;opcombo < obj.length;opcombo++){
          if(trim(obj[opcombo].value)==trim(id)){
          obj.selectedIndex=opcombo;
          }
       }
}


function gup( name ){
	var regexS = "[\\?&]"+name+"=([^&#]*)";
	var regex = new RegExp ( regexS );
	var tmpURL = window.location.href;
	var results = regex.exec( tmpURL );
	if( results == null )
		return"";
	else
		return results[1];
}


function tildar(control,valor){
	var chk=document.getElementById(control);
	
	if (valor==1){
		chk.checked=true;
	}else{
		chk.checked=false;
	}
	
}

function estaChequeado(control){
	 var control=document.getElementById(control);
	 
	 if (!control){
		 return 0;
	 }
	 
	 if (control.checked){
		 return 1;
	 }else{
		 return 0;
	 }
}

function openCloseDiv(id){

    var capa;

    capa=$("#" +id);
    if (objExiste(capa)){
		
		limpiarCapasTool(id);
		
        if (capa.css('display')=='none'){
            capa.fadeIn("fast");
        }else{
            capa.fadeOut("fast");
        }
    }else{

    }
}
function mostrarCapa(id){
	$(id).fadeIn("fast");
}

function ocultarCapa(id){
	$(id).fadeOut("fast");
}



function contactoINlistado(strid,id){
	
	capaActivaContacto="mail_" + strid;
	var nombre=getValue("name_" + strid);
	var email=getValue("email_" + strid);
	var mensaje=getValue("message_" + strid);
	var respuesta=getValue("question_" + strid);
	var idq=trim("#" + "q_" + strid);
	var pregunta=$(idq);
	pregunta=pregunta.html();
	
	if (nombre=="" || email=="" || !isEmailAddress(email) || respuesta== "" || !is_numeric(respuesta) || mensaje==""){
		$.jGrowl("Complete los datos correctamente!!");
		return;
	}
	
	// ponemos el icono de mandando
	idcapaAjax=trim("#" + "ajax_" + strid);
	var capaAjax=$(idcapaAjax);
	capaAjax.html("<img src='static/img/mandandoEmail.gif'>");
	
	var idbutton=trim("#" + "b_" + strid);
	$(idbutton).attr("disabled", "true");
	
	// limpiamos el form
	
	$.post("ajax/mailINlistado.php",{nombre:nombre,email:email,mensaje:mensaje,pregunta:pregunta,respuesta:respuesta,id:id},contactoINlistadoProc);
}

function contactoINlistadoProc(data){
	
	var capaAjax=$(idcapaAjax);
	capaAjax.html("");
	
	openCloseDiv(capaActivaContacto);
	$.jGrowl('Se ha enviado el mensaje.');
	
	/*
	if (data=='true'){
		openCloseDiv('capaActivaContacto');
		$.jGrowl('Se ha enviado el mensaje.');
	}else{
		$.jGrowl('En este momento no se pudo enviar el mensaje.');
	}
	*/
	
}


function is_numeric(mixed_var){
	return (typeof(mixed_var) === 'number' || typeof(mixed_var) === 'string') && mixed_var !== '' && !isNaN(mixed_var);
}

function keywordProc(data){
}

function str_len(mystring){
	return(mystring.length);
}



function login(){
	
	var usuario=getValue("usuario");
	var password=getValue("password");
	var url=location.href;
	urlLogin=url;
	var url=explode("/",url);
	url=url[count(url)-1];

	if (usuario=="" || password == ""){
		Sexy.error('Ingrese los datos correctamente');
		return;
	}
	
	$.post("ajax/login.php",{usuario:usuario,password:password,url:url},loginProc);
	
	
}

function loginEmpresa(){
	
	var usuario=getValue("tx_usuario_empresa");
	var password=getValue("tx_password_empresa");
	var url=location.href;
	urlLogin=url;
	var url=explode("/",url);
	url=url[count(url)-1];

	if (usuario=="" || password == ""){
		Sexy.error('Ingrese todos los datos');
		return;
	}
	
	$.post("ajax/login.php",{usuario:usuario,password:password,url:url},loginProc);
	
	$("#mensajeForm").focus();
	
}

function loginProc(data){
//alert(data);

	var capa=$("#mensajeForm");
	
	switch (trim(data)){
		case "login":
			// reload loguiado
			window.location.reload();
		break;
		
		case "error":
			Sexy.error('Error en usuario o contrase&ntilde;a');
			//capa.css("color","red");
		break;
		
		case "no activa":
			Sexy.error("Su cuenta no esta todavia activa. Revise su email");
			//capa.css("color","red");
		break;
		
		case "ampliar-aviso":
			top.location.href = urlLogin; 
		break;
		
	}
}


function logOut(){
	$.post("ajax/logOut.php",{},logOutProc);
}

function logOutProc(data){
	top.location.href = 'index.php'; 
}

function borrarContenido(control){
	
	setValue(control,"");
}

function validarFecha(dia,mes,anio){
	
	var edad = 18;
	var miFecha = new Date();
	miFecha.setFullYear(anio, mes-1, dia);
	var fechaActual = new Date();
	fechaActual.setFullYear(fechaActual.getFullYear() - edad);
	if ((fechaActual - miFecha) <0){
		alert("Disculpa, sólo personas de más de " + edad + " pueden ingresar a este sitio.");
		return false;
	}
	return true;
}

function campoCUIL(texto,n,id){
	/*
	if (str_len(texto)>n){
		setValue(id,texto.substr(0,str_len(texto)-1));
		return;
	}
	*/
}

function v(valor){
	if (valor){
		return(true);
	}else{
		return(false);
	}
}



function IsNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }


function getSelectedRadio(buttonGroup) {
   // returns the array number of the selected radio button or -1 if no button is selected
   if (buttonGroup[0]) { // if the button group is an array (one button is not an array)
      for (var i=0; i<buttonGroup.length; i++) {
         if (buttonGroup[i].checked) {
            return i
         }
      }
   } else {
      if (buttonGroup.checked) { return 0; } // if the one button is checked, return zero
   }
   // if we get to this point, no radio button is selected
   return -1;
} // Ends the "getSelectedRadio" function


function getSelectedRadioValue(buttonGroup) {
   // returns the value of the selected radio button or "" if no button is selected
   var i = getSelectedRadio(buttonGroup);
   if (i == -1) {
      return "";
   } else {
      if (buttonGroup[i]) { // Make sure the button group is an array (not just one button)
         return buttonGroup[i].value;
      } else { // The button group is just the one button, and it is checked
         return buttonGroup.value;
      }
   }
} // Ends the "getSelectedRadioValue" function



function alturaCapasVisibles(){
	// retornamos la suma del alto
	// de las capas que se ven, de los tabs
	var retorno=0;
	$("div.cuerpoTab").each(function(index){
		if ($(this).css("display")=='block'){
			retorno=retorno + $(this).height();
		}
	});
	
	return(retorno);
}


function explode (delimiter, string, limit) {
    // http://kevin.vanzonneveld.net
    // +     original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +     improved by: kenneth
    // +     improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +     improved by: d3x
    // +     bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // *     example 1: explode(' ', 'Kevin van Zonneveld');
    // *     returns 1: {0: 'Kevin', 1: 'van', 2: 'Zonneveld'}
    // *     example 2: explode('=', 'a=bc=d', 2);
    // *     returns 2: ['a', 'bc=d']
 
    var emptyArray = { 0: '' };
    
    // third argument is not required
    if ( arguments.length < 2 ||
        typeof arguments[0] == 'undefined' ||
        typeof arguments[1] == 'undefined' ) {
        return null;
    }
 
    if ( delimiter === '' ||
        delimiter === false ||
        delimiter === null ) {
        return false;
    }
 
    if ( typeof delimiter == 'function' ||
        typeof delimiter == 'object' ||
        typeof string == 'function' ||
        typeof string == 'object' ) {
        return emptyArray;
    }
 
    if ( delimiter === true ) {
        delimiter = '1';
    }
    
    if (!limit) {
        return string.toString().split(delimiter.toString());
    } else {
        // support for limit argument
        var splitted = string.toString().split(delimiter.toString());
        var partA = splitted.splice(0, limit - 1);
        var partB = splitted.join(delimiter.toString());
        partA.push(partB);
        return partA;
    }
}


function print_r(theObj){
  if(theObj.constructor == Array ||
     theObj.constructor == Object){
    document.write("<ul>")
    for(var p in theObj){
      if(theObj[p].constructor == Array||
         theObj[p].constructor == Object){
document.write("<li>["+p+"] => "+typeof(theObj)+"</li>");
        document.write("<ul>")
        print_r(theObj[p]);
        document.write("</ul>")
      } else {
document.write("<li>["+p+"] => "+theObj[p]+"</li>");
      }
    }
    document.write("</ul>")
  }
}

function arrToJsonFormat(data){
	// array assosiative to Json format
	// by max
	var str;
	str="{";
	 for(var indice in data) {
		 //$json = '{"a":1,"b":2,"c":3,"d":4,"e":5}';
          str += "\"" + indice+ "\"" + ":" +  "\"" + data[indice] +  "\"" + ",";
        }
        
	str=str.substr(0,str.length-1);
	str += "}";
	return(str);
}


function show_no_show(id){
	
	alert(id);
	
	var capa=$(id);
	
	if (capa.css("display")=='block'){
		capa.fadeOut("fast");
	}else{
		capa.fadeIn("fast");
	}
	
}

function menuDer(id){
	var altoInicial="24px";
	var capaSubMenu=trim("#sub_" + id);
	var capa=$(capaSubMenu);
	
	var itemMenu=trim("#cat_" + id);
	var itemLI=$(itemMenu);
	
	if (capa.css("display")=='block'){
		capa.fadeOut(100);
		itemLI.css("height",altoInicial);
	}else{
		// agrandamos el item de la lista el alto de la capa sub
		altoCapaSub=capa.height();
		nuevoAlto=itemLI.height() + altoCapaSub;
		nuevoAltoStr=nuevoAlto + "px";
		itemLI.css("height",nuevoAltoStr);
		capa.fadeIn(100);
	}
}

function registroNews(){
	
	var nombre=getValue("n_nombre");
	var email=getValue("n_email");
	
	if (nombre && email && isEmailAddress(email)){
		$.post("ajax/suscribirseNewsletter.php",{nombre:nombre,email:email,sep:sep},registroNewsProc);
	}else{
		Sexy.error('Complete todos los datos');
	}
}

function registroNewsProc(data){
	//alert(data);
	var arrData=data.split(sep);
	
	 if (arrData[0]=='1'){
		Sexy.info('Gracias por registrarse.');
		setValue("n_nombre","");
		setValue("n_email","");
	 }else{
		Sexy.error('Su email ya se encuentra registrado.');
	 }
}

function darDbaja(id){
Sexy.confirm('Desea dar de baja su cuenta? Una vez confirmada esta operaci&oacute;n no podr&aacute volver a utilizar la misma.', {
  onComplete:
   function(returnvalue) {
      if (returnvalue) {
		$.post("ajax/darbaja.php",{id:id},darDbajaProc);
     } 
   }
 });
}

function darDbajaProc(data){
	//alert(data);
	var arrData=data.split(sep);
	
	if (arrData[0]=='0'){
		// error
		Sexy.info(arrData[1]);
	}else{
		// todo ok
		Sexy.info('Su cuenta ha sido eliminada');
		logOut();
}
}


function htmlentities (string, quote_style) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: nobbler
    // +    tweaked by: Jack
    // +   bugfixed by: Onno Marsman
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +    bugfixed by: Brett Zamir (http://brett-zamir.me)
    // +      input by: Ratheous
    // -    depends on: get_html_translation_table
    // *     example 1: htmlentities('Kevin & van Zonneveld');
    // *     returns 1: 'Kevin &amp; van Zonneveld'
    // *     example 2: htmlentities("foo'bar","ENT_QUOTES");
    // *     returns 2: 'foo&#039;bar'

    var hash_map = {}, symbol = '', tmp_str = '', entity = '';
    tmp_str = string.toString();
    
    if (false === (hash_map = get_html_translation_table('HTML_ENTITIES', quote_style))) {
        return false;
    }
    hash_map["'"] = '&#039;';
    for (symbol in hash_map) {
        entity = hash_map[symbol];
        tmp_str = tmp_str.split(symbol).join(entity);
    }
    
    return tmp_str;
}


function get_html_translation_table (table, quote_style) {
    // http://kevin.vanzonneveld.net
    // +   original by: Philip Peterson
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfixed by: noname
    // +   bugfixed by: Alex
    // +   bugfixed by: Marco
    // +   bugfixed by: madipta
    // +   improved by: KELAN
    // +   improved by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Brett Zamir (http://brett-zamir.me)
    // +      input by: Frank Forte
    // +   bugfixed by: T.Wild
    // +      input by: Ratheous
    // %          note: It has been decided that we're not going to add global
    // %          note: dependencies to php.js, meaning the constants are not
    // %          note: real constants, but strings instead. Integers are also supported if someone
    // %          note: chooses to create the constants themselves.
    // *     example 1: get_html_translation_table('HTML_SPECIALCHARS');
    // *     returns 1: {'"': '&quot;', '&': '&amp;', '<': '&lt;', '>': '&gt;'}
    
    var entities = {}, hash_map = {}, decimal = 0, symbol = '';
    var constMappingTable = {}, constMappingQuoteStyle = {};
    var useTable = {}, useQuoteStyle = {};
    
    // Translate arguments
    constMappingTable[0]      = 'HTML_SPECIALCHARS';
    constMappingTable[1]      = 'HTML_ENTITIES';
    constMappingQuoteStyle[0] = 'ENT_NOQUOTES';
    constMappingQuoteStyle[2] = 'ENT_COMPAT';
    constMappingQuoteStyle[3] = 'ENT_QUOTES';

    useTable       = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS';
    useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() : 'ENT_COMPAT';

    if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') {
        throw new Error("Table: "+useTable+' not supported');
        // return false;
    }

    entities['38'] = '&amp;';
    if (useTable === 'HTML_ENTITIES') {
        entities['160'] = '&nbsp;';
        entities['161'] = '&iexcl;';
        entities['162'] = '&cent;';
        entities['163'] = '&pound;';
        entities['164'] = '&curren;';
        entities['165'] = '&yen;';
        entities['166'] = '&brvbar;';
        entities['167'] = '&sect;';
        entities['168'] = '&uml;';
        entities['169'] = '&copy;';
        entities['170'] = '&ordf;';
        entities['171'] = '&laquo;';
        entities['172'] = '&not;';
        entities['173'] = '&shy;';
        entities['174'] = '&reg;';
        entities['175'] = '&macr;';
        entities['176'] = '&deg;';
        entities['177'] = '&plusmn;';
        entities['178'] = '&sup2;';
        entities['179'] = '&sup3;';
        entities['180'] = '&acute;';
        entities['181'] = '&micro;';
        entities['182'] = '&para;';
        entities['183'] = '&middot;';
        entities['184'] = '&cedil;';
        entities['185'] = '&sup1;';
        entities['186'] = '&ordm;';
        entities['187'] = '&raquo;';
        entities['188'] = '&frac14;';
        entities['189'] = '&frac12;';
        entities['190'] = '&frac34;';
        entities['191'] = '&iquest;';
        entities['192'] = '&Agrave;';
        entities['193'] = '&Aacute;';
        entities['194'] = '&Acirc;';
        entities['195'] = '&Atilde;';
        entities['196'] = '&Auml;';
        entities['197'] = '&Aring;';
        entities['198'] = '&AElig;';
        entities['199'] = '&Ccedil;';
        entities['200'] = '&Egrave;';
        entities['201'] = '&Eacute;';
        entities['202'] = '&Ecirc;';
        entities['203'] = '&Euml;';
        entities['204'] = '&Igrave;';
        entities['205'] = '&Iacute;';
        entities['206'] = '&Icirc;';
        entities['207'] = '&Iuml;';
        entities['208'] = '&ETH;';
        entities['209'] = '&Ntilde;';
        entities['210'] = '&Ograve;';
        entities['211'] = '&Oacute;';
        entities['212'] = '&Ocirc;';
        entities['213'] = '&Otilde;';
        entities['214'] = '&Ouml;';
        entities['215'] = '&times;';
        entities['216'] = '&Oslash;';
        entities['217'] = '&Ugrave;';
        entities['218'] = '&Uacute;';
        entities['219'] = '&Ucirc;';
        entities['220'] = '&Uuml;';
        entities['221'] = '&Yacute;';
        entities['222'] = '&THORN;';
        entities['223'] = '&szlig;';
        entities['224'] = '&agrave;';
        entities['225'] = '&aacute;';
        entities['226'] = '&acirc;';
        entities['227'] = '&atilde;';
        entities['228'] = '&auml;';
        entities['229'] = '&aring;';
        entities['230'] = '&aelig;';
        entities['231'] = '&ccedil;';
        entities['232'] = '&egrave;';
        entities['233'] = '&eacute;';
        entities['234'] = '&ecirc;';
        entities['235'] = '&euml;';
        entities['236'] = '&igrave;';
        entities['237'] = '&iacute;';
        entities['238'] = '&icirc;';
        entities['239'] = '&iuml;';
        entities['240'] = '&eth;';
        entities['241'] = '&ntilde;';
        entities['242'] = '&ograve;';
        entities['243'] = '&oacute;';
        entities['244'] = '&ocirc;';
        entities['245'] = '&otilde;';
        entities['246'] = '&ouml;';
        entities['247'] = '&divide;';
        entities['248'] = '&oslash;';
        entities['249'] = '&ugrave;';
        entities['250'] = '&uacute;';
        entities['251'] = '&ucirc;';
        entities['252'] = '&uuml;';
        entities['253'] = '&yacute;';
        entities['254'] = '&thorn;';
        entities['255'] = '&yuml;';
    }

    if (useQuoteStyle !== 'ENT_NOQUOTES') {
        entities['34'] = '&quot;';
    }
    if (useQuoteStyle === 'ENT_QUOTES') {
        entities['39'] = '&#39;';
    }
    entities['60'] = '&lt;';
    entities['62'] = '&gt;';


    // ascii decimals to real symbols
    for (decimal in entities) {
        symbol = String.fromCharCode(decimal);
        hash_map[symbol] = entities[decimal];
    }
    
    return hash_map;
}



function recomendar(){
}



function buscarTop(){
	
	
    var cadena=getValue("tx_search");
    
    if (!cadena){
		Sexy.error('Ingrese alg&uacute;n texto en la caja');
		return;
	}
	
    
	escape(cadena);
	
	url="buscar.php?q=" + cadena;
	
    document.location.href=url;
 
}

function rightString(fullString, subString) {
if (fullString.indexOf(subString) == -1) {
return "";
}
else {
return (fullString.substring(fullString.indexOf(subString)+subString.length, fullString.length));
}
}

