﻿function updateElements(strTopics, strTime, strEntryCount) {
    var img = document.getElementById("imgLoadingPanel1");
    if (null != img) {
        var src = img.src;

        if (window.location.port != "")
            port = ':' + window.location.port;

        img.src = src.replace("loading-tagcloud-groß-ani.gif", "loading-groß-ani.gif");
    }

    __doPostBack("ctl00_MainContent_UpdatePanel1", "drillDown$" + strTopics + "$" + strTime + "$" + strEntryCount);
}
function updateElements2(strTopics, strOutIn, strEntryCount) {
    var img = document.getElementById("imgLoadingPanel1");
    if (null != img) {
        var src = img.src;

        if (window.location.port != "")
            port = ':' + window.location.port;

        img.src = src.replace("loading-tagcloud-groß-ani.gif", "loading-groß-ani.gif");
    }

    __doPostBack("ctl00_MainContent_UpdatePanel1", "drillDown2$" + strTopics + "$" + strOutIn + "$" + strEntryCount);
}
function updateElements3(strTopics, strTonalities, strTime, strEntryCount) {
    var img = document.getElementById("imgLoadingPanel1");
    if (null != img) {
        var src = img.src;

        if (window.location.port != "")
            port = ':' + window.location.port;

        img.src = src.replace("loading-tagcloud-groß-ani.gif", "loading-groß-ani.gif");
    }

    __doPostBack("ctl00_MainContent_UpdatePanel1", "drillDown$" + strTopics + "$" + strTonalities + "$" + strTime + "$" + strEntryCount);
}
function updateElements4() {
    var img = document.getElementById("imgLoadingPanel1");
    if (null != img) {
        var src = img.src;

        if (window.location.port != "")
            port = ':' + window.location.port;

        img.src = src.replace("loading-tagcloud-groß-ani.gif", "loading-groß-ani.gif");
    }

    __doPostBack("ctl00_MainContent_UpdatePanel1", "drillDown3");
}
function updateAllElements() {
    var img = document.getElementById("imgLoadingPanel1");
    if (null != img) {
        var src = img.src;

        if (window.location.port != "")
            port = ':' + window.location.port;

        img.src = src.replace("loading-tagcloud-groß-ani.gif", "loading-groß-ani.gif");
    }
    
    __doPostBack("ctl00_MainContent_UpdatePanel1", "drillDownAll");
}

function OpenPrintWin() {
    var win = null;
    var port = '';

    if (window.location.port != "")
        port = ':' + window.location.port;
    
    var w    = 350;
    var h    = 170;
    var winl = (screen.width-w)/2;
    var wint = (screen.height-h)/2;

    features =
   'toolbar=no, location=no, directories=no, status=no, menubar=no, locationbar=no ' +
   'scrollbars=no, resizable=no, top=' + wint + ',left=' + winl + ', width=' + w + ', height=' + h;

    win = window.open(location.protocol + '//' + document.domain + port + "/PrintWindow.aspx", "Print", features);
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus() };
    
    document.close();
}

function OpenLanguageWin() {
    var oManager = GetRadWindowManager();

    //Success. Getting existing window DialogWindow using GetWindowByName
    var oWnd = oManager.GetWindowByName("LanguageWindow");
    var port = '';

    if (window.location.port != "")
        port = ':' + window.location.port;

    //Success. Setting a size and a Url to the window using its client API before showing
    oWnd.SetUrl(location.protocol + '//' + document.domain + port + "/Config.aspx?type=language");
    oWnd.SetStatus(" ");

    //Success. Opening window
    oWnd.Show();

    return false;
}

function OpenClientWin() {
    var oManager = GetRadWindowManager();

    //Success. Getting existing window DialogWindow using GetWindowByName
    var oWnd = oManager.GetWindowByName("ClientWindow");
    var port = '';

    if (window.location.port != "")
        port = ':' + window.location.port;

    //Success. Setting a size and a Url to the window using its client API before showing
    oWnd.SetUrl(location.protocol + '//' + document.domain + port + "/Config.aspx?type=client");
    oWnd.SetStatus(" ");

    //Success. Opening window
    oWnd.Show();

    return false;
}

function OpenFilterWin() {
    var oManager = GetRadWindowManager();

    //Success. Getting existing window DialogWindow using GetWindowByName
    var oWnd = oManager.GetWindowByName("FilterWindow");
    var port = '';

    if (window.location.port != "")
        port = ':' + window.location.port;

    //Success. Setting a size and a Url to the window using its client API before showing
    oWnd.SetUrl(location.protocol + '//' + document.domain + port + "/Filter.aspx");
    oWnd.SetStatus(" ");

    //Success. Opening window
    oWnd.Show();

    return false;
}

function OpenNotificationUserWin(notificationID) {
    var oManager = GetRadWindowManager();

    //Success. Getting existing window DialogWindow using GetWindowByName
    var oWnd = oManager.GetWindowByName("FilterWindow");
    var port = '';

    if (window.location.port != "")
        port = ':' + window.location.port;

    //Success. Setting a size and a Url to the window using its client API before showing
    oWnd.SetUrl(location.protocol + '//' + document.domain + port + "/Administration/NotificationUser.aspx?notificationID=" + notificationID);
    oWnd.SetStatus(" ");

    //Success. Opening window
    oWnd.Show();

    return false;
}

