
var cover;

var loadDiv = function(startDiv) {

	cover = document.getElementById('cover');
        if (startDiv != null) {
                popUp(startDiv);
        }

}
	
var popClose = function(id) {

	var currentWindow = document.getElementById(id);
                  
	if (typeof currentWindow.style.opacity != 'undefined') {
                                
		currentWindow.style.opacity = 0;
        } else if (typeof currentWindow.style.filter != 'undefined') {
                currentWindow.style.filter = 'alpha(opacity=' + 0 + ')';
		
        }
	if (typeof cover.style.opacity != 'undefined') {

                cover.style.opacity = 0;
        } else if (typeof cover.style.filter != 'undefined') {
                cover.style.filter = 'alpha(opacity=' + 0 + ')';

        } 
	cover.style.zIndex = 0;
	currentWindow.style.zIndex = 0;               
}

var popUp = function(id) {

        if (typeof cover.style.opacity != 'undefined') {

                cover.style.opacity = .5;
        } else if (typeof cover.style.filter != 'undefined') {
                cover.style.filter = 'alpha(opacity=50)';

        }

        var currentWindow = document.getElementById(id);

        if (typeof currentWindow.style.opacity != 'undefined') {

                currentWindow.style.opacity = 1;
        } else if (typeof currentWindow.style.filter != 'undefined') {
                currentWindow.style.filter = 'alpha(opacity=100)';

        }
	cover.style.zIndex = 2;
	currentWindow.style.zIndex = 3;
 
}


