/*
$Id: js_functions.inc.js 6 2009-09-22 04:44:45Z root $
*/
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();
	}
}

/* preload images */
if (document.images) {
	var spacerOn = new Image();
	spacerOn.src = "/images/spacer.gif";
}

function insert_tv() {
	if (document.getElementById('polaroid')) {
		document.getElementById('polaroid').innerHTML = '<div id="tv">' +
																							'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="257" height="208" id="student-city" align="middle">' +
																							'<param name="allowScriptAccess" value="sameDomain" />' +
																							'<param name="movie" value="/flash/student-city.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="/flash/student-city.swf" quality="high" bgcolor="#ffffff" width="257" height="208" name="student-city" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
																							'</object>';
																							'</div>';
	}
}
