// A blank HTML file /includes/blank.htm should be included for the frames option to function properly
/* usage:-
<a href="page.htm" onclick="popItUp(this,'Page Title','no',500,500,true,false,true);return false;" target="_blank">
	this, - URL
	'Page Title', - page title for frames version
	'no', - show menu bars etc. (yes/no)
	500,500, - width and height
	true, - use framed version (true/false)
	false, - use cache buster (true/false with ASP) 
	true - Pages are printable (true/false - from same domain only)
*/
//global vars
var persWin=null;
var printIt=null;
var openWins = new Array("persiwin")
// register new windows for 'close all' function
function regWin(winName) {
	//alert (openWins.length + ", " + winName);
	for(f=0;f<=openWins.length;f++) {

		if (!openWins[f]) {
			openWins[f] = winName;
			//alert (openWins[f]);
			break;
		}
	}
}
//'close all' function
function closeAll() {
	for(f=0;f<openWins.length;f++) {
			//eval(openWins[f].value.window.close());
			alert (openWins[f]);
			persWin=openWins[f];
			persWin.window.close();
	}
}
//frames version
function popItUp(file_url,file_title,menu_bar,xwide,yhigh,frameIt,cacheBust,printLink)
{
printIt=printLink;
// cachebuster - causes problems with .asp?
if (cacheBust==true) {
file_url += '?';
file_url += Math.random();
}

	if (frameIt==true){
var frames_html='<html><head><title>' + file_title + '</title></head><frameset frameborder="0" framespacing="0" border="0" rows="20,*" ><frame name="blank" src="/locallife/includes/popnav.htm" scrolling="no"><frame name="popup_page" src="' + file_url + '" scrolling="auto" marginwidth="10" marginheight="0"></frameset></html>';
persWin=window.open('','persiwin','toolbar=no,location=no,directories=no,status='+menu_bar+',menubar='+menu_bar+',scrollbars=no,resizable=yes,copyhistory=no,width='+xwide+',height='+yhigh+'top=10,left=100');
persWin.document.clear();
persWin.document.open();
persWin.resizeTo(xwide,yhigh); 
setTimeout('persWin.window.focus();',250);
persWin.document.write(frames_html);
persWin.document.close();
	}
else
	{
	persWin=window.open(file_url,'persiwin','toolbar=no,location=no,directories=no,status='+menu_bar+',menubar='+menu_bar+',scrollbars=no,resizable=yes,copyhistory=no,width='+xwide+',height='+yhigh+'top=10,left=100');
	persWin.resizeTo(xwide,yhigh); 
	setTimeout('persWin.window.focus();',250);
	} 
}