var myHeight = 0;
var myWidth = 0;
if (typeof(window.innerHeight) == 'number') {
// Non-IE
myHeight = window.innerHeight;
myWidth = window.innerWidth;
} else if (document.documentElement && document.documentElement.clientHeight) {
// IE
myHeight = document.documentElement.clientHeight;
myWidth = document.documentElement.clientWidth;
}
myHeight = myHeight - 150;
myWidth = myWidth;
document.write('<link rel="stylesheet" ',
	'type="text/css" media="screen" href="lib/screen_css.php?height=', myHeight, '&amp;width=', myWidth, '" />');

function refresh()
{
	window.location.reload()
}

function showpic(src, w, h, alt, aln, pw, ph, bw, bh) {
		if (src == null) return;
		var iw, ih; // Set inner width and height
		iw = myWidth - 20; 
		ih = myHeight - 50;

		if (w == null) w = iw;
		if(h == null)  h = ih;
		if(alt == null) alt = "Picture";
		if(aln == null) aln = "left";
		if(pw == null) pw = 100;
		if(ph == null) ph = 100;
		if(bw == null) bw = 24;
		if(bh == null) bh = 24;
		var sw = Math.round((iw - bw) * pw / 100);
		var sh = Math.round((ih - bh) * ph / 100);
		if ((w * sh) / (h * sw) < 1)sw = Math.round(w * sh / h);
		else 
			sh = Math.round(h * sw / w);
			document.write('<img src="'+src+'" alt="'+alt+'" width="'+sw+'" height="'+sh+'" align="'+aln+'">');
}


var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, strWidth, strHeight){
	
	closeWin();
	
	var tools="";
	tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=0,top=0";
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}


