<?php

// see http://www.webreference.com/js/column90/ for a tutorial on modal dialogs

function JSModalDialog($url,$width=400,$hgt=300)
{
GLOBAL $HTTP_SERVER_VARS;
	$width = $width.'px';
	$hgt = $hgt.'px';
	if (strpos($HTTP_SERVER_VARS['HTTP_USER_AGENT'],'MSIE') !== false) {
		return "showModalDialog('$url',window,'dialogWidth:$width;dialogHeight:$height;status:false;center:yes');";
	} else {
		return "window.open('$url')";
	}
}
function ModalAnchor($title,$url,$w=400,$h=300)
{
	return "<a href=\"javascript:".JSModalDialog($url,$w,$h)."\">$title</a>";
}

function JSModalDialogButton($title,$url,$w=400,$h=300)
{
return '<input value="'.$title.'" type=button onclick="'.JSModalDialog($url,$w,$h).'">';
}

//print JSModalDialogButton('a box','/');
//print ModalAnchor('Hello','/');

function JSCloseButton($title)
{
return "<BUTTON onclick='self.close()'>$title</BUTTON>";
}
?>