﻿function showAlert(msg, url) {
    alert(msg);
    if (url != '') {
        redirectURL(url);
    }
}

function redirectURL(url) {
    if (navigator.appName == 'Microsoft Internet Explorer') {
        window.location.href(url);
    } else if (navigator.appName == 'Netscape') {
    window.open(url, '_parent', 1);
    //window.close();       
    }
}

function deleteRecord(url) {
    if (confirm("Want to delete clicked record?\nAll the related data to this record will also be deleted!")) {
        redirectURL(url);
    }
}

function hideRecord(url) {
    if (confirm("Want to hide clicked record?\nAll the related data to this record will also be hidden!")) {
        redirectURL(url);
    }
}

function unhideRecord(url) {
    if (confirm("Want to unhide clicked record?\nAll the related data to this record will also be shown!")) {
        redirectURL(url);
    }
}

function actRecord(url) {
    if (confirm("Want to Activate clicked user?")) {
        redirectURL(url);
    }
}

function deactRecord(url) {
    if (confirm("Want to De-Activate clicked user?")) {
        redirectURL(url);
    }
}

function timer(obj) {
    var t = setTimeout("document.getElementById('" + obj + "').style.display = 'none'", 5000);
}

function showAlertAndgoBack() {
    window.location.href("Default.aspx?type=noaccess");
}
