function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'number') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}
		function setFooter() {
			if (document.getElementById && $('whitebg')) {
				var windowHeight = getWindowHeight();
				if (windowHeight > 0) {
					var contentHeight = document.getElementById('whitebg').offsetHeight;
					var footerElement = document.getElementById('footer');
					var footerHeight  = footerElement.offsetHeight;
					if (windowHeight - (contentHeight + footerHeight) >= 0) {
						footerElement.style.position = 'absolute';
						footerElement.style.top = (windowHeight - footerHeight) + 'px';
					}
					else {
						footerElement.style.position = 'static';
					}
				}
			}
		}
Event.observe(window,'load',setFooter, false);
window.onresize = function() {setFooter();}

/*Event.observe(window,'load',focusSearch, false);

function focusSearch(){
	if($('searchinput')){
		$('searchinput').focus();	
	}
}*/
function emptyfy(id,text){
	if($(id).value == text){
		if($('login-password')) $('login-password').type = "password";
		$(id).value = "";
	}
}
function fillify(id,text){
	if($(id).value == ""){
		if($('login-password') && $(id).id == 'login-password'){
			$('login-password').value = "Lösenord";
			$('login-password').type = "text";
		}
		$(id).value = text;
	}
}
function setLoginPwd(){
	if($('login-password')) $('login-password').type = "text";	
}
Event.observe(window,'load',setLoginPwd, false);

function kontoHelp(){
	/*Event.observe('konto-mail', 'focus', function(event){ showHelp('help-mail',event);});
	Event.observe('konto-mail', 'blur', function(e){ hideHelp('help-mail');});
	Event.observe('konto-password1', 'focus', function(e){ showHelp('help-password1');});
	Event.observe('konto-password1', 'blur', function(e){ hideHelp('help-password1');});
	Event.observe('konto-password2', 'focus', function(e){ showHelp('help-password2');});
	Event.observe('konto-password2', 'blur', function(e){ hideHelp('help-password2');});
	Event.observe('konto-shoppingteam', 'focus', function(e){ showHelp('help-shoppingteam');});
	Event.observe('konto-shoppingteam', 'blur', function(e){ hideHelp('help-shoppingteam');});*/
}
function showHelp(id,event){
	Element.addClassName(id,'autohelp');
	$(id).style.visibility = 'visible';
	//$(id).style.left = 'visible';
}
function hideHelp(id){
	Element.removeClassName(id,'autohelp');
	$(id).style.visibility = 'hidden';
	//new Effect.Fade(id);
}

function observeUtbetalningar(){
	if($('tidigare')) Element.hide('tidigare');
	if($('aktiviteter')) Element.hide('aktiviteter');
}
function gliderClasses(id){
	Element.removeClassName('gs1','current');
	Element.removeClassName('gs2','current');
	Element.removeClassName('gs3','current');
	Element.removeClassName('gs4','current');
	Element.addClassName(id,'current');
}
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}