// Window control JavaScript

var popupWin = ''; //Window ID for this document


function popimage (img, w, h)
{
	var ow = w;
	var oh = h;
	var screenW = (screen.availWidth - 25);
	var screenH = (screen.availHeight - 50);
	var scroll ='no';  //only use scroll bars if needed
	var resize ='no';
	
	w += 5;
	h += 20;
	
	// Size popup window to actual required or to max reasonable
	if((w > screenW) && (h > screenH))
	{
		scroll='yes';
		resize='yes';
		w = screenW;
		h = screenH;
	}
	else
	{
		if(w > screenW)
		{
			scroll='yes';
			resize='yes';
			w = screenW;
			h = h + 20; //allow for horiz scroll bars
		}
		if(h > screenH)
		{
			scroll='yes';
			resize='yes';
			h = screenH;
			w = w + 20; //allow for vert scroll bars
		}
	}
	// popup new window
	if ( !popupWin.closed && (popupWin != ''))
		popupWin.close();
	popupWin = window.open('', 'thumbWin', 'toolbar=no,scrollbars='+scroll+',resizable='+resize+',width='+w+',height='+h);
	popupWin.document.write('<html>\n<head>\n<title>WBo2 - '+ow+' x '+oh+' = '+img+'</title>\n</head>\n<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor=#ffffff>\n<img align=middle src="'+img+'">\n<a href="JavaScript:self.close()"><img align=right border=0 height=19 width=57 src=http://wbo2.com/im/close.gif></a>\n</body>\n</html>\n');
	popupWin.document.close();
	popupWin.moveTo(5,5);
	popupWin.focus();
}

function makeMiniHeader (headerText) {

	//document.write('<table width=100%><tr><td>\n<img align=right src=../im/wbo2.gif>\n<h1>' + headerText + '</h1>\n</td>\n');
	document.write('<table width=100%><tr><td>\n<h1>' + headerText + '</h1></td>\n');
	document.write('<td width=250 align=right><a href="javascript:history.go(-1)"><img align=top border=0 width=47 height=19 src=../im/back.gif></a>\n');
	document.write('<b id=g>|</b> <a href=../cart/orderpages.htm>Buy <img align=top width=19 height=16 border=0 src=../im/cart.gif></a>\n');
	document.write('<b id=g>|</b> <a href=../home/default.htm><img width=120 height=46 src=../im/wbo2.gif border=0 align=top></a>\n');
	document.write('</td>\n</tr></table>\n');
}

function makeFooter (pageSubject, counterName, createDate, updateDate) {

	document.write('<br>\n<br>\n<hr size=1 noshade color=#40FF40>\n<p align=center>\n<a href=http://techedge.com.au><img align=left width=132 height=102 border=0 src=http://wbo2.com/logotxt.gif></a>\n\n	Page updated ' + updateDate );
	if (counterName != "") {
		document.write('\n<br>\n<br>\n	<i id=lgy> Unique-visitor counter &nbsp;\n	<IMG SRC="http://counter.digits.com/wc/-d/4/' + counterName);
		document.write('" align=top height=20 border=0 hspace=4 vspace=2>\n	Statistics by <a href=http://www.digits.com/>www.digits.com</a></i>\n</p>\n');
	}
	document.write('<p id=g align=center>\n<i>Page created</i> ' + createDate + '\n	| <i><a href="mailto:peter@techedge.com.au?subject=' + pageSubject);
	document.write(' Page has a broken link">Tell me about broken links</a></i>\n</p>\n<p id=g align=center>\n');

	document.write('<span class=mm>\n<table align=center cellpadding=0 cellspacing=2><tr>\n');
	document.write('<td bgcolor=#519F9F><b id=w><a href="javascript:history.go(-1)">&nbsp;&nbsp;<img align=top border=0 src=http://wbo2.com/menu_arrow_left.gif>&nbsp;Back&nbsp;</a>\n');
	document.write('<td bgcolor=#336666><a href=http://wbo2.com/default.htm>&nbsp;WBo2&nbsp;<img align=top width=17 height=16 border=0 src=http://wbo2.com/im/home.gif>&nbsp;</a>\n');
	document.write('<td bgcolor=#336666><a href=http://techedge.com.au/contact.shtml>&nbsp;&nbsp;&nbsp;Contact&nbsp;&nbsp;</a>\n');
	document.write('<td bgcolor=#336666><a href="mailto:peter@techedge.com.au?subject=[te] ' + pageSubject + ' feedback.">&nbsp;&nbsp;&nbsp;Feedback&nbsp;&nbsp;</a>\n');
	document.write('<td bgcolor=#336666><a href=http://techedge.com.au/copyrite.htm>&nbsp;&nbsp;&nbsp;Copyright&nbsp;&copy;&nbsp;&nbsp;</a>\n');
	document.write('<td bgcolor=#336666><a href=http://techedge.com.au>&nbsp;&nbsp;<b><i>Tech&nbsp;Edge</i></b>&nbsp;<img align=top width=16 height=16 border=0 src=http://wbo2.com/im/favicon.gif>&nbsp;&nbsp;</a>\n');
	document.write('</td></tr></table>\n</span>');
}

