function nuevoAjax (){
	var xmlhttp=false;
	try{
       xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
      try{
       xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      }catch(E){
       xmlhttp = false;
      }
    }
    if(!xmlhttp && typeof XMLHttpRequest!='undefined'){
       xmlhttp = new XMLHttpRequest();
    }
	return xmlhttp;
}

function mostrarContidoFuncion(archivo,contenedor,variables,codigo,tab){
	
	var q=15;
	//alert(document.getElementById(tab).class);
	if(tab!=""){
		for(var k=1;k<=q;k++){
			try{
			document.getElementById("tab"+k).className ="";
			}catch(e){}
		}
		try{
			document.getElementById(tab).className="current";
		}catch(e){}
	}
	//a=this.objetoAjaxComplejo();
	var cont=document.getElementById(contenedor);
	a=new nuevoAjax();
	a.open("POST", archivo,true);
	a.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	a.send(variables);
	if(validarProceso()){
		return;
	}else{
		proceso=true;
	}
	cont.innerHTML = codigo;
	a.onreadystatechange=function() {
		if (a.readyState==4) {
			proceso=false;
			cont.innerHTML = a.responseText;
			setTimeout(Acc,100);
	 	}
	}
}
function Acc(){}

function validarProceso(pro){
	return false;
}

/**************** FUNCIONES DE BUSQUEDA * ************************************/

function buscarleyes()
{
	if((document.getElementById('valor').value=="")){
		alert("Se requiere un valor de busqueda");
		return;
	}
	var valor=document.getElementById('valor').value;
	var seccion=document.getElementById('seccion').value;
	var variables = 1;
	mostrarContidoFuncion('res_normas_n.php?valor='+valor+'&seccion='+seccion,'resultado_bus',variables,'<div style=margin-top:25px align=center><img src=images/load.gif ></div>','tab3');
}

function buscar(limite){
	if((document.getElementById('valor').value=="")){
		alert("Se requiere un valor de busqueda");
		return;
	}
	var variables = 1;	
	var valor = document.getElementById('valor').value;
	var seccion=document.getElementById('seccion').value;
	mostrarContidoFuncion('res_normas_n.php?limite='+limite+'&valor='+valor+'&seccion='+seccion,'resultado_bus',variables,'<div style=margin-top:25px align=center><img src=images/load.gif ></div>','tab3');
}


/**************** FORMULARIOS * ************************************/
function registro_demo()
{
	var variables = 1;
	var tipo=document.getElementById('tipo').value;
	var ip=document.getElementById('ip').value;
	var cliente=document.getElementById('cliente').value;
	var nombre=document.getElementById('nombre').value;
	var documento=document.getElementById('documento').value;
	var direccion=document.getElementById('direccion').value;
	var telefono=document.getElementById('telefono').value;
	var celular=document.getElementById('celular').value;
	var ciudad=document.getElementById('ciudad').value;
	var email=document.getElementById('email').value;
	var dominio=document.getElementById('dominio').value;
	var variables = 1;
	mostrarContidoFuncion('includes/registro_demo.php?cliente='+cliente+'&nombre='+nombre+'&documento='+documento+'&direccion='+direccion+'&telefono='+telefono+'&ciudad='+ciudad+'&celular='+celular+'&email='+email+'&ip='+ip+'&dominio='+dominio+'&tipo='+tipo,'resultado',variables,'<div align=center><img src=images/load.gif ></div>','tab3');
}

function opine()
{	
	var nombre=document.getElementById('nombre').value;
	var institucion=document.getElementById('institucion').value;	
	var email=document.getElementById('email').value;
	var amigable=document.getElementById('amigable').value;
	var rapida=document.getElementById('rapida').value;
	var actualizada=document.getElementById('actualizada').value;
	var util=document.getElementById('util').value;
	var recomienda=document.getElementById('recomienda').value;
	var comentarios=document.getElementById('comentarios').value;
	var dominio=document.getElementById('dominio').value;
	var variables = 1;
	mostrarContidoFuncion('includes/opine.php?nombre='+nombre+'&institucion='+institucion+'&email='+email+'&amigable='+amigable+'&rapida='+rapida+'&actualizada='+actualizada+'&util='+util+'&recomienda='+recomienda+'&dominio='+dominio+'&comentarios='+comentarios,'resultado',variables,'<div align=center><img src=images/load.gif ></div>','tab3');
}

function registro_ccb()
{
	var ip=document.getElementById('ip').value;
	var nombre=document.getElementById('nombre').value;
	var documento=document.getElementById('documento').value;
	var direccion=document.getElementById('direccion').value;
	var telefono=document.getElementById('telefono').value;
	var ciudad=document.getElementById('ciudad').value;
	var pais=document.getElementById('pais').value;
	var email=document.getElementById('email').value;
	var usuario=document.getElementById('email').value;
	var dominio=document.getElementById('dominio').value;
	var tipo=document.getElementById('tipo').value;
	var solicitud=document.getElementById('solicitud').value;
	var variables = 1;
	mostrarContidoFuncion('includes/registro_ccb.php?nombre='+nombre+'&documento='+documento+'&direccion='+direccion+'&telefono='+telefono+'&ciudad='+ciudad+'&pais='+pais+'&email='+email+'&usuario='+usuario+'&ip='+ip+'&dominio='+dominio+'&tipo='+tipo+'&solicitud='+solicitud,'resultado',variables,'<div align=center><img src=images/load.gif ></div>','tab3');
}












