/*
$Id: js_functions.inc.js 1624 2005-12-21 01:29:32Z matt $
*/
function popup_image(image_url, title) {
	var winl = (screen.width - 200)/2;
	var wint = (screen.height - 300)/2;
	var settings ='top='+wint+',';
	settings +='left='+winl+',';
	settings +='width=200, ';
	settings +='height=300, ';
	settings +='scrollbars=no,';
	settings +='resizable=yes';

	title = title.replace(/\s/g, '%20');

	win=window.open('image_popup.php?image_url='+image_url+'&title='+title, 'image',settings);

	if(parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}

function popup_gallery(g, i, w, h) {
	var winl = (screen.width - 700)/2;
	var wint = (screen.height - 500)/2;
	var settings ='top='+wint+',';
		settings +='left='+winl+',';
		settings +='width=700, ';
		settings +='height=500, ';
		settings +='scrollbars=no,';
		settings +='resizable=yes';

	win=window.open('/gallery_popup.php?g='+g+'&i='+i+'&w='+w+'&h='+h, 'image',settings);

	if(parseInt(navigator.appVersion) >= 4) {
	   win.window.focus();
	}
}


var dhtmlPopup;

function showDHTMLPopup(elm_id) {

	dhtmlPopup = document.getElementById(elm_id);
	dhtmlPopup.style.display = 'block';
	var left = (document.body.scrollWidth /2) - (dhtmlPopup.clientWidth/2);

	dhtmlPopup.style.left = left+'px';

	window.onresize = centerDHTMLPopup;
}

function closeDHTMLPopup(elm_id) {
	document.getElementById(elm_id).style.display='none';
	window.onresize = null;
}

function centerDHTMLPopup() {
	var left = document.body.scrollWidth /2 - 250;
	dhtmlPopup.style.left = left+'px';
}

function OpenCertDetails() {
	thewindow = window.open('https://www.thawte.com/cgi/server/certdetails.exe?code=NZBABY2-2', 'anew', config='height=513,width=516,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes');
}
