Eduify.Splash = {
    OpenFileDialog: function() {
        try {
            var lFile = $j("input[id$=fuPickAPaper]")[0];
            if (lFile.click) {
                lFile.click();
                var lSplittedArray = lFile.value.split("\\");
                lFile = $j("input[id$=txtFileName]")[0];
                lFile.value = lSplittedArray[lSplittedArray.length - 1];
                lFile.title = lSplittedArray[lSplittedArray.length - 1];
            }
            else {
                alert("firefox")
            }
        }
        catch (e) {
            alert(e.description)
        }
    },
    ValidateTermsAgreed: function(source, args) {
        try {
            $j("*[id$='hdnReCaptchaChallange']")[0].value = Recaptcha.get_challenge();
            args.IsValid = $j("*[id$='chkTerms']")[0].checked;
        }
        catch (e) { alert(e.description) }
    },
    hideSigninOD: function() {
        try {
            document.body.removeChild($j('.Elightbox_bg')[0]);
            $j("*[id$='pnlODSignin']")[0].className = 'TC W640 MA Emodal DN BC2';
        }
        catch (e) {
            alert("hideSigninOD: " + e.description)
        }
    },
    displaySigninOD: function() {
        try {
            var lOpDiv = document.createElement('div');
            document.body.appendChild(lOpDiv);
            lOpDiv.className = 'Elightbox_bg DB WP100';
            lOpDiv.style.display = 'block';
            lOpDiv.style.height = document.body.offsetHeight + "px";

            left = Math.ceil((document.body.offsetWidth - 640) / 2);
            $j("*[id$='pnlODSignin']")[0].className = 'TC W640 MA Emodal DB BC2';
            $j("*[id$='pnlODSignin']")[0].style.left = left + "px";
            $j("input[id$='UserName']")[0].focus();
        }
        catch (e) {
            alert("displaySigninOD: " + e.description)
        }
    },
    hideTouOD: function() {
        try {
            document.body.removeChild($j('.Elightbox_bg')[0]);
            $j("#pnlTOU")[0].className = 'TC W912 MA  DN';
        }
        catch (e) {
            alert("hideTouOD: " + e.description)
        }
    },
    displayTouOD: function() {
        try {
            var lOpDiv = document.createElement('div');
            document.body.appendChild(lOpDiv);
            lOpDiv.className = 'Elightbox_bg DB WP100';
            lOpDiv.style.display = 'block';
            lOpDiv.style.height = document.body.offsetHeight + "px";

            left = Math.ceil((document.body.offsetWidth - 912) / 2);
            $j("#pnlTOU")[0].className = 'TC W912 MA Emodal  DB';
            $j("#pnlTOU")[0].style.left = left + "px";
        }
        catch (e) {
            alert("displayTouOD: " + e.description)
        }
    },
    ShowRecoverAccountDialogue: function() {
        try {
            Eduify.Splash.HideRecoverAccountDialogue();
            $j(".Emodal").removeClass("DB").addClass("DN");
            var lOpDiv = document.createElement('div');
            document.body.appendChild(lOpDiv);

            lOpDiv.className = 'Elightbox_bg DB WP100';
            lOpDiv.style.display = 'block';
            lOpDiv.style.height = document.body.offsetHeight + "px";

            left = Math.ceil((document.body.offsetWidth - 570) / 2);
            $j("#pnlRecoverAccount")[0].className = 'TC W554 MA W570  Emodal DB';
            $j("#pnlRecoverAccount")[0].style.left = left + "px";
            $j("input[id$='txtRecoveryEmail']")[0].focus();
        }
        catch (e) { alert(e.description) }
    },
    HideRecoverAccountDialogue: function() {
        try {
            if ($j('.Elightbox_bg')[0]) {
                document.body.removeChild($j('.Elightbox_bg')[0]);
            }
            $j("#pnlRecoverAccount")[0].className = 'TC W554 MA W570  DN';
            $j("*[id$='btnRecoverAccount']")[0].disabled = false;
            $j(".Emodal").removeClass("DB").addClass("DN");
            $j("*[id$='pnlSuccessMessage']").hide();
            $j("*[id$='rfvRecoveryEmail']").hide();
            $j("*[id$='reRecoveryEmail']").hide();
            $j("*[id$='txtRecoveryEmail']")[0].value = "";
        }
        catch (e) { alert(e.description) }
    },
    displayVerityBetaInviteOD: function() {
        try {
            var lOpDiv = document.createElement('div');
            document.body.appendChild(lOpDiv);
            lOpDiv.className = 'Elightbox_bg DB WP100';
            lOpDiv.style.display = 'block';
            lOpDiv.style.height = document.body.offsetHeight + "px";

            left = Math.ceil((document.body.offsetWidth - 450) / 2);
            $j("*[id$='pnlODVerifyBetaInvite']")[0].className = 'TC W450 MA MT100 Emodal DB';
            $j("*[id$='pnlODVerifyBetaInvite']")[0].style.left = left + "px";
        }
        catch (e) {
            alert("displaySigninOD: " + e.description)
        }
    },
    hideInfoOD: function(pODId) {
        document.body.removeChild($j('.Elightbox_bg')[0]);
        $j("#" + pODId)[0].className = 'TC W912 MA  DN';
    },
    displayInfoOD: function(pODId) {
        var lOpDiv = document.createElement('div');
        document.body.appendChild(lOpDiv);
        lOpDiv.className = 'Elightbox_bg DB WP100';
        lOpDiv.style.display = 'block';
        lOpDiv.style.height = $j(document.body).height() + 20 + "px";
        var lInfoDiv = $j("#" + pODId)[0];

//        if (document.documentElement && document.body.offsetHeight == 0) {
//            lOpDiv.style.height = document.documentElement.offsetHeight + "px";
//        }
        lInfoDiv.className = 'Emodal DB TC W912 MA ZI2000';
        $j(lInfoDiv).css("top", ($j(window).height() - $j(lInfoDiv).height()) / 2);
        $j(lInfoDiv).css("left", ($j(window).width() - $j(lInfoDiv).width()) / 2);
    },
    ValidateFields: function() {
        Page_ClientValidate("vgSignup");
        if (Page_IsValid) {
            Eduify.FBConnectNew.Login();
            return false;
        }
    }
};
