function checkInput(){
	var val1 = document.getElementById("login").value;
	var val2 = document.getElementById("pass").value;
	
	if(val1.length>0 && val2.length>0){
		document.getElementById("submit").innerHTML = "<input type='submit' value='einloggen' onclick='login()'>";
	}
}

function login(){
	var ajax = new ajaxRequest("scripts/dirreader.php?login="+document.getElementById("login").value+"&pass="+document.getElementById("pass").value);
	ajax.onSuccess = function(txt,xml){
		document.getElementById("files").innerHTML = txt;
	}
	ajax.doRequest();
}

function checkForm(val,name){	// baustelle!
	var inputs = document.getElementsByTagName("input");
	
	for(var x=0;x<inputs.length;x++){
		if(inputs[x].name!="submit"){
			
		}
	}
	
	switch (name) {
		case "firstname":
		case "lastname":
		
			break;
	}
}

function formmail(){
	var inputs = document.getElementsByTagName("input");
	var get='';
	
	for(var x=0;x<inputs.length;x++){
		get+= inputs[x].name+"="+inputs[x].value+"&";
	}
	
	var ajax = new ajaxRequest("scripts/formmailer.php?"+get+"message="+document.getElementById("message").value);
	ajax.onSuccess = function(txt,xml){
		document.getElementById("kontForm").innerHTML = txt;
	}
	ajax.doRequest();
}

var hwndPopup_27b5;
function openpopup_27b5(url){
var popupWidth = 1024;
var popupHeight = 768;
var popupTop = 300;
var popupLeft = 300;
var isFullScreen = false;
var isAutoCenter = true;
var popupTarget = "popupwin_27b5";
var popupParams = "toolbar=1, scrollbars=1, menubar=1, status=1, resizable=1";

if (isFullScreen) {
	popupParams += ", fullscreen=1";
} else if (isAutoCenter) {
	popupTop	= parseInt((window.screen.height - popupHeight)/2);
	popupLeft	= parseInt((window.screen.width - popupWidth)/2);
}

var ua = window.navigator.userAgent;
var isMac = (ua.indexOf("Mac") > -1);

//IE 5.1 PR on OSX 10.0.x does not support relative URLs in pop-ups the way they're handled below w/ document.writeln
if (isMac && url.indexOf("http") != 0) {
  url = location.href.substring(0,location.href.lastIndexOf('\/')) + "/" + url;
}

var isOpera = (ua.indexOf("Opera") > -1);
var operaVersion;
if (isOpera) {
	var i = ua.indexOf("Opera");
	operaVersion = parseFloat(ua.substring(i + 6, ua.indexOf(" ", i + 8)));
	if (operaVersion > 7.00) {
		var isAccessible = false;
		eval("try { isAccessible = ( (hwndPopup_27b5 != null) && !hwndPopup_27b5.closed ); } catch(exc) { } ");
		if (!isAccessible) {
			hwndPopup_27b5 = null;
		}
	}
}
if ( (hwndPopup_27b5 == null) || hwndPopup_27b5.closed ) {
	
	if (isOpera && (operaVersion < 7)) {
		if (url.indexOf("http") != 0) {
			hwndPopup_27b5 = window.open(url,popupTarget,popupParams + ((!isFullScreen) ? ", width=" + popupWidth +", height=" + popupHeight : ""));
			if (!isFullScreen) {
				hwndPopup_27b5.moveTo(popupLeft, popupTop);
			}
			hwndPopup_27b5.focus();
			return;
		}
	}
	if (!(window.navigator.appName == "Netscape" && !document.getElementById)) {
		//not ns4
		popupParams += ", width=" + popupWidth +", height=" + popupHeight + ", left=" + popupLeft + ", top=" + popupTop;
	} else {
		popupParams += ", left=" + popupLeft + ", top=" + popupTop;
	}
	//alert(popupParams);
	hwndPopup_27b5 = window.open("",popupTarget,popupParams);
	if (!isFullScreen) {
		hwndPopup_27b5.resizeTo(popupWidth, popupHeight);
		hwndPopup_27b5.moveTo(popupLeft, popupTop);
	}
	hwndPopup_27b5.focus();
	with (hwndPopup_27b5.document) {
		open();
		write("<ht"+"ml><he"+"ad><\/he"+"ad><bo"+"dy onLoad=\"window.location.href='" + url + "'\"><\/bo"+"dy><\/ht"+"ml>");
		close();
	}
} else {
	if (isOpera && (operaVersion > 7.00)) {
		eval("try { hwndPopup_27b5.focus();	hwndPopup_27b5.location.href = url; } catch(exc) { hwndPopup_27b5 = window.open(\""+ url +"\",\"" + popupTarget +"\",\""+ popupParams + ", width=" + popupWidth +", height=" + popupHeight +"\"); } ");
	} else {
		hwndPopup_27b5.focus();
		hwndPopup_27b5.location.href = url;
	}
}

}

function ie6OrNot(img,alt){
	if(browser=="ie6"){
		document.write("<img src='images/"+alt+"' alt='' />");
	}else{
		document.write("<img src='images/"+img+"' alt='' />");
	}
}

