/**
 * Gets the real scroll top
 */
function getScrollTop() {
    if (self.pageYOffset) // all except Explorer
    {
        return self.pageYOffset;
    }
    else if (document.documentElement && document.documentElement.scrollTop)
        // Explorer 6 Strict
    {
        return document.documentElement.scrollTop;
    }
    else if (document.body) // all other Explorers
    {
        return document.body.scrollTop;
    }
}
function getScrollLeft() {
    if (self.pageXOffset) // all except Explorer
    {
        return self.pageXOffset;
    }
    else if (document.documentElement && document.documentElement.scrollLeft)
        // Explorer 6 Strict
    {
        return document.documentElement.scrollLeft;
    }
    else if (document.body) // all other Explorers
    {
        return document.body.scrollLeft;
    }
}
function getViewportHeight() {
    if (window.innerHeight!=window.undefined) return window.innerHeight;
    if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight;
    if (document.body) return document.body.clientHeight; 

    return window.undefined; 
}
function getViewportWidth() {
    var offset = 17;
    var width = null;
    if (window.innerWidth!=window.undefined) return window.innerWidth; 
    if (document.compatMode=='CSS1Compat') return document.documentElement.clientWidth; 
    if (document.body) return document.body.clientWidth; 
}


function show_shadowbox(p_width, p_height, p_content)
{
    var newdiv = document.createElement('div');
    var divIdName = 'shadowbox';
    newdiv.setAttribute('id',divIdName);  
    opacity(divIdName, 0, 85, 1);
    document.body.appendChild(newdiv);
    
    var width = p_width;
    var height = p_height;
    var top_pos = (getViewportHeight()/2 - height/2)*0.75;  
    var left_pos = (getViewportWidth()/2 - width/2);
    
    var hide_iframe = document.createElement('IFRAME');
    var iframe_name = 'hide_frame';
    hide_iframe.setAttribute('id',iframe_name);      
    hide_iframe.style.border = '0';
    hide_iframe.style.width = (width) + 'px';
    hide_iframe.style.height = (height) + 'px';
    hide_iframe.style.top =  top_pos + 'px';
    hide_iframe.style.left = left_pos + 'px';
    //opacity(iframe_name, 0, 1, 50);
  
  
    var modal = document.createElement('div');
    var modal_name = 'landing';
    modal.setAttribute('id',modal_name);    
   
    modal.style.width = width + 'px';
    modal.style.height = height + 'px';
    modal.style.top =  top_pos + 'px';
    modal.style.left = left_pos + 'px';
    modal.innerHTML = p_content;
    //opacity(modal_name, 0, 100, 50);
  
  
    document.body.appendChild(hide_iframe);
    document.body.appendChild(modal);
}