/****************************************************************************************************************/
/****************************************************************************************************************/
/****************************************************************************************************************/
// Funciones usadas genericas que se usan en el site de Teleticket
// Autor: Erick Castro Villazana
// Fecha: Marzo 2009
/****************************************************************************************************************/
/****************************************************************************************************************/
/****************************************************************************************************************/
/*function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}*/



function clicDetalleDia(valor,valor1)
{   CountdownTimer();
    getObj('ctl00_hdfParametro').value="E-"+valor+"-"+valor1;
    __doPostBack('ctl00$lkbCategorias','');
}

function clicDetalle(valor)
{   CountdownTimer();    
    getObj('ctl00_hdfParametro').value="D-"+valor;
    __doPostBack('ctl00$lkbCategorias','');
}
// Abre popup de Verisign
function SelloVerisign() {
    var width = 515;
    var height= 500;
	var url   = "https://seal.verisign.com/splash?form_file=fdf/splash.fdf&dn=WWW.TELETICKET.COM.PE&lang=es";
	var name  = "SelloVerisign";
	popup(url, name, width, height);
}
// Funcion generica para abrir un popup centrado en la pantalla.
function popup(url, name, width, height) {
	// Saca medidas de Pantalla para centrar
	var left  = parseInt((screen.availWidth/2) - (width/2));
	var top   = parseInt((screen.availHeight/2) - (height/2));
	var popup = window.open(url, name, "width="+width+",height="+height+",left="+left+",top="+top+",toolbar=0,statusbar=0,menubar=0");
	popup.focus();
}
//realiza una pre carga de las imagenes
function MM_preloadimagenes() { //v3.0
  var d=document; if(d.imagenes){ if(!d.MM_p) d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadimagenes.arguments; for(i=0; i<a.length; i++)
  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}  
  MM_CheckFlashVersion('7,0,0,0','El contenido de la p&aacute;gina requiere una nueva versi&oacute;n del reproductor Macromedia Flash.  Desea descargarlo ahora?');    
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//oculta el primer div y muestra el segundo div
function cargar()
    {
        getObj("primero").style.display='none';
        getObj("segundo").style.display='';        
    }
//chequea la version del flash del cliente
function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}
//funcion que verifica el enter en el onkeypress del carrito temporal
function onEnter( evt, frm ) 
{
    var keyCode = null;
    if( evt.which ) {
    keyCode = evt.which;
    } else if( evt.keyCode ) {
    keyCode = evt.keyCode;
    }
    if( 13 == keyCode ) {
    mUpdatePanel();
    getObj(frm).click();
    return false;
    }
    return true;
}
//funcion creada que se activa cada cierto tiempo y llama al server para conservar la sesion
function MantenSesion() 
{                
    var CONTROLADOR = "ConservarSesion.ashx";
    var head = document.getElementsByTagName('head').item(0);            
    script = document.createElement('script');            
    script.src = CONTROLADOR ;
    script.setAttribute('type', 'text/javascript');
    script.defer = true;
    head.appendChild(script);
} 
// Es Numerico
function IsNumeric(sText)
{  if (sText=="") return false;
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;
   var dotCnt = 0;
   for (i = 0; i < sText.length && IsNumber == true; i++) 
   { 
      Char = sText.charAt(i); 
      if (Char==".") dotCnt = dotCnt +1;
      if (ValidChars.indexOf(Char) == -1 || dotCnt>1) 
      {
         IsNumber = false;
      }
   }
   return IsNumber;   
}
//lee la posicion de un control a traves del ID
function getElementPosition(elemID) 
{
	var offsetTrail = getObj(elemID);
	var offsetLeft = 0;
	var offsetTop = 0;
	while (offsetTrail) 
	{
	    offsetLeft += offsetTrail.offsetLeft;
	    offsetTop += offsetTrail.offsetTop;
	    offsetTrail = offsetTrail.offsetParent;
	}
	if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined" && navigator.appName=="Microsoft Internet Explorer" ) 
	{
		offsetLeft += parseInt(document.body.leftMargin);
		offsetTop += parseInt(document.body.topMargin);
	}	
	return{left:offsetLeft, top:offsetTop};
}
//lee y devuelve el control html a traves de su nombre o ID
function getObj(strName)
{
  if (document.getElementById)
  {
    return document.getElementById(strName);
  }
  else if (document.all)
  {
    return document.all[strName];
  }
  else if (document.layers)
  {
    return document.layers[strName];
  } 
  else 
  {
    return null;
  }
}
/////funcion que permite el ingreso de solo letras
function validar(e) 
{ // 1
    tecla = (document.all) ? e.keyCode : e.which; // 2
    if (tecla==8) return true; // 3
    patron =/[A-Za-z\s]/; // 4
    te = String.fromCharCode(tecla); // 5
    return patron.test(te); // 6
 }    
 ///// Funcion que reemplaza una cadena de texto en otra
 function str_replace(busca, repla, orig)
    {
	    str 	= new String(orig);
	    rExp	= "/"+busca+"/g";
	    rExp	= eval(rExp);
	    newS	= String(repla);
	    str = new String(str.replace(rExp, newS));
	    return str;
    }
  ///funcion que valida el ingreso de Solo Numeros
	var nav4 = window.Event ? true : false;
    function acceptNum(evt)
    {	    
        // NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57	
        var key = nav4 ? evt.which : evt.keyCode;	
        return (key <= 13 || (key >= 48 && key <= 57));
    }
