// ----------------------------------------------------------------------
// browser detection
// ----------------------------------------------------------------------
var V1 = (document.getElementById) ? 1 : 0;
var V2 = (document.all) ? 1 : 0;
var V3 = (document.layers) ? 1 : 0;
// var chk = NN4+":"+IE5+":"+NN6+":"+IE6;
var n_active = 'none';
var file_active;
var bild_active;

// ----------------------------------------------------------------------
// mouse over event
// ----------------------------------------------------------------------
function onMouseOver(n,file) {
	if (V1) {
		document.getElementById(n).src = file;
	}
	else if (V2) {
		document.all[n].src = file;
	}
	else if (V3) {
		document[n].src = file;
	}
	
}

// ----------------------------------------------------------------------
// mouse over project event
// ----------------------------------------------------------------------
function onMouseClickPrj(n,file,bild,kat_bild,kat_name,prj_name,prj_jahr,link) {
	if (link != "") {
		txt = "<IMG SRC=\"../bilder/clr.gif\" WIDTH=\"30\" HEIGHT=\"1\" BORDER=\"0\"><IMG SRC=\""+kat_bild+"\" BORDER=\"0\"> <IMG SRC=\"../bilder/vertikalstrich.gif\" WIDTH=\"1\" HEIGHT=\"8\" BORDER=\"0\"> "+kat_name+" <IMG SRC=\"../bilder/vertikalstrich.gif\" WIDTH=\"1\" HEIGHT=\"8\" BORDER=\"0\"> "+prj_name+" "+prj_jahr+", <A HREF=\"http://"+link+"\" TARGET=\"new\">"+link+"</A>";
	}
	else {
		txt = "<IMG SRC=\"../bilder/clr.gif\" WIDTH=\"30\" HEIGHT=\"1\" BORDER=\"0\"><IMG SRC=\""+kat_bild+"\" BORDER=\"0\"> <IMG SRC=\"../bilder/vertikalstrich.gif\" WIDTH=\"1\" HEIGHT=\"8\" BORDER=\"0\"> "+kat_name+" <IMG SRC=\"../bilder/vertikalstrich.gif\" WIDTH=\"1\" HEIGHT=\"8\" BORDER=\"0\"> "+prj_name+" "+prj_jahr;
	}
	if (n != n_active) {
		if (V1) {
			document.getElementById(n).src = file;
			document.getElementById('projekt0').src = bild;
			document.getElementById('ebene0').innerHTML = txt;
			if (n_active != 'none') {
				document.getElementById(n_active).src = file_active;
			}
		}
		else if (V2) {
			document.all[n].src = file;
			document.all['projekt0'].src = bild;
			document.all['projekt0'].innerHTML = txt;
			if (n_active != 'none') {
				document.all[n_active].src = file_active;
			}
		}
		else if (V3) {
			document[n].src = file;
			document['projekt0'].src = bild;
			document['projekt0'].innerHTML = txt;
			if (n_active != 'none') {
				document[n_active].src = file_active;
			}
		}
	}

	n_active = n;
}

// ----------------------------------------------------------------------
// mouse out event
// ----------------------------------------------------------------------
function onMouseOut(n,file) {
	if (V1) {
		document.getElementById(n).src = file;
	}
	else if (V2) {
		document.all[n].src = file;
	}
	else if (V3) {
		document[n].src = file;
	}
}

// ----------------------------------------------------------------------
// mouse out project event
// ----------------------------------------------------------------------
function onMouseOutPrj(n,file) {
	if (n == n_active) {
		file_active = file;
	}
	else {
		if (V1) {
			document.getElementById(n).src = file;
		}
		else if (V2) {
			document.all[n].src = file;
		}
		else if (V3) {
			document[n].src = file;
		}
	}
}

// ----------------------------------------------------------------------
// click event
// ----------------------------------------------------------------------
function click(n,w,h) {
	w = w + 12;
	h = h + 32;
//	var imwin = window.open("../files/imshow.phtml?image="+n, "HWP", "width="+w+",height="+h);
	var imwin = window.open("../files/imshow.phtml?image="+n+"&w="+w+"&h="+h, "HWP", "scollbars=no");
}
