//(C) Stephen Daly
// www.stephendaly.org
// Date: 11/3/2008

// Checks if the browsers is IE or another.
// document.all will return true or false depending if its IE
// If its not IE then it adds the mouse event

// These varibles will be used to store the position of the mouse
var X = 0
var Y = 0

function backgroundFilter()
{
    var div;
    
    if(document.getElementById)
    // Standard way to get element
    div = document.getElementById('backgroundFilter'); 
    else if(document.all) 
    // Get the element in old IE's 
    div = document.all['backgroundFilter']; 
    
    // if the style.display value is blank we try to check it out here 
    if(div.style.display==''&&div.offsetWidth!=undefined&&div.offsetHeight!=undefined)
    {
        div.style.display = (div.offsetWidth!=0&&div.offsetHeight!=0)?'block':'none'; 
    }
    
    // If the background is hidden ('none') then it will display it ('block').
    // If the background is displayed ('block') then it will hide it ('none').
    div.style.display = (div.style.display==''||div.style.display=='block')?'none':'block';
}

function popUp(popupname)
{
    var div;
    
    if(document.getElementById)
    // Standard way to get element
        div = document.getElementById(popupname); 
    else if(document.all) 
    // Get the element in old IE's
        div = document.all[popupname]; 
    
    // if the style.display value is blank we try to check it out here 
    if(div.style.display==''&&div.offsetWidth!=undefined&&div.offsetHeight!=undefined)
    {
        div.style.display = (div.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none'; 
    }
    
    // If the PopUp is hidden ('none') then it will display it ('block').
    // If the PopUp is displayed ('block') then it will hide it ('none').
    div.style.display = (div.style.display==''||div.style.display=='block')?'none':'block';
    
    // Off-sets the X position by 15px
    X = X + 15;

    X = (screen.width / 2) - (div.offsetWidth / 2);
    Y = (screen.height / 2) - ((div.offsetHeight / 2)*2);
    
    //alert(X + ', ' + Y);
    
    // Sets the position of the DIV
    div.style.left = X+'px';
    div.style.top = Y+'px';
}


