String.prototype.camelCase = function() {
    return this.replace(/-\D/g, function(match){
        return match.charAt(1).toUpperCase();
    });
}
Element = function(node, attrib) {
    attrib = attrib || null;
    node = document.createElement(node);
    if(typeof attrib == 'object') {
        for(attribute in attrib) {
            switch(attribute) {
                case 'html': 
                    node.innerHTML = attrib[attribute];
                    break;
                case 'style': 
                    if(typeof attrib[attribute] == 'object') {
                        for(styleattribute in attrib[attribute]) {
                            stylevalue = attrib[attribute][styleattribute];
                            styleattribute = styleattribute.camelCase();
                            node.style[styleattribute] = stylevalue;
                        }
                    } else {
                        continue;
                    }
                    break;
                default: 
                    node.setAttribute(attribute, attrib[attribute]);
                    break;
            }
        }
    }
    return node;
}
function showPopup(p_icon, p_title, p_text, p_link, p_linkurl) {
    LayerPop = new Element('div', {
        'style': {
            'font': '12px sans-serif',
            'width': '300px',
            'position': 'absolute',
            'z-index': '9999',
            'padding': '5px 10px 10px 10px',
            'text-align': 'left',
            'bottom': '20px',
            'left': (document.getElementsByTagName('body')[0].offsetWidth - 350) + 'px',
            'background': '#C0CEFB',
            'border': '5px solid #1A2959'
        }
    });
    LayerPopH = new Element('h3', {
        'html': p_title,
        'style': {
            'color': '#1A2959',
            'font-size': '13px',
            'padding': '0 0 0 20px',
            'font-weight': 'bold',
            'margin': '0',
            'background-image' : 'url(' + p_icon + ')',
            'background-repeat' : 'no-repeat',
            'background-position' : 'center left'
        }
    });
    LayerPopP = new Element('p', {
        'html': p_text + '<br /> <a style="color: #1A2959; font-weight: bold; text-decoration: underline;" href="' + p_linkurl + '">' + p_link + '</a>',
        'style': {
            'color': '#1A2959',
            'padding': '0',
            'line-height': '16px',
            'margin': '5px 0 0',
            'font-size': '11px'
        }
    });
    LayerPopC = new Element('a', {
        'html': 'X',
        'href': '#',
        'style': {
            'position': 'absolute',
            'text-decoration': 'none',
            'right': '0px',
            'padding': '2px 4px',
            'top': '0px',
            'font-size': '10px',
            'font-weight': 'bold',
            'color': '#1A2959',
            'display': 'block'
        }
    });
    LayerPopC.onclick = function() {
        document.getElementsByTagName('body')[0].removeChild(this.parentNode);
    }
    LayerPop.appendChild(LayerPopH);
    LayerPop.appendChild(LayerPopP);
    LayerPop.appendChild(LayerPopC);
    document.getElementsByTagName('body')[0].appendChild(LayerPop);
}