      function getCookieValue( name ) 
      {
        var c = document.cookie; 
        var begin = c.indexOf( name ); 
        if( begin < 0 ) return( "" ); 
        begin += name.length + 1; 
        var end = c.indexOf( ";", begin ); 
        if( end == -1 ) end = c.length; 
        return( c.slice( begin, end ) );
      }

      
    function isAcrobatReaderPresent() {
        var mime = navigator.mimeTypes["application/pdf"];
        if(navigator.appName == "Netscape") {
            return mime;
        } else if(navigator.appName == "Microsoft Internet Explorer") {
            var acrobat=new Object();

            acrobat.installed=false;
            acrobat.version='0.0';

            if (navigator.plugins && navigator.plugins.length)
            {
                for (x=0; x < navigator.plugins.length; x++)
                {
                    if (navigator.plugins[x].description.indexOf('Adobe Acrobat') != -1)
                    {
                        acrobat.version=parseFloat(navigator.plugins[x].description.split('Version ')[1]);
                        if (acrobat.version.toString().length == 1) acrobat.version+='.0';
                        acrobat.installed=true;
                        break;
                    }
                }
            }
            else if (window.ActiveXObject)
            {
                for (x=2; x<10; x++)
                {
                    try
                    {
                        var oAcro=eval("new ActiveXObject('PDF.PdfCtrl."+x+"');");
                        if (oAcro)
                        {
                            acrobat.installed=true;
                            acrobat.version=x+'.0';
                        }
                    }
                    catch(e) {}
                }

                try
                {
                    var oAcro4=new ActiveXObject('PDF.PdfCtrl.1');
                    if (oAcro4)
                    {
                        acrobat.installed=true;
                        acrobat.version='4.0';
                    }
                }
                catch(e) {}

                try
                {
                    var oAcro7=new ActiveXObject('AcroPDF.PDF.1');
                    if (oAcro7)
                    {
                        acrobat.installed=true;
                        acrobat.version='7.0';
                    }
                }
                catch(e) {}

            }

            return acrobat.installed;
        }
    }

    function alertAcrobat() {
        if(isAcrobatReaderPresent()) {
            alert("Adobe Acrobat Plugin is there!");
        } else {
            alert("You do not have Adobe Acrobat Plugin!");
        }
    }
    
    function openPDFFile(nodePath, isCMSNode, targetWindow)
    {        
        if(isAcrobatReaderPresent())
        {
            var winFeature = "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,resizable=yes";
            var url;
            if(isCMSNode)
            {
                url = '/rocheRimPortal/portlets/common/DisplayPDFContent.jsp?isCMSNode='+isCMSNode+'&pdfNodePath='+nodePath;
            }
            else if(nodePath)
            {
                var normalized = nodePath.toLowerCase();
                if(normalized.indexOf('/redirect?') == 0)
                {
                    url = nodePath;
                }
                else if(normalized.indexOf('http://') != 0 && normalized.indexOf('https://') != 0)
                {
                    url = "http://" + nodePath;
                }
                else
                {
                    url = nodePath;
                }
            }
            //window.open('/rocheRimPortal/portlets/common/DisplayPDFContent.jsp?isCMSNode='+isCMSNode+'&pdfNodePath='+nodePath,'_blank',winFeature);    
            openWindowNoChrome(url,targetWindow,600,450,1,1);
        }
        else
        {
            openPDFHint();
        }
    }
    
    /**
    * Here DisplayPDFContent.jsp is reused. The page uses one iFrame to show the node content.
    */
    function openFile(nodePath)
    {        
        var winFeature = "height=600,width=800,status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes";
        window.open('/rocheRimPortal/portlets/common/DisplayPDFContent.jsp?pdfNodePath='+nodePath,'_blank',winFeature);    
    }
    
    
    
    function disClaimer(nodePath, isPDF, isLocked)
    {
        var winFeature = "height=650,width=675,status=no,toolbar=no,menubar=no,location=no,resizable=yes";
        if(isPDF)
        {
            if(isAcrobatReaderPresent())
            {
                window.open('/rocheRimPortal/portlets/common/DisplayPDFContent.jsp?disclaimer=true&isLocked='+isLocked+'&pdfNodePath='+nodePath,'_blank',winFeature);    
            }
            else
            {
                openPDFHint();
            }
        }
        else
        {
            window.open('/rocheRimPortal/portlets/common/Disclaimer.jsp?isPDF=false&isLocked='+isLocked+'&nodePath='+nodePath,'_blank',winFeature);    
        } 
    }