

if(!true)
    alert("You must activate the Vizit Feature in the Site Collection Features management area. Please contact your Site Collection administrator.");

var Vizit;
if(!Vizit) Vizit = {};

function LoadResources() {
    var head = document.getElementsByTagName('head')[0];

    var script = document.createElement('script');
    script.src = Vizit.JavascriptPath + 'component.js?ver=2.0.2.36478';
    script.type = 'text/javascript';
    script.language = 'javascript';
    head.appendChild(script);
    
    var style = document.createElement('link');
    style.setAttribute('rel', 'stylesheet');
    style.setAttribute('type', 'text/css');
    style.href = Vizit.WebUrl + '_layouts/Vizit/Viewer/css/Buttons.css?ver=2.0.2.36478';
    head.appendChild(style);
}

Vizit.PreviewerMultiplier = 1;
Vizit.WebUrl = "http://www.ranson.us/";
Vizit.ViewerPath = "http://www.ranson.us/_layouts/Vizit/Viewer/";
Vizit.JavascriptPath = Vizit.WebUrl + "_layouts/Vizit/Previewer/JavaScript/";
Vizit.ImagePath = Vizit.WebUrl + "_layouts/Vizit/Previewer/Images/";
Vizit.ViewerIsLicensed = false;
            
if(!Vizit.ViewerIsLicensed) createCSSClass('.VizitViewerIcon','display:none !important;');

LoadResources();

function createCSSClass(selector, style)
{
    // using information found at: http://www.quirksmode.org/dom/w3c_css.html
    // doesn't work in older versions of Opera (< 9) due to lack of styleSheets support
    if(!document.styleSheets) return;
    if(document.getElementsByTagName("head").length == 0) return;
    var stylesheet;
    var mediaType;
    if(document.styleSheets.length > 0)
    {
        for(i = 0; i < document.styleSheets.length; i++)
        {
            if(document.styleSheets[i].disabled) continue;
            var media = document.styleSheets[i].media;
            mediaType = typeof media;
            // IE
            if(mediaType == "string")
            {
                if(media == "" || media.indexOf("screen") != -1)
                {
                    styleSheet = document.styleSheets[i];
                }
            }
            else if(mediaType == "object")
            {
                if(media.mediaText == "" || media.mediaText.indexOf("screen") != -1)
                {
                    styleSheet = document.styleSheets[i];
                }
            }
            // stylesheet found, so break out of loop
            if(typeof styleSheet != "undefined") break;
        }
    }
    // if no style sheet is found
    if(typeof styleSheet == "undefined")
    {
        // create a new style sheet
        var styleSheetElement = document.createElement("style");
        styleSheetElement.type = "text/css";
        // add to head
        document.getElementsByTagName("head")[0].appendChild(styleSheetElement);
        // select it
        for(i = 0; i < document.styleSheets.length; i++)
        {
            if(document.styleSheets[i].disabled) continue;
            styleSheet = document.styleSheets[i];
        }
        // get media type
        var media = styleSheet.media;
        mediaType = typeof media;
    }
    
    if (mediaType == "string") styleSheet.addRule(selector,style);
    else if(mediaType == "object") styleSheet.insertRule(selector + "{" + style + "}", styleSheet.cssRules.length);
}