/*******************************************************************************

'popwin.js', by Professional Solutions

popup window routines

Permission is granted to use and modify this script for any purpose,
provided that this credit header is retained, unmodified, in the script.


*******************************************************************************/

<!--
var isNav = (navigator.appName.indexOf("Netscape") !=-1);

function handlerMD(e){
Xmd = (isNav) ? e.pageX : event.clientX;
Ymd = (isNav) ? e.pageY : event.clientY;
}

if (isNav) {
document.captureEvents(Event.MOUSEDOWN);
}

document.onmousedown = handlerMD;

// -----------------------------------------------------------------------------

//	winName.document.write('win:'+winName+'/w'+winWidth+'/h'+winHeight+''); //debug

function pspopOpen(winName,multiWin,winTitle,winWidth,winHeight,winLeft,winTop,pagecolor) {

	winparams = "width="+winWidth+",height="+winHeight+",left="+winLeft+",top="+winTop+",toolbar=no,status=no,location=no,resizable=yes,scrollbars=no";
	winName = window.open("",winName, winparams);

	winName.document.write('<html><title>'+winTitle+'</title>\n');

	winName.document.write('<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="'+pagecolor+'"');

	if (multiWin=="s") { //Single window only
		winName.document.write(' onBlur="self.close()"');
		//winName.document.write(' onBlur="self.focus()"');
		winName.document.write('');
	};
	winName.document.write('>\n');

	winName.document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">\n');

//	winName.document.write('<tr><td>win:'+winName.name+'/width='+winWidth+',height='+winHeight+',left=0,top=0</td></tr>'); //debug

	return winName
}

function pspopPic(winName,graphicPath,winWidth,winHeight,alt) {
	winName.document.write('<tr><td align="center">\n');
//	winName.document.write('<img src="'+graphicPath+'" width='+winWidth+' height='+winHeight+' alt="'+alt+'">\n');
//	winName.document.write('<img src="'+graphicPath+'" alt="'+alt+'">\n<br>x'+Xmd+'/y'+Ymd+'<br>');
	winName.document.write('<img src="'+graphicPath+'" alt="'+alt+'">\n<br>');
	winName.document.write('</td></tr>\n');
}

function pspopText(winName,Align,Bold,Italic,Text) {
	winName.document.write('<tr><td align="'+Align+'">');
	if (Bold=="b") {
		winName.document.write("<b>");
	}
	if (Italic=="i") {
		winName.document.write("<i>");
	}

	winName.document.write(Text);

	if (Italic=="i") {
		winName.document.write("</i>");
	}
	if (Bold=="b") {
		winName.document.write("</b>");
	}
	winName.document.write('</td></tr>\n');
}
// -----------------------------------------------------------------------------

function pspopClose(winName) {
//	winName.document.write('<tr><td align="center"><font="ariel">Click to close</font></td></tr>\n');
	winName.document.write('</table></body></html>\n');
	winName.document.close();
	winName.focus();
}

// -----------------------------------------------------------------------------
function popup(winName,winTitle,graphicPath,winWidth,winHeight,winLeft,winTop,alt,pagecolor,multiWin) {

	thisWin = pspopOpen(winName,multiWin,winTitle,winWidth,winHeight,winLeft,winTop,pagecolor);

	pspopPic(thisWin,graphicPath,winWidth,winHeight,alt);

//	pspopText(thisWin,"Center","b","i","Click to close");
//	pspopText(thisWin,"left","b","x","&nbsp;"); //Blank Line

//	message = "Click to close";
//	message+= "at any point<br>";
//	pspopText(thisWin,"left","x","x",message);

//	pspopText(thisWin,"left","b","x","&nbsp;"); //Blank Line
//	pspopText(thisWin,"Center","x","i","a centered italic message");

	pspopClose(thisWin);

}

function popupt(winName,winTitle,graphicPath,winWidth,winHeight,winLeft,winTop,alt,pagecolor,multiWin) {

	thisWin = pspopOpen(winName,multiWin,winTitle,winWidth,winHeight,winLeft,winTop,pagecolor);

	pspopPic(thisWin,graphicPath,winWidth,winHeight,alt);

//	pspopText(thisWin,"Center","b","i","Click to close");
//	pspopText(thisWin,"left","b","x","&nbsp;"); //Blank Line

//	message = "Click to close";
//	message+= "at any point<br>";
//	pspopText(thisWin,"left","x","x",message);

	pspopText(thisWin,"left","b","x","&nbsp;"); //Blank Line
	pspopText(thisWin,"Center","x","i","a centered italic message");

	pspopClose(thisWin);

}

// -----------------------------------------------------------------------------

function popup2(winName,winTitle,graphicPath,winWidth,winHeight,winLeft,winTop,alt,pagecolor,multiWin) {

	thisWin = pspopOpen(winName,multiWin,winTitle,winWidth,winHeight,winLeft,winTop,pagecolor);

	pspopPic(thisWin,graphicPath,winWidth,winHeight,alt);

	pspopClose(thisWin);

}

// -----------------------------------------------------------------------------
function popuphtml(mylink, windowname, winWidth, winHeight, winLeft, winTop)
{
if (! window.focus)return true;
var href;
winparams = "width="+winWidth+",height="+winHeight+",left="+winLeft+",top="+winTop+",toolbar=no,status=no,location=no,resizable=yes,scrollbars=no";

if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;

window.open(href, windowname, winparams);
}
//-->
