/*
	JavaScript Helper functions for ROBERTSFLUTES.COM

	(partly based on concepts from CodeLifter.com)

	22.8.2004 -mf
*/

function popNews(head)
{
	var newsWindow = window.open("news.html#" + head,"News",
		"top=100,left=100,width=650,height=400,scrollbars=yes,resizable=yes");
	newsWindow.focus();
}

PositionX = 12;
PositionY = 12;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)
defaultWidth  = 2500;
defaultHeight = 2500;

imageTitle = "Howel Roberts - Flutemaker (Detailimage)";

var optNN='scrollbars=yes,resizable=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=yes,resizable=yes,width=150,height=100,left='+PositionX+',top='+PositionY;

if (parseInt(navigator.appVersion.charAt(0))>=4)
{
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}

function popImage(imageURL)
{
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}

	with (imgWin.document)
	{
		writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
		writeln('<sc'+'ript>');
		writeln('var isNN,isIE;');
		writeln('if(parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');
		writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('var maxWidth = screen.availWidth-'+PositionX+';');
		writeln('var maxHeight = screen.availHeight-'+PositionY+';');
		writeln('function reSizeToImage(){');
		writeln('if(isIE){');
		writeln('window.resizeTo(100,100);');
		writeln('width=100-(document.body.clientWidth-document.images[0].width);');
		writeln('height=100-(document.body.clientHeight-document.images[0].height);');
		writeln('width=(width>maxWidth)?maxWidth:width;');
		writeln('height=(height>maxHeight)?maxHeight:height;');
		writeln('window.resizeTo(width,height);}');
		writeln('if(isNN){');
		writeln('width=document.images["Howel"].width;');
		writeln('height=document.images["Howel"].height;');
		writeln('window.innerWidth=(width>maxWidth)?maxWidth:width;');
		writeln('window.innerHeight=(height>maxHeight)?maxHeight:height;}}');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');
		writeln('</sc'+'ript>');
// Close the window automatically
//		writeln('</head><body bgcolor=000000 onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
// OR (!!!) allow multiple popup windows
		writeln('</head><body bgcolor=000000 onload="reSizeToImage();doTitle();self.focus()">');
// (comment unused!)
		writeln('<a href="javascript:self.close()">');
		writeln('<img name="Howel" src='+imageURL+' style="display:block" border="0" alt="click to close" onclick"self.close()">');
		writeln('</a></body></html>');
		close();
	}
}

// end of source code