/* Certifica.com : Version 2.05 (15/6/2000)*/
/* BEGIN PAGE COUNT CODE */
Certifica_resolucion="otro";
Certifica_colores="otro";
Certifica_java_activado="otro";
Certifica_browser="otro";
Certifica_version="otro";
Certifica_desde=""+escape(document.referrer);
Certifica_cpu_XXXX="otro";
Certifica_idioma_sistema="otro";
if (Certifica_desde== "") 
{
   Certifica_desde="otro";
}
Certifica_resolucion=screen.width;
Certifica_browser=navigator.appName;
Certifica_version_navegador=navigator.appVersion.charAt(0) + navigator.appVersion.charAt(1);
Certifica_version_navegador=Certifica_version_navegador + navigator.appVersion.charAt(2);
Certifica_cpu_XXXX=navigator.cpuClass;
Certifica_idioma_sistema=navigator.userLanguage;
if (Certifica_browser != "Netscape")
{
   Certifica_colores=screen.colorDepth;
} else {
   Certifica_colores=screen.pixelDepth;
}
Certifica_java_activado=navigator.javaEnabled();
Certifica_NS2Ch_a=0;
if (navigator.appName == "Netscape" && navigator.appVersion.charAt(0) == "2")
{
   Certifica_NS2Ch_a=1;
}
if (Certifica_NS2Ch_a == 0) {

dato=document.location.pathname;
/********************************
Fecha: 24/07/2003
Modificado por: Antonio Torres
*******************************/
// Se quitan los "%20" y se subtituyen por "+"
while(dato.indexOf("%20") > -1){
	dato = dato.replace("%20","+");
}

/********************************
Fecha: 24/07/2003
Modificado por: Antonio Torres
Se agregó Ids para que registre 
en cuentas separadas los accesos
*******************************/
// Ponemos www si se trata de internet
var vurl;
vurl = dato.toUpperCase();
dato = "/PushtoMail" + dato;
v_id = "106141"

/******************************/
datoback=dato;
dato2=dato.length;
dato3=dato.charAt(dato2-1);
cadena="/";
otracadena="|";

contador=0;
while (datoback.indexOf(cadena) > -1) {
dato4=datoback.indexOf(cadena);
datoback=datoback.substring(0,dato4)+otracadena+datoback.substring(dato4+1,datoback.length);
contador=contador+1;
}

if ((dato3 == '/') && (contador==2))
{
dato=dato+"home/";
}

Certifica_url_source='https://hits.e.cl/cert/hit.dll?sitio_id=' + v_id + '&path=' + dato + '&vc=3.00';

   Certifica_url_source+="&size="+Certifica_resolucion+"&colors="+Certifica_colores;
   Certifica_url_source+="&referer="+Certifica_desde+"&java="+Certifica_java_activado;
   Certifica_url_source+="&idio="+Certifica_idioma_sistema+"&cpu="+Certifica_cpu_XXXX+"&vers='"+Certifica_version_navegador+"'";
   //document.writeln("<IMG BORDER=0 SRC=\"" + Certifica_url_source + "\">");
   
   // Removed following line because it was substantially slowing pages down. -- KL 20080506
   //document.writeln("<div style=\"display:none;\"><IMG BORDER=0 SRC=\"" + Certifica_url_source + "\"><A HREF=\"https://www.certifica.com/link/index.asp?sitio_id=" + v_id + "&vc=3.00\"><IMG BORDER=0 SRC=\"" + Certifica_url_source + "\"></A></div>");
   //alert(Certifica_url_source);
}
/* END OF PAGE COUNT CODE */


plus = new Image();
plus.src = "Images/icon_drawer_closed.gif";
minus = new Image();
minus.src = "Images/icon_drawer_open.gif";
		
function PtmHelpPopup( src )
{
  var winHeight = "450";
  var winWidth = "500";
  var lLeft = window.screen.width-winWidth-10;
  var winOptions = "toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no";
  //var winOptions = "toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,location=yes,directories=no";
  var winFeature = "left=" + lLeft + ",top =0";
  var winLocation = src;
  var winName = "Help";
  var winString = "height=" + winHeight + "," + "width=" + winWidth + "," + winOptions + "," + winFeature;
  x =  window.open(winLocation, winName, winString);
  x.focus();
}

function PtmHelp( HelpPath, lang )
{
  var url = window.location.href;	// current url
  var filename = url;
  var pos = filename.lastIndexOf("/");	// last slash
  filename = filename.substring(pos+1);	// extract fname
  url = url.substr(0,pos+1);			// get path only
  pos = filename.indexOf(".");			// locate .
  filename = filename.substr(0,pos);	// lop off past .
  //filename = filename + "_hlp.asp";		// insert _hlp - assumes .htm ext
  var fullURL = HelpPath + "/" + lang + "/PSTNhelp.htm#" + filename; // + "?home=" + url + "&lang=" + lang;
  PtmHelpPopup( fullURL );	// open new help window	
}

