﻿function expandcollapse(obj, row) {
    var div = document.getElementById(obj);
    var img = document.getElementById('img' + obj);

    if (div.style.display == "none") {
        div.style.display = "block";
        if (row == 'alt') {
            img.src = "../images/collapse.jpg";
        }
        else {
            img.src = "../images/collapse.jpg";
        }
        img.alt = "Close";
    }
    else {
        div.style.display = "none";
        if (row == 'alt') {
            img.src = "../images/expand.jpg";
        }
        else {
            img.src = "../images/expand.jpg";
        }
        img.alt = "Expand";
    }
}

function confirmdel() {
    var conf;
    conf = confirm("Are you sure you want to delete this record?\r\nPlease note that you will not be able to retrieve it again!");
    if (conf) {
        return true;
    }
    else {
        alert("Deletion operation was cancelled.");
        return false;
    }
}

function confirmdelFile() {
    var conf;
    conf = confirm("Are you sure you want to remove this file from the bin library?");
    if (conf) {
        return true;
    }
    else {
        alert("Deletion operation was cancelled.");
        return false;
    }

}

function confirmdelall() {
    var conf;
    conf = confirm("Are you sure you want to delete all the records?");
    if (conf) {
        return true;
    }
    else {
        alert("Deletion operation was cancelled.");
        return false;
    }
}

function openNewWindow(url) {
    window.open(url, 'open_window', 'menubar=0, toolbar=0, status=0, scrollbars=0, resizable=0, width=640, height=480, left=0, top=0');
    return false;
}


function confirmSEO() {
    try {
        var pageChanged = document.getElementById('ctl00_ContentPlaceHolder1_CMSFrameWork1_pageInfoChanged');
        if (pageChanged != null) {
            var tempVal = pageChanged.getAttribute("Value");
            var hvalue = parseInt(tempVal);
            var confirmmsg = "";
            if (hvalue > 0) {
                confirmmsg = "You are about to leave this page. The system detected that you have made changes on some of the pages.\r\n\r\nPlease note that you are going to be logged out of the system so that your website can be optimised for SEO.";
                if (confirm(confirmmsg)) return true;
                else return true;
            }
            else {
                return true;
            }
        }
        else {
            return true;
        }
    }
    catch (Error) {
        alert("Error : " + Error);
    }
}

function clearPreloadPage() { //DOM
    //    if (document.getElementById){
    //        document.getElementById('prepage').style.visibility='hidden';
    //    }
    //    else
    //    {
    //        if (document.layers){ //NS4
    //        document.prepage.visibility = 'hidden';
    //    }
    //    else 
    //    { //IE4
    //            document.all.prepage.style.visibility = 'hidden';
    //    }    
}


//if (typeof(Sys) == 'undefined')	
//	    Sys.Application.notifyScriptLoaded();	
	



