function loadFile(userid){
	document.getElementById('demo').style.visibility = "hidden";
	document.getElementById('centerer').innerHTML = "<div id=\"demodrop\"><h5>FILE SELECTION</h5><p>please select the File you want to upload (please take care of the filesize: files, which are bigger than 20 MB will be ignored!)</p><form action=\"global/skript/uplfl.php\" name=\"upldform\" id=\"upldform\" method=\"post\" enctype=\"multipart/form-data\" target=\"loadframe\"><input type=\"file\" name=\"datei1\" class=\"demofield\" /><br /><br />You can save a small message <br />descibing your file:<br /><br /><textarea name=\"message\" cols=\"30\" rows=\"10\" class=\"demoarea\"></textarea><input type=\"hidden\" name=\"usrid\" value=\"\" /><br /><br /><a href=\"javascript: onclick=loadit('"+userid+"');\" id=\"submitbut\" onfocus=\"this.blur();\">Submit</a></form></div>";
	if(document.getElementById("picpreview").style.display != "block"){
		document.getElementById("picpreview").style.display="block";
		//document.getElementById("picpreview").style.height = screen.height+"px";
		myWidth = 0; myHeight = 0;  
		if( typeof( window.innerWidth ) == 'number' ) {  
		//Non-IE  
		myWidth = window.innerWidth;  
		myHeight = window.innerHeight;  
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {  
		//IE 6+ in 'standards compliant mode'  
		myWidth = document.documentElement.clientWidth;  
		myHeight = document.documentElement.clientHeight;  
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {  
		//IE 4 compatible  
		myWidth = document.body.clientWidth;  
		myHeight = document.body.clientHeight;  
		}
		scrOfX = 0; scrOfY = 0;  
		if( typeof( window.pageYOffset ) == 'number' ) {  
		//Netscape compliant  
		scrOfY = window.pageYOffset;  
		scrOfX = window.pageXOffset;  
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {  
		//DOM compliant  
		scrOfY = document.body.scrollTop;  
		scrOfX = document.body.scrollLeft;  
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {  
		//IE6 standards compliant mode  
		scrOfY = document.documentElement.scrollTop;  
		scrOfX = document.documentElement.scrollLeft;  
		}  
		ypos = ((myHeight/2)+scrOfY);
		document.getElementById("centerer").style.top = ypos+"px";
		document.getElementById("demodrop").style.top = "-"+(document.getElementById("demodrop").offsetHeight/2)+"px";
		document.getElementById("picpreview").style.height = (document.body.scrollHeight+myHeight)+"px";
	}
}
function loadit(userid){
	if(document.upldform.datei1.value == ""){
	if(!confirm("You did not select a file!\n\nIf you don't want to upload one,\nclick 'Cancel', otherwise click 'OK' to select a file!")){
		document.getElementById("picpreview").style.display = "none";
		document.getElementById("demo").style.visibility = "visible";
	}
	}else{
		document.upldform.usrid.value = userid;
		document.upldform.submit();
		//alert('okay'+document.upldform);
		document.getElementById("demodrop").innerHTML = "<br /><br /><br /><h5>LOADING...</h5><br /><br /><img src=\""+path+"global/images/loadfile.gif\" /><br /><br /><br /><h6>Please don't close this window!</h6><p>(As soon as the upload is finished, <br />it will close automatically)</p>";
	}
}
function loaded(){
	alert('Fileupload complete');
	document.upldform.usrid.value = "";
	document.getElementById("picpreview").style.display = "none";
	document.getElementById("demo").style.visibility = "visible";
}









function demoResult(){
	if (http_request.readyState == 4) {
	if (http_request.status == 200) {
		document.getElementById('centerer').innerHTML = http_request.responseText;
	if(document.getElementById("picpreview").style.display != "block"){
		document.getElementById("picpreview").style.display="block";
		//document.getElementById("picpreview").style.height = screen.height+"px";
		myWidth = 0; myHeight = 0;  
		if( typeof( window.innerWidth ) == 'number' ) {  
		//Non-IE  
		myWidth = window.innerWidth;  
		myHeight = window.innerHeight;  
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {  
		//IE 6+ in 'standards compliant mode'  
		myWidth = document.documentElement.clientWidth;  
		myHeight = document.documentElement.clientHeight;  
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {  
		//IE 4 compatible  
		myWidth = document.body.clientWidth;  
		myHeight = document.body.clientHeight;  
		}
		scrOfX = 0; scrOfY = 0;  
		if( typeof( window.pageYOffset ) == 'number' ) {  
		//Netscape compliant  
		scrOfY = window.pageYOffset;  
		scrOfX = window.pageXOffset;  
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {  
		//DOM compliant  
		scrOfY = document.body.scrollTop;  
		scrOfX = document.body.scrollLeft;  
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {  
		//IE6 standards compliant mode  
		scrOfY = document.documentElement.scrollTop;  
		scrOfX = document.documentElement.scrollLeft;  
		}  
		ypos = ((myHeight/2)+scrOfY);
		document.getElementById("centerer").style.top = ypos+"px";
		document.getElementById("tableau").style.top = "-"+(document.getElementById("tableau").offsetHeight/2)+"px";
		document.getElementById("picpreview").style.height = (document.body.scrollHeight+myHeight)+"px";
	}
	
	}
	}
	}