function OpenEditClassificationsWin(entryID) {
    var oManager = GetRadWindowManager();

    //Success. Getting existing window DialogWindow using GetWindowByName
    var oWnd = oManager.GetWindowByName("EditClassificationsWindow");
    var port = '';

    if (window.location.port != "")
        port = ':' + window.location.port;

    //Success. Setting a size and a Url to the window using its client API before showing
    oWnd.SetUrl(location.protocol + '//' + document.domain + port + "/Administration/EditClassifications.aspx?entryID=" + entryID);
    oWnd.SetStatus(" ");

    //Success. Opening window
    oWnd.Show();

    return false;
}

function OpenNotificationSitesWin(notificationID) {
    var oManager = GetRadWindowManager();

    //Success. Getting existing window DialogWindow using GetWindowByName
    var oWnd = oManager.GetWindowByName("FilterWindow");
    var port = '';

    if (window.location.port != "")
        port = ':' + window.location.port;

    //Success. Setting a size and a Url to the window using its client API before showing
    oWnd.SetUrl(location.protocol + '//' + document.domain + port + "/Administration/NotificationSites.aspx?notificationID=" + notificationID);
    oWnd.SetStatus(" ");

    //Success. Opening window
    oWnd.Show();

    return false;
}

function OpenDocumentWin(URL, Name) {
    MeinFenster = window.open(URL, Name, "width=1100,height=600,left=100,top=100,scrollbars=yes,resizable=yes,menubar=yes");
    MeinFenster.focus();
}

function OpenEditNewWin(url, id, mode) {
    var oManager = GetRadWindowManager();

    //Success. Getting existing window DialogWindow using GetWindowByName
    var oWnd = oManager.GetWindowByName("EditNewWindow");
    var port = '';

    if (window.location.port != "")
        port = ':' + window.location.port;

    //Success. Setting a size and a Url to the window using its client API before showing
    oWnd.SetUrl(location.protocol + '//' + document.domain + port + url + "?mode=" + mode + "&id=" + id);
    oWnd.SetStatus(" ");

    //Success. Opening window
    oWnd.Show();

    return false;
}

function OpenMapDetailWindow(id, topicID) {
    var oManager = GetRadWindowManager();

    //Success. Getting existing window DialogWindow using GetWindowByName
    var oWnd = oManager.GetWindowByName("MapDetailWindow");
    var port = '';

    if (window.location.port != "")
        port = ':' + window.location.port;

    //Success. Setting a size and a Url to the window using its client API before showing
    oWnd.SetUrl(location.protocol + '//' + document.domain + port + "/Results/GeoMapDetail.aspx?ID=" + id + "&TopicID=" + topicID);
    oWnd.SetStatus(" ");

    //Success. Opening window
    oWnd.Show();
}

function OpenSearchTermAliasWindow() {
    var oManager = GetRadWindowManager();

    //Success. Getting existing window DialogWindow using GetWindowByName
    var oWnd = oManager.GetWindowByName("SearchTermAliasWindow");
    var port = '';

    if (window.location.port != "")
        port = ':' + window.location.port;

    //Success. Setting a size and a Url to the window using its client API before showing
    oWnd.SetUrl(location.protocol + '//' + document.domain + port + "/Administration/SearchTermAlias.aspx");
    oWnd.SetStatus(" ");

    //Success. Opening window
    oWnd.Show();
}

function OpenKPIWindow(mode) {
    var oManager = GetRadWindowManager();

    //Success. Getting existing window DialogWindow using GetWindowByName
    var oWnd = oManager.GetWindowByName("KPIWindow");
    var port = '';

    if (window.location.port != "")
        port = ':' + window.location.port;

    //Success. Setting a size and a Url to the window using its client API before showing
    oWnd.SetUrl(location.protocol + '//' + document.domain + port + "/Results/KPISelection.aspx?mode=" + mode);
    oWnd.SetStatus(" ");

    //Success. Opening window
    oWnd.Show();
}

function OpenEntryExportWin() {
    var oManager = GetRadWindowManager();

    //Success. Getting existing window DialogWindow using GetWindowByName
    var oWnd = oManager.GetWindowByName("EntryExportWindow");
    var port = '';

    if (window.location.port != "")
        port = ':' + window.location.port;

    //Success. Setting a size and a Url to the window using its client API before showing
    oWnd.SetUrl(location.protocol + '//' + document.domain + port + "/ExportFormatSelection.aspx");
    oWnd.SetStatus(" ");

    //Success. Opening window
    oWnd.Show();
}

function sendEntryLinkToClipboard(s) {
    var port = '';

    if (window.location.port != "")
        port = ':' + window.location.port;
        
    if (window.clipboardData && clipboardData.setData) {
        clipboardData.setData("Text", location.protocol + '//' + document.domain + port + "/Results/EntryDetails.aspx?EntryID=" + s);
    }
    else {
        alert("Internet Explorer required");
    }
}

function printpage() {
    window.print();  // For printing the page 
}
