function $(e)
{
	var element = document.getElementById(e);
	return element;
}

function getStyle(el,styleProp)
{
	var x = $(el);
	
	if (x.currentStyle)	
		var y = x.currentStyle[styleProp];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	
	return y;
}

function CutPx(Value){
	var tmp = Value;
	tmp = tmp.substring(0,tmp.length-2);
	tmp = parseInt(tmp);
	return tmp;
}

function memberLoginResponse(text)
{	
	switch (text) { 
		case "1":
			document.location = "index.php?s=member";
		break;
		
		case "2":
			document.location = "index.php?s=1";
		break;
		
		case "3":
			alert("Authentifizierung fehlgeschlagen.");
			document.location = "index.php?s=1";
		break;
	}
}


function memberLogin(value, action)
{
	var mLoginQ = new Ajax("members/login.php", memberLoginResponse);
	
	switch (action) {
		case 0:
			mLoginQ.query("logout=true");
		break;
		case 1:
			mLoginQ.query("pw=" + value);
		break;
	}
}
