function hide(names)
{
        var n = names.split(',');
        for(x in n){
                var e = document.getElementById(n[x]);
                if(e==null)
                        alert(n[x] + ' was not found on this page');
                if(e.className.indexOf('show')>=0){
                        e.className=e.className.replace('show','hide');
                }
        }
}
function show(names)
{
        var n = names.split(',');
        for(x in n){
                var e = document.getElementById(n[x]);
                if(e==null)
                        alert(n[x] + ' was not found on this page');
                if(e.className.indexOf('hide')>=0){
                        e.className=e.className.replace('hide','show');
                }
        }
}
/*
 *  *This function is used to display a lightbox message to the user.
 *   * message = html formatted message to the user.
 *    *              || div id name of a div you want to fill this message with.
 *     * width = css type width for the message box.
 *      */
function getScrollPosition(){
        var y = (window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop);
        var x = (window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft);
        return [x, y];
}
function getPageSize(){
        var w = (window.innerWidth + window.scrollMaxX || document.body.scrollWidth || document.body.offsetWidth);
        var h = (window.innerHeight + window.scrollMaxY || document.body.scrollHeight || document.body.offsetHeight);
        return [h,w];
}
function wvMessage(message, width){
        var t1 = document.getElementById(message);
        var s = document.getElementById('shade');
        var m = document.getElementById('message');
        var mb = document.getElementById('message_box');
        var mf = document.getElementById('message_frame');
        var ps = getPageSize();
        var sp = getScrollPosition();
        s.style.height=ps[0]+'px';
        mb.style.top=sp[1]+'px';
        mb.style.left=sp[0]+'px';
        mf.style.width=width;
        if(t1 == undefined){
                m.innerHTML=message;
        }
        else{
                m.innerHTML = t1.innerHTML
        }
        show('shade,message_box');
}

