/* Default popup function */
function display_popup(url, name, width, height, directories, toolbar, menubar, scrollbars, status, resizable, dependent, fullscreen) {
	var args = "width="+ width +",height="+ height;
	if(directories == true) args += ",directories"
	if(toolbar == true) args += ",toolbar"
	if(menubar == true) args += ",menubar"
	if(scrollbars == true) args += ",scrollbars"
	if(status == true) args += ",status"
	if(resizable == true) args += ",resizable"
	if(dependent == true) args += ",dependent"
	if(fullscreen == true) args += ",fullscreen"
	
	args += ",resizable"
	
	window.open(url, name, args);
}


/* Close Window */
function close_popup() {
	window.close();
	window.setTimeout("window.close()", 1);
}


/* Display an image in a new popup window */
function enlarge_image(image, title, width, height, language) {
	var l = (screen.availWidth - width) / 2;
	var t = (screen.availHeight - height) / 2;

	var generator = window.open('', 'enlarge_image', 'height='+height+',width='+width+',left='+l+',top='+t+',scrollbars,resizable');
	if(generator) {
		generator.document.write('<html><head>');
		generator.document.write('<title>'+title+'</title>');
		generator.document.write('</head><body style="margin:0">');
		generator.document.write('<table style="width: 100%; height: 100%;" cellpadding="0" cellspacing="0" border="0"><tr><td align="center" valign="center"><a href="javascript:self.close()"><img src="'+image+'" alt="" border="0"/></a></td></tr></table>');
		generator.document.write('</body></html>');
		generator.document.close();	
	} else {
		var generator = window.open(image, 'enlarge_image', 'height='+height+',width='+width+',left='+l+',top='+t+',scrollbars,resizable');
	}
	
	return false;
}
