function swapClass(obj, cls) {
  obj.className = cls
}

function openBigWindow(link)
{
preLoaded=new Image();
preLoaded.src=link;
var picLeft = 100;
var picTop = 50;
var loop = 0;
var picWidth = 800;
var picHeight = 600;
if (true)
{
	picWidth = preLoaded.width+40;
	picHeight = preLoaded.height+80;

	if (screen.availWidth < preLoaded.width+100)
	{
	   picWidth = screen.availWidth-20;
	   picLeft = 10;
	}

	if (screen.availHeight < preLoaded.height+50)
	{
	   picHeight = screen.availHeight-20;
	   picTop = 10;
	}
}


var myParams='left='+picLeft+',top='+picTop + ',width=' + picWidth + ',height=' + picHeight + ',scrollbars=yes,resizable=yes,menubar=yes';
var newWin = open('','View',myParams);
newWin.document.writeln('<body BGCOLOR="pink">');
newWin.document.writeln('<b>Click image to close</b>');
newWin.document.writeln('<p>');
newWin.document.writeln('<table border="2"><tr><td>');
newWin.document.writeln('<img src="'+link+'" onClick="window.close()"></td></tr></table>');
newWin.document.writeln('</body>');
newWin.document.close();
newWin.focus();
}

function openTextWindow(link)
{
var myParams='screenX=200,screenY=100,width=430,height=400,scrollbars=no,resizable=yes,menubar=yes';
var newWin = open('','Details',myParams);
newWin.document.writeln('<body BGCOLOR="#ffffcf">');
newWin.document.writeln('<iframe name="list" allowtransparency="true" width="400" height="330" src="'+link+'"></iframe>');
newWin.document.writeln('<form>');
newWin.document.writeln('<center>');
newWin.document.writeln('<p><INPUT type="BUTTON" value="Close Window", name="Cncl" onclick=window.close()>');
newWin.document.writeln('</center>');
newWin.document.writeln('</form>');
newWin.document.writeln('</body>');
newWin.document.close();
newWin.focus();
}
