// v 1.7 - La Nacion.
function votShow(OBJID,OBJTIPO,PATH_TAX,OBJTIT) {
  var movieUrl = "/votac/flash/votacion_lanacion_1.7.swf";
  var W = 176;
  var H = 59;
  var theId = 'votacion_1.7';
  var flashvars = "&OBJID=" + votDespulga(OBJID)
                + "&OBJTIPO=" + votDespulga(OBJTIPO)
                + "&PATH_TAX=" + votDespulga(votRePath(PATH_TAX))
                + "&NICK=invitado"
                + "&OBJTIT=" + votEncode(desEntities(OBJTIT));

  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
  document.write('  codebase="http://active.macromedia.com/flash6/cabs/swflash.cab#version=6,0,0,0"');
  document.write('  width="'+W+'"');
  document.write('  height="'+H+'">');
  document.write('  <param name="movie" value="' + movieUrl + '">');
  document.write('  <param name="play" value="true">');
  document.write('  <param name="loop" value="true">');
  document.write('  <param name="quality" value="high">');
  document.write('  <param name="wmode" value="OPAQUE">');
  document.write('  <param name="flashvars" value="' + flashvars + '" />');
  document.write('  <embed');
  document.write('      type="application/x-shockwave-flash"');
  document.write('      pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"');
  document.write('      src="' + movieUrl + '"');
  document.write('      width="'+W+'"');
  document.write('      height="'+H+'"');
  document.write('      play="true"');
  document.write('      loop="true"');
  document.write('      quality="high"');
  document.write('      wmode="OPAQUE"');
  document.write('      flashvars="' + flashvars + '" />');
  document.write('  </embed>');
  document.write('  </object>');
}; // votShow

function votRePath(txt) {
  txt = txt.replace(/;/g, '/');
  return txt;
}; // votRePath

function votDespulga(txt) {
  txt = txt.toLowerCase();
  txt = txt.replace(/^\s+/g, '');
  txt = txt.replace(/\s+$/g, '');
  txt = txt.replace(/á/g, 'a');
  txt = txt.replace(/é/g, 'e');
  txt = txt.replace(/í/g, 'i');
  txt = txt.replace(/ó/g, 'o');
  txt = txt.replace(/ú/g, 'u');
  txt = txt.replace(/ñ/g, 'n');
  txt = txt.replace(/ü/g, 'u');
  txt = txt.replace(/ /g, '_');
  txt = txt.replace(/[^0-9a-z\/\_\-]/g, '');
  return txt;
}; // votDespulga

function votEncode(txt) {
  txt = txt.replace(/&/g, '|amp;');
  txt = txt.replace(/á/g, '|aacute;');
  txt = txt.replace(/é/g, '|eacute;');
  txt = txt.replace(/í/g, '|iacute;');
  txt = txt.replace(/ó/g, '|oacute;');
  txt = txt.replace(/ú/g, '|uacute;');
  txt = txt.replace(/ñ/g, '|ntilde;');
  txt = txt.replace(/ü/g, '|uuml;');
  txt = txt.replace(/Á/g, '|aacute;');
  txt = txt.replace(/É/g, '|eacute;');
  txt = txt.replace(/Í/g, '|iacute;');
  txt = txt.replace(/Ó/g, '|oacute;');
  txt = txt.replace(/Ú/g, '|uacute;');
  txt = txt.replace(/Ñ/g, '|ntilde;');
  txt = txt.replace(/Ü/g, '|uuml;');
  txt = txt.replace(/\"/g, '|quot;');
  txt = txt.replace(/\'/g, '|quot;');
  txt = txt.replace(/¡/g, '|iexcl;');
  txt = txt.replace(/ /g, '|nbsp;');
  txt = txt.replace(/[^0-9a-zA-Z\/\_\-\|\;]/g, '');
  return txt;
}; // votEncode

function desEntities(txt) {
  txt = txt.replace(/&aacute;/g, 'á');
  txt = txt.replace(/&eacute;/g, 'é');
  txt = txt.replace(/&iacute;/g, 'í');
  txt = txt.replace(/&oacute;/g, 'ó');
  txt = txt.replace(/&uacute;/g, 'ú');
  txt = txt.replace(/&ntilde;/g, 'ñ');
  txt = txt.replace(/&uuml;/g, 'ü');
  txt = txt.replace(/&Aacute;/g, 'Á');
  txt = txt.replace(/&Eacute;/g, 'É');
  txt = txt.replace(/&Iacute;/g, 'Í');
  txt = txt.replace(/&Oacute;/g, 'Ó');
  txt = txt.replace(/&Uacute;/g, 'Ú');
  txt = txt.replace(/&Ntilde;/g, 'Ñ');
  txt = txt.replace(/&Uuml;/g, 'Ü');
  txt = txt.replace(/&quot;/g, '"');
  txt = txt.replace(/&iexcl;/g, '¡');
  txt = txt.replace(/&nbsp;/g, ' ');
  txt = txt.replace(/&amp;/g, '&');
  txt = txt.replace(/&\w+;/g, '');
  return txt;
}; // desEntities