/////////////////////// FUNCIONES PARA LA CARGA DE VIDEOS, MAPAS, DISTRIBUCION
//funcion que muestra el mapa del como llegar al evento
function Muestra(obj,nombre,direccion,imagen) 
{
  var divResults = document.getElementById(obj); 
  var strOptionString = "";
  strOptionString="<table width=\"288\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
  "<tr> \n"+
  "  <td colspan=\"3\"><img src=\"../tlk_imagenes/v_mapa_ima01.png\" width=\"573\" height=\"8\" /></td> \n"+
  "</tr> \n"+
  "<tr> \n"+
  "  <td width=\"21\"><img src=\"../tlk_imagenes/v_video_ima02.png\" width=\"21\" height=\"15\" /></td> \n"+
  "  <td width=\"240\" rowspan=\"2\"><table width=\"525\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
  "    <tr> \n"+
  "      <td><img src=\"../tlk_imagenes/tlk_mapas/"+imagen+"\" width=\"525\" height=\"400\" /></td> \n"+
  "    </tr> \n"+
  "    <tr> \n"+
  "      <td background=\"../tlk_imagenes/v_mapa_ima04.png\"><table width=\"525\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
  "        <tr> \n"+
  "          <td width=\"10\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"10\" height=\"33\" /></td> \n"+
  "          <td width=\"375\"><div align=\"left\"><strong class=\"TF_text_ventana\">"+nombre+"</strong><br /> \n"+
  "              <span class=\"TF_text_ventana2\">"+direccion+"</span></div></td> \n"+
  "          <td width=\"130\"><div align=\"right\"></div></td> \n"+
  "          <td width=\"10\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"10\" height=\"33\" /></td> \n"+
  "        </tr> \n"+
  "      </table></td> \n"+
  "    </tr> \n"+
  "  </table></td> \n"+
  "  <td width=\"27\"><table width=\"27\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
  "    <tr> \n"+
  "      <td><a href=\"javascript:Oculta('"+obj+"');\"><img src=\"../tlk_imagenes/v_video_ima03.png\" width=\"16\" height=\"15\" border=\"0\" /></a></td> \n"+
  "      <td><img src=\"../tlk_imagenes/v_video_ima04.png\" width=\"11\" height=\"15\" /></td> \n"+
  "    </tr> \n"+
  "  </table></td> \n"+
  "</tr>   \n"+
  "<tr> \n"+
  "  <td><img src=\"../tlk_imagenes/v_mapa_ima02.png\" width=\"21\" height=\"418\" /></td> \n"+
  "  <td><img src=\"../tlk_imagenes/v_mapa_ima03.png\" width=\"27\" height=\"418\" /></td> \n"+
  "</tr> \n"+
  "<tr> \n"+
  "  <td colspan=\"3\"><img src=\"../tlk_imagenes/v_mapa_ima05.png\" width=\"573\" height=\"14\"/></td> \n"+
  "</tr> \n"+
  "</table>";
  divResults.innerHTML=strOptionString;
  divResults.style.display='';
}
//funcion que muestra el plano de distribucion del evento
function MuestraDistribucion(obj,nombre,direccion,imagen) 
{
  var divResults = document.getElementById(obj); 
  var strOptionString = "";
  strOptionString="<table width=\"288\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
  "<tr> \n"+
  "  <td colspan=\"3\"><img src=\"../tlk_imagenes/v_mapa_ima01.png\" width=\"573\" height=\"8\" /></td> \n"+
  "</tr> \n"+
  "<tr> \n"+
  "  <td width=\"21\"><img src=\"../tlk_imagenes/v_video_ima02.png\" width=\"21\" height=\"15\" /></td> \n"+
  "  <td width=\"240\" rowspan=\"2\"><table width=\"525\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
  "    <tr> \n"+
  "      <td><img src=\"../tlk_imagenes/tlk_distribucion/"+imagen+"\" width=\"525\" height=\"400\" /></td> \n"+
  "    </tr> \n"+
  "    <tr> \n"+
  "      <td background=\"../tlk_imagenes/v_mapa_ima04.png\"><table width=\"525\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
  "        <tr> \n"+
  "          <td width=\"10\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"10\" height=\"33\" /></td> \n"+
  "          <td width=\"375\"><div align=\"left\"><strong class=\"TF_text_ventana\">"+nombre+"</strong><br /> \n"+
  "              <span class=\"TF_text_ventana2\">"+direccion+"</span></div></td> \n"+
  "          <td width=\"130\"><div align=\"right\"></div></td> \n"+
  "          <td width=\"10\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"10\" height=\"33\" /></td> \n"+
  "        </tr> \n"+
  "      </table></td> \n"+
  "    </tr> \n"+
  "  </table></td> \n"+
  "  <td width=\"27\"><table width=\"27\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
  "    <tr> \n"+
  "      <td><a href=\"javascript:Oculta('"+obj+"');\"><img src=\"../tlk_imagenes/v_video_ima03.png\" width=\"16\" height=\"15\" border=\"0\" /></a></td> \n"+
  "      <td><img src=\"../tlk_imagenes/v_video_ima04.png\" width=\"11\" height=\"15\" /></td> \n"+
  "    </tr> \n"+
  "  </table></td> \n"+
  "</tr>   \n"+
  "<tr> \n"+
  "  <td><img src=\"../tlk_imagenes/v_mapa_ima02.png\" width=\"21\" height=\"418\" /></td> \n"+
  "  <td><img src=\"../tlk_imagenes/v_mapa_ima03.png\" width=\"27\" height=\"418\" /></td> \n"+
  "</tr> \n"+
  "<tr> \n"+
  "  <td colspan=\"3\"><img src=\"../tlk_imagenes/v_mapa_ima05.png\" width=\"573\" height=\"14\" /></td> \n"+
  "</tr> \n"+
  "</table>";
  divResults.innerHTML=strOptionString;
  divResults.style.display='';
}
//funcion que muestra el video del evento
function MuestraVideo(obj,archivo) 
{
  var divResults = document.getElementById(obj); 
  var strOptionString = "";
  strOptionString="<table width=\"288\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
  "<tr> \n"+
  "  <td colspan=\"3\"><img src=\"../tlk_imagenes/v_video_ima01.png\" width=\"288\" height=\"8\" /></td> \n"+
  "</tr> \n"+
  "<tr> \n"+
  "  <td width=\"21\"><img src=\"../tlk_imagenes/v_video_ima02.png\" width=\"21\" height=\"15\" /></td> \n"+
  "  <td width=\"240\" rowspan=\"2\"> "+
  " <object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"240\" height=\"180\" id=\"FLVPlayer\"> "+ 
  "              <param name=\"movie\" value=\"FLVPlayer_Progressive.swf\" /> "+
  "              <param name=\"salign\" value=\"lt\" /> "+
  "              <param name=\"quality\" value=\"high\" /> "+
  "              <param name=\"scale\" value=\"noscale\" /> "+
  "              <param name=\"FlashVars\" value=\"&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=../tlk_videos/"+archivo+"&autoPlay=true&autoRewind=false\" /> "+
  "              <embed src=\"FLVPlayer_Progressive.swf\" flashvars=\"&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=../tlk_videos/"+archivo+"&autoPlay=true&autoRewind=false\" quality=\"high\" scale=\"noscale\" width=\"240\" height=\"180\" name=\"FLVPlayer\" salign=\"LT\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />         "+
  "          </object> "+ 
  " </td> \n"+
  "  <td width=\"27\"><table width=\"27\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
  "    <tr> \n"+
  "      <td><a href=\"#\" onclick=\"javascript:Oculta('Video');\"><img src=\"../tlk_imagenes/v_video_ima03.png\" width=\"16\" height=\"15\" border=\"0\" /></a></td> \n"+
  "      <td><img src=\"../tlk_imagenes/v_video_ima04.png\" width=\"11\" height=\"15\" /></td> \n"+
  "    </tr> \n"+
  "  </table></td> \n"+
  "</tr> \n"+
  "<tr> \n"+
  "  <td><img src=\"../tlk_imagenes/v_video_ima05.png\" width=\"21\" height=\"165\" /></td> \n"+
  "  <td><img src=\"../tlk_imagenes/v_video_ima06.png\" width=\"27\" height=\"165\" /></td> \n"+
  "</tr> \n"+
  "<tr> \n"+
  "  <td colspan=\"3\"><img src=\"../tlk_imagenes/v_video_ima07.png\" width=\"288\" height=\"14\" /></td>   \n"+
  "</tr> \n"+
  "</table> \n";
  divResults.innerHTML=strOptionString;
  divResults.style.display='';
}
//funcion que oculta los paneles del como llegar, ver video y distribucion
function Oculta(obj)
{   var divR=getObj(obj);
    if(divR!=null)
    {
        divR.style.display='none';
    }
}
/////////////// PUNTOS DE VENTA
//funcion que muestra el Punto de Venta
function MuestraPunto(obj,nombre,direccion,imagen)
{
var divResults = getObj(obj); 
var strOptionString=  " <table width=\"527\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> "+
                "  <tr> "+
                "    <td bgcolor=\"#CC0000\"><table width=\"525\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\"> "+
                "      <tr> "+
                "        <td height=\"23\" bgcolor=\"#FFFFFF\"><table width=\"525\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> "+
                "          <tr> "+
                "            <td width=\"424\"><strong class=\"Texto_fecha2\">&nbsp;&nbsp;&nbsp; Módulo  Teleticket - "+nombre+" </strong></td> "+
                "            <td width=\"101\" align=\"right\"> "+                
                "               <table width=\"101\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"Texto_vinculo_3\"> "+
                "              <tr> "+
                "                <td width=\"24\"><img src=\"../tlk_imagenes/p14_print.gif\" width=\"24\" height=\"14\" /></td> "+
                "                <td width=\"67\"><div align=\"left\"><a href=\"javascript:window.print();\">Imprimir</a></div></td> "+
                "                <td><a href=\"javascript:OcultaPunto('"+obj+"')\"><img src=\"../tlk_imagenes/lm_ima_cerrar_off.gif\" width=\"14\" height=\"14\" border=\"0\" id=\"Image111\" onmouseover=\"MM_swapImage('Image111','','../tlk_imagenes/lm_ima_cerrar_on.gif',1)\" onmouseout=\"MM_swapImgRestore()\" /></a>&nbsp;</td> "+
                "              </tr> "+
                "            </table> "+
                "           </td> "+
                "          </tr> "+
                "        </table></td> "+
                "      </tr> "+
                "      <tr> "+
                "        <td><img src=\"../tlk_imagenes/tlk_puntosventa/"+imagen+"\" width=\"525\" height=\"400\" /></td> "+
                "      </tr> "+
                "      <tr> "+
                "        <td height=\"21\" bgcolor=\"#FFFFFF\"><div align=\"left\" class=\"Texto_body\">&nbsp;&nbsp;&nbsp;"+direccion+" </div></td> "+
                "      </tr> "+
                "    </table></td> "+
                "  </tr> "+
                "</table> ";
  divResults.innerHTML=strOptionString;
  divResults.style.display='';
}
//funcion que oculta el div del punto de venta
function OcultaPunto(obj)
{
  getObj(obj).style.display='none';
}
//funcion que imprime el punto de venta
function imprimir(que) {
var ventana = window.open("", "", "");
var contenido = "<html><body onload='window.print();window.close();'>" + getObj(que).innerHTML + "</body></html>";
ventana.document.open();
ventana.document.write(contenido);
ventana.document.close();
}
/////////////CALENDARIO DE EVENTOS
//funcion que muestra el calendario de eventos de un dia seleccionado
function sacaDiv(cadena,cadena1,cadena2,Lobj,direccion,boton,dia)
{
    var divEventResult = getObj(Lobj);  
    var btnBotonInfo = getObj(boton);   
    var strOptionDivString="";    
    division=cadena.split('*');  
    //alert('*('+0+') : '+division[0]+'\n('+1+') : '+division[1]+'\n');
    /*for(var h=0;h<division.length;h++)
    {
        alert('('+h+') : '+division[h]+'\n');
    }*/
    strOptionDivString=" <table width=\"177\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
"  <tr> \n"+
"    <td><img src=\"../tlk_imagenes/lm_ima12.png\" width=\"170\" height=\"11\" /></td> \n"+
"    <td><img src=\"../tlk_imagenes/lm_ima13.png\" width=\"7\" height=\"11\" /></td> \n"+
"  </tr> \n"+
"  <tr> \n"+
"    <td background=\"../tlk_imagenes/lm_ima02.png\"> \n"+
"      <table width=\"170\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"Texto_vinculo_lm\"> \n"+
"      <tr> \n"+
"        <td colspan=\"4\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"170\" height=\"4\" /></td> \n"+
"      </tr> \n"+
" <tr> "+
"        <td><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"10\" /></td> "+
"        <td colspan=\"2\" class=\"Texto_fecha2\"> "+
"        <table width=\"149\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> "+
"          <tr> "+
"            <td width=\"129\" align=\"left\">&nbsp; "+dia+"</td> "+
"            <td width=\"20\" align=\"left\"><a href=\"javascript:Oculta('"+Lobj+"')\"><img src=\"../tlk_imagenes/lm_ima_cerrar_off.gif\" width=\"14\" height=\"14\" border=\"0\" id=\"Image111\" onmouseover=\"MM_swapImage('Image111','','../tlk_imagenes/lm_ima_cerrar_on.gif',1)\" onmouseout=\"MM_swapImgRestore()\" /></a></td> "+
"          </tr> "+
"        </table></td> "+
"        <td><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"10\" /></td> "+
"      </tr> "+
"      <tr> \n"+
"       <td><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"11\" /></td> \n"+
"        <td colspan=\"2\" valign=\"top\" background=\"../tlk_imagenes/lms_ima01.gif\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"11\" /></td> \n"+
"        <td><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"11\" /></td> \n"+
"      </tr> \n";
if(division!=null)
{  //division  "0" : d_even_cor separado por '|'
   //division  "1" : local+']'+hora+'Ç'+c_func
    nombreCorto=division[0].split('|');  //d_even_cor
    
if(nombreCorto.length >= 1 && nombreCorto[0] != "" && division.length>=1)
{
    division2=division[1].split(']');  //local+']'+hora+'Ç'+c_func    
    lugar=division2[0].split('^');  //local
    division3=division2[1].split('[');  //hora+'Ç'+c_func  
    //alert('*('+0+') : '+division[0]+'\n('+1+') : '+division[1]+'\n\n'+
          //']('+0+') : '+division2[0]+'\n('+1+') : '+division2[1]+'\n\n'+
          //'[('+0+') : '+division3[0]+'\n('+1+') : '+division3[1]+'\n\n');
    //division4=division3[0].split('.');  //local
    //alert('Ç('+0+') : '+division4[0]+'\n('+1+') : '+division4[1]+'\n');
    hora=division3[0].split('º');    
    cfunc=division3[1].split('.');    
    cadena2=cadena2.replace(/[:]/g,"(").replace(/[;]/g,")");
    cadena_replace=cadena2.replace(/[*]/g,"'");
    javascripting=cadena_replace.split(']');    
    cevenencript=cadena1.split(']');
        if(hora.length >= 1 && hora[0] != "")
        {   var nombre_evento="";
            for(var i=0;i<nombreCorto.length;i++)
            {   nombre_evento=nombreCorto[i];
                nombre_evento=nombre_evento.replace(/[#]/g,"'");                
                strOptionDivString+="      <tr> \n"+
                "        <td width=\"10\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"17\" /></td> \n"+
                "        <td width=\"19\" valign=\"top\"><img height=\"11\" alt=\"\"  \n"+
                "                  src=\"../tlk_imagenes/p00_ima7.gif\" width=\"19\" /></td> \n"+
                "        <td width=\"130\"><div align=\"left\"><span class=\"Texto_vinculo_3\"> \n"+                
                "	<a href=\"javascript:clicDetalleDia('"+cevenencript[i]+"','"+cfunc[i]+"');\" onclick=\"javascript:"+javascripting[i]+"\" class=\"Texto_vinculo_3\">"+nombre_evento+"</a></span><br /> \n"+
                "   <span class=\"Texto_body\"> "+lugar[i].replace(/[#]/g,"'")+"</span><br /> \n"+
                " </div></td> \n"+
                //"          "+hora[i]+"</span></div></td> \n"+
                "        <td width=\"11\">&nbsp;</td> \n"+
                "      </tr> \n";
                //http://"+direccion+"/tlk_formularios/frm_DetalleEventoPrecio.aspx?ceven
                if(i<nombreCorto.length-1)
                {
                strOptionDivString+="      <tr> \n"+
                "        <td><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"11\" /></td> \n"+
                "        <td colspan=\"2\" valign=\"top\" background=\"../tlk_imagenes/lms_ima01.gif\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"11\" /></td> \n"+
                "        <td><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"11\" /></td> \n"+
                "      </tr> \n";
                }
           }        
       }
}
}
strOptionDivString+="      <tr> \n"+
"        <td colspan=\"4\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"170\" height=\"4\" /></td> \n"+
"      </tr> \n"+
"    </table></td> \n"+
"    <td background=\"../tlk_imagenes/lm_ima05.png\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"7\" height=\"9\" /></td> \n"+
"  </tr> \n"+
"  <tr> \n"+
"    <td><img src=\"../tlk_imagenes/lm_ima03.png\" width=\"170\" height=\"11\" /></td> \n"+
"    <td background=\"../tlk_imagenes/lm_ima06.png\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"7\" height=\"11\" /></td> \n"+
"  </tr> \n"+
"  <tr> \n"+
"    <td colspan=\"2\"><img src=\"../tlk_imagenes/lm_ima07.png\" width=\"177\" height=\"7\" /></td> \n"+
"  </tr> \n"+
" </table> \n";

divEventResult.innerHTML = strOptionDivString; //add result group to Div
divEventResult.style.display='';
}
//funcion que oculta el div del calendario de eventos por dia
function Oculta(obj)
{
  document.getElementById(obj).style.display='none';
}

//////////////////////TERMINOS Y CONDICIONES
//funcion que muestra los terminos y condiciones de pago
function MostrarCondiciones(div1)
{
var strOption="";
var divResult=getObj(div1);
strOption = "    <table width=\"527\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
"     <tr> \n"+
"       <td bgcolor=\"#CC0000\"><table width=\"527\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\"> \n"+
"         <tr> \n"+
"           <td height=\"23\" bgcolor=\"#FFFFFF\"><table width=\"525\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
"             <tr> \n"+
"               <td width=\"424\"><strong class=\"Texto_fecha2\">&nbsp;&nbsp;&nbsp; Teleticket - T&eacute;rminos y condiciones de venta</strong></td> \n"+
"               <td width=\"101\"><table width=\"91\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"Texto_vinculo_3\"> \n"+
"                 <tr> \n"+
//"                   <td width=\"24\"><img src=\"../tlk_imagenes/p14_print.gif\" width=\"24\" height=\"14\" /></td> \n"+
//"                   <td width=\"67\"><div align=\"left\"><a href=\"javascript:window.print()\">Imprimir</a></div></td> \n"+
"               <td width=\"101\" align=\"right\"> "+                
"               <table width=\"101\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"Texto_vinculo_3\"> "+
"              <tr> "+
"                <td width=\"24\"><img src=\"../tlk_imagenes/p14_print.gif\" width=\"24\" height=\"14\" /></td> "+
"                <td width=\"67\"><div align=\"left\"><a href=\"javascript:window.print();\">Imprimir</a></div></td> "+
"                <td><a href=\"javascript:OcultaPunto('"+div1+"')\"><img src=\"../tlk_imagenes/lm_ima_cerrar_off.gif\" width=\"14\" height=\"14\" border=\"0\" id=\"Image111\" onmouseover=\"MM_swapImage('Image111','','../tlk_imagenes/lm_ima_cerrar_on.gif',1)\" onmouseout=\"MM_swapImgRestore()\" /></a>&nbsp;</td> "+
"              </tr> "+
"            </table> "+
"           </td> "+
"                 </tr> \n"+
"               </table></td> \n"+
"             </tr> \n"+
"           </table></td> \n"+
"         </tr> \n"+
"         <tr> \n"+
"           <td bgcolor=\"#fffcf2\"><table width=\"527\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
"             <tr> \n"+
"               <td width=\"30\">&nbsp;</td> \n"+
"               <td width=\"25\">&nbsp;</td> \n"+
"               <td width=\"442\">&nbsp;</td> \n"+
"               <td width=\"30\">&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td><img src=\"../tlk_imagenes/p06_ima07.gif\" width=\"25\" height=\"16\" /></td> \n"+
"               <td><div align=\"left\" class=\"Texto_vinculo_1\" >Para comprar con tarjetas VISA</div></td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"30\" height=\"3\" /></td> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"25\" height=\"3\" /></td> \n"+
"               <td background=\"../tlk_imagenes/p06_ima17.gif\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"3\" /></td> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"30\" height=\"3\" /></td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td colspan=\"4\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"5\" /></td> \n"+
"               </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td> <div align=\"left\"><span class=\"Texto_body\" align=\"left\">Las transacciones realizadas con su tarjeta Visa, utilizan un nuevo servicio de Visa: Verified by Visa, el cual hace que estas transacciones sean autenticadas y seguras. Al confirmar las identidades de los tarjetahabientes, se reducen las transacciones de comercio electr&oacute;nico fraudulentas o en disputa, y es una forma de satisfacer las inquietudes del consumidor con respecto a las compras en l&iacute;nea.</span></div></td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td><img src=\"../tlk_imagenes/p06_ima08.gif\" width=\"25\" height=\"16\" /></td> \n"+
"               <td><div align=\"left\" class=\"Texto_vinculo_1\" >Para comprar con tarjetas MASTERCARD</div></td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"30\" height=\"3\" /></td> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"25\" height=\"3\" /></td> \n"+
"               <td background=\"../tlk_imagenes/p06_ima17.gif\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"3\" /></td> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"30\" height=\"3\" /></td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td colspan=\"4\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"5\" /></td> \n"+
"               </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td><div align=\"left\"> <span class=\"Texto_body\">Las transacciones realizadas con su tarjeta MasterCard, utilizan un nuevo servicio de MasterCard: SecureCode, que proporciona protecci&oacute;n adicional para compras online el cual hace que estas transacciones sean seguras. Al confirmar las identidades de los tarjetahabientes, se reducen las transacciones de comercio electr&oacute;nico fraudulentas o en disputa, y es una forma de satisfacer las inquietudes del consumidor con respecto a las compras en l&iacute;nea.</span><br></div></td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td><img src=\"../tlk_imagenes/p06_ima09.gif\" width=\"25\" height=\"16\" /></td> \n"+
"               <td><div align=\"left\" class=\"Texto_vinculo_1\" >Para comprar con SAFTPAY</div></td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"30\" height=\"3\" /></td> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"25\" height=\"3\" /></td> \n"+
"               <td background=\"../tlk_imagenes/p06_ima17.gif\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"3\" /></td> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"30\" height=\"3\" /></td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td colspan=\"4\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"5\" /></td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td class=\"Texto_vinculo_2\"><div align=\"left\"> <span class=\"Texto_body\">Las transacciones realizadas con Saftpay, utilizan un nuevo sistema de pago: SaftPay es un sistema seguro para pagos electr&oacute;nicos que permite a clientes de bancos realizar compras on-line a nivel mundial pagando directamente a trav&eacute;s de su banco local.<br /> \n"+
"                 <br /> \n"+
"                 El cliente solo necesita tener cualquier tipo de cuenta en los bancos afiliados a SaftPay para utilizar este sistema de pago.<br /> \n"+
"                 <strong><br /> \n"+
"                 Como Funciona SaftPay?</strong></span><br></div></td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td><table width=\"442\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n"+
"                 <tr> \n"+
"                   <td width=\"20\" align=\"left\" valign=\"top\"><span class=\"Texto_body\"><strong>1.</strong></span></td> \n"+
"                   <td width=\"422\" align=\"left\"><span class=\"Texto_body\">El cliente hace el pedido en Teleticket. <br />                 \n"+
"                   </span></td> \n"+
"                 </tr> \n"+
"                 <tr> \n"+
"                   <td align=\"left\" valign=\"top\"><span class=\"Texto_body\"><strong>2.</strong></span></td> \n"+
"                   <td align=\"left\"><span class=\"Texto_body\"> Selecciona SaftPay como m&eacute;todo de pago.<br />    \n"+             
"                   </span></td> \n"+
"                 </tr> \n"+
"                 <tr> \n"+
"                   <td align=\"left\" valign=\"top\"><span class=\"Texto_body\"><strong>3.</strong></span></td> \n"+
"                   <td align=\"left\"><span class=\"Texto_body\">SaftPay le emite un n&uacute;mero de transacci&oacute;n, el equivalente al monto de compra en la moneda elegida y un tiempo de validez para la transacci&oacute;n (02 horas). La informaci&oacute;n aparece en la pantalla y se env&iacute;a por e-mail al usuario. <br />                 \n"+
"                   </span></td> \n"+
"                 </tr> \n"+
"                 <tr> \n"+
"                   <td align=\"left\" valign=\"top\"><span class=\"Texto_body\"><strong>4.</strong></span></td> \n"+
"                   <td align=\"left\"><span class=\"Texto_body\">El cliente ingresa al portal bancario en la opci&oacute;n pago de servicios y realiza el pago.<br />                 \n"+
"                   </span></td> \n"+
"                 </tr> \n"+
"                 <tr> \n"+
"                   <td align=\"left\" valign=\"top\"><span class=\"Texto_body\"><strong>5.</strong></span></td> \n"+
"                   <td align=\"left\"><span class=\"Texto_body\">Una vez que el banco recibe el pago de la transacci&oacute;n, SaftPay le env&iacute;a una autorizaci&oacute;n a Teleticket.<br />                 \n"+
"                   </span></td> \n"+
"                 </tr> \n"+
"                 <tr> \n"+
"                   <td align=\"left\" valign=\"top\"><span class=\"Texto_body\"><strong>6.</strong></span></td> \n"+
"                   <td align=\"left\"><span class=\"Texto_body\">Teleticket le enviar&aacute; el resultado de compra v&iacute;a correo electr&oacute;nico.</span></td> \n"+
"                 </tr> \n"+
"               </table></td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td><img src=\"../tlk_imagenes/p06_ima10.gif\" width=\"25\" height=\"16\" /></td> \n"+
"               <td><div align=\"left\" class=\"Texto_vinculo_1\" >  Una vez realizada la compra</div></td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"30\" height=\"3\" /></td> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"25\" height=\"3\" /></td> \n"+
"               <td background=\"../tlk_imagenes/p06_ima17.gif\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"3\" /></td> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"30\" height=\"3\" /></td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td colspan=\"4\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"5\" /></td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td class=\"Texto_body\"><div align=\"left\">Realizada la compra, usted deber&aacute; imprimir los datos del resultado de compra. Con este documento s&iacute;rvase acercar a cualquiera de los m&oacute;dulos de Teleticket para realizar el canje respectivo conjuntamente con una copia de su documento de identidad. Si compr&oacute; con tarjeta Visa, MasterCard o SAFTPAY y por alg&uacute;n motivo no pudo realizar dicha impresi&oacute;n el sistema le enviar&aacute; a su correo electr&oacute;nico una copia de este documento a la cuenta de correo ingresada por usted. <strong>Recuerde que luego de realizada la compra, NO PODRA REALIZAR NINGUNA DEVOLUCION DE LA MISMA</strong>.</div></td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td><img src=\"../tlk_imagenes/p06_ima11.gif\" width=\"25\" height=\"16\" /></td> \n"+
"               <td><div align=\"left\" class=\"Texto_vinculo_1\" >Sobre su cuenta de correo electr&oacute;nico</div></td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"30\" height=\"3\" /></td> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"25\" height=\"3\" /></td> \n"+
"               <td background=\"../tlk_imagenes/p06_ima17.gif\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"3\" /></td> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"30\" height=\"3\" /></td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td colspan=\"4\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"5\" /></td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td class=\"Texto_body\"><div align=\"left\">Para que usted señor Cliente pueda realizar cualquier compra desde nuestra p&aacute;gina, deber&aacute; de proporcionarnos una cuenta de correo valida ya que nuestro sistema proceder&aacute; a realizar la verificaci&oacute;n de la misma. Ante una negativa en esta respuesta su registro quedar&aacute; autom&aacute;ticamente rechazado.</div></td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td><img src=\"../tlk_imagenes/p06_ima12.gif\" width=\"25\" height=\"16\" /></td> \n"+
"               <td><div align=\"left\" class=\"Texto_vinculo_1\" >Mayor informaci&oacute;n sobre nuestras condiciones de compra</div></td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"30\" height=\"3\" /></td> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"25\" height=\"3\" /></td> \n"+
"               <td background=\"../tlk_imagenes/p06_ima17.gif\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"3\" /></td> \n"+
"               <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"30\" height=\"3\" /></td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td colspan=\"4\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"5\" /></td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td class=\"Texto_body\"><div align=\"left\">Si usted señor Cliente necesita tener mayor informaci&oacute;n sobre nuestras condiciones de compra, s&iacute;rvase por favor CONTACTARNOS que gustosos nos estaremos comunicando con usted.</div></td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"             <tr> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"               <td>&nbsp;</td> \n"+
"             </tr> \n"+
"           </table></td> \n"+
"         </tr> \n"+
"         <tr> \n"+
"           <td height=\"21\" bgcolor=\"#FFFFFF\"><div align=\"left\" class=\"Texto_body\">&nbsp;&nbsp;&nbsp;Central telef&oacute;nica: <strong>613-8888 opci&oacute;n 3</strong></div></td> \n"+
"         </tr> \n"+
"       </table></td> \n"+
"     </tr>  \n"+
"    </table> ";
    if(divResult!=null)
    {
        divResult.innerHTML=strOption;
        divResult.style.display='';
    }
}
/////DETALLE DE UN EVENTO
function Resaltar_On(GridView)
{
    if(GridView != null)
    {
       GridView.originalBgColor = GridView.style.backgroundColor;
       GridView.style.backgroundColor="#CC3300";
    }
}
function Resaltar_Off(GridView)
{
    if(GridView != null)
    {
        GridView.style.backgroundColor = GridView.originalBgColor;
    }
}

////////////////////CARRITO DE COMPRAS
//funcion que valida el ingreso de un maximo de entradas en la caja de texto del carrito de compras
/*
function verificaCantidad(obj,txt1,objH,maximo)
{   
    var txt=obj.value;
    var resultado=true;
    var texto="";
    var max_entradas=maximo;
    var btn=getObj(txt1);
    var objHH=getObj(objH);
    if(obj.value==objHH.value)
    { resultado=false; }
    else
    {
        if(IsNumeric(txt)==true)
        {
            if(parseInt(txt)==0)
            {
                texto="Ingresa Mas de 1 Entrada";
                obj.value=objHH.value;
                resultado=false;
            }else if(parseInt(txt)>max_entradas)
            {
                texto="Maximo de Entradas es "+max_entradas;
                obj.value=objHH.value;
                resultado=false;
            }
        }else
        {
            texto="Ingresa un Número Válido";
            obj.value=objHH.value;
            resultado=false;
        }
    }    
    if(texto!='')
    { alert(texto); }
    return resultado;         
}
*/
function verificaCantidad(obj,txt1,objH,maximo,total)
{
    var txt = obj.value; //4
    var resultado=true;
    var texto="";
    var max_entradas=maximo; //4
    var btn=getObj(txt1);
    var objHH = getObj(objH);
    var cantidadInicial = objHH.value;//2
    var cantidadTotal = total; //3
    var cantidadFalta = max_entradas - cantidadTotal; //1
    /*alert('txt:' + txt + '\nmax_entradas:' + max_entradas + '\ntotal:' + total + '\ncantidadFalta (max_entradas - cantidadTotal):' + cantidadFalta + '\ncantidadInicial:' + cantidadInicial);    
    alert('IsNumeric(txt) : ' + IsNumeric(txt));
    alert('cantidadFalta < (parseInt(txt) - cantidadTotal) : ' + cantidadFalta + ' < (' + parseInt(txt) + ' - ' + cantidadTotal + ' : ' + (cantidadFalta < (parseInt(txt) - cantidadTotal)));*/
    if(obj.value==objHH.value)
    { resultado=false; }
    else
    {
        if(IsNumeric(txt)==true)
        {
            if(parseInt(txt)==0)
            {
                texto="Ingresa Mas de 1 Entrada";
                obj.value=objHH.value;
                resultado=false;
            } else if ((cantidadFalta < (parseInt(txt) - cantidadInicial)))// || (cantidadFalta == 0 && (parseInt(txt) - cantidadTotal) == 0))                        
            //if(parseInt(txt) > max_entradas)
            {
                texto="Maximo de Entradas es "+max_entradas;
                obj.value=objHH.value;
                resultado=false;
            }
        }else
        {
            texto="Ingresa un Número Válido";
            obj.value=objHH.value;
            resultado=false;
        }
    }   
    if(texto!='')
    { alert(texto); }
    return resultado;         
}
//funcion que llama al click de un boton cuando se hace un cambio en la caja de texto y este pierde el foco
function onBlurTextBox(obj,txt1,objH,maximo,total)
{   
    var btn=getObj(txt1);
    if(verificaCantidad(obj,txt1,objH,maximo,total))
    {       mUpdatePanel();
            btn.click();            
            return false;
    }else
    {      return false;
    }
}
//funcion que llama al click de un boton cuando se hace un enter en la caja de texto
function onEnterTexBox(evt,obj,txt1,objH,maximo,total)
{   
    var txt = obj.value;
    var resultado=true;    
    var keyCode = null;
    var btn=getObj(txt1);
    if( evt.which ) {
    keyCode = evt.which;
    } else if( evt.keyCode ) {
    keyCode = evt.keyCode;
    }    
    if( 13 == keyCode ) { 
        if(verificaCantidad(obj,txt1,objH,maximo,total))
        {   mUpdatePanel();
            btn.click();            
            return false;
        }else
        {
            return false;
        }
    }   
    return true;     
}
//funcion que permite seleccionar un maximo de entradas en una venta normal
function validaCondicion(txt)
{   var opb=txt.split('%');    
    var contador=0; var txt1="";
    var resultado=false;
    var texto_j="";    
    //alert(txt);
    for(var a=0;a<opb.length;a++)
    {        
        var combo=getObj(opb[a]);  
        if(combo!=null)      
        {   var indice=combo.selectedIndex;
            if(combo.options[indice].value!='')
            {
                contador=contador+1;
            }
            //txt1=txt1+'\nValor:'+combo.options[indice].value+'\n'+combo.options[indice].text;            
        }
    }        
    if(contador>0)
    {   CountdownTimer();
        resultado=true; 
    }else
    {
        alert('Favor de Seleccionar al Menos una Entrada');
    }
	return resultado;
}

/////////////////ESCRIBANOS
//funcion que corta el texto una vez sobrepasado el maximo de caracteres permitido
function corta(obj,evt)
{   forma=obj.value;
    var keyCode = null;
    if( evt.which ) {
    keyCode = evt.which;
    } else if( evt.keyCode ) {
    keyCode = evt.keyCode;
    }
	with (forma)
	{
		if (forma.length>500)
		{	obj.value=obj.value.substring(0,500);  }
			
			if (keyCode == 13)
			{	evt.returnValue = false;	}
			cuenta(obj);			
			obj.focus();
	    
	}
}
//funcion que cuenta la cantidad de caracteres ingresadas en el textarea
function cuenta(obj)
{   forma=obj.value;
	with(forma)
	{
	    //alert(obj.value.length);
		getObj("txtCaracteres").value= obj.value.length;
	}
}
   
///////////////////////// ALERTA
//funcion que pinta el mensaje de alerta
function Muestra_Alerta(div1,control,t_top,t_left,titulo,texto)
{   var divR=getObj(div1);
    var strOptionString=" <table width=\"250\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">  \n"+
"  <tr>  \n"+
"   <td><img src=\"../tlk_imagenes/lm_ima12.png\" width=\"243\" height=\"11\" /></td>  \n"+
"    <td><img src=\"../tlk_imagenes/lm_ima13.png\" width=\"7\" height=\"11\" /></td>  \n"+
"  </tr>  \n"+
"  <tr>  \n"+
"    <td background=\"../tlk_imagenes/lm_ima02.png\">  \n"+
"      <table width=\"243\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"Texto_vinculo_lm\">  \n"+
"      <tr>  \n"+
"        <td colspan=\"4\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"243\" height=\"4\" /></td>  \n"+
"      </tr>  \n"+
"      <tr>  \n"+
"        <td><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"10\" /></td>  \n"+
"        <td colspan=\"2\" class=\"Texto_fecha2\">  \n"+
"        <table width=\"222\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">  \n"+
"          <tr>  \n"+
"            <td width=\"202\" align=\"center\">"+titulo+"</td>  \n"+
"            <td width=\"20\" align=\"left\"><a href=\"javascript:Oculta('"+div1+"');\"><img src=\"../tlk_imagenes/lm_ima_cerrar_off.gif\" width=\"14\" height=\"14\" border=\"0\" id=\"Image111\" onmouseover=\"MM_swapImage('Image111','','../tlk_imagenes/lm_ima_cerrar_on.gif',1)\" onmouseout=\"MM_swapImgRestore()\" /></a></td>  \n"+
"          </tr>  \n"+
"        </table></td> \n"+
"       <td><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"10\" /></td>  \n"+
"      </tr>          \n"+
"      <tr>  \n"+
"       <td><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"11\" /></td>  \n"+
"        <td colspan=\"2\" valign=\"top\" background=\"../tlk_imagenes/lms_ima01.gif\"> \n"+
"        <img src=\"../tlk_imagenes/ima_trans.gif\" width=\"222\" height=\"11\" /></td>  \n"+
"        <td><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"11\" /></td>  \n"+
"      </tr>  \n"+
"      <tr>  \n"+
"      <td width=\"10\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"17\" /></td>          \n"+
"       <td width=\"10\"><img src=\"../tlk_imagenes/p00_ima7.gif\" width=\"19\" height=\"11\" /></td>          \n"+
"       <td width=\"212\"><div align=\"left\"><span class=\"Texto_vinculo_3\" align=\"justify\">"+texto+" \n"+
"        </span></div></td>  \n"+
"        <td width=\"11\">&nbsp;</td>  \n"+
"     </tr> \n"+
"      <tr>  \n"+
"     <td><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"11\" /></td>  \n"+
"     <td colspan=\"2\" valign=\"top\" background=\"../tlk_imagenes/lms_ima01.gif\"> \n"+
"     <img src=\"../tlk_imagenes/ima_trans.gif\" width=\"212\" height=\"11\" /></td>  \n"+
"      <td><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"8\" height=\"11\" /></td>  \n"+
"    </tr>  \n"+
"    <tr>  \n"+
"        <td colspan=\"4\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"243\" height=\"4\" /></td>  \n"+
"    </tr>  \n"+
"    </table></td>  \n"+
"    <td background=\"../tlk_imagenes/lm_ima02.png\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"7\" height=\"9\" /></td>  \n"+
"  </tr>  \n"+
"  \n"+
"  <tr> \n"+ 
"    <td><img src=\"../tlk_imagenes/lm_ima03.png\" width=\"243\" height=\"11\" /></td>  \n"+
"    <td ><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"7\" height=\"11\" /></td>  \n"+
"  </tr>  \n"+
"  <tr>  \n"+
"    <td colspan=\"2\"><img src=\"../tlk_imagenes/lm_ima07.png\" width=\"250\" height=\"7\" /></td>  \n"+
"  </tr>  \n"+
" </table> ";

    if(divR!=null)
    {
      divR.innerHTML=strOptionString;        
      divR.style.top=(getElementPosition(control).top-t_top)+'px';
      divR.style.left=(getElementPosition(control).left+t_left)+'px';
      divR.style.display='';
    }
}

///////////SCRIPTS PARA EL DETALLE DEL EVENTO

    
    function mpeSeleccionOnOk(btnAceptarAsientos)
    {        
      //var algo=getObj('ctl00_ContentPlaceHolder1_btnAceptarAsientos');      
      var algo=getObj(btnAceptarAsientos);      
      algo.click();      
    }    
    function mpeSeleccionOnCancel(hdfContador,hdfEventos, mpeSeleccion,hdfIdCheckBox)
    {
        ocultaDiv(hdfContador,hdfEventos, mpeSeleccion,hdfIdCheckBox);
    }    
    function OcultarSiempreVisible()
    {
      var divR=getObj('ctl00_ContentPlaceHolder1_panelLeyenda');
      if(divR!=null)
      {
        divR.style.display='none';
      }
    }
    
    function MuestraSinNumeracion(div1,control)
    {
        var divR=getObj(div1);
        if(divR!=null)
        {
             divR.style.top=(getElementPosition(control).top-20)+'px';
             divR.style.left=(getElementPosition(control).left+20)+'px';
             divR.style.display='';
        }        
        
    }  
    
    function Ocultar1()
    {
        var divR=getObj('ctl00_ContentPlaceHolder1_panelTarifasMapaSN');
        if(divR!=null) 
        {
            divR.style.display='none';
        }
    }                         
    function ValidaCheckBox(obj,maximo,ent,contador,boletos,boton,ubicaciondel,abc,btnBorrarAsientos,hdfIdCheckBox,listaTarifa)
    {   var cuenta=0;        
        var hdfContador=getObj(contador);
        var hdfBoletos=getObj(boletos);
        var tarifas=getObj(listaTarifa);
        //var bot=getObj(boton);
        var txt=""; var accion=false;
        var accion_aceptar=false; var accion_borrar=false;
        var entrada=hdfBoletos.value;        
        cuenta=hdfContador.value;
        //alert(tarifas.selectedIndex);        
        var ubicacionDel=getObj(ubicaciondel);        
        if(tarifas.selectedIndex > -1)
        {
            if(obj.checked)
            {
                if(IsNumeric(hdfContador.value))
                {              
                    cuenta=parseInt(cuenta)+1;
                    if(cuenta>maximo)
                    {
                       txt="Has Seleccionado Mas de lo permitido";
                       obj.checked=false;
                       cuenta=parseInt(cuenta) - 1;
                       accion_aceptar=false; //determina accion del click
                       accion_borrar=false; //determina si se muestra
                       alert(txt);
                    }else
                    {   entrada=ent;                    
                        accion_aceptar=true; 
                        accion_borrar=false;                
                    }
                    ubicacionDel.value="";
                }else   {   }            
            }else
            {
                if(IsNumeric(hdfContador.value))
                {              
                    cuenta=parseInt(cuenta)-1;                   
                    entrada=str_replace(ent,"",entrada);                
                    ubicacionDel.value=ent;
                    accion_borrar=true;
                    accion_aceptar=false;
                }
            }
        }else
        {
            alert('Seleccione una Tarifa de la Lista');
        }
        hdfBoletos.value=entrada;
        getObj(hdfIdCheckBox).value=obj.id;
        //getObj('ctl00_ContentPlaceHolder1_txtVer').value=obj.id;
        hdfContador.value=cuenta;         
        if(accion_aceptar && !accion_borrar)
        {   accion=true;
            var aceptar=getObj(boton);
            aceptar.click();
        }else if(!accion_aceptar && accion_borrar)        
        {   accion=true;
            var borrar=getObj(btnBorrarAsientos);
            borrar.click();      
        }else
        {
            accion=false;
        }                  
        return accion;
    }
 
 function ocultaDiv(hdfContador,hdfEventos,mpeSeleccion,hdfIdCheckBox)
 {              
        var hdfContador=getObj(hdfContador);        
        var hdfIdCheckBoxS=getObj(hdfIdCheckBox);        
        cuenta=hdfContador.value;
        cuenta=parseInt(cuenta)-1;
        hdfContador.value=cuenta;                
        var hdfBoletos=getObj(hdfEventos);
        entrada=hdfBoletos.value;            
        $find(mpeSeleccion).hide();
        var indice=entrada.lastIndexOf(',');
        var new_nuevotexto=entrada.substring(0,indice);
        hdfBoletos.value=new_nuevotexto;        
        var bol=entrada.substring(indice+1,entrada.length);        
        var arreglo=bol.split('-');
        fila=""; columna="";
        if(parseInt(arreglo[0])-1 < 10){ fila="0"+(parseInt(arreglo[0])-1);    } else {fila=(parseInt(arreglo[0])-1);}
        if(parseInt(arreglo[1])-1 < 10){ columna="0"+(parseInt(arreglo[1])-1); } else {columna=(parseInt(arreglo[1])-1);}                
        var txt=getObj(hdfIdCheckBox).value;        
        getObj(txt).checked=false;                
 } 
 
 /////USER CONTROL WUC_BUSCADOR
  var textoParaTxtQuery="Ingrese Evento..";    
    function lTrim(sStr){
     while (sStr.charAt(0) == " ") 
      sStr = sStr.substr(1, sStr.length - 1);
     return sStr;
    }
 
    function rTrim(sStr){
     while (sStr.charAt(sStr.length - 1) == " ") 
      sStr = sStr.substr(0, sStr.length - 1);
     return sStr;
    }
 
    function allTrim(sStr){
     return rTrim(lTrim(sStr));
    }
    function verificabusqueda(strQueryBoxNameHidden)
    {   
        var obj=getObj(strQueryBoxNameHidden);
        //alert(strQueryBoxNameHidden);
        if(allTrim(obj.value)=='' || allTrim(obj.value)=='Ingrese Evento..')
        {   alert('Ingresa Texto a Buscar');
            return false;
        }else
        {   CountdownTimer();
            return true; 
        }
    }   

function onEnterSearch(evt,strSubmitButtonName,strQueryBoxName) 
{   
    var keyCode = null;
    if( evt.which ) {
    keyCode = evt.which;
    } else if( evt.keyCode ) {
    keyCode = evt.keyCode;
    }    
    if( 13 == keyCode ) {                
        if(verificabusqueda(strQueryBoxName))
        {            
            mUpdatePanel();
            getObj(strSubmitButtonName).click();            
            return false;
        }else
        {
            return false;
        }
    }   
    return true;     
}
function onFocusCaja(txtQuery)
{  
   txtQuery.value='';        
}
function onBlurCaja(txtQuery,strResultDivName)
{    
   txtQuery.value=textoParaTxtQuery;  
   $(document).bind("click", function(){            
			$('#'+strResultDivName).hide();				
   });   
}

function cierraDiv()
    {   var divR=getObj('AutoCompleteResults');    
        divR.style.display='none';                
        //getObj("primero").style.display='none';
        //getObj("segundo").style.display='';
    } 
////////INTENTO DE MENUS

function despMenu(nombre,boton,imagen,tipo,sn)
{
    obj = getObj(nombre);
    boton.src=imagen;
    if (sn>0)
    {    mDespliega(boton,tipo,nombre);          
    }else
    {
        obj.style.visibility='hidden';
    }
}
function destacar(obj, val)
{
    if (val==1)
    {   itemOrig = obj.style.backgroundColor;
        obj.style.backgroundColor="Aqua";
    }
    else
    {   obj.style.backgroundColor= itemOrig;  }
}    

//////////////  Mantenimiento
//<<<<  frm_Evento.aspx                >>>>
function MuestraMapa()
    {
        var divR=getObj('mapa');
        var chkC=getObj('TabContainer1_tbParametro_chkConMapa');
        if(divR!=null)
        {
            if(chkC.checked)
            {
                //divR.style.visibility='visible';
                divR.style.display='';
            }else
            {
                //divR.style.visibility='hidden';
                divR.style.display='none';
            }
        }        
    }
    function MuestraCartelera()
    {
        var divR=getObj('cartelera');
        var chkC=getObj('TabContainer1_tbParametro_chkCartelera');
        if(divR!=null)
        {
            if(chkC.checked)
            {
                //divR.style.visibility='visible';
                divR.style.display='';
            }else
            {
                //divR.style.visibility='hidden';
                divR.style.display='none';
            }
        }
        MuestraGrilla(-1);
    }
    function MuestraGrilla(obj,ent)
    {   
        var grilla=getObj('grilla');
        var literal=getObj('literal');
        if(obj.value=='Ver Pesos')
        {  obj.value='Ocultar Pesos';  
            if(grilla != null && literal != null)
            {                
                grilla.style.display='';
                literal.style.display='none';
            } 
        }
        else if(obj.value=='Ocultar Pesos')
        {  obj.value='Ver Pesos';             
           if(grilla != null && literal != null)
            {           
                grilla.style.display='none';
                literal.style.display='none';
            }    
        }else if(obj.value=='Ver Cartelera')
        {  obj.value='Ocultar Cartelera';  
           if(literal != null)
           {                
                grilla.style.display='none';
                literal.style.display='';
            } 
        }else if(obj.value=='Ocultar Cartelera')
        {  obj.value='Ver Cartelera';  
           if(literal != null)
            {           
                grilla.style.display='';
                literal.style.display='none';
            }         
        }
        /*
        if(ent>0)
        {
            if(grilla != null && literal != null)
            {         
                grilla.style.display='';
                literal.style.display='none';
            }
        }
        else if(ent==0)
        {
            if(grilla != null && literal != null)
            {             
                grilla.style.display='none';
                literal.style.display='';
            }
        }else
        {
            if(grilla != null && literal != null)
            {             
                grilla.style.display='none';
                literal.style.display='none';
            }
        }*/        
    }    

function VerificarSel(lista)
{
    var opt = getObj(lista);
    var Index=opt.selectedIndex;
    if(Index>=0)
    { return true;}
    else
    { alert('Seleccione un Elemento'); return false;}
}    

function MoveUp(Opcion,lista)
{
	var no = new Option();
	var no1 = new Option();
	var opt = getObj(lista);
	var tamanho=opt.length;
	var Index=opt.selectedIndex;
	if (Opcion>0)
	    var LastIndex = Index - 1;
	else if (Opcion==0)
	    var LastIndex = Index + 1;
	
	if((tamanho-1)>=LastIndex)
	{
	    if (Index >= 0 && LastIndex >=0)
	    { 
	      no.text=opt.options[Index].text;
	      no.value=opt.options[Index].value;

	      no1.text=opt.options[LastIndex].text;
	      no1.value=opt.options[LastIndex].value;

	      opt.options[Index]=no1;

	      opt.options[LastIndex]=no;
	      if (Opcion>0)
	      {
	       opt.options[Index-1].selected=true;
	      }else
	      {
	        opt.options[Index+1].selected=true;
	      }
	    }
	 }
} 

function buscaEventos(txtCaja,combobox)
    {
        var texto=txtCaja.value;
        var combo=getObj(combobox);        
        for(var a=0;a<combo.length;a++)
        {            
            var encontrado=combo.options[a].text.toLowerCase().indexOf(texto.toLowerCase(),0);
            if(encontrado!=-1)
            {   
                combo.selectedIndex=a;
                break;
            }            
        }
    }

function mvalidaExtension(control,extensiones)
    {
        var fileup=getObj(control);
        var ruta_archivo=fileup.value;        
        var ultima_posicion=ruta_archivo.lastIndexOf('.');        
        var extension=ruta_archivo.substring(ultima_posicion+1)
        var lista_extensiones=extensiones.split(',');
        var contador=0;
        for(var a=0;a<lista_extensiones.length;a++)
        {
            if(lista_extensiones[a].toUpperCase()==extension.toUpperCase())
            {
              contador=contador+1;
              break;
            }
        }
        if(contador>0)
        { 
            return true;
        }else
        {
            alert('Archivo(s) permitido(s): '+extensiones);
            return false;
        }
    }
    
function mVistaPrevia(control,extensiones)
    {
        var fileup=getObj(control);              
        var ruta_archivo=fileup.value;        
        var mensaje='';
        if(ruta_archivo=='')
        {
            mensaje='Selecciona el Archivo a Visualizar';        
        }else
        {
            if(mvalidaExtension(control,extensiones))
            { return true;}            
        }
        if(mensaje!='')
        { alert(mensaje);
        }
        return false;
    }
    function verificaCambio(obj,boton)
    {   
        var indice=obj.selectedIndex;
        var valor=obj.options[indice].value;
        var boton_submit=getObj(boton);        
        if( indice > 1)
        {
            if(valor != '')
            {   mUpdatePanel();
                boton_submit.click();
            }
        }
    }
 
    
function muestraDetalleEvento(div1,nombre_evento,imagen,descripcion,local, direccion,inicio_fin)
{   var divR=getObj(div1);
    descripcion=str_replace("#","\t",descripcion);
    descripcion=str_replace("&","\n",descripcion);               
    var strOptionString="       <table width=\"407\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">             \n"+
"         <tr>            \n"+
"           <td width=\"400\"><img src=\"../tlk_imagenes/lm_ima25.png\" width=\"400\" height=\"11\" /></td>            \n"+
"           <td width=\"7\"><img src=\"../tlk_imagenes/lm_ima13.png\" width=\"7\" height=\"11\" /></td>            \n"+
"        </tr>            \n"+
"        <tr>            \n"+
"          <td class=\"Fondo_tarifa_nn\" ><table width=\"400\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"Texto_vinculo_lm\">            \n"+
"            <tr>            \n"+
"              <td colspan=\"3\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"170\" height=\"4\" /></td>            \n"+
"            </tr>            \n"+
"            <tr>            \n"+
"              <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"8\" height=\"10\" /></td>            \n"+
"              <td class=\"Texto_fecha2\"><table width=\"381\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">            \n"+
"                <tr>            \n"+
"                  <td width=\"318\" align=\"left\">&nbsp; "+nombre_evento+"</td>            \n"+
"                  <td width=\"14\" align=\"left\"><a href=\"javascript:Oculta('"+div1+"');\"><img src=\"../tlk_imagenes/lm_ima_cerrar_off.gif\" width=\"14\" height=\"14\" border=\"0\" id=\"Image111\" onmouseover=\"MM_swapImage('Image111','','../tlk_imagenes/lm_ima_cerrar_on.gif',1)\" onmouseout=\"MM_swapImgRestore()\" /></a></td>            \n"+
"                </tr>            \n"+
"              </table></td>            \n"+
"              <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"8\" height=\"10\" /></td>            \n"+
"            </tr>            \n"+
"            <tr>            \n"+
"             <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"8\" height=\"11\" /></td>            \n"+
"              <td valign=\"top\" background=\"../tlk_imagenes/lms_ima01.gif\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"8\" height=\"11\" /></td>            \n"+
"              <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"8\" height=\"11\" /></td>            \n"+
"            </tr>            \n"+
"            <tr>            \n"+
"              <td width=\"11\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"8\" height=\"17\" /></td>            \n"+
"              <td><table width=\"381\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">            \n"+
"                <tr>            \n"+
"                  <td width=\"10\"><span class=\"Texto_body\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"9\" height=\"10\" /></span></td>            \n"+
"                  <td width=\"105\" valign=\"top\"><table width=\"105\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">            \n"+
"                    <tr>            \n"+
"                      <td><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"4\" /></td>            \n"+
"                    </tr>            \n"+
"                    <tr>            \n"+
"                      <td><img src=\""+imagen+"\" width=\"94\" height=\"80\" /></td>            \n"+
"                    </tr>            \n"+
"                  </table></td>            \n"+
"                  <td width=\"255\" valign=\"top\" class=\"Texto_body\" align=\"left\">"+descripcion+"</td>            \n"+
"                  <td width=\"10\" valign=\"top\" class=\"Texto_body\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"10\" height=\"10\" /></td>            \n"+
"                </tr>            \n"+
"                <tr>            \n"+
"                  <td colspan=\"4\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"10\" /></td>            \n"+
"                  </tr>            \n"+
"                <tr>            \n"+
"                  <td>&nbsp;</td>            \n"+
"                  <td valign=\"top\">&nbsp;</td>            \n"+
"                  <td valign=\"top\" class=\"Texto_body\"><table width=\"255\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">            \n"+
"                    <tr>            \n"+
"                      <td width=\"48\" class=\"Texto_calendvereventos\">Local:</td>            \n"+
"                     <td width=\"207\" class=\"Texto_vinculo_2\" align=\"left\"><strong>"+local+"</strong></td>            \n"+
"                    </tr>            \n"+
"                    <tr>            \n"+
"                      <td>&nbsp;</td>            \n"+
"                      <td class=\"Texto_vinculo_2\" align=\"left\">"+direccion+"</td>            \n"+
"                    </tr>            \n"+
"                    <tr>            \n"+
"                      <td colspan=\"2\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"5\" /></td>            \n"+
"                      </tr>            \n"+
"                    <tr>            \n"+
"                      <td class=\"Texto_calendvereventos\">Fechas:</td>            \n"+
"                      <td class=\"Texto_vinculo_2\" align=\"left\">"+inicio_fin+"</td>            \n"+
"                    </tr>            \n"+
"                    <tr>            \n"+
"                      <td colspan=\"2\" class=\"Texto_calendvereventos\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"7\" /></td>            \n"+
"                      </tr>            \n"+
"                  </table></td>            \n"+
"                  <td valign=\"top\" class=\"Texto_body\">&nbsp;</td>            \n"+
"                </tr>            \n"+
"              </table></td>            \n"+
"              <td width=\"8\">&nbsp;</td>            \n"+
"            </tr>            \n"+
"            <tr>            \n"+
"              <td colspan=\"3\"><img src=\"../tlk_imagenes/ima_trans.gif\" alt=\"\" width=\"100\" height=\"5\" /></td>            \n"+
"            </tr>            \n"+
"          </table></td>            \n"+
"          <td background=\"../tlk_imagenes/lm_ima05.png\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"7\" height=\"9\" /></td>            \n"+
"        </tr>            \n"+
"        <tr>            \n"+
"          <td><img src=\"../tlk_imagenes/lm_ima26.png\" width=\"400\" height=\"11\" /></td>            \n"+
"          <td background=\"../tlk_imagenes/lm_ima06.png\"><img src=\"../tlk_imagenes/ima_trans.gif\" width=\"7\" height=\"11\" /></td>            \n"+
"        </tr>            \n"+
"        <tr>            \n"+
"          <td colspan=\"2\"><img src=\"../tlk_imagenes/lm_ima28.png\" width=\"407\" height=\"7\" /></td>            \n"+
"        </tr>            \n"+
"      </table>         ";
    if(divR!=null)
    {
      divR.innerHTML=strOptionString;        
      divR.style.top='200px';
      divR.style.left='250px';
      divR.style.display='';
    }
}

function mPintaTarifaDiv(obj,div1)
{
    var indice=obj.selectedIndex;
    var txt=obj.options[indice].text;
    var divR=getObj(div1);
    if(divR!=null)
    {
        divR.innerHTML=txt; 
    }
}

var top_scroll=0;
function scrollingDetector()
 {    
	if (navigator.appName == "Microsoft Internet Explorer")
	{
	    top_scroll=document.documentElement.scrollTop;
	}
	else
	{   top_scroll = window.pageYOffset;   } 
 } 
  
function CountdownTimer()
{    
	if (window.CountdownTimerInstance == null)
	{   
		window.CountdownTimerInstance = this;
		var divProgreso=getObj('ctl00_updProgreso');		
		var divProgreso1=getObj('algo');		
		var divProgreso2=getObj('fondoUpdate');		
		var divProgreso3=getObj('updProgress');		
		
		var windowBackGround = document.all["windowBackGround"];
		var _body = document.all["_body_principal"];
		if(divProgreso!=null )
		{   //alert('divprogreso');		    
		    divProgreso.style.display='none';
		    divProgreso1.style.display='none';
		    divProgreso2.style.display='none';
		    divProgreso3.style.display='none';
		}
		//Detectando el Scroll
		scrollingDetector();
		//Calculando medio de la pantalla
		calculo = ((screen.height/2) + top_scroll)-100;
		
		if (windowBackGround != null)
		{   
			windowBackGround.style.width = _body.scrollWidth;//document.body.clientWidth + parseInt(document.body.scrollLeft);
			windowBackGround.style.height = _body.scrollHeight;//document.body.clientHeight + parseInt(document.body.scrollTop);
			windowBackGround.style.top = "0";//parseInt(document.body.scrollTop);
			windowBackGround.style.left = "0";
			windowBackGround.style.display = 'block';
		}
		
		var DivIframeWindowWait = document.all['DivWindowWait'];
		if (DivIframeWindowWait != null)
		{
			DivIframeWindowWait.style.width = "400px";
			DivIframeWindowWait.style.height = "95px";
			DivIframeWindowWait.style.top = calculo+"px";
			//(document.body.clientHeight / 2) - (parseInt(DivIframeWindowWait.style.height) / 2) + parseInt(document.body.scrollTop);
			DivIframeWindowWait.style.left = (document.body.clientWidth / 2) - (parseInt(DivIframeWindowWait.style.width) / 2) + parseInt(document.body.scrollLeft);
			DivIframeWindowWait.style.display = 'block';
		}
		
		var divWindowWait = document.all['windowWait'];
		if (divWindowWait != null)
		{
			divWindowWait.style.width = "400";
			divWindowWait.style.height = "95";
			divWindowWait.style.top =  calculo+"px";
			//(document.body.clientHeight / 2) - (parseInt(divWindowWait.style.height) / 2) + parseInt(document.body.scrollTop);
			divWindowWait.style.left = (document.body.clientWidth / 2) - (parseInt(divWindowWait.style.width) / 2) + parseInt(document.body.scrollLeft);
			divWindowWait.style.display = 'block';
		}
	}
	else
	{
		/*var lblMessageWait = document.getElementById("lblMessageWait");
		lblMessageWait.innerHTML = "Espere mientras se procese su solicitud.";*/
		return null;
	}
}

function mUpdatePanel()
{   
   var updateBackGround = getObj("fondoUpdate");
   var updateProgreso = getObj("updProgress");
   var divEventoSinFoto = getObj('ctl00_ContentPlaceHolder1_wuc_EventosDisponiblesSinImagen1_panelEventosSinFoto');
   if(divEventoSinFoto!=null)
   {
    divEventoSinFoto.style.display='none';
   }
   var ultimo=getElementPosition('ctl00_txtUltimo').top;   
   scrollingDetector();
   calculo = ((screen.height/2) + top_scroll)-100;
   //alert(getElementPosition('ctl00_ContentPlaceHolder1_wuc_EventosDisponiblesSinImagen1_txtUltimo').top);
  		if (updateBackGround != null)
		{	//alert('updateBackGround');
			updateBackGround.style.display = 'block';
			updateBackGround.style.top= 0; // (getElementPosition('ctl00_ContentPlaceHolder1_wuc_EventosDisponiblesSinImagen1_imgEventosDisponiblesSF').top);
            updateBackGround.style.left = 0; //(getElementPosition('ctl00_ContentPlaceHolder1_wuc_EventosDisponiblesSinImagen1_imgEventosDisponiblesSF').left);
            updateBackGround.style.width = "100%";            
            updateBackGround.style.position = 'absolute';
            updateBackGround.style.height =ultimo;
            //(getElementPosition('ctl00_ContentPlaceHolder1_wuc_EventosDisponiblesSinImagen1_imgEventosDisponiblesSF').top);
            
            //(getElementPosition('ctl00_ContentPlaceHolder1_wuc_EventosDisponiblesSinImagen1_imgEventosDisponiblesSF').left)+'px';
		}
		if (updateProgreso != null)
		{	//		alert('updateProgreso');
		    updateProgreso.style.width = "400px";
			updateProgreso.style.height = "96px";			
			updateProgreso.style.top =  calculo+"px";
			//(getElementPosition('ctl00_ContentPlaceHolder1_wuc_EventosDisponiblesSinImagen1_imgEventosDisponiblesSF').top+150);					
			updateProgreso.style.left = (document.body.clientWidth / 2) - (parseInt(updateProgreso.style.width) / 2) + parseInt(document.body.scrollLeft);
			//(getElementPosition('ctl00_ContentPlaceHolder1_wuc_EventosDisponiblesSinImagen1_imgEventosDisponiblesSF').left+3);					
			updateProgreso.style.display = 'block';
		}
}
function mEliminarUpdate()
{
    var bool=confirm("¿Esta seguro de eliminar este registro?");
    if(bool)
    {
        mUpdatePanel();
        return true;
    }else
    {
        return false;
    }
}



    function mPreVentaEventos()
    {           
            //var texto = getObj('muestraTexto');    
            //var clientes = getObj('ctl00_ContentPlaceHolder1_hdfNumeroCliente');
            var panel = getObj('panelPreVenta');
            if(panel!=null)
            {   mCerrarDivs();
		        scrollingDetector();
		        //Calculando medio de la pantalla
		        calculo = ((screen.height/2) + top_scroll)-300;
		        panel.style.width = "400px";
		        panel.style.top = calculo+"px";			
			    panel.style.left = (document.body.clientWidth / 2) - (parseInt(panel.style.width) / 2) + parseInt(document.body.scrollLeft);
                panel.style.display = '';
                var email = getObj('ctl00_ContentPlaceHolder1_txtUsuarioPreVenta');
                var codigo = getObj('ctl00_ContentPlaceHolder1_txtCodigoPreVenta');
                if(email.value=='')
                {  email.focus(); }
                else
                {
                    codigo.focus();
                }
            }         
    }
    
    function mCierraPanel()
    {
         var panel = getObj('panelPreVenta');
         if(panel!=null)
         { 
            panel.style.display = 'none';
         }
    }
    function mValidaPreVentaDatos()
    {
        var email = getObj('ctl00_ContentPlaceHolder1_txtUsuarioPreVenta');
        var codigo = getObj('ctl00_ContentPlaceHolder1_txtCodigoPreVenta');
        if(codigo!=null)
        {
            if(email.value == '')
            {   email.focus();
                alert('Ingrese su email');
                return false;
            }
            /*else
            {
              
                if (!Validate_Email_Address(email.value))                
                {   
                    email.focus();
                    alert('Email incorrecto');
                    return false;
                }

            }*/
            if(codigo.value == '')
            {   codigo.focus();
                alert('Ingrese codigo de preventa');
                return false;
            }
            CountdownTimer(); 
            return true;
        }
    }
   
    function Validate_String(string, return_invalid_chars)
         {
         valid_chars = '1234567890-_.^~abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
         invalid_chars = '';
         
         if(string == null || string == '')
            return(true);
         
         //For every character on the string.   
         for(index = 0; index < string.length; index++)
            {
            char = string.substr(index, 1);                        
            
            //Is it a valid character?
            if(valid_chars.indexOf(char) == -1)
              {
              //If not, is it already on the list of invalid characters?
              if(invalid_chars.indexOf(char) == -1)
                {
                //If it's not, add it.
                if(invalid_chars == '')
                   invalid_chars += char;
                else
                   invalid_chars += ', ' + char;
                }
              }
            }                     
            
         //If the string does not contain invalid characters, the function will return true.
         //If it does, it will either return false or a list of the invalid characters used
         //in the string, depending on the value of the second parameter.
         if(return_invalid_chars == true && invalid_chars != '')
           {
           last_comma = invalid_chars.lastIndexOf(',');
           
           if(last_comma != -1)
              invalid_chars = invalid_chars.substr(0, $last_comma) + 
              ' and ' + invalid_chars.substr(last_comma + 1, invalid_chars.length);
                      
           return(invalid_chars);
           }
         else
           return(invalid_chars == ''); 
         }


function Validate_Email_Address(email_address)
         {
         //Assumes that valid email addresses consist of user_name@domain.tld
         at = email_address.indexOf('@');
         dot = email_address.indexOf('.');
         
         if(at == -1 || 
            dot == -1 || 
            dot <= at + 1 ||
            dot == 0 || 
            dot == email_address.length - 1)
            return(false);
            
         user_name = email_address.substr(0, at);
         domain_name = email_address.substr(at + 1, email_address.length);                  
         
         if(Validate_String(user_name) === false || 
            Validate_String(domain_name) === false)
            return(false);                     
         
         return(true);
         }
function mCargaDivs()
{
  var divB = getObj('showDiv');
  if(divB!=null)
  {
    scrollingDetector();
    //Calculando medio de la pantalla
	calculo = ((screen.height/2) + top_scroll)-300;
	divB.style.width = "400px";
	divB.style.top = calculo+"px";			
	divB.style.left = (document.body.clientWidth / 2) - (parseInt(divB.style.width) / 2) + parseInt(document.body.scrollLeft);
    divB.style.display = 'none';    
  }
}
function mCerrarDivs()
{
  var divB = getObj('showDiv');
  if(divB!=null)
  {
    divB.style.display = 'none';
  }
}

function mCargarBoticas()
{
    var divB = getObj('showDiv');
  if(divB!=null)
  {
    scrollingDetector();
    //Calculando medio de la pantalla
	calculo = ((screen.height/2) + top_scroll)-250;
	divB.style.width = "400px";
	divB.style.top = calculo+"px";			
	divB.style.left = (document.body.clientWidth / 2) - (parseInt(divB.style.width) / 2) + parseInt(document.body.scrollLeft);
    divB.style.display = '';    
  }
}

function mPublicidadEventos()
{
    //var texto = getObj('muestraTexto');    
    //var clientes = getObj('ctl00_ContentPlaceHolder1_hdfNumeroCliente');
    /*var panel = getObj('panelPublicidad');
    if(panel!=null)
    {   
        mCerrarDivs();
		scrollingDetector();
		//Calculando medio de la pantalla
		calculo = ((screen.height/2) + top_scroll)-300;
		panel.style.width = "400px";
		panel.style.top = calculo+"px";			
		panel.style.left = (document.body.clientWidth / 2) - (parseInt(panel.style.width) / 2) + parseInt(document.body.scrollLeft);
        panel.style.display = '';
    }*/         
 }
 
 function mCierraPanel2()
 {
    var panel = getObj('panelPublicidad');
    if(panel!=null)
    { 
      panel.style.display = 'none';
    }
 }