﻿// Version 1.10
function CCC_MakeClickFunction(href, windowprops) {
    return function() { window.open(href, "_blank", windowprops, false); return false; };
};
function CCC_SetupPopUP() 
{
    var aList = document.getElementsByTagName('a');
    for (var i = 0; i < aList.length; i++) {
        var x = aList[i]
        if (x.id) {
            if (x.id.substring(0, 2).toUpperCase() == 'PU') {
                if (x.href.substring(0, 11).toLowerCase() != "javascript:") {
                    var width = 200;
                    var height = 200;
                    var top = 100;
                    var left = 100;
                    var scrollbars = "no";
                    var resizable = "no";
                    var fixedOption = "location=no,menubar=no,status=no,titlebar=no,toolbar=no,";
                    var args = x.id.split("_");
                    for (j = 1; j < args.length; j++) {
                        if (args[j].charAt(0).toUpperCase() == "W") width = args[j].substring(1);
                        else if (args[j].charAt(0).toUpperCase() == "H") height = args[j].substring(1);
                        else if (args[j].charAt(0).toUpperCase() == "T") top = args[j].substring(1);
                        else if (args[j].charAt(0).toUpperCase() == "L") left = args[j].substring(1);
                        else if (args[j].charAt(0).toUpperCase() == "S") scrollbars = args[j].substring(1);
                        else if (args[j].charAt(0).toUpperCase() == "R") resizable = args[i].substring(1);
                    }
                    var windowprops = fixedOption + "width=" + width + ",height=" + height
                        + ",top=" + top + ",left=" + left + ",scrollbars=" + scrollbars + ",resizable=" + resizable;
                    x.onclick = CCC_MakeClickFunction(x.href, windowprops);
                    x.href = "#";
                }
            }
        }
    }
};