function ShowHideInstructionsLink(val)
{
	if (document.getElementById(val).style.display=='none')
		
		document.getElementById(val).style.display='block';
		
	else
	
		document.getElementById(val).style.display='none';
}

function ShowHideInstructions(instrId,imgId) 
{
			
	var img = document.getElementById(imgId);
		
	if (document.getElementById(instrId).style.display=='none') {
		document.getElementById(instrId).style.display='block';
		img.src = minus.src;	
	} 
	else {	
		document.getElementById(instrId).style.display='none';
		img.src = plus.src;	
	}
}


function validateLength(txt, val){ 
if(txt.value.length >= val)
	{
		txt.value = txt.value.substring(0, val);
	} 
	return (val - txt.value.length);
} 

function validateLength2(txt1, txt2, val){ 
var total = txt1.value.length + txt2.value.length;
if(total >= val)
	{
		txt2.value = txt2.value.substring(0, (val-txt1.value.length));
	} 
	return (val - (txt1.value.length + txt2.value.length));
} 

function refererPopup() {
	openURL = 'http://www.nextel.com.mx/nr/nextelsite/includes/referPage.asp?page='+this.location.href;
	window.open(openURL, 'Referer', 'width=260,height=340,scrollbars=no');
}

function DisableReplys_Click(obj)
				{
				    var s = obj.name;
				    var ind = s.lastIndexOf('$');
				    if(ind==-1)
				        ind = s.lastIndexOf(':');
				    var ControlName = s.substring(0,ind+1);
				    if (document.forms[0].elements[s].checked==true) 
				    {
				    document.forms[0].elements[ControlName + 'chkReplyOnPhone'].checked=false; 
				    } 
				
				}
// funcion SendReplys_Click
				function SendReplys_Click(obj) 
				{
				var s = obj.name;
				var ind = s.lastIndexOf('$');
				if(ind==-1)
				        ind = s.lastIndexOf(':');
				var ControlName = s.substring(0,ind+1);

				if (document.forms[0].elements[s].checked==true) {
				document.forms[0].elements[ControlName + 'chkNoReplyOnPhone'].checked=false; }
				}
// function SendNotification_Click
				function SendNotification_Click(obj) 
				{ 
				var s = obj.name;  
				var ind = s.lastIndexOf('$');
				if(ind==-1)
				        ind = s.lastIndexOf(':');
				var ControlName = s.substring(0,ind+1); 
				if (document.forms[0].elements[s].checked==true) { 
				document.forms[0].elements[ControlName + 'chkNoReplyOnPhone'].checked=false; }
				}
				
				
				function ValidateText(sender, args)
                  {
                    var regexstring =args.Value;
                   
                    var myregexp = new RegExp(/<[a-z]|<!|&#|\Won[a-z]*\s*=|(script\s*:)|expression\(/);

                    if(myregexp.test(regexstring))
                         args.IsValid = false;
                    else
                        args.IsValid = true;
                  }
                  
                    function ValidateSMSLength(sender, args)
                      {
                        var str =args.Value;
                        if (str.length >= 120)
                             args.IsValid = false;
                        else
                            args.IsValid = true;
                      }
                  function remarksLength(objID)
                    {
                    if (document.all(objID).value.length >= 120)
                    {
                    alert('SMS Text cant be more than 120 characters');
                    return false;
                    }
                    return true;
                    }
      
                  function ClearText(clientid)
                  {
                    var textbox = document.getElementById(clientid);
                    textbox.innerText = "";
                    return false;
                  }  
                  
                  function ClearText()
                  {
                  
                        for(var i=1;i<document.forms[0].elements.length;i++)
	                    {
	                        var elm = document.forms[0].elements[i];
	                        if(elm!=null && elm.type=="textbox" )
	                        {
	                             var regexstring =elm.Value;
                   
                                    var myregexp = new RegExp(/<[a-z]|<!|&#|\Won[a-z]*\s*=|(script\s*:)|expression\(/);

                                    if(myregexp.test(regexstring))
                                        {
                                        elm.innerText = "";
                                        return false;
                                        }
		                    }
	                    }
                  } 
                  
                  
//char count functions


            var IE = (document.all) ? 1 : 0;
            var DOM = 0; 
            if (parseInt(navigator.appVersion) >=5) {DOM=1};

            function txtShow( counterId, txt2show ) 
            {
               // Detect Browser
               if (DOM) {
                  var viewer = document.getElementById(counterId);
                  viewer.innerHTML=txt2show;
               }
               else if(IE) {
                  document.all[counterId].innerHTML=txt2show;
               }
            } 
 
            function getTxt( counterId ) 
            {
               var output = '';
               // Detect Browser
               if (DOM) {
                    
                  var viewer = document.getElementById(counterId);
                  output = viewer.value;
               }
               else if(IE) {
                    
                  output = document.all[counterId].value;
               }
               
               return output;
            }

            function countChars(txtMessageText, lblCharCount) 
            {
               var str = new String(getTxt(txtMessageText));
               var len = str.length;
               var showstr = len;
               txtShow( lblCharCount, showstr );
            } 

