﻿temp_idu = 1;
var validarformulariocount = 1;
var FlashDetect = new function () {
    var self = this; self.installed = false; self.raw = ""; self.major = -1; self.minor = -1; self.revision = -1; self.revisionStr = ""; var activeXDetectRules = [{ "name": "ShockwaveFlash.ShockwaveFlash.7", "version": function (obj) { return getActiveXVersion(obj); } }, { "name": "ShockwaveFlash.ShockwaveFlash.6", "version": function (obj) {
        var version = "6,0,21"; try { obj.AllowScriptAccess = "always"; version = getActiveXVersion(obj); } catch (err) { }
        return version;
    } 
    }, { "name": "ShockwaveFlash.ShockwaveFlash", "version": function (obj) { return getActiveXVersion(obj); } }]; var getActiveXVersion = function (activeXObj) {
        var version = -1; try { version = activeXObj.GetVariable("$version"); } catch (err) { }
        return version;
    }; var getActiveXObject = function (name) {
        var obj = -1; try { obj = new ActiveXObject(name); } catch (err) { obj = { activeXError: true }; }
        return obj;
    }; var parseActiveXVersion = function (str) { var versionArray = str.split(","); return { "raw": str, "major": parseInt(versionArray[0].split(" ")[1], 10), "minor": parseInt(versionArray[1], 10), "revision": parseInt(versionArray[2], 10), "revisionStr": versionArray[2] }; }; var parseStandardVersion = function (str) { var descParts = str.split(/ +/); var majorMinor = descParts[2].split(/\./); var revisionStr = descParts[3]; return { "raw": str, "major": parseInt(majorMinor[0], 10), "minor": parseInt(majorMinor[1], 10), "revisionStr": revisionStr, "revision": parseRevisionStrToInt(revisionStr) }; }; var parseRevisionStrToInt = function (str) { return parseInt(str.replace(/[a-zA-Z]/g, ""), 10) || self.revision; }; self.majorAtLeast = function (version) { return self.major >= version; }; self.minorAtLeast = function (version) { return self.minor >= version; }; self.revisionAtLeast = function (version) { return self.revision >= version; }; self.versionAtLeast = function (major) { var properties = [self.major, self.minor, self.revision]; var len = Math.min(properties.length, arguments.length); for (i = 0; i < len; i++) { if (properties[i] >= arguments[i]) { if (i + 1 < len && properties[i] == arguments[i]) { continue; } else { return true; } } else { return false; } } }; self.FlashDetect = function () { if (navigator.plugins && navigator.plugins.length > 0) { var type = 'application/x-shockwave-flash'; var mimeTypes = navigator.mimeTypes; if (mimeTypes && mimeTypes[type] && mimeTypes[type].enabledPlugin && mimeTypes[type].enabledPlugin.description) { var version = mimeTypes[type].enabledPlugin.description; var versionObj = parseStandardVersion(version); self.raw = versionObj.raw; self.major = versionObj.major; self.minor = versionObj.minor; self.revisionStr = versionObj.revisionStr; self.revision = versionObj.revision; self.installed = true; } } else if (navigator.appVersion.indexOf("Mac") == -1 && window.execScript) { var version = -1; for (var i = 0; i < activeXDetectRules.length && version == -1; i++) { var obj = getActiveXObject(activeXDetectRules[i].name); if (!obj.activeXError) { self.installed = true; version = activeXDetectRules[i].version(obj); if (version != -1) { var versionObj = parseActiveXVersion(version); self.raw = versionObj.raw; self.major = versionObj.major; self.minor = versionObj.minor; self.revision = versionObj.revision; self.revisionStr = versionObj.revisionStr; } } } } } ();
}; FlashDetect.JS_RELEASE = "1.0.4";
function reloadtodo() {
        document.location.href =urlweb;
} 
function abrir() {
    var nueva = window.open("gestion/condiciones.aspx", "Disclamer", "width=600,height=400,toolbar=no,menubar=no,status=yes,scrollbars=yes, top=25, left=25, location=no,resizable=yes");
} 
function comenzando() {
    if (document.getElementById("dlSexo").value == "")
        ErrorMensaje("dlSexo", "diverrSex");
    else {
        //document.location.href = urlweb+"p_co.aspx?u=" + document.getElementById("dlSexo").value;
        document.location.href = urlweb + "a_tot.aspx?u=" + document.getElementById("dlSexo").value;
    }
}
function Registrate() {
  document.location.href = urlweb+"register.aspx";
}
function get_pos_X(element) {
	var current_left = 0;
	
	if (element.offsetParent) {
		while (element.offsetParent) {
			current_left += element.offsetLeft
			element = element.offsetParent;
		}
	} else if (element.x)
		current_left += element.x;
	
	return current_left ;
}
function get_pos_Y(element) {
	var current_top = 0;
	
	if (element.offsetParent) {
		while (element.offsetParent) {
			current_top += element.offsetTop
			element = element.offsetParent;
		}
	} else if (element.y)
		current_top += element.y;
	
	return current_top;
}
function ErrorMensaje(origen,capa)
{
    var textbox = document.getElementById(origen);
    var selectbox = document.getElementById(capa);
    selectbox.style.display = '';
    selectbox.style.position = 'absolute';
    selectbox.style.left = get_pos_X(textbox) + document.getElementById(origen).offsetWidth +15 + 'px';
    selectbox.style.top = (get_pos_Y(textbox)+4 ) + 'px';
    selectbox.style.display='inline';
}
function ERRORusupass()
{
    var textbox = document.getElementById("txtUsuarioRegistrado");
    var selectbox = document.getElementById("diverrRegUP");
    selectbox.style.left = get_pos_X(textbox)  -240 + 'px';
    selectbox.style.top = (get_pos_Y(textbox) +38) + 'px';
    selectbox.style.position = 'absolute';
    selectbox.style.display='inline';
}
function CarProhibidos()
{ 
    var intTecla = event.keyCode; 
    var sLetra = String.fromCharCode(intTecla).toUpperCase();
    var sNoPermitidos = "&¿?#·|'%*<>\"";
    if(sNoPermitidos.indexOf(sLetra) != -1) 
        return false;
}
function trimjs(texto){
	if (texto.length == 1 && texto.charCodeAt(0) == 160) texto = '';
	texto = texto.replace (/^\s*/,'').replace(/\s*$/,'').replace(" ","");
	return(texto);
}
var anima_timerX = 0;
var anima_timerY = 0;
var anima_iX2;
var anima_iY2;
var anima_iX1;
var anima_iY1;
var anima_sIdDiv;
var anima_iVelocidad = 4;
function amina(sDiv, x1, y1, x2, y2) {
    anima_sIdDiv = sDiv;
    anima_iX1 = x1;
    anima_iY1 = y1;
    anima_iX2 = x2;
    anima_iY2 = y2;
    document.getElementById(sDiv).style.display = "inline";
    document.getElementById(sDiv).style.left = x1 + "px";
    document.getElementById(sDiv).style.top = y1 + "px";
    anima_timerX = setInterval("amina_timerX()", 10);
    anima_timerY = setInterval("amina_timerY()", 10);
}
function amina_timerX() {
    var x = parseInt(document.getElementById(anima_sIdDiv).style.left.replace("px", ""), 10);
    if (anima_iX2 > anima_iX1)
        x += Math.ceil(x * anima_iVelocidad / 100);
    else
        x -= Math.ceil(x * anima_iVelocidad / 100);
    if (x < 0) x = 0;
    document.getElementById(anima_sIdDiv).style.left = x + "px";

    if (anima_iX2 > anima_iX1) {
        if (x > anima_iX2) {
            clearInterval(anima_timerX);
            anima_timerX = 0;
        }
    }
    else {
        if (x < anima_iX2) {
            clearInterval(anima_timerX);
            anima_timerX = 0;
        }
    }
}
function amina_timerY() {
    var y = parseInt(document.getElementById(anima_sIdDiv).style.top.replace("px", ""), 10);
    if (anima_iY2 > anima_iY1)
        y += Math.ceil(y * anima_iVelocidad / 100);
    else
        y -= Math.ceil(y * anima_iVelocidad / 100);
    if (y < 0) y = 0;
    document.getElementById(anima_sIdDiv).style.top = y + "px";

    if (anima_iY2 > anima_iY1) {
        if (y > anima_iY2) {
            clearInterval(anima_timerY);
            anima_timerY = 0;
        }
    }
    else {
        if (y < anima_iY2) {
            clearInterval(anima_timerY);
            anima_timerY = 0;
        }
    }
}
function onLoad() {
    var cookmeeu = Cookie_get("cookmeeu");
    var cookmeep = Cookie_get("cookmeep");
    var cookchck = Cookie_get("cookchck");

    if (cookchck == "s") {
        document.getElementById("chkRecordar").checked = true;
        if (cookmeeu != "") 
        {
            document.getElementById("txtUsuarioRegistrado").value = cookmeeu;
            if (cookmeep != "")
                document.getElementById("txtPasswordRegistrado").value = cookmeep;
        }
    }


    document.getElementById("animgratis").style.display="none";
    //var xpos = (get_pos_X(document.getElementById("dlSexo")) + document.getElementById("dlSexo").offsetWidth + 10 + 120);
    var xpos = (get_pos_X(document.getElementById("bAceptarRegistrado")) + - 500);

    amina("animgratis", xpos, 15, xpos, 80);
}
function grabarcookies() {
    if (document.getElementById("chkRecordar").checked) {
        Cookie_set("cookmeeu", document.getElementById("txtUsuarioRegistrado").value.toLowerCase(), 9999999);
        Cookie_set("cookmeep", document.getElementById("txtPasswordRegistrado").value.toLowerCase(), 9999999);
        Cookie_set("cookchck", "s", 9999999);
    }
    else {
        Cookie_set("cookmeeu", document.getElementById("txtUsuarioRegistrado").value.toLowerCase(), 9999999);
        Cookie_set("cookmeep", document.getElementById("txtPasswordRegistrado").value.toLowerCase(), 9999999);
        Cookie_set("cookchck", "", 0);
    }
}
function Cookie_set(c_name, value, segundos) {
    var exdate = new Date();
    exdate.setSeconds(exdate.getSeconds() + segundos);
    document.cookie = c_name + "=" + escape(value) + ((segundos == null) ? "" : ";expires=" + exdate.toUTCString());
}
function Cookie_get(c_name) {
    if (document.cookie.length > 0) {
        c_start = document.cookie.indexOf(c_name + "=");
        if (c_start != -1) {
            c_start = c_start + c_name.length + 1;
            c_end = document.cookie.indexOf(";", c_start);
            if (c_end == -1) c_end = document.cookie.length;
            return unescape(document.cookie.substring(c_start, c_end));
        }
    }
    return "";
}
