// Popup Window Function - Park Board Template

// --------------------------------------------------------------
// script used in body 'onload' to set up windowPop function
// (this is already done in our page templates)
function windowPopSetup() {
	var a;
	for (var i = 0; (a = document.links[i]); i++) {
		if (a.target && a.target.indexOf("_windowPop") == 0) {
			a.onclick = windowPop;
		}
	}
}

// --------------------------------------------------------------
// script for HTML page popup
// --- example of use:
// <a href="popup.htm" target="_windowPop:width=600,height=400,resizable"><img src="thumbnail.gif" border="0"></a>
// --- example of code in HTML popup page to 'click to close':
// <div style="height: 100%; width: 100%; position: absolute; top: 0; left: 0; zindex: 1;"><a href="javascript:self.close();"><img src="../../images/spacer.gif" height="100%" width="100%" border="0"></a></div>
// <div style="background-color:#000000; padding: 1px; padding-left: 15px; padding-right: 10px; font-family: Arial,Helvetica; font-weight: bold; font-size: 11px; color: #FFFFFF; zindex: 1; position: absolute; right: 0; bottom: 0; filter: alpha(opacity=50); opacity: 0.5; -moz-opacity: 0.5; ">Click window to close</div>
function windowPop() {
	var a = this.target.split(":");
	var sFeatures = a[1];
	window.open(this.href, a.length > 2 ? a[2] : String((new Date()).getTime()), sFeatures);
	return false;
	alert("Popup Error")
}

// --------------------------------------------------------------
// script for image popup
// --- example of use:
// <img src="thumbnail.gif" style="border: none; cursor: pointer;" onclick="MM_openImgWindow('fullsizeimage.jpg','windowname','width=600,height=400','Window Title')">
function MM_openImgWindow(theURL,winName,features,wnd_title) {
  var h = features.match(/height=\d+/)[0].split('=')[1] * 1.0 + 30.0;
  features = features.replace(/height=\d+/, 'height='+h);
  var w=window.open('',winName,features+',location=no,menubar=no,toolbar=no,status=no,resizable=no');
  w.document.writeln('<html><head><title>'+wnd_title+'</title>');
  w.document.writeln('<style>');
  w.document.writeln('body {margin:0; padding:0; background: #000000;}');
  w.document.writeln('.pictext {color: #ffffff; font-family: Verdana,Arial,Helvetica; font-size: 13px;}');
  w.document.writeln('</style></head>');
  w.document.writeln('<body><img src="'+theURL+'"><table border="0" width="100%"><tr>' +
                     '<td align="left">&nbsp;<a class="pictext" href="#" onClick="javascript:self.print();return(false);">Print</a>&nbsp;</td>' +
                     '<td align="right"><a class="pictext" href="#" onClick="javascript:self.close()">Close</a>&nbsp;</td>' +
                     '</tr></table></body></html>');
  w.document.close();
  return false;
}


