﻿function GoToSecurePage(url) {
    if (document.getElementById('ctl00_Greeting1_hiddIsAuthenticated').value == 'true') { window.location = url } 
    else { showPopup('Login.aspx?redirectURL=' + url , 220, 350, false, true, false,true) }
}
function GoToSecurePageWithDelay(url) {
    setTimeout(function () { GoToSecurePage(url); }, 500);
}
function ContactUs() {
    //showPopup('<iframe height=100% width=100% frameborder=0 scrolling=no src=ContactUs.htm></iframe>', 400, 470,false,true);
    showPopup('ContactUs.htm', 410, 470,false,true);
}
function UnderConstruction() {
    //showPopup('<iframe height=100% width=100% frameborder=0 scrolling=no src=UnderConstruction.htm></iframe>', 400, 540, false, true);
    showPopup('UnderConstruction.htm', 410, 540, false, true);
}
function ShowWait() {
    showPopup('<div style="text-align: center;width:100%;color: gray; font-family: Verdana; font-size:8pt"><img src=Images/Loading.gif /><br>Loading...</div>', 50, 107, true);
}
function HideWait(leaveBG) {
    hidePopup(leaveBG);
}
function ShowAboutToExpire(url) {
    showPopup('keepalive.aspx?url=' + url, 240, 350, true,true);
}
function openMailWindow(selection) {
    showPopup('MailForm.aspx?id=' + gblAnimalID + '&s=' + selection , 250, 560, false, true);
}
function copyToClipboard(text) {
    try {
        if (window.clipboardData.setData('text', text))
            alert('The link has been copied to the clipboard.');
    } catch (e) { alert('Your browser does not support this function.') }
}
function fnSelect(objId) {
    fnDeSelect();
    if (document.selection) {
        var range = document.body.createTextRange();
        range.moveToElementText(document.getElementById(objId));
        range.select();
    }
    else if (window.getSelection) {
        var range = document.createRange();
        range.selectNode(document.getElementById(objId));
        window.getSelection().addRange(range);
    }
}

function fnDeSelect() {
    if (document.selection) document.selection.empty();
    else if (window.getSelection)
        window.getSelection().removeAllRanges();
}
function cancelEvent(e) {
    if (!e) e = window.event;
    if (e.preventDefault) {
        e.preventDefault();
    } else {
        e.returnValue = false;
    }
}
function stopEvent(e) {
    if (!e) e = window.event;
    if (e.stopPropagation) {
        e.stopPropagation();
    } else {
        e.cancelBubble = true;
    }
}




