var minHeight = 340;
var c1 = 90, c2= 200;
window.onload = doSize;
window.onresize = doSize;

function doSize()
{
	var newHeight = document.documentElement.clientHeight - c1 - c2;

	if (newHeight < minHeight) 
		newHeight = minHeight;
	
	document.getElementById("main").style.height = newHeight + "px";
	document.getElementById("footer").style.top	= 230 + newHeight + "px";
}

var nn = !(document.all);
var nnHeight = 100;
var sTimer = -1;

function ShowPict(myPict,ww,hh,b,title) {
	document.write("<img title=\""+title+"\" border=\""+b+"\" SRC=\""+myPict+"\" WIDTH=\""+ww+"\" HEIGHT=\""+hh+"\" style=\"border-color:#000000; filter:alpha(opacity=60)\" onMouseover=\"makevisible(this,0); window.status=\'\'; return true\" onMouseout=\"makevisible(this,1); window.status=\'\';\">");
}

function makevisible(cur,which){
	if (which==0) {cur.filters.alpha.opacity=100;}
	else {cur.filters.alpha.opacity=60;}
}

function getPosition(pos, w, h){
	if(w == null){
		w = 500;
		h = 715;
	}
	if (pos=="lefttop"){
		return 'width=' + w + ', height=' + h + ', top=0, left=0, resizable=yes';
	}
	else{// if (pos=="center") {
		return 'width=' + w + ', height=' + h + ', left=' + 
			((screen.width)?(screen.width-w)/2 : 100) + ', top=' + ((screen.height)?(screen.height-h)/2 : 100) + ', resizable=no';
	}
}

function openWindow(myLink, windowName, w, h, scroll, pos, pict, wp, hp, name){
	var $name = ' / Industrial IT, Automation, Process Technology @ cowex a/s', settings;

	if (!window.focus) return;

	settings = getPosition(pos, w, h) + ',dependent=yes,scrollbars=' + scroll + 
					',location=no,directories=no,status=no,menubar=no,toolbar=no';

	var myWin=window.open('', windowName, settings);
	name = name + $name;
	myWin.document.write("<HTML><Title>\"" + name + 
		"\"</title><BODY bgcolor=black leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><img src=\"" + pict + 
		"\" height=\"" + hp + "\" width=\"" + wp + "\"></body></html>");

	myWin.focus();
	myLink.target=windowName;
}

function openLink(URL, wName, pos, w, h){
	var myWin=window.open(URL, wName, getPosition(pos, w, h));
//	myWin.document.bgColor = '#000000';
	myWin.focus();
}
