
// Displays a 300x400 popup.
// Usage: <lss-html:link  action="MyAction" target="_blank" onclick="popupSmall(this); return false">My Popup Link</lss-html:link>
function popupSmall(link) {
	
	var w = 300;
	var h = 400;
	var xMax, yMax;

    if (document.all) {
        xMax = screen.width;
        yMax = screen.height;
	} else {
        if (document.layers) {
            xMax = window.outerWidth;
            yMax = window.outerHeight;
        } else {
            xMax = 640;
            yMax = 480;
        }
	}
	
    var xOffset = (xMax - w) / 2;
    var yOffset = (yMax - h) / 2;

	var theWindow = window.open(link.getAttribute('href'), 
								link.getAttribute('target') || '_blank', 
								'location=0,statusbar=0,menubar=0,resizable=1,width='+w+',height='+h+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset);
	theWindow.focus();
	return theWindow;

}

// 600 x 600
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=600');");
}

// 600 x 600
function popUpLink(link) {
	day = new Date();
	id = day.getTime();
	
	var theWindow = window.open(link.getAttribute('href'), 	id, 
								'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=600');
	theWindow.focus();
	return theWindow;
}

// 400 x 450
function popUpMedium(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(link.getAttribute('href'), '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=450');");
}