﻿function onSourceDownloadProgressChanged(sender, eventArgs) {
    sender.findName("uxStatus").Text = "Cargando Visor: " + Math.round((eventArgs.progress * 1000)) / 10 + "%";
    sender.findName("uxProgressBar").ScaleY = eventArgs.progress * 356;
}


function AddFavorites(url) 
{

    if (navigator.appVersion.indexOf("Mac", 0) > 0) {
        alert("Esta funci" + decodeURI('%c3%b3') + "n no puede ejecutarse en Macintosh.\n Utiliza la combinaci" + decodeURI('%c3%b3') + "n de teclas Command D");
    }
    else if (window.sidebar) {
        //Gecko (Netscape 6 etc.) - add to Sidebar
        return window.sidebar.addPanel("Visor Sigpac", url, "");
    }
    else if (window.external && (navigator.platform == "Win32" ||
								(window.ScriptEngine && ScriptEngine().indexOf("InScript") + 1))) {
        //IE Win32 or iCab - checking for AddFavorite produces errors for no
        //good reason, so I use a platform and browser detect.
        //adds the current page page as a favourite; if this is unwanted,
        //simply write the desired page in here instead of "location.href"
        return window.external.AddFavorite(url, document.title);
    }
    else if (window.opera) {
        //Opera 6+ - add as sidebar panel to Hotlist
    //        window.alert("El navegador no soporta la funci" + decodeURI('%c3%b3') + "n A" + decodeURI('%c3%b1') + "adir a Favoritos.\nPresiona Ctrl+D para a" + decodeURI('%c3%b1') + "adir un marcador de la p" + decodeURI('%c3%a1') + "gina.");

        a = document.createElement("A");
        a.rel = "sidebar";
        a.target = "_search";
        a.title = title;
        a.href = url;
        a.click();
    }
    else if (document.layers) {
        //NS4 &amp; Escape - tell them how to add a bookmark quickly (adds current page,
        //not target page)
        window.alert("El navegador no soporta la funci" + decodeURI('%c3%b3') + "n A" + decodeURI('%c3%b1') + "adir a Favoritos.\nPresiona Ctrl+D para a" + decodeURI('%c3%b1') + "adir un marcador de la p" + decodeURI('%c3%a1') + "gina.");
    }
    else {
        //other browsers - tell them to add a bookmark (adds current page, not target page)
        window.alert("El navegador no soporta la funci" + decodeURI('%c3%b3') + "n A" + decodeURI('%c3%b1') + "adir a Favoritos.\nUsa los marcadores de tu navegador para a" + decodeURI('%c3%b1') + "adir marcador de la p" + decodeURI('%c3%a1') + "gina.");
    }
    return false;
}
/*
function AddFavorites(url) 
{
    var title = "Visor SigPac";
    if (window.sidebar) 
    {
        window.sidebar.addPanel(title, url, "");
    }
    else if (document.all) {
        window.external.AddFavorite(url, title);
    }
    else if (window.opera) 
    {
        a = document.createElement("A");
        a.rel = "sidebar";
        a.target = "_search";
        a.title = title;
        a.href = url;
        a.click();
    }
}
*/
//function bookmarksite(url) 
//{
//   
//    if (document.all) 
//        window.external.AddFavorite(url, document.title);
//    else if (window.sidebar)
//        window.sidebar.addPanel(document.title, url, '')
//    else if (window.opera && window.print) { // Opera Hotlist
//        alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
//    }
//}

function clipboardCopyText(s) 
{
    window.clipboardData.setData("Text", s);
} 


