function initFileUploads() {
	if (!W3CDOM) return;
	var fakeFileUpload = document.createElement('div');
	fakeFileUpload.className = 'fakefile';
	fakeFileUploadInput = document.createElement('input')
	fakeFileUpload.appendChild(fakeFileUploadInput);
	var image = document.createElement('img');
	image.src='templates/images/durchsuchen.gif';
	fakeFileUpload.appendChild(image);
	var x = document.getElementsByTagName('input');
	for (var i=0;i<x.length;i++) {
		if (x[i].type != 'file') continue;
		if (x[i].parentNode.className != 'fileinputs') continue;
		x[i].className = 'file hidden';
		var clone = fakeFileUpload.cloneNode(true);
		x[i].parentNode.appendChild(clone);
		x[i].relatedElement = clone.getElementsByTagName('input')[0];
		x[i].onchange = x[i].onmouseout = function () {
			this.relatedElement.value = this.value;
			document.getElementById('filepath').value = this.value;
		}
	}
}


function writethis(what) {
	document.write(what);
}

function changeIcon(which, active) {
	which.style.backgroundPosition = active == 1 ? "0px -38px" : "0px 0px";
	which.style.color = active == 1 ? "#000000" : "#807F84";
	
}

function initAll() {
	initFileUploads();
	setUserOptions();
	initMenu();
	searchOnMouseOver();
}

function deInitAll() {
	saveSettings();
}

var W3CDOM = (document.createElement && document.getElementsByTagName);
var IE = document.all?true:false;

window.onload = initAll;
window.onunload = deInitAll;
