﻿// JScript File



$(function(){ 

    HandlePager();
})

//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function trim(stringToTrim) {
    return stringToTrim.replace(/^\s+|\s+$/g, "");
}   

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function SetDefaultCategory() {
    //document.getElementById(""+catList+"").value="-1";
    //document.getElementById(""+txtSearch+"").value="";
    $("select[id$='catList']").val("-1");
    $("input[id$='txtSearch']").val('');
    $("input[id$='btnSearch']").trigger("click");
}

//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//   

//
//function used to clear the value and used to raise the click the event
//
function CallSearch() {
    document.getElementById('txtSearch').value = "";
    document.getElementById('btnSearch').click();
}

//---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

//
//function use to assign no image 
//LoadUploadImage
function LoadUploadImage(obj, path) {
    obj.src = path;
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//      

//
// function for checking all the check boxes
//
function CheckAllDataGridCheckBoxes(gvID, ChkID, checkVal) {
    ClearMessage();
    var chkApprove;
    for (var i = 2; ; i++) {
        if (i <= 9)
            chkApprove = gvID + "_ctl0" + i + "_" + ChkID;
        else
            chkApprove = gvID + "_ctl" + i + "_" + ChkID;
        var CtrlChkApproveID = document.getElementById(chkApprove);
        if (CtrlChkApproveID == null)
            break;
        else {
            if (!CtrlChkApproveID.disabled)
                CtrlChkApproveID.checked = checkVal;
        }
    }
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//                   

//
//function used to clear the message
//
function ClearMessage() {
    if (document.getElementById('ctl00_mainContentPlaceHolder_message'))
        document.getElementById('ctl00_mainContentPlaceHolder_message').className = "notice hide";
}

function ClearMessageinSchoolEdit() {
    if (document.getElementById("" + Message1 + ""))
        document.getElementById("" + Message1 + "").className = "success hide";
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//                  

//
//function used to check the password
//
function CheckPassword() {
    if (document.getElementById('ctl00_mainContentPlaceHolder_txtOldpassword').value.length != 0) {
        if (document.getElementById('ctl00_mainContentPlaceHolder_txtNewpassword').value.length == 0) {
            document.getElementById("ctl00_mainContentPlaceHolder_LabelNewPassword").innerHTML = "<span class='mandatory small'>New Password is required</span>"
            document.getElementById("ctl00_mainContentPlaceHolder_txtNewpassword").focus();
            return false;
        }
        if (document.getElementById('ctl00_mainContentPlaceHolder_txtConfirmnewpassword').value.length == 0) {
            document.getElementById("ctl00_mainContentPlaceHolder_LabelConfirmNewPassword").innerHTML = "<span class='mandatory small'>Confirm Password is required</span>"
            document.getElementById("ctl00_mainContentPlaceHolder_txtConfirmnewpassword").focus();
            return false;
        }
        if (document.getElementById('ctl00_mainContentPlaceHolder_txtNewpassword').value.length != 0 && document.getElementById('ctl00_mainContentPlaceHolder_txtConfirmnewpassword').value.length != 0) {
            return true;
        }
    }
    return true;
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//                         

//
//
//function used to assign the category when it is not selected
function chkCategory() {
    var ApprovalChkBox = document.getElementById('lblApproval').innerHTML.split(';')

    for (i = 0; i < ApprovalChkBox.length - 1; i++) {
        var chkApproval = document.getElementById(ApprovalChkBox[i].split(',')[0]).checked;
        var Category = document.getElementById(ApprovalChkBox[i].split(',')[0].replace("chkApproval", "lblCategory")).innerHTML;
        var Title = document.getElementById(ApprovalChkBox[i].split(',')[0].replace("chkApproval", "lblTitle")).innerHTML;
        if (chkApproval && Category.indexOf("Category is not") > 0) {
            alert("Assign the category for " + Title);
            document.getElementById(ApprovalChkBox[i].split(',')[0]).checked = false;
            return false;
        }
    }
    return true;
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//                     

//
//function used in LiveGameSchedule.aspx for clear the textbox values when search
//
function SetDefaultinSchedule() {
    if (document.getElementById("" + txtSearch + ""))
        document.getElementById("" + txtSearch + "").value = "";

    if (document.getElementById("" + txtStartDate + ""))
        document.getElementById("" + txtStartDate + "").value = "";

    if (document.getElementById("" + txtEndDate + ""))
        document.getElementById("" + txtEndDate + "").value = "";

    $("input[id$='hidSelectedEndDate']").val("");
    $("input[id$='hidSelectedStartDate']").val("");
    document.getElementById("" + btnSearch + "").click();
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//                     

//
//function used in ViewUsers.aspx for clear the textbox values when search
//
function SetDefaultinUser() {
    if (document.getElementById("" + textSearch + ""))
        document.getElementById("" + textSearch + "").value = "";

    if (document.getElementById("" + ddlStatus + ""))
        document.getElementById("" + ddlStatus + "").value = "-1";

    if (document.getElementById("" + ddlRole + ""))
        document.getElementById("" + ddlRole + "").value = "-1";

    document.getElementById("" + btnSearch + "").click();
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function SetDefaultinGroup() {
    $("input[id$='txtSearch']").val("");
    $("input[id$='btnSearch']").click();
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function Loadarrow(obj) {
    document.getElementById(obj).src = "../Images/arrowRight.gif"
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function ValidateKeyPress(e) {
    if ((navigator.appName == 'Netscape' || navigator.appName == 'Mozilla Firefox' || navigator.appName == 'Opera' || navigator.appName == 'Safari')) {
        if (parseInt(e.which) < 44 || parseInt(e.which) > 58) {
            switch (parseInt(e.which)) {
                case 32:
                case 40:
                case 41:
                case 0:
                case 8:
                    break;
                default:
                    e.preventDefault();
                    break;
            }
        }
    }
    else if (window.event.keyCode < 44 || window.event.keyCode > 58) {
        switch (window.event.keyCode) {
            case 32:
            case 40:
            case 41:
                break;
            default:
                window.event.keyCode = 0;
                break;
        }
    }
}

// Function to allow the numeric value only
function ValidateNumber(e) {
    if ((navigator.appName == 'Netscape' || navigator.appName == 'Mozilla Firefox')) {
        if (parseInt(e.which) < 47 || parseInt(e.which) > 58) {
            e.which = 0;
        }
    }
    else {
        if (event.keyCode < 47 || event.keyCode > 58)
            event.keyCode = 0;
    }
}

function CheckNumeric(e) {
    var key;
    if (window.event)
        key = event.keyCode;
    else
        key = e.which;

    // Was key that was pressed a alphabetic character or backspace (8)?
    if (key < 44 && key > 58 || key == 8 || key == 0)
        return;
    else // otherwise, discard character
        if (window.event) //IE
        window.event.returnValue = null;
    else
        e.preventDefault();
    //Firefox
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function CheckSameVideos(chk, obj, currentobj) {
    var chkApprove, chkActivate, _VideoID;
    var CurrentVideoID = document.getElementById(obj.replace(currentobj, "lblId")).innerHTML;
    for (var i = 2; ; i++) {
        if (i <= 9) {
            chkApprove = "VideoApprovalGrid_ctl0" + i + "_chkApproval";
            chkActivate = "VideoApprovalGrid_ctl0" + i + "_chkActivate";
            _VideoID = "VideoApprovalGrid_ctl0" + i + "_lblId";
        }
        else {
            chkApprove = "VideoApprovalGrid_ctl" + i + "_chkApproval";
            chkActivate = "VideoApprovalGrid_ctl" + i + "_chkActivate";
            _VideoID = "VideoApprovalGrid_ctl" + i + "_lblId";
        }

        var CtrlChkApproveID = document.getElementById(chkApprove);
        var CtrlChkActivateID = document.getElementById(chkActivate);
        var CtrlVideoID = document.getElementById(_VideoID);

        if (CtrlChkApproveID == null)
            break;
        else {
            if (CtrlVideoID.innerHTML == CurrentVideoID) {
                if (currentobj == "chkApproval")
                    CtrlChkApproveID.checked = chk;
                else {
                    CtrlChkActivateID.checked = chk;
                    if (CtrlChkApproveID.disabled == false)
                        CtrlChkApproveID.checked = chk;
                }
            }
        }
    }
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function Logout() {
    $("input[id$='btnLogout']").trigger("click");
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function fnLoadArrowImage(img) {
    if ($("#" + img)) {
        $("#" + img).attr("src", "../Images/arrowRight.gif")
    }
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function WriteArrowImage(id) {
    //$("#div"+id).html("<img id='img"+id+"arrow'  src='Images/arrowRight.gif' width='10' height='10' onerror='fnLoadArrowImage(this.id)'/>");
    //var img="<img id='img"+id+"arrow'  src='Images/arrowRight.gif' width='10' height='10' onerror='fnLoadArrowImage(this.id)'/>";
    var homePath = $("a[id$='virualPath']").attr("href")
    var img = "<img id='img" + id + "arrow'  src=" + homePath + "Images/modern/arrowRight.gif width='10' height='10' />";
    document.write(img);
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function WriteFooter() {
    //    var mailid= document.getElementById(SuperAdminMail).value;
    //    
    //    var tomailid ='Mail To Admin'
    var currentpath = document.location.pathname.toLowerCase();
    var footer = "Copyright &copy 2008." + "<a href='http://www.jdlhorizons.com' target='_blank'>JDL Horizons, LLC.</a>" + "All rights reserved.   |  " + "<a href='Privacy.aspx' target='_blank'>Privacy Policy</a>   |" + "<a href='Terms.aspx' target='_blank'>Terms &amp; Conditions </a>      |"
    + "<a  href='javascript:openwindow()' >Supports/Suggestions </a>";
    var adminfooter = "Copyright &copy  2008." + "<a href='http://www.jdlhorizons.com' target='_blank'>JDL Horizons, LLC.</a> " + "All rights reserved.   |  " + "<a href='../Privacy.aspx' target='_blank'>Privacy Policy</a>   | " + "<a href='../Terms.aspx' target='_blank'>Terms &amp; Conditions </a>     | " + "<a href='javascript:openwindow()' >Supports/Suggestions </a>";
    if (currentpath.indexOf('admin/') > 0) {
        document.write(adminfooter);
    } else
        document.write(footer);
}

function openwindow() {
    window.open($("a[id$='virualPath']").attr("href") + 'Feedback.aspx', 'FeedBack', 'height=550,width=310');
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function Adminmail(SuperAdminMail) {
    $("#divMail").html('Contact'.link("mailto:" + $("#" + SuperAdminMail).val()));
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function writeMandatory(classname) {
    document.write("<span class='" + classname + " small'>* = required field</span>");
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function CurrentUserName(CurrentName) {
    $("#divCurrentUserName").html((("Welcome " + ($("#" + CurrentName).val().length == 0 ? "Guest" : $("#" + CurrentName).val())).bold()));
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//                   
//
//when press enter key in textbox. fire the search event
//
function keyPress(evt) {
    if (evt.which || evt.keyCode) {
        if ((evt.which == 13) || (evt.keyCode == 13)) {
            document.getElementById("" + btnSearch + "").click();
            return false;
        }
        return true;
    }
}

function ClearNewPWError() {
    if (document.getElementById("ctl00_mainContentPlaceHolder_LabelNewPassword").innerHTML != "")
        document.getElementById("ctl00_mainContentPlaceHolder_LabelNewPassword").innerHTML = "";
}

function ClearCNewPWError() {
    if (document.getElementById("ctl00_mainContentPlaceHolder_LabelConfirmNewPassword").innerHTML != "")
        document.getElementById("ctl00_mainContentPlaceHolder_LabelConfirmNewPassword").innerHTML = "";
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function AdminBackLink() {
    if ($("#adminssu")) {
        if ($("#hidssulink").val().toLowerCase() == "true") {
            $("#adminssu").html("Back To Approval");
        }
    }
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function fnCheckManageScheduleLink(isLive) {
    if (document.getElementById("lstFormanageSchedule") && isLive.toLowerCase() == 'false') {
        document.getElementById("lstFormanageSchedule").style.display = 'none'
    }
    if (document.getElementById("lstwatchmenu") && isLive.toLowerCase() == 'false') {
        document.getElementById("lstwatchmenu").style.display = 'none'
    }

}

//-----------------------------------------------------------------------------------------------------------------------------------------

var checkLinks = function(from) {
    var currentLocation = document.location.pathname.toLowerCase();
    var location = from;
    if (!(from))
        location = currentLocation.split('/')[currentLocation.split('/').length - 1].replace(".aspx", '');
    $(document).ready(function() {
        if ($("#" + location) != null) {
            $("#" + location).removeAttr("href");
            $("#" + location).addClass("current");
        }
    });
}

//--------------------------------------------------------------------------------------------------------------------------------------------------------//

function ShowOthersOption(page) {
    var lblError = document.getElementById("" + labelError + "");
    var lblSchoolAvail = document.getElementById("" + labelAvail + "");
    if (document.getElementById("" + ddlStateValue + "").value == "0") {
        document.getElementById("" + divState + "").className = "buttons show";
    }
    else {
        document.getElementById("" + ddlStateValue + "").className = "hide";
        lblError.innerHTML = "";
        lblSchoolAvail.innerHTML = "";
    }
    if (page = "SM") {
        var StateValue = document.getElementById("" + hiddenStateValue + "").value;
        if (document.getElementById("" + ddlStateValue + "").value == StateValue)
            document.getElementById("" + divState + "").className = "buttons show";
    }
}

//--------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function CheckStates() {
    var ddlValue = document.getElementById("" + ddlStateValue + "");
    var StateName = document.getElementById("" + txtStateName + "");
    var Abbreviation = document.getElementById("" + txtCountryName + "");
    var lblError = document.getElementById("" + labelError + "");
    if (ddlValue.value == "0" && (trim(StateName.value).length == 0 || trim(Abbreviation.value).length == 0)) {
        lblError.innerHTML = "Please enter the state/country";
        return false;
    }
    return true;
}

//--------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function CheckStateIsEmpty(source, args) {
    var ddlValue = document.getElementById('ctl00_mainContentPlaceHolder_ddl_state');
    var StateName = document.getElementById('ctl00_mainContentPlaceHolder_txtStateName');
    var Abbreviation = document.getElementById('ctl00_mainContentPlaceHolder_txtCountry');
    var lblError = document.getElementById('ctl00_mainContentPlaceHolder_lblError');
    if (ddlValue.value == "0" && (trim(StateName.value).length == 0 || trim(Abbreviation.value).length == 0)) {
        args.IsValid = false;
        return false;
    }
    args.IsValid = true;
}

//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

// handled in the page itself using jQuery - rajakvk 4.5.2009
function ClearStateDELETE() {
    var lblError = document.getElementById("" + labelError + "");
    if (lblError)
        lblError.innerHTML = "";
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function CheckDistrictId(source, args) {
    // var districtvalue = document.getElementById(""+txtDistrict +"") .value;
    var districtvalue = $("input[id$='txtdistrictid']").val();
    if (parseInt(districtvalue) == 0) {
        args.IsValid = false;
        return false;
    }
    args.IsValid = true;
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function customcheck(source, args) {
    if (document.getElementById('ctl00_mainContentPlaceHolder_chkDistrictSchool').checked && trim(document.getElementById("" + txturl + "").value).length == 0) {
        args.IsValid = false;
        return false;
    }
    args.IsValid = true;
}

//------------------------------------------------------------------------------------------------------------------------------------

function CheckIsDistrictSchool(source, args) {
    var districtvalue = document.getElementById('ctl00_mainContentPlaceHolder_txtdistrictid').value;
    if (document.getElementById('ctl00_mainContentPlaceHolder_chkDistrictSchool').checked && parseInt(districtvalue) == 0 || document.getElementById('ctl00_mainContentPlaceHolder_chkDistrictSchool').checked && trim(districtvalue).length == 0) {
        args.IsValid = false;
        return false;
    }
    args.IsValid = true;
}

//---------------------------------------------------------------------------------------------------------------------------
function fncheckppv(source, args) {
    if (document.getElementById('ctl00_mainContentPlaceHolder_txtprice')) {
        var pricevalue = document.getElementById('ctl00_mainContentPlaceHolder_txtprice').value;
        var classvalue = document.getElementById('divprice').className;
        if (trim(pricevalue).length == 0 && classvalue.toLowerCase() == "show") {
            args.IsValid = false;
            return false;
        }
        else if (parseFloat(pricevalue) < 5 && classvalue.toLowerCase() == "show") {
            args.IsValid = false;
            return false;
        }
        args.IsValid = true;
    }
}

//--------------------------------------------------------------------------------------------------------------------------------

function ValidatePrice(source, args) {
    if (document.getElementById('ctl00_mainContentPlaceHolder_txtprice')) {
        var pricevalue = document.getElementById('ctl00_mainContentPlaceHolder_txtprice').value;
        var classvalue = document.getElementById('divprice').className;
        pricevalue = alltrim(pricevalue);
        var result = /^(?=.*[0-9].*$)\d{0,7}(?:\.\d{0,2})?$/.test(pricevalue);
        if (alltrim(pricevalue).length > 0 && classvalue.toLowerCase() == "show" && !result) {
            args.IsValid = false;
            return false;
        }
        args.IsValid = true;
    }
}

//--------------------------------------------------------------------------------------------------------------------------------

function VaildatePlayTime(source, args) {
    if (document.getElementById('ctl00_mainContentPlaceHolder_txtvideoplaytime')) {
        var playtime = document.getElementById('ctl00_mainContentPlaceHolder_txtvideoplaytime').value;
        if (trim(playtime).length == 0) {
            args.IsValid = false;
            return false;
        }
        else if (Math.ceil(playtime) == 0) {
            args.IsValid = false;
            return false;
        }
    }
    args.IsValid = true;
}

//--------------------------------------------------------------------------------------------------------------------------------

function Validateplaytimevalue(source, args) {
    if (document.getElementById('ctl00_mainContentPlaceHolder_txtvideoplaytime')) {
        var pricevalue = document.getElementById('ctl00_mainContentPlaceHolder_txtvideoplaytime').value;
        pricevalue = alltrim(pricevalue);
        var result = /^[-+]?[0-9]+(\.[0-9]+)?$/.test(pricevalue);

        if (alltrim(pricevalue).length > 0 && !result) {

            args.IsValid = false;
            return false;
        }
        args.IsValid = true;
    }
}

//------------------------------------------------------function to validate PPV---------------------------------------------------------------------------

function SetPPVForDefault(source, args) {
    if (document.getElementById('ctl00_mainContentPlaceHolder_chkDefault') && document.getElementById('ctl00_mainContentPlaceHolder_chkppv')) {
        if (document.getElementById('ctl00_mainContentPlaceHolder_chkDefault').checked == true && document.getElementById('ctl00_mainContentPlaceHolder_chkppv').checked == true) {
            args.IsValid = false;
            return false;
        }
    }
    args.IsValid = true;
}

function SetPPVForSiteDefault(source, args) {
    if (document.getElementById('ctl00_mainContentPlaceHolder_chkSiteDefault') && document.getElementById('ctl00_mainContentPlaceHolder_chkppv')) {
        if (document.getElementById('ctl00_mainContentPlaceHolder_chkSiteDefault').checked == true && document.getElementById('ctl00_mainContentPlaceHolder_chkppv').checked == true) {
            args.IsValid = false;
            return false;
        }
    }
    args.IsValid = true;
}

//-----------------------------------------------------------------function to clear browse button in firefox-----------------------------------------------------------------------------

function chkFileTypes(control) {
    control = $("input[id$='" + control + "']").attr("id");
    if ((navigator.appName == 'Netscape' || navigator.appName == 'Mozilla Firefox')) {
        $('#' + control).val("");
    }
    else {
        clearfileinie(control)
    }
}
//-------------------------------------------------------------------------function to validate----------------------------------------------------------------------

function checkValidDate(source, args) {
    if (trim($("input[id$='txtStartDate']").val()) != "" && trim($("input[id$='txtEndDate']").val()).length == 0) {
        args.IsValid = false;
        return false;
    }
    if (trim($("input[id$='txtStartDate']").val()) == "" && trim($("input[id$='txtEndDate']").val()) != "") {
        args.IsValid = false;
        return false;
    }
    if ($("input[id$='labelStartDate']").val() != "" && trim($("input[id$='txtEndDate']").val()).length == 0 && $('#ctl00_mainContentPlaceHolder_divLabelStartDate').hasClass("show")) {
        args.IsValid = false;
        return false;
    }
    args.IsValid = true;
}  

// --------------------------------------------------------function to clear browse button in ie------------------------------------------------------------------------------------------------------------------------------------

function clearfileinie(control){
    var who=document.getElementsByName(control)[0];
    var who2= who.cloneNode(false);
    who2.onchange= who.onchange;
    who.parentNode.replaceChild(who2,who);
}

// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

function ValidateToAddress(source, args) {
    if (document.getElementById('txtToEmai')) {
        var toaddress = document.getElementById('txtToEmai').value;
        toaddress = alltrim(toaddress);
        var result = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]+([,.][a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]+)*$/.test(toaddress);
        if (!result && toaddress.length > 0) {
            args.IsValid = false;
            return false;
        }
        args.IsValid = true;
    }
}

function alltrim(str) {
    var str = str.replace(/^\s\s*/, ''),
		    ws = /\s/,
		    i = str.length;
    while (ws.test(str.charAt(--i)));
    return str.slice(0, i + 1);
}

// ------------------------------------function to handle pager--------------------------------------------------------------------------------------------------------------------//

function HandlePager() {
    if ($("pager")) {
        if ($(".tablesorter") != null || $(".tablesorter") != undefined) {
            $(".pagedisplay").attr("disabled", "disabled");

            $(".tablesorter").each(function(i) {
                this.rows.length > 11 ?
            $($(".pager")[i]).show() :
            $($(".pager")[i]).hide();
            });
        }
    }
}

// ------------------------------------function to handle SetPage--------------------------------------------------------------------------------------------------------------------//

function fnSetPager() {
    $("#ctl00_txtpageCount").val($(".pagesize").val());
    $("input:text[id$='txtShow']").val($(".pagesize").val())
}

function alltrim(str) {
    return str.replace(/^\s+|\s+$/g, '');
}
    
// --------------------------------------------------------------------------------------------------------------------------------------------------------//

function CopyToClipboard(ele) {
    if ($.browser.mozilla)
        alert('Clipboard functions are not supported in this browser. ' + '\n' + 'Press Ctrl-C to copy the text.');
    document.getElementById(ele).focus();
    document.getElementById(ele).select();
    CopiedTxt = document.selection.createRange();
    CopiedTxt.execCommand("Copy");
};

// --------------------------------------------------------------- // FadeIn effect appear when validation message show //-----------------------------------------------------------------------------------------//

//    function animateValidation() {
//        $(".validation").fadeIn(1000);
//    }

// --------------------------------------------------------------------------------------------------------------------------------------------------------//