var calendario="";
function calendar(aN) {
    this.Version = "1.42basic";
    this.bD = 0;
    this.bE = 0;
    this.bF = 0;
    this.by = new f(aN);
    this.bC = new Date();
    this.bA = this.bC.getFullYear();
    this.dc = glbCalendars.length;
    this.aO = Array(43);
    this.aryMonths = Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
    this.aryDays = Array("S", "M", "T", "W", "T", "F", "S", "S");
    this.aryDaysShort = Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun");
    this.FullMonthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
    this.FullDayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
    this.aC = "Please select a future date";
    glbCalendars[glbCalendars.length] = this;
    this.bP = "caldiv_" + this.dc;
    this.cw = false;
    this.Div = null;
    this.aG = null;
    this.cu = false;
    this.isOpen = false;
    this.cy = 0;
    this.cz = 0;
    this.rect = {
        x: 0,
        y: 0,
        dx: 0,
        dy: 0
    };
    this.cL = {
        x: 0,
        y: 0,
        dx: 0,
        dy: 0
    };
    this.ea = {
        x: 0,
        y: 0,
        dx: 0,
        dy: 0
    };
    this.dG = "";
    this.bV = false;
    this.dh = true;
    var cv = (navigator.userAgent.toLowerCase().indexOf("db") != -1);
    this.aR = cv ? "title": "alt";
    this.aQ = Array(3);
    this.dH = "";
    this.cr = null;
    this.eb = null;
    this.cM = null;
    this.bc = this.by.Item("FIELD") ? eval(this.by.Item("FIELD")) : null;
    this.be = this.by.Item("FORMAT") ? this.by.Item("FORMAT") : "0";
    this.aZ = this.by.Item("DELIMITER") ? this.by.Item("DELIMITER") : "/";
    this.bg = false;
    switch (this.be) {
    case "1":
        this.bk = "D" + this.aZ + "M" + this.aZ + "YYYY";
        break;
    case "2":
        this.bk = "YYYY" + this.aZ + "M" + this.aZ + "D";
        break;
    default:
        this.bk = "M" + this.aZ + "D" + this.aZ + "YYYY";
    }
    this.bw = true;
    this.bn = false;
    this.aX = true;
    this.aY = 2000;
    this.bd = 0;
    this.bi = null;
    this.bj = null;
    this.bl = 1;
    this.bv = 1;
    this.bb = false;
    this.aW = true;
    this.bm = 0;
    this.ba = "basic";
    this.bs = 0;
    this.bf = null;
    this.bq = "Click here to visually select a date with DateClick...";
    this.bp = 0;
    this.bo = 0;
    this.bt = 0;
    this.bu = 0;
    if (this.by.Item("ZEROS")) this.dG += "ZEROS\n";
    if (this.by.Item("MOUSEOVER")) this.dG += "MOUSEOVER\n";
    if (this.by.Item("SHOWDAYS")) this.dG += "SHOWDAYS\n";
    if (this.by.Item("DELAY")) this.dG += "DELAY\n";
    if (this.by.Item("BEGINONMONDAY")) this.dG += "BEGINONMONDAY\n";
    if (this.by.Item("ICONLEFT")) this.dG += "ICONLEFT\n";
    if (this.by.Item("ICONTOP")) this.dG += "ICONTOP\n";
    if (this.by.Item("DIR")) this.dG += "DIR\n";
    if (this.by.Item("MONTH")) this.dG += "MONTH\n";
    if (this.by.Item("SHADOW")) this.dG += "SHADOW\n";
    if (this.by.Item("CLOSE")) this.dG += "CLOSE\n";
    if (this.by.Item("YEAR")) this.dG += "YEAR\n";
    if (this.by.Item("MOVEMODE")) this.dG += "MOVEMODE\n";
    if (this.by.Item("INVALID")) this.dG += "INVALID\n";
    if (this.by.Item("FUNCTION")) this.dG += "FUNCTION\n";
    if (this.by.Item("TOOLTIP")) this.dG += "TOOLTIP\n";
    if (this.by.Item("STATIC")) this.dG += "STATIC\n";
    if (this.by.Item("POSITION")) this.dG += "POSITION\n";
    var dm = new RegExp("^D", "i");
    switch (this.be) {
    case "1":
        this.dh = false;
        break;
    case "2":
        this.dh = false;
        break;
    default:
        if (dm.test(this.bk)) this.dh = false;
    }
    this.dX = this.bq;

    var dN;
    if (this.ba) {
        if (this.ba.indexOf("/") >= 0) {
            dN = this.ba.split("/");
            this.aV = dN[dN.length - 1];
        } else {
            this.aV = this.ba ? this.ba: "basic";
        }
    } else {
        this.aV = this.ba ? this.ba: "basic";
    }
    this.au = au;
    this.R = R;
    this.U = U;
    this.T = T;
    this.aw = aw;
    this.av = av;
    this.nextMonth = nextMonth;
    this.prevMonth = prevMonth;
    this.nextYear = nextYear;
    this.prevYear = prevYear;
    this.ac = ac;
    this.ab = ab;
    this.Y = Y;
    this.V = V;
    this.ax = ax;
    this.B = B;
    this.C = C;
    this.F = F;
    this.writeCalendar = writeCalendar;
    this.ai = ai;
    this.aj = aj;
    this.ak = ak;
    this.M = M;
    this.Q = Q;
    this.J = J;
    this.N = N;
    this.L = L;
    this.ar = ar;
    this.aq = aq;
    this.at = at;
    this.A = A;
    this.al = al;
    this.ao = ao;
    this.ap = ap;
    this.as = as;
    this.setDefDate = setDefDate;
    this.an = an;
    this.I = I;
    this.K = K;
    this.ad = ad;
    this.X = X;
    this.z = z;
    aF = this;
    function r() {};
    function an(co) {
        if (aF.bc) aF.bc.value = I(co);
    };
    function writeCalendar() {
        var dC, dI;
        dC = document.all ? "onClick": "onMouseDown";
        var ci = (document.all && !document.getElementById) ? "width:20;": "";
        var dE = aF.bn ? "onMouseOver": dC;
        var dA;
        dA = aF.bb ? "filter: progid:DXImageTransform.Microsoft.DropShadow(color=#777788,direction=135,strength=2);": "";
        var bh = aF.bj ? "top:" + aF.bj + "px;": "";
        bh += aF.bi ? "left:" + aF.bi + "px;": "";
        bh += bh.length > 0 ? "position: absolute;": "";
        aF.F();
        if (aF.bp < 1) {
            calendario = calendario + "<img src='" + aF.ba + "/calendar.gif' id='img_" + aF.bP + "' border='0' align='top' style='" + bh + "' " + dE + "='glbCalendars[" + aF.dc + "].setDefDate();glbCalendars[" + aF.dc + "].au(event);if (window.event)window.event.cancelBubble=true;' title='" + aF.dX + "' />";
            dI = "display:none;";
        } else {
            dI = "display:inline;";
        }
        calendario = calendario + "<div id='" + aF.bP + "' ";
        calendario = calendario + "onMouseOut='glbCalendars[" + aF.dc + "].ar();' ";
        calendario = calendario + "style='position:absolute;" + dA + ci + "" + dI + "' class='" + aF.aV + "-cl-body'> ";
        calendario = calendario + aF.J();
        calendario = calendario + "</div>";
        if (aF.bv) {
            calendario = calendario + "<div id='" + aF.bP + "_year' ";
            calendario = calendario + "onMouseOut='glbCalendars[" + aF.dc + "].ar();' ";
            calendario = calendario + "onMouseOver='glbCalendars[" + aF.dc + "].ac(this);' ";
            calendario = calendario + "style='position:absolute;display:none;background-color:white;'> ";
            calendario = calendario + aF.Q();
            calendario = calendario + "</div>";
        }
        if (aF.bl) {
            calendario = calendario + "<div id='" + aF.bP + "_month' ";
            calendario = calendario + "onMouseOut='glbCalendars[" + aF.dc + "].aq();' ";
            calendario = calendario + "onMouseOver='glbCalendars[" + aF.dc + "].ac(this);' ";
            calendario = calendario + "style='position:absolute;display:none;background-color:white;'> ";
            calendario = calendario + aF.M();
            calendario = calendario + "</div>";
        }
        calendario = calendario + "<IFRAME src=\"javascript:false;\" style='DISPLAY: none; LEFT: 0px; POSITION: absolute; TOP: 0px;COLOR: #FFFFFF;BACKGROUND-COLOR: #FFFFFF;' frameBorder='0' scrolling='no' id='" + aF.bP + "_ghost'></IFRAME>\n";
        calendario = calendario + "<IFRAME src=\"javascript:false;\" style='DISPLAY: none; LEFT: 0px; POSITION: absolute; TOP: 0px;COLOR: #FFFFFF;BACKGROUND-COLOR: #FFFFFF;' frameBorder='0' scrolling='no' id='" + aF.bP + "_ghost_mo'></IFRAME>\n";

        calendario = calendario + "<IFRAME src=\"javascript:false;\" style='DISPLAY: none; LEFT: 0px; POSITION: absolute; TOP: 0px;COLOR: #FFFFFF;BACKGROUND-COLOR: #FFFFFF;' frameBorder='0' scrolling='no' id='" + aF.bP + "_ghost_year'></IFRAME>\n";
        if (this.dG) {
            if (confirm("The following options are not available in DateClick Standard Edition:\n" + this.dG + "\nTo obtain DateClick Professional or Developer, please " + "click 'OK' to be redirected straight to our website.")) {
                document.location.href = "http://www.primorissoftware.com/purchase.asp";
            }
        }
		return calendario;
    };
    function m() {};
     function au(bS) {
        var aS, shim, cP, cn;
        var co;
        bS = H(bS);
        cP = aF.N(bS);
        cn = aF.L();
        W();
        if (cf) aF.bg = true;
        if (document.getElementById) {
            aS = document.getElementById(aF.bP);
            if (aF.bg) shim = document.getElementById(aF.bP + "_ghost");
        } else if (document.all) {
            aS = document.all[aF.bP];
            if (aF.bg) shim = document.all[aF.bP + "_ghost"];
        } else aS = document.layers[aF.bP];
        aF.Div = aS;
        aF.aG = shim;
        if (aF.isOpen) {
            if (aF.bg) {
                aF.ao(shim, aS);
                shim.style.display = "block";
            }
            return false;
        }
        aF.V();
        clearInterval(aF.cr);
        for (var i = 0; i < glbCalendars.length; i++) {
            if (glbCalendars[i] == aF) glbCalendars[i].cw = true;
            else glbCalendars[i].cw = false;
            if (!glbCalendars[i].cw) {
                glbCalendars[i].R();
            }
        }
        if (aS) {
            aS.style.zIndex = ++cg;
            aS.style.display = "block";
            if (!aF.cy) {
                if (aF.bo == 1) {
                    aF.al(aS, aF.z({
                        x: aF.bt,
                        y: aF.bu
                    },
                    cn));
                } else if (aF.bo == 2) {
                    aF.al(aS, {
                        x: aF.bt,
                        y: aF.bu
                    });
                } else {
                    aF.al(aS, aF.z({
                        x: aF.bt,
                        y: aF.bu
                    },
                    cP));
                }
            }
            aF.isOpen = true;
            aF.rect = O(aS);
            if (aF.bg) {
                shim.style.display = "block";
                aF.ao(shim, aS);
            }
            if (window.event) {
                window.event.cancelBubble = true;
                window.event.returnValue = false;
            }
        }
        return false;
    };
    function av(bS) {
        var aS, bQ, du, shim, cP = aF.N(bS);
        if (aF.cu) return false;
        clearInterval(aF.cr);
        if (document.getElementById) {
            aS = document.getElementById(aF.bP);
            bQ = document.getElementById(aF.bP + "_month");
            if (aF.bg) shim = document.getElementById(aF.bP + "_ghost_mo");
        } else if (document.all) {
            aS = document.all[aF.bP];
            bQ = document.all[aF.bP + "_month"];
            if (aF.bg) shim = document.all[aF.bP + "_ghost_mo"];
        } else {
            aS = document.layers[aF.bP];
            bQ = document.layers[aF.bP + "_month"];
        }
        aF.U();
        if (aS) {
            bQ.style.display = "block";
            bQ.style.zIndex = ++cg;
            aF.ap(aS, bQ);
            aF.cL = O(bQ);
            if (aF.bg) {
                aF.ao(shim, bQ);
                shim.style.display = "block";
            }
        }
    };
    function aw(bS) {
        var aS, bR, du, cP = aF.N(bS);
        if (aF.cu) return false;
        clearInterval(aF.cr);
        if (document.getElementById) {
            aS = document.getElementById(aF.bP);
            bR = document.getElementById(aF.bP + "_year");
            if (aF.bg) shim = document.getElementById(aF.bP + "_ghost_year");
        } else if (document.all) {
            aS = document.all[aF.bP];
            bR = document.all[aF.bP + "_year"];
            if (aF.bg) shim = document.all[aF.bP + "_ghost_year"];
        } else {
            aS = document.layers[aF.bP];
            bR = document.layers[aF.bP + "_year"];
        }
        aF.T();
        if (aS) {
            bR.style.display = "block";
            aF.as(aS, bR);
            bR.style.zIndex = ++cg;
            aF.ea = O(bR);
            if (aF.bg) {
                aF.ao(shim, bR);
                shim.style.display = "block";

            }
        }
    };
    function R() {
        var aS, shim;
        if (!aF.isOpen) return false;
        if (document.getElementById) {
            aS = document.getElementById(aF.bP).style;
            if (aF.bg) shim = document.getElementById(aF.bP + "_ghost").style;
        } else if (document.all) {
            aS = document.all[aF.bP].style;
            if (aF.bg) shim = document.all[aF.bP + "_ghost"].style;
        } else {
            aS = document.layers[aF.bP];
        }
        if (aS) {
            aS.display = "none";
            if (aF.bg) shim.display = "none";
        }
        if (aF.bv) aF.U();
        if (aF.bl) aF.T();
        aF.isOpen = false;
        clearInterval(aF.cr);
    };
    function T() {
        var bQ, shim;
        if (document.getElementById) {
            bQ = document.getElementById(aF.bP + "_month");
            if (bQ) bQ = bQ.style;
            if (aF.bg) shim = document.getElementById(aF.bP + "_ghost_mo").style;
        } else if (document.all) {
            bQ = document.all[aF.bP + "_month"];
            if (bQ) bQ = bQ.style;
            if (aF.bg) shim = document.all[aF.bP + "_ghost_mo"].style;
        } else {
            bQ = document.layers[aF.bP + "_month"];
        }
        if (bQ) {
            bQ.display = "none";
            aF.cL = {
                x: 0,
                y: 0,
                dx: 0,
                dy: 0
            };
            if (aF.bg) shim.display = "none";
        }
    };
    function U() {
        var bR, shim;
        if (document.getElementById) {
            bR = document.getElementById(aF.bP + "_year");
            if (bR) bR = bR.style;
            if (aF.bg) shim = document.getElementById(aF.bP + "_ghost_year").style;
        } else if (document.all) {
            bR = document.all[aF.bP + "_year"];
            if (bR) bR = bR.style;
            if (aF.bg) shim = document.all[aF.bP + "_ghost_year"].style;
        } else {
            bR = document.layers[aF.bP + "_year"];
        }
        if (bR) {
            bR.display = "none";
            aF.ea = {
                x: 0,
                y: 0,
                dx: 0,
                dy: 0
            };
            if (aF.bg) shim.display = "none";
        }
    };
    function n() {};
    function ac(aI) {
        clearInterval(aF.cr);
        if (aI.className == aF.aV + "-cl-on-month") aI.className = aF.aV + "-cl-on-month-lit";
        else if (aI.className == aF.aV + "-cl-off-month") aI.className = aF.aV + "-cl-off-month-lit";
        else if (aI.className == aF.aV + "-cl-year") aI.className = aF.aV + "-cl-year-lit";
    };
    function ab(aI) {
        if (aI.className == aF.aV + "-cl-on-month-lit") aI.className = aF.aV + "-cl-on-month";
        else if (aI.className == aF.aV + "-cl-off-month-lit") aI.className = aF.aV + "-cl-off-month";
        else if (aI.className == aF.aV + "-cl-year-lit") aI.className = aF.aV + "-cl-year";
    };
    function nextMonth() {
        aF.bC.setMonth(++aF.bE);
        F();
        Y(aF.bP, J());
    };
  function nextYear() {
        aF.bA += 10;
        Y(aF.bP + "_year", Q());
    };
    function prevMonth() {
        aF.bC.setMonth(--aF.bE);
        F();
        Y(aF.bP, J());
    };
    function prevYear() {
        aF.bA -= 10;
        Y(aF.bP + "_year", Q());
    };
    function ai(td) {
        var dw = td.getAttribute(aF.aR);
        if (!X(dw)) {
            alert(aF.aC);
            return;
        }
        aF.dH = dw;
        if (aF.bc) {
            if (aF.bc) aF.bc.value = aF.dH;
        }
        if (aF.bf) {
            eval(aF.bf + "(new Date(aF.K(aF.dH,aF.bk)))");
        }
        if (aF.aW) aF.R();
        if (aF.bp > 0) {
            Y(aF.bP, J());
        }
    };
    function ak(cs, cW) {
        aF.bC.setFullYear(cs);
        F();
        Y(aF.bP, J());
        aF.cw = true;
        aF.U();
        if (window.event) event.cancelBubble = true;
        else cW.stopPropagation();
    };
    function aj(cq, cW) {
        aF.bC.setMonth(cq);
        F();
        Y(aF.bP, J());
        aF.cw = true;
        aF.T();
        if (window.event) event.cancelBubble = true;
        else cW.stopPropagation();
    };
    function o() {};
    function I(co) {
        aD = ['st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'st'];
        var ca = aF.bk;
        var cC = 'DMYHdhmst'.split('');
        var dL = new Array();
        var bz = 0;
        var dn;
        var dp = /\[(\d+)\]/;;
        var dO = new Date(co);
        var day = dO.getDay();
        var date = dO.getDate();
        var month = dO.getMonth();
        var year = dO.getFullYear().toString();
        var ck = dO.getHours();
        var cF = dO.getMinutes();
        var dz = dO.getSeconds();
        var bZ = new Object();
        bZ['D'] = date;
        bZ['d'] = date + aD[date - 1];
        bZ['DD'] = (date < 10) ? '0' + date: date;
        bZ['DDD'] = aF.FullDayNames[day].substring(0, 3);
        bZ['DDDD'] = aF.FullDayNames[day];
        bZ['M'] = month + 1;
        bZ['MM'] = (month + 1 < 10) ? '0' + (month + 1) : month + 1;
        bZ['MMM'] = aF.FullMonthNames[month].substring(0, 3);
        bZ['MMMM'] = aF.FullMonthNames[month];
        bZ['Y'] = (year.charAt(2) == '0') ? year.charAt(3) : year.substring(2, 4);
        bZ['YY'] = year.substring(2, 4);
        bZ['YYYY'] = year;
        for (var i = 0; i < cC.length; i++) {
            dn = new RegExp('(' + cC[i] + '+)');
            while (dn.test(ca)) {
                dL[bz] = RegExp.$1;
                ca = ca.replace(RegExp.$1, '[' + bz + ']');
                bz++;
            }
        }
        while (dp.test(ca)) {
            ca = ca.replace(dp, bZ[dL[RegExp.$1]]);
        }
        return ca;
    };
    function ad(dW) {
        var dg = (arguments.length == 2) ? arguments[1] : false;
        cb = new Array('YYYY/M/D', 'y-M-d', 'MMM d, y', 'MMM d,y', 'y-MMM-d', 'd-MMM-y', 'MMM d');
        cK = new Array('M/D/YYYY', 'MM/DD/YYYY', 'MM/DD/YY', 'M/D/YY', 'M/d/y', 'M-d-y', 'M.d.y', 'MMM-d', 'M/d', 'M-d');
        bL = new Array('D/M/YYYY', 'DD/MM/YYYY', 'DD/MM/YY', 'D/M/YY', 'd/M/y', 'd-M-y', 'd.M.y', 'd-MMM', 'd/M', 'd-M');
        var bx = new Array('cb', dg ? 'bL': 'cK', dg ? 'cK': 'bL');
        var d = null;
        for (var i = 0; i < bx.length; i++) {
            var l = window[bx[i]];
            for (var j = 0; j < l.length; j++) {
                d = K(dW, l[j]);
                if (d != 0) {
                    return new Date(d);
                }
            }
        }
        return null;
    };
    function g(x) {
        return (x < 0 || x > 9 ? "": "0") + x
    };
    function K(dW, bY) {
        dW = dW + "";
        bY = bY + "";
        var cm = 0;
        var cl = 0;
        var c = "";
        var dT = "";
        var dU = "";
        var x, y;
        var cT = new Date();
        var year = cT.getYear();
        var month = cT.getMonth() + 1;
        var date = 1;
        var hh = cT.getHours();
        var mm = cT.getMinutes();
        var ss = cT.getSeconds();
        var aH = "";
        while (cl < bY.length) {
            c = bY.charAt(cl);
            dT = "";
            while ((bY.charAt(cl) == c) && (cl < bY.length)) {
                dT += bY.charAt(cl++);
            }
            if (dT == "YYYY" || dT == "YY" || dT == "Y") {
                if (dT == "YYYY") {
                    x = 4;
                    y = 4;
                }
                if (dT == "YY") {
                    x = 2;
                    y = 2;
                }
                if (dT == "Y") {
                    x = 2;
                    y = 4;
                }
                year = v(dW, cm, x, y);
                if (year == null) {
                    return 0;
                }
                cm += year.length;
                if (year.length == 2) {
                    if (year > 70) {
                        year = 1900 + (year - 0);
                    } else {
                        year = 2000 + (year - 0);
                    }
                }
            } else if (dT == "MMM" || dT == "NNN") {
                month = 0;
                for (var i = 0; i < aF.FullMonthNames.length; i++) {
                    var cN = aF.FullMonthNames[i];
                    if (dW.substring(cm, cm + cN.length).toLowerCase() == cN.toLowerCase()) {
                        if (dT == "MMM" || (dT == "NNN" && i > 11)) {
                            month = i + 1;
                            if (month > 12) {
                                month -= 12;
                            }
                            cm += cN.length;
                            break;
                        }
                    }
                }
                if ((month < 1) || (month > 12)) {
                    return 0;
                }
            } else if (dT == "DDDD" || dT == "DDD") {
                for (var i = 0; i < aF.FullDayNames.length; i++) {
                    var bN = aF.FullDayNames[i];
                    if (dW.substring(cm, cm + bN.length).toLowerCase() == bN.toLowerCase()) {
                        cm += bN.length;
                        break;
                    }
                }
            } else if (dT == "MM" || dT == "M") {
                month = v(dW, cm, dT.length, 2);
                if (month == null || (month < 1) || (month > 12)) {
                    return 0;
                }
                cm += month.length;
            } else if (dT == "dd" || dT == "d" || dT == "D" || dT == "DD") {
                date = v(dW, cm, dT.length, 2);
                if (date == null || (date < 1) || (date > 31)) {
                    return 0;
                }
                cm += date.length;
            } else if (dT == "hh" || dT == "h") {
                hh = v(dW, cm, dT.length, 2);
                if (hh == null || (hh < 1) || (hh > 12)) {
                    return 0;
                }
                cm += hh.length;
            } else if (dT == "HH" || dT == "H") {
                hh = v(dW, cm, dT.length, 2);
                if (hh == null || (hh < 0) || (hh > 23)) {
                    return 0;
                }
                cm += hh.length;
            } else if (dT == "KK" || dT == "K") {
                hh = v(dW, cm, dT.length, 2);
                if (hh == null || (hh < 0) || (hh > 11)) {
                    return 0;
                }
                cm += hh.length;
            } else if (dT == "kk" || dT == "k") {
                hh = v(dW, cm, dT.length, 2);
                if (hh == null || (hh < 1) || (hh > 24)) {
                    return 0;
                }
                cm += hh.length;
                hh--;
            } else if (dT == "mm" || dT == "m") {
                mm = v(dW, cm, dT.length, 2);
                if (mm == null || (mm < 0) || (mm > 59)) {
                    return 0;
                }
                cm += mm.length;
            } else if (dT == "ss" || dT == "s") {
                ss = v(dW, cm, dT.length, 2);
                if (ss == null || (ss < 0) || (ss > 59)) {
                    return 0;
                }
                cm += ss.length;
            } else if (dT == "a") {
                if (dW.substring(cm, cm + 2).toLowerCase() == "am") {
                    aH = "AM";
                } else if (dW.substring(cm, cm + 2).toLowerCase() == "pm") {
                    aH = "PM";
                } else {
                    return 0;
                }
                cm += 2;
            } else {
                if (dW.substring(cm, cm + dT.length) != dT) {
                    return 0;
                } else {
                    cm += dT.length;
                }
            }
        }
        if (cm != dW.length) {
            return 0;
        }
        if (month == 2) {
            if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {
                if (date > 29) {
                    return 0;
                }
            } else {
                if (date > 28) {
                    return 0;
                }
            }
        }
        if ((month == 4) || (month == 6) || (month == 9) || (month == 11)) {
            if (date > 30) {
                return 0;
            }
        }
        if (hh < 12 && aH == "PM") {
            hh = hh - 0 + 12;
        } else if (hh > 11 && aH == "AM") {
            hh -= 12;
        }
        var cS = new Date(year, month - 1, date, hh, mm, ss);
        return cS.getTime();
    };
    function w(dW) {
        var bO = "1234567890";
        for (var i = 0; i < dW.length; i++) {
            if (bO.indexOf(dW.charAt(i)) == -1) {
                return false;
            }
        }
        return true;
    };
    function v(dB, i, cE, cD) {
        for (var x = cD; x >= cE; x--) {
            var dT = dB.substring(i, i + x);
            if (dT.length < cE) {
                return null;
            }
            if (w(dT)) {
                return dT;
            }
        }
        return null;
    };
    function V() {
        aF.Div.onmousedown = aF.ax;
        if (isNaN(parseInt(aF.Div.style.left))) aF.Div.style.left = "0px";
        if (isNaN(parseInt(aF.Div.style.top))) aF.Div.style.top = "0px";
        aF.Div.da = new Function();
        aF.Div.cZ = new Function();
        aF.Div.cY = new Function();
    };
    function ax(e) {
        e = H(e);
        var y = parseInt(aF.Div.style.top);
        var x = parseInt(aF.Div.style.left);
        aF.T();
        aF.U();
        aF.Div.da(x, y);
        aF.cu = true;
        if (aF.bm) {
            aF.cy = e.clientX;
            aF.cz = e.clientY;
            aF.bV = false;
        }
        document.onmousemove = aF.B;
        document.onmouseup = aF.C;
        return false;
    };
    function B(e) {
        e = H(e);
        var bU = e.clientY;
        var bT = e.clientX;
        var y = parseInt(aF.Div.style.top);
        var x = parseInt(aF.Div.style.left);
        var cU, cV;
        cU = x + (bT - aF.cy);
        cV = y + (bU - aF.cz);
        if (aF.bm > 0) {
            if (!aF.bV) {
                aF.Div.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
                if (aF.Div.style.cursor) aF.Div.style.cursor = "move";
                aF.bV = true;
            }
            aF.Div.style["left"] = cU + "px";
            aF.Div.style["top"] = cV + "px";
            aF.cy = bT;
            aF.cz = bU;
            if (aF.aG) aF.aG.style.display = "none";
        }
        aF.Div.cY(cU, cV);
        return false;
    };
    function C() {
        document.onmousemove = null;
        document.onmouseup = null;
        aF.Div.cZ(parseInt(aF.Div.style["left"]), parseInt(aF.Div.style["top"]));
        if (aF.bm) {
            aF.Div.style.filter = "";
            if (aF.Div.style.cursor) aF.Div.style.cursor = "arrow";
            aF.rect = O(aF.Div);
            if (aF.aG) {
                aF.ao(aF.aG, aF.Div);
                aF.aG.style.display = "block";
            }
            if (aF.bm > 1) {
                aF.cy = 0;
                aF.cz = 0;
            }
        }
        aF.cu = false;
    };
    function F() {
        var bW, bX = 0;
        var cx, cA;
        var bB = aF.bC;
        var i, j = 1;
        aF.bD = bB.getDate();
        aF.bE = bB.getMonth();
        aF.bF = bB.getFullYear();
        bW = new Date(aF.bF, aF.bE, 1);
        bX -= bW.getDay() > 0 ? bW.getDay() : bW.getDay() + 7;
        for (i = 0; i < 43; i++) {
            aF.aO[i] = new Date(bW.getFullYear(), bW.getMonth(), ++bX);
        }
    };
    function M() {
        var innerHTML = "";
        innerHTML += "<table cellspacing=0 cellpadding=0 border=0>";
        innerHTML += "<tr>";
        for (var i = 0; i < 12; i++) {
            if (i % 6 == 0) innerHTML += "</tr><tr>";
            innerHTML += "<td class='" + aF.aV + "-cl-year' onMouseOver='glbCalendars[" + aF.dc + "].ac(this);' onMouseOut='glbCalendars[" + aF.dc + "].ab(this);' style='cursor: hand; cursor: pointer;' onClick='glbCalendars[" + aF.dc + "].aj(" + i + ",event);'>";
            innerHTML += aF.aryMonths[i];
            innerHTML += "</td>";
        }
        innerHTML += "</tr>";
        innerHTML += "</table>";
        return innerHTML;
    };
    function Q() {
        var innerHTML = "";
        innerHTML += "<table cellspacing=0 cellpadding=0 border=0>";
        innerHTML += "<tr>";
        innerHTML += "<td class='" + aF.aV + "-cl-year' onMouseOver='glbCalendars[" + aF.dc + "].ac(this);' onMouseOut='glbCalendars[" + aF.dc + "].ab(this);' style='cursor: hand; cursor: pointer;' onMouseDown='glbCalendars[" + aF.dc + "].nextYear();' align='center' valign='center'>";
        innerHTML += "<img src='" + aF.ba + "/up.gif' border='0' />";
        innerHTML += "</td>";
        innerHTML += "</tr>";
        for (var i = parseInt(aF.bA); i > parseInt(aF.bA) - 10; i--) {
            innerHTML += "<tr>";
            innerHTML += "<td class='" + aF.aV + "-cl-year' onMouseOver='glbCalendars[" + aF.dc + "].ac(this);' onMouseOut='glbCalendars[" + aF.dc + "].ab(this);' style='cursor: hand; cursor: pointer;' onClick='glbCalendars[" + aF.dc + "].ak(" + i + ",event);'>";
            innerHTML += i;
            innerHTML += "</td>";
            innerHTML += "</tr>";
        }
        innerHTML += "<tr>";
        innerHTML += "<td class='" + aF.aV + "-cl-year' onMouseOver='glbCalendars[" + aF.dc + "].ac(this);' onMouseOut='glbCalendars[" + aF.dc + "].ab(this);' style='cursor: hand; cursor: pointer;' onMouseDown='glbCalendars[" + aF.dc + "].prevYear();' align='center' valign='center'>";
        innerHTML += "<img src='" + aF.ba + "/down.gif' border='0' />";
        innerHTML += "</td>";
        innerHTML += "</tr>";
        innerHTML += "</table>";
        return innerHTML;
    };
    function J() {
        var innerHTML = "";
        var dN, dR, dQ = "none",
        dS = "none";
        var cR;
        innerHTML += "<table cellspacing=0 cellpadding=0 border=0 id='aS' class='" + aF.aV + "-cl-innertable'>";
        innerHTML += "<tr class='" + aF.ba + "-header-row'>";
        innerHTML += "<td align='left' class='" + aF.aV + "-cl-header' onMouseOver='glbCalendars[" + aF.dc + "].ac(this);'>";
        innerHTML += "<img src='" + aF.ba + "/prev.gif' border='0' onClick='window.event.returnValue=false;return false;' onMouseDown='glbCalendars[" + aF.dc + "].prevMonth();return false;' style='cursor:hand;cursor:pointer;' />";
        innerHTML += "</td>";
        innerHTML += "<td align='center' class='" + aF.aV + "-cl-header' onMouseOver='glbCalendars[" + aF.dc + "].ac(this);'>";
        if (aF.bl == 2) dQ = "onMouseOver";
        else if (aF.bl == 1) dQ = "onClick";
        innerHTML += "<span class='" + aF.aV + "-cl-header' " + dQ + "='return glbCalendars[" + aF.dc + "].av(event);' " + (dQ == "none" ? "style='cursor:default;'": "style='cursor:hand;cursor:pointer;text-decoration:underline;'") + ">";
        innerHTML += aF.aryMonths[aF.bE];
        innerHTML += "</span>&nbsp;";
        if (aF.bv == 2) dS = "onMouseOver";
        else if (aF.bv == 1) dS = "onClick";
        innerHTML += "<span class='" + aF.aV + "-cl-header' " + dS + "='return glbCalendars[" + aF.dc + "].aw(event);' " + (dS == "none" ? "style='cursor:default;'": "style='cursor:hand;cursor:pointer;text-decoration:underline;'") + ">";
        innerHTML += aF.bF;

        innerHTML += "</span>";
        innerHTML += "</td>";
        innerHTML += "<td align='right' class='" + aF.aV + "-cl-header' onMouseOver='glbCalendars[" + aF.dc + "].ac(this);'>";
        innerHTML += "<img src='" + aF.ba + "/next.gif' border='0' onClick='window.event.returnValue=false;return false;' onMouseDown='glbCalendars[" + aF.dc + "].nextMonth();return false;' style='cursor:hand;cursor:pointer;' />";
        innerHTML += "</td>";
        innerHTML += "</tr>";
        innerHTML += "<tr>";
        innerHTML += "<td colspan=4 style='background-color:white;'>";
        innerHTML += "<table cellspacing=0 cellpadding=0 border=0 class='" + aF.aV + "-cl-innertable'>";
        if (aF.aX) {
            innerHTML += "<tr class='" + aF.aV + "-cl-days'>";
            for (var x = 0; x < 7; x++) {
                innerHTML += "<td class='" + aF.aV + "-cl-day' onMouseOver='glbCalendars[" + aF.dc + "].ac(this);' onMouseOut='glbCalendars[" + aF.dc + "].ab(this);'>";
                innerHTML += aF.aryDays[aF.bd + x];
                innerHTML += "</td>";
            }
            innerHTML += "</tr>";
        }
        var dP;
        for (var i = 1; i < 42;) {
            innerHTML += "<tr>";
            for (var j = 0; j < 7; ++j, i++) {
                dP = aF.bc ? aF.bc.value: null;
                cR = aF.I(aF.aO[i - 1 + aF.bd]);
                dR = aF.I(aF.aO[i - 1 + aF.bd]);
                dN = aF.aO[i - 1 + aF.bd].getMonth() == aF.bE ? "cl-on-month": "cl-off-month";
                if (!aF.X(dR)) {
                    dN = " " + aF.aV + "-old";
                } else if (dP == dR) {
                    dN = " " + aF.aV + "-tgt";
                } else if (aF.I(new Date().toGMTString()) == dR) {
                    dN = " " + aF.aV + "-today";
                }
                innerHTML += "<td class='" + aF.aV + "-" + dN + "' onMouseOver='glbCalendars[" + aF.dc + "].ac(this);' onMouseOut='glbCalendars[" + aF.dc + "].ab(this);' title='" + cR + "' style='cursor: hand; cursor: pointer;' " + aF.aR + "='" + dR + "' onClick='glbCalendars[" + aF.dc + "].ai(this);'>";
                innerHTML += aF.aO[i - 1 + aF.bd].getDate();
                innerHTML += "</td>";
            }
            innerHTML += "</tr>";
        }
        innerHTML += "</table>";
        innerHTML += "</td>";
        innerHTML += "</tr>";
        innerHTML += "</table>";
        return (innerHTML);
    };
    function Y(cB, dV) {
        if (document.getElementById) {
            document.getElementById(cB).innerHTML = dV;
        } else if (document.all) {
            document.all[cB].innerHTML = dV;
        } else if (document.layers) {
            with(document.layers[cB].document) {
                open();
                write(dV);
                close();
            }
        }
        return null;
    };
    function N(e) {
        var de = 0;
        var df = 0;
        if (!e) e = window.event;
        if (e) {
            if (e.pageX || e.pageY) {
                de = e.pageX + "px";
                df = e.pageY + "px";
            } else if (e.clientX || e.clientY) {
                de = e.clientX + document.body.scrollLeft + "px";
                df = e.clientY + document.body.scrollTop + "px";
            }
        }
        var dq = {
            x: de,
            y: df
        };
        return dq;
    };
    function z(aA, aE) {
        var dq, dr, ds;
        dr = parseInt(aA.x) + parseInt(aE.x);
        ds = parseInt(aA.y) + parseInt(aE.y);
        dq = {
            x: dr,
            y: ds
        };
        return dq;
    };
    function L() {
        var de = 0;
        var df = 0;
        var dv;
        dv = G(document.getElementById("img_" + aF.bP));
        var dq = {
            x: dv[0],
            y: dv[1]
        };
        return dq;
    };
    function ar() {
        if (aF.cr) {
            clearInterval(aF.cr);
            aF.cr = null;
        }
        aF.cr = setInterval("glbCalendars[" + aF.dc + "].R()", aF.aY);
    };
    function aq() {
        if (aF.cM) {
            clearInterval(aF.cM);
            aF.cM = null;
        }
        aF.cM = setInterval("glbCalendars[" + aF.dc + "].T()", 4000);
        aF.ar();
    };
    function at() {
        if (aF.eb) {
            clearInterval(aF.eb);
            aF.eb = null;
        }
        aF.eb = setInterval("glbCalendars[" + aF.dc + "].U()", 4000);
        aF.ar();
    };
    function A(ct) {
        var dq;
        if (ct <= 9) {
            dq = aF.bw ? "0" + ct: ct;
        } else dq = ct;
        return dq;
    };
    function al(aS, cQ) {
        var bI = O(aS);
        var dY = P();
        if (bI["dx"] + cQ["x"] > dY["x"]) aS.style.left = cQ["x"] - bI["dx"] + "px";
        else aS.style.left = cQ["x"];
        if (bI["dy"] + cQ["y"] > dY["y"]) aS.style.top = cQ["y"] - bI["dy"] + "px";
        else {
            aS.style.top = cQ["y"];
        }
        if (aS.style.top <= 0) aS.style.top = 1;
        if (aS.style.left <= 0) aS.style.left = 1;
    };
    function ao(cc, aS) {
        var bI = O(aS);
        if (bI.x > 0) {
            cc.style.left = bI.x;
            cc.style.top = bI.y;
            cc.style.width = bI.dx;
            cc.style.height = bI.dy;
            cc.style.zIndex = 0;
            cc.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';
        }
    };
    function ap(aS, mo) {
        var aU = O(aS);
        var bI = O(mo);
        var dY = P();
        var aT = aU["dx"] / 2;
        var cG = bI["dx"] / 2;
        var cH = aU["x"] - (cG - aT);
        var cI = aU["dy"] + aU["y"];
        mo.style.left = cH + "px";
        if (cI + bI["dy"] > dY["y"]) mo.style.top = cI - bI["dy"];
        else mo.style.top = cI + "px";
    };
    function as(aS, yr) {
        var aU = O(aS);
        var ec = O(yr);
        var dY = P();
        if (ec["dx"] + aU["x"] + aU["dx"] > dY["x"]) yr.style.left = dY["x"] - ec["dx"];
        else yr.style.left = aU["x"] + aU["dx"] + "px";
        if (ec["dy"] + aU["y"] > dY["y"]) yr.style.top = aU["y"];
        else yr.style.top = aU["y"] + "px";
    };
    function setDefDate() {
        var dP;
        if (aF.bc) {
            dP = aF.bc.value;
            if (aF.bc.value != "") {
                co = aF.ad(dP.replace(/\./g, "-"), !this.dh);
                if (co == null) co = new Date(aF.K(dP, aF.bk));
            } else co = new Date();
        } else co = new Date();
        if (isNaN(co)) aF.bC = new Date();
        else aF.bC = co;
        aF.F();
        Y(aF.bP, J());
    };
    function X(dD) {
        var bJ = aF.I(new Date());
        if (aF.bs == 1 && aF.K(dD, aF.bk) < aF.K(bJ, aF.bk)) {
            return false;
        } else if (aF.bs == 2 && aF.K(dD, aF.bk) <= aF.K(bJ, aF.bk)) {
            return false;
        }
        return true;
    };
    var aF;
};
function t() {};
function f(aN) {
    this.dk = new Array();
    this.dj = new Array();
    this.k = k;
    this.Item = Item;
    k(aN, this);
    function k(aM, aJ) {
        var i, aP;
        var dF, dJ;
        if (aM) aP = aM.split(";");
        else return;
        var dF, dK, cp;
        for (i = 0; i < aP.length; i++) {
            cp = aP[i].indexOf(":");
            if (cp > 0) {
                dF = aP[i].substring(0, cp).toUpperCase();
                dJ = aP[i].substring(cp + 1, aP[i].length);
                if (dJ.toLowerCase() == "true") dJ = true;
                else if (dJ.toLowerCase() == "false") dJ = false;
                aJ.dj[i] = dF;
                aJ.dk[i] = dJ;
            }
        }
    };
    function Item(aK) {
        var i;
        for (i = 0; i < this.dj.length; i++) {
            if (this.dj[i] == aK) {
                return this.dk[i];
            }
        }
        return null;
    }
};
function docClick(bS) {
    var aB = false;
    var cO = {
        x: 0,
        y: 0
    };
    if (window.event) {
        cO.x = event.clientX + document.body.scrollLeft;
        cO.y = event.clientY + document.body.scrollTop;
    } else if (bS) {
        cO.x = bS.pageX;
        cO.y = bS.pageY;
    }
    for (var i = 0; i < glbCalendars.length; i++) {
        if (!ag(cO, glbCalendars[i].rect) && !ag(cO, glbCalendars[i].cL) && !ag(cO, glbCalendars[i].ea)) {
            glbCalendars[i].R();
        } else aB = true;
        glbCalendars[i].cw = false;
    }
};
function ag(di, rect) {

    if ((di.x > rect.x && di.x < rect.x + rect.dx) && (di.y > rect.y && di.y < rect.y + rect.dy)) return true;
    return false;
};
function O(aL) {
    var dM = {
        x: 0,
        y: 0,
        dx: 0,
        dy: 0
    };
    if (aL != null) {
        dM.dy = aL.offsetHeight;
        dM.dx = aL.offsetWidth;
        while (aL) {
            dM.x += aL.offsetLeft;
            dM.y += aL.offsetTop;
            aL = aL.offsetParent;
        }
        return (dM);
    }
};
function P() {
    var dM = {
        x: 0,
        y: 0
    };
    if (document.body.clientWidth) {
        dM.x += document.body.clientWidth;
        dM.y += document.body.clientHeight;
    } else if (window.innerWidth) {
        dM.x += window.innerWidth;
        dM.y += window.innerHeight;
    }
    return (dM);
};
var cd = "";
if (typeof(document.media) == 'string' && document.getElementById && document.all) cd = "ie6";
else if (document.getElementById && document.all) cd = "ie5";
else if (document.getElementById && !document.all) cd = "ns6";
else if (document.all) cd = "ie4";
else if (document.layers) cd = "ns4";
else cd = "other";
var cg = 9999;
switch (cd) {
case "ie5":
case "ie6":
    if (document.attachEvent) document.attachEvent('onclick', docClick);
    break;
case "ns6":
    break;
case "ns4":
    break;
}
function H(e) {
    if (typeof e == 'undefined') e = window.event;
    if (e) {
        if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
        if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
    }
    return e;
};
function W() {
    if (cd == "ie6" && !window.db) {
        if (!document.getElementsByTagName("select")) cf = false;
        else cf = true;
    } else cf = false;
};
function ah(vl) {
    var S = vl,
    D;
    S = S.replace(/(\d+).(\d+).(\d+)/, '$3/$2/$1');
    S = S.replace(/^(\d\d\/)/, '20$1');
    D = new Date(S);
    return D;
};
function G(cX) {
    var bG = bH = 0;
    if (cX.offsetParent) {
        bG = cX.offsetLeft;
        bH = cX.offsetTop;
        while (cX = cX.offsetParent) {
            bG += cX.offsetLeft;
            bH += cX.offsetTop
        }
    }
    return [bG, bH];
};
var glbCalendars = Array();
var cf = Array();

//************codigo de erick**************///////
var indiceFilaFormulario=1;
    function addLine(i){
		if(indiceFilaFormulario < i){
   indiceFilaFormulario = i;
		}
		 myNewRow = document.getElementById("tablaFormulario").insertRow(-1);
		 myNewRow.id=indiceFilaFormulario;
		 
		 myNewCell=myNewRow.insertCell(-1);
		 myNewCell.innerHTML="<td><input type='text' name='cantidad["+indiceFilaFormulario+"]' id='cantidad["+indiceFilaFormulario+"]' ></td>";
myNewCell=myNewRow.insertCell(-1);
		 myNewCell.innerHTML="<img src= images/delete2.jpg onclick='removeLine(this)'>";		 
		 
		 
		 indiceFilaFormulario++;
	}
	
	var indiceFilaFormulario2=1;
    function addLine2(i2){
		if(indiceFilaFormulario2 < i2){
   indiceFilaFormulario2 = i2;
		}
		 myNewRow = document.getElementById("tablaFormulario2").insertRow(-1);
		 myNewRow.id=indiceFilaFormulario2;
		 
		 myNewCell=myNewRow.insertCell(-1);
		 myNewCell.innerHTML="<td><input type='text' name='cantidad2["+indiceFilaFormulario2+"]' id='cantidad2["+indiceFilaFormulario2+"]' title='noEntra' ></td>";
myNewCell=myNewRow.insertCell(-1);
		 myNewCell.innerHTML="<img src= images/delete2.jpg onclick='removeLine(this)'>";		 
		 
		 
		 indiceFilaFormulario2++;
	}
	 
	function removeLine(obj){
		 var oTr = obj;
		 while(oTr.nodeName.toLowerCase()!='tr'){
			  oTr=oTr.parentNode;
		 }
		 var root = oTr.parentNode;
		 root.removeChild(oTr);
	}
	
	
	function valida_empresa(value)
{
	if (value == 'empresa')
	{
		//alert("entro empresa");
		document.getElementById("nombres").disabled = 'disabled';
		document.getElementById("apellidos").disabled = 'disabled';
		document.getElementById("dia_nac").disabled = 'disabled';
		document.getElementById("mes_nac").disabled = 'disabled';
		document.getElementById("profesion").disabled = 'disabled';
		document.getElementById("cargo_").disabled = 'disabled';
		document.getElementById("ocupacion").disabled = 'disabled';
		document.getElementById("estudiante").disabled = 'disabled';
		document.getElementById("docente").disabled = 'disabled';
		
	}
	else if (value == 'usuario')
		{
		//alert("entro usuario");
		document.getElementById("nombres").disabled = '';
		document.getElementById("apellidos").disabled = '';
		document.getElementById("dia_nac").disabled = '';
		document.getElementById("mes_nac").disabled = '';
		document.getElementById("profesion").disabled = '';
		document.getElementById("cargo_").disabled = '';
		document.getElementById("ocupacion").disabled = '';
		document.getElementById("estudiante").disabled = '';
		document.getElementById("docente").disabled = '';
	}
}


function Disponibles(cant)
{
	
	var cantidad = document.getElementById("empresas").value;
	var cantidad = cantidad.split('|');
	if (cantidad[1] != 0)
	{
		 
		document.getElementById("disponibles").value = cantidad[1];
	}
	else
	{
		alert("Esta empresa no tiene suscripciones disponibles.");
		document.getElementById("disponibles").value = "";
	}
	if(cant == 0)
	{
		document.getElementById("disponibles").value = "";
	}
}



function validar_guardar_notipaquete(){
	
	//alert(tipo);
	if(validarProceso())
	{
		return;
	}
	else
	{
		proceso=true;
	}
	var mensaje="Faltan los siguientes campos:  \n\n";

	if(document.getElementById('empresas').value == 0 ){
		afectar('empresas');
		mensaje=mensaje+"- Empresas\n";
	}
	
	if(document.getElementById('cantidad_susc').value == 0 ){
		afectar('cantidad_susc');
		mensaje=mensaje+"- Cantidad de Suscripciones \n";
	}
	
	if(document.getElementById('estado').value == 0 ){
		afectar('estado');
		mensaje=mensaje+"- Estado Suscripcion\n";
	}
		
		if(document.getElementById('tipo_plan').value == 0){
		afectar('tipo_plan');
		mensaje=mensaje+"- Tipo suscripcion \n";
	}
		if(document.getElementById('cantidad').value == 0){
		afectar('cantidad');
		mensaje=mensaje+"- Cantidad de ediciones \n";
	}
		if(document.getElementById('desde').value == 0){
		afectar('desde');
		mensaje=mensaje+"- Campo desde  \n";
	}
		if(document.getElementById('hasta').value == 0){
		afectar('hasta');
		mensaje=mensaje+"- Hasta esta \n";
	}
	//**************************verifica que no sea una cortesia**************************
	if(document.getElementById('tipo_plan').value != 4){
		
		if(document.getElementById('forma_pago').value == 0){
		afectar('forma_pago');
		mensaje=mensaje+"- Forma de pago \n";
		}
	
	    if(document.getElementById('forma_pago').value == 2){
				
				if(document.getElementById('num_cheque').value == "")
				{
				afectar('num_cheque');
				mensaje=mensaje+"- Numero del cheque \n";
				}	
				
				if(document.getElementById('cod_banco').value == "")
				{
				afectar('cod_banco');
				mensaje=mensaje+"- Codigo de banco \n";
				}	
	} 
	
		if(document.getElementById('forma_pago').value == 4){
				
				if(document.getElementById('num_factura').value == "")
				{
				afectar('num_factura');
				mensaje=mensaje+"- Numero de Factura\n";
				}	
				
				
	} 
		if(document.getElementById('forma_pago').value == 3){
				
			if(document.getElementById('suscriptor').checked == false && document.getElementById('suscriptor_otro').checked == false)
				{
				afectar('suscriptor');
				afectar('suscriptor_otro');
				mensaje=mensaje+"- Suscriptor Tarjeta \n";
				}
				if(document.getElementById('nombre_suscr').value == "")
				{
				afectar('nombre_suscr');
				mensaje=mensaje+"- Nombre Suscriptor Tarjeta \n";
				}
				if(document.getElementById('cedula_suscr').value == "")
				{
				afectar('cedula_suscr');
				mensaje=mensaje+"- Cedula Suscriptor Tarjeta \n";
				}
				if(document.getElementById('direccion_suscr').value == "")
				{
				afectar('direccion_suscr');
				mensaje=mensaje+"- Direccion Suscriptor Tarjeta \n";
				}
				if(document.getElementById('telefono_suscr').value == "")
				{
				afectar('telefono_suscr');
				mensaje=mensaje+"- Telefono Suscriptor Tarjeta \n";
				}
				if(document.getElementById('comprobante').value == "")
				{
				afectar('comprobante');
				mensaje=mensaje+"- Comprobante \n";
				}	
				
				if(document.getElementById('num_tarjeta').value == "")
				{
				afectar('num_tarjeta');
				mensaje=mensaje+"- Numero de tarjeta \n";
				}
				if(document.getElementById('fecha_vencimiento').value == "")
				{
				afectar('fecha_vencimiento');
				mensaje=mensaje+"- Fecha de vencimiento \n";
				}
				if(document.getElementById('franquicia').value == "")
				{
				afectar('franquicia');
				mensaje=mensaje+"- Franquicia \n";
				}

	} 

	if(document.getElementById('forma_pago').value == 1){
								
				if(document.getElementById('tipo_pago').value == 0)
				{
				afectar('tipo_pago');
				mensaje=mensaje+"- Tipo de pago \n";
				}
				if(document.getElementById('fecha').value == "")
				{
				afectar('fecha');
				mensaje=mensaje+"- Fecha de Transaccion \n";
				}
				if(document.getElementById('numero').value == "")
				{
				afectar('numero');
				mensaje=mensaje+"- Numero de transaccion \n";
				}
	} 
	}
		else {
			if(document.getElementById('autorizador').value == "")
				{
				afectar('autorizador');
				mensaje=mensaje+"- Autorizador cortesia \n";
				}
		}	
		
	var n_cheque="";
	var	c_banco="";
	var	suscriptor="";
	var	suscriptor_otro="";
	var	nom_suscr="";
	var	ced_suscr="";
	var	direc_suscr="";
	var	tel_suscr="";
	var	comprobante="";
	var	n_tarjeta="";
	var	f_vencimiento="";
	var	franquicia="";
	var	t_pago="";
	var	fecha="";
	var	numero="";
	var n_factura="";
	var autorizador="";
	var observaciones="";
	
	tip_plan=document.getElementById('tipo_plan').value;
	
	if(document.getElementById('tipo_plan').value == 4){	
	autorizador=document.getElementById('autorizador').value;
	}
	cant=document.getElementById('cantidad').value;
	desde=document.getElementById('desde').value;
	hasta=document.getElementById('hasta').value;
	f_pago=document.getElementById('forma_pago').value;
	estado=document.getElementById('estado').value;
	
	
	if(document.getElementById('forma_pago').value == 2){
		n_cheque=document.getElementById('num_cheque').value;
		c_banco=document.getElementById('cod_banco').value;
	}	
	if(document.getElementById('forma_pago').value == 4){
		n_factura=document.getElementById('num_factura').value;
	}
	if(document.getElementById('forma_pago').value == 3){	
		suscriptor=document.getElementById('suscriptor').value;
		suscriptor_otro=document.getElementById('suscriptor_otro').value;
		nom_suscr=document.getElementById('nombre_suscr').value;
		ced_suscr=document.getElementById('cedula_suscr').value;
		direc_suscr=document.getElementById('direccion_suscr').value;
		tel_suscr=document.getElementById('telefono_suscr').value;
		comprobante=document.getElementById('comprobante').value;
		n_tarjeta=document.getElementById('num_tarjeta').value;
		f_vencimiento=document.getElementById('fecha_vencimiento').value;
		franquicia=document.getElementById('franquicia').value;
	}
	if(document.getElementById('forma_pago').value == 1){
		t_pago=document.getElementById('tipo_pago').value;
		fecha=document.getElementById('fecha').value;
		numero=document.getElementById('numero').value;
	}
	autorizador=document.getElementById('autorizador').value;
	//recibo_caja=document.getElementById('recibo_caja').value;	
	id_vendedor=document.getElementById('id_vendedor').value;
	valorventa=document.getElementById('valorventa').value;
	observaciones=document.getElementById('observaciones').value;
	
	empresa = document.getElementById('empresas').value;
	cant_susc=document.getElementById('cantidad_susc').value; 
	


	var variables= "?empresas=" + empresa + "&cant_susc=" + cant_susc
	+ "&tipo_plan=" + tip_plan + "&cantidad=" + cant
	+ "&desde=" + desde + "&hasta=" + hasta
	+ "&forma_pago=" + f_pago + "&estado=" + estado + "&num_cheque=" + n_cheque
	+ "&cod_banco=" + c_banco + "&num_factura=" + n_factura
	+ "&suscriptor=" + suscriptor + "&suscriptor_otro=" + suscriptor_otro
	+ "&nombre_suscr=" + nom_suscr + "&cedula_suscr=" + ced_suscr
	+ "&direccion_suscr=" + direc_suscr + "&telefono_suscr=" + tel_suscr
	+ "&comprobante=" + comprobante + "&num_tarjeta=" + n_tarjeta
	+ "&fecha_vencimiento=" + f_vencimiento + "&franquicia=" + franquicia  + "&tipo_pago=" + t_pago
	+ "&fecha=" + fecha + "&numero=" + numero + "&autorizador=" + autorizador 
	+ "&id_vendedor=" + id_vendedor + "&autorizador=" + autorizador
	+ "&valorventa=" + valorventa + "&observaciones=" + observaciones;
	
variables = variables.replace("#","|");
//alert ("variables = "+variables);
	
	

	if (mensaje == "Faltan los siguientes campos:  \n\n")
		{
			
			archivo = "insertar_notipaquete.php";
			a=new nuevoAjax();
			a.open("POST", archivo+variables,true);
			a.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			a.send(variables);
			
			a.onreadystatechange=function() {
			if (a.readyState==4) {
				alert(a.responseText);
				location.href = "nueva_suscripcion.php";
				window.showModalDialog("GenerarRecibo_noticreto.php"+variables,"Recibo de caja","dialogWidth:800px;dialogHeight:600px");
				setTimeout(w,1000);
	 		}
		}
		}
	else{
			alert(mensaje);
			return;
		}
}


function ValidarGuardarSuscripcionNotipaquete(){
	
	//alert(tipo);
	if(validarProceso())
	{
		return;
	}
	else
	{
		proceso=true;
	}
	var mensaje="Faltan los siguientes campos:  \n\n";
	
	if(document.getElementById('documento').value == ""){
		afectar('documento');
		mensaje=mensaje+"- Documento\n";
	}
	if(document.getElementById('nombres').value == ""){

				if(document.getElementById('nombres').disabled != true){
					afectar('nombres');
					mensaje=mensaje+"- Nombre \n";
				}
				
				
	}
	if(document.getElementById('apellidos').value == ""){

				if(document.getElementById('apellidos').disabled != true){
					afectar('apellidos');
					mensaje=mensaje+"- Apellidos \n";
				}
				
	}
		if(document.getElementById('direccion').value == ""){
		afectar('direccion');
		mensaje=mensaje+"- Direccion \n";
	}
		if(document.getElementById('pais').value == 0){
		afectar('pais');
		mensaje=mensaje+"- Pais \n";
	}
		if(document.getElementById('ciudad').value == 0){
		afectar('ciudad');
		mensaje=mensaje+"- Ciudad \n";
	}
	
	if(document.getElementById('telefono').value == ""){
		afectar('telefono');
		mensaje=mensaje+"- Telefono \n";
	}

	if(document.getElementById('empresas').value == 0){
		afectar('empresas');
		mensaje=mensaje+"- Notipaquete Empresa \n";
	}
	
	if(document.getElementById('disponibles').value == ""){
		afectar('disponibles');
		mensaje=mensaje+"- Disponibles \n";
	}

	docu=document.getElementById('documento').value;
	nomb=document.getElementById('nombres').value;
	apel=document.getElementById('apellidos').value;
	dian=document.getElementById('dia_nac').value;
	mesn=document.getElementById('mes_nac').value;
	empr=document.getElementById('empresa').value;
	carg=document.getElementById('cargo_').value;
	prof=document.getElementById('profesion').value;
	ocup=document.getElementById('ocupacion').value;
	dire=document.getElementById('direccion').value;
	ema1=document.getElementById('email').value;
	tele=document.getElementById('telefono').value;
	nfax=document.getElementById('fax').value;
	pais=document.getElementById('pais').value;
	ciud=document.getElementById('ciudad').value;
	club_=document.getElementById('club').value;
	t1=document.getElementById('tema1');
	t2=document.getElementById('tema2');
	t3=document.getElementById('tema3');
	t4=document.getElementById('tema4');
	tint=""
	t5=document.getElementById('tema5');
	if(t1.checked){
		tint="@1@";
	}
	if(t2.checked){
		if(tint=="")
			tint="@2@";
		else
			tint=tint+",@2@";
	}
	if(t3.checked){
		if(tint=="")
			tint="@3@";
		else
			tint=tint+",@3@";
	}
	if(t4.checked){
		if(tint=="")
			tint="@4@";
		else
			tint=tint+",@4@";
	}
	if(t5.checked){
		if(tint=="")
			tint="@5@";
		else
			tint=tint+",@5@";
	}
	
	id_usuario = document.getElementById('id_cliente').value;
	notipaquete = document.getElementById('empresas').value;
	disponibles = document.getElementById('disponibles').value;


	var variables= "?id=" + id_usuario + "&docu=" + docu + "&nomb=" + nomb 
	+ "&apel=" + apel + "&dian=" + dian + "&mesn=" 
	+ mesn + "&empr=" + empr + "&carg=" + carg 
	+ "&prof=" + prof + "&ocup=" + ocup + "&dire=" 
	+ dire + "&ema1=" + ema1 +  "&tele=" + tele 
	+ "&nfax=" + nfax + "&pais=" + pais + "&ciud=" 
	+ ciud +"&club=" +club_ + "&interes=" + tint
	+ "&notipaquete=" +notipaquete + "&disponibles=" +disponibles ;
	
variables = variables.replace("#","|");
//alert ("variables = "+variables);
	
	

	if (mensaje == "Faltan los siguientes campos:  \n\n")
		{
			
			archivo = "guardar_suscripcion_notipaquete.php";
			a=new nuevoAjax();
			a.open("POST", archivo+variables,true);
			a.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			a.send(variables);
			
			a.onreadystatechange=function() {
			if (a.readyState==4) {
				alert(a.responseText);
				location.href = "nueva_suscripcion.php";
				setTimeout(w,1000);
	 		}
		}
		}
	else{
			alert(mensaje);
			return;
		}
		
		

		
}




function validar_guardar_suscripcion_multiple(id_suscripcion,tipo){
	
	if(document.getElementById("multiples").value =='0')
	{
		
		alert("No tiene suscripciones adicionales");
		afectar('multiples');
		if(confirm('¿ Desea agregar suscripciones adicionales ?'))
		{
			document.getElementById("multiples").value = "";
			document.getElementById("multiples").readOnly =""; 
			document.getElementById("multiples").focus(); 
		}
		else
		{
			location.href = "nueva_suscripcion.php";
		}
		return;
	}
	
	if(document.getElementById("multiples").value == "")
	{
		alert("- Debe ingresar el numero de suscripciones adicionales.");
		afectar('multiples');
		return;
	}
	else if(document.getElementById("multiples").value != "" && document.getElementById("multiples").value != 0) 
	{
		var cont = document.getElementById("multiples").value - 1;
		document.getElementById("multiples").value = cont;
		document.getElementById("multiples").readOnly ="readOnly"; 
	}

	if(validarProceso())
	{
		return;
	}
	else
	{
		proceso=true;
	}
	var mensaje="Faltan los siguientes campos:  \n\n";
	
	
	if(document.getElementById('estado').value == 0 ){
		afectar('estado');
		mensaje=mensaje+"- Estado Suscripcion\n";
	}
	
	
	if(document.getElementById('documento').value == ""){
		afectar('documento');
		mensaje=mensaje+"- Documento\n";
	}
	
		if(document.getElementById('direccion').value == ""){
		afectar('direccion');
		mensaje=mensaje+"- Direccion \n";
	}
		if(document.getElementById('pais').value == 0){
		afectar('pais');
		mensaje=mensaje+"- Pais \n";
	}
		if(document.getElementById('ciudad').value == 0){
		afectar('ciudad');
		mensaje=mensaje+"- Ciudad \n";
	}
	
		if(document.getElementById('telefono').value == ""){
		afectar('telefono');
		mensaje=mensaje+"- Telefono \n";
	}
	
//******************************************Campos suscripcion***************************************
	
	
	
		if(document.getElementById('tipo_plan').value == 0){
		afectar('tipo_plan');
		mensaje=mensaje+"- Tipo suscripcion \n";
	}
		if(document.getElementById('cantidad').value == 0){
		afectar('cantidad');
		mensaje=mensaje+"- Cantidad de ediciones \n";
	}
		if(document.getElementById('desde').value == 0){
		afectar('desde');
		mensaje=mensaje+"- Campo desde  \n";
	}
		if(document.getElementById('hasta').value == 0){
		afectar('hasta');
		mensaje=mensaje+"- Hasta esta \n";
	}
	//**************************verifica que no sea una cortesia**************************
	if(document.getElementById('tipo_plan').value != 4){
		
		if(document.getElementById('forma_pago').value == 0){
		afectar('forma_pago');
		mensaje=mensaje+"- Forma de pago \n";
	}
	
	    if(document.getElementById('forma_pago').value == 2){
				
				if(document.getElementById('num_cheque').value == "")
				{
				afectar('num_cheque');
				mensaje=mensaje+"- Numero del cheque \n";
				}	
				
				if(document.getElementById('cod_banco').value == "")
				{
				afectar('cod_banco');
				mensaje=mensaje+"- Codigo de banco \n";
				}	
	} 
	
		if(document.getElementById('forma_pago').value == 4){
				
				if(document.getElementById('num_factura').value == "")
				{
				afectar('num_factura');
				mensaje=mensaje+"- Numero de Factura\n";
				}	
				
				
	} 
		if(document.getElementById('forma_pago').value == 3){
				
			if(document.getElementById('suscriptor').checked == false && document.getElementById('suscriptor_otro').checked == false)
				{
				afectar('suscriptor');
				afectar('suscriptor_otro');
				mensaje=mensaje+"- Suscriptor Tarjeta \n";
				}
				if(document.getElementById('nombre_suscr').value == "")
				{
				afectar('nombre_suscr');
				mensaje=mensaje+"- Nombre Suscriptor Tarjeta \n";
				}
				if(document.getElementById('cedula_suscr').value == "")
				{
				afectar('cedula_suscr');
				mensaje=mensaje+"- Cedula Suscriptor Tarjeta \n";
				}
				if(document.getElementById('direccion_suscr').value == "")
				{
				afectar('direccion_suscr');
				mensaje=mensaje+"- Direccion Suscriptor Tarjeta \n";
				}
				if(document.getElementById('telefono_suscr').value == "")
				{
				afectar('telefono_suscr');
				mensaje=mensaje+"- Telefono Suscriptor Tarjeta \n";
				}
				if(document.getElementById('comprobante').value == "")
				{
				afectar('comprobante');
				mensaje=mensaje+"- Comprobante \n";
				}	
				
				if(document.getElementById('num_tarjeta').value == "")
				{
				afectar('num_tarjeta');
				mensaje=mensaje+"- Numero de tarjeta \n";
				}
				if(document.getElementById('fecha_vencimiento').value == "")
				{
				afectar('fecha_vencimiento');
				mensaje=mensaje+"- Fecha de vencimiento \n";
				}
				if(document.getElementById('franquicia').value == "")
				{
				afectar('franquicia');
				mensaje=mensaje+"- Franquicia \n";
				}

	} 

	if(document.getElementById('forma_pago').value == 1){
								
				if(document.getElementById('tipo_pago').value == 0)
				{
				afectar('tipo_pago');
				mensaje=mensaje+"- Tipo de pago \n";
				}
				if(document.getElementById('fecha').value == "")
				{
				afectar('fecha');
				mensaje=mensaje+"- Fecha de Transaccion \n";
				}
				if(document.getElementById('numero').value == "")
				{
				afectar('numero');
				mensaje=mensaje+"- Numero de transaccion \n";
				}
	} 
	}
		else {
			if(document.getElementById('autorizador').value == "")
				{
				afectar('autorizador');
				mensaje=mensaje+"- Autorizador cortesia \n";
				}
		}	
	
	
		//if(document.getElementById('recibo_caja').value == 0){
		//afectar('recibo_caja');
		//mensaje=mensaje+"- Numero de recibo de caja \n";
		//}



//******************************************Fin Campos suscripcion***************************************



	docu=document.getElementById('documento').value;
	empr=document.getElementById
			a.open("POST", archivo+variables,true);
			a.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			a.send(variables);('empresa').value;
	carg=document.getElementById('cargo_').value;
	ocup=document.getElementById('ocupacion').value;
	dire=document.getElementById('direccion').value;
	ema1=document.getElementById('email').value;
	tele=document.getElementById('telefono').value;
	nfax=document.getElementById('fax').value;
	pais=document.getElementById('pais').value;
	ciud=document.getElementById('ciudad').value;
	club_=document.getElementById('club').value;
	t1=document.getElementById('tema1');
	t2=document.getElementById('tema2');
	t3=document.getElementById('tema3');
	t4=document.getElementById('tema4');
	tint=""
	t5=document.getElementById('tema5');
	if(t1.checked){
		tint="@1@";
	}
	if(t2.checked){
		if(tint=="")
			tint="@2@";
		else
			tint=tint+",@2@";
	}
	if(t3.checked){
		if(tint=="")
			tint="@3@";
		else
			tint=tint+",@3@";
	}
	if(t4.checked){
		if(tint=="")
			tint="@4@";
		else
			tint=tint+",@4@";
	}
	if(t5.checked){
		if(tint=="")
			tint="@5@";
		else
			tint=tint+",@5@";
	}
	
	var n_cheque="";
	var	c_banco="";
	var	suscriptor="";
	var	suscriptor_otro="";
	var	nom_suscr="";
	var	ced_suscr="";
	var	direc_suscr="";
	var	tel_suscr="";
	var	comprobante="";
	var	n_tarjeta="";
	var	f_vencimiento="";
	var	franquicia="";
	var	t_pago="";
	var	fecha="";
	var	numero="";
	var n_factura="";
	var autorizador="";
	var observaciones="";
	
	tip_plan=document.getElementById('tipo_plan').value;
	
	if(document.getElementById('tipo_plan').value == 4){	
	autorizador=document.getElementById('autorizador').value;
	}
	cant=document.getElementById('cantidad').value;
	desde=document.getElementById('desde').value;
	hasta=document.getElementById('hasta').value;
	f_pago=document.getElementById('forma_pago').value;
	estado=document.getElementById('estado').value;
	
	
	if(document.getElementById('forma_pago').value == 2){
		n_cheque=document.getElementById('num_cheque').value;
		c_banco=document.getElementById('cod_banco').value;
	}	
	if(document.getElementById('forma_pago').value == 4){
		n_factura=document.getElementById('num_factura').value;
	}
	if(document.getElementById('forma_pago').value == 3){	
		suscriptor=document.getElementById('suscriptor').value;
		suscriptor_otro=document.getElementById('suscriptor_otro').value;
		nom_suscr=document.getElementById('nombre_suscr').value;
		ced_suscr=document.getElementById('cedula_suscr').value;
		direc_suscr=document.getElementById('direccion_suscr').value;
		tel_suscr=document.getElementById('telefono_suscr').value;
		comprobante=document.getElementById('comprobante').value;
		n_tarjeta=document.getElementById('num_tarjeta').value;
		f_vencimiento=document.getElementById('fecha_vencimiento').value;
		franquicia=document.getElementById('franquicia').value;
	}
	if(document.getElementById('forma_pago').value == 1){
		t_pago=document.getElementById('tipo_pago').value;
		fecha=document.getElementById('fecha').value;
		numero=document.getElementById('numero').value;
	}
	autorizador=document.getElementById('autorizador').value;
	//recibo_caja=document.getElementById('recibo_caja').value;	
	id_vendedor=document.getElementById('id_vendedor').value;
	valorventa=document.getElementById('valorventa').value;
	observaciones=document.getElementById('observaciones').value;
	
	id_usuario = document.getElementById('id_cliente').value;


	var variables= "?id=" + id_usuario + "&docu=" + docu 
	+ mesn + "&empr=" + empr + "&carg=" + carg + "&dire=" 
	+ dire + "&ema1=" + ema1 +  "&tele=" + tele 
	+ "&nfax=" + nfax + "&pais=" + pais + "&ciud=" 
	+ ciud +"&club=" +club_ + "&interes=" + tint
	+ "&tipo_plan=" + tip_plan + "&cantidad=" + cant
	+ "&desde=" + desde + "&hasta=" + hasta
	+ "&forma_pago=" + f_pago + "&estado=" + estado + "&num_cheque=" + n_cheque
	+ "&cod_banco=" + c_banco + "&num_factura=" + n_factura
	+ "&suscriptor=" + suscriptor + "&suscriptor_otro=" + suscriptor_otro
	+ "&nombre_suscr=" + nom_suscr + "&cedula_suscr=" + ced_suscr
	+ "&direccion_suscr=" + direc_suscr + "&telefono_suscr=" + tel_suscr
	+ "&comprobante=" + comprobante + "&num_tarjeta=" + n_tarjeta
	+ "&fecha_vencimiento=" + f_vencimiento + "&franquicia=" + franquicia  + "&tipo_pago=" + t_pago
	+ "&fecha=" + fecha + "&numero=" + numero
	+ "&autorizador=" + autorizador 
	+ "&id_vendedor=" + id_vendedor + "&autorizador=" + autorizador
	+ "&valorventa=" + valorventa + "&observaciones=" + observaciones;
	
variables = variables.replace("#","|");
	

	if (mensaje == "Faltan los siguientes campos:  \n\n")
		{
			
			archivo = "editar_usuario.php";
			a=new nuevoAjax();
			
			a.onreadystatechange=function() {
			if (a.readyState==4) {
				alert(a.responseText);
				window.showModalDialog("GenerarRecibo_noticreto.php"+variables,"Recibo de caja","dialogWidth:800px;dialogHeight:600px");
				setTimeout(w,1000);
	 		}
		}
		}
	else{
			alert(mensaje);
			return;
		}
		
		

		
}


function cargar_nombre(id,name)
{
	opener.document.getElementById("cliente").value = name;
	opener.document.getElementById("id_cliente").value = id;
	window.close();
}