function makeNewFooter (pageSubject, counterName, createDate, updateDate) {

	document.write('<br>\n<br>\n<hr size=1 noshade color=#40FF40>\n<p align=center>\n<a href=http://techedge.com.au><img align=left width=132 height=102 border=0 src=http://wbo2.com/logotxt.gif></a>\n\n	Page updated ' + updateDate );
	if (counterName != "") {
		document.write('\n<br>\n<br>\n	<i id=lgy> Unique-visitor counter &nbsp;\n	<IMG SRC="http://counter.digits.com/?counter={' + counterName + '}&template=simple');
		document.write('" align=top height=20 border=0 hspace=4 vspace=2>\n	Statistics by <a href=http://www.digits.com/>www.digits.com</a></i>\n</p>\n');
	}
	document.write('<p id=g align=center>\n<i>Page created</i> ' + createDate + '\n	| <i><a href="mailto:peter@techedge.com.au?subject=' + pageSubject);
	document.write(' Page has a broken link">Tell me about broken links</a></i>\n</p>\n<p id=g align=center>\n');
	
	document.write('<span class=mm>\n<table align=center cellpadding=0 cellspacing=2><tr>\n');
	document.write('<td bgcolor=#519F9F><b id=w><a href="javascript:history.go(-1)">&nbsp;<img align=top border=0 src=http://wbo2.com/menu_arrow_left.gif>&nbsp;Back&nbsp;</a></b>\n');
	document.write('<td bgcolor=#336666><a href=http://wbo2.com/default.htm>&nbsp;WBo2&nbsp;<img align=top width=17 height=16 border=0 src=http://wbo2.com/im/home.gif>&nbsp;</a>\n');
	
	document.write('<td bgcolor=#336666><a href=http://techedge.com.au/contact.shtml>&nbsp;Contact&nbsp;</a>\n');
	document.write('<td bgcolor=#336666><a href="mailto:peter@techedge.com.au?subject=[te] ' + pageSubject + ' feedback.">&nbsp;Feedback&nbsp;</a>\n');
	document.write('<td bgcolor=#336666><a href=http://techedge.com.au/copyrite.htm>&nbsp;Copyright&nbsp;&copy;&nbsp;</a>\n');
	document.write('<td bgcolor=#336666><a href=http://techedge.com.au>&nbsp;<i><b>&nbsp;Tech&nbsp;Edge&nbsp;</i><img align=top width=16 height=16 border=0 src=http://wbo2.com/im/favicon.gif>&nbsp;</a>\n');
	document.write('</td></tr></table>\n</span>');
}

