window.onresize = function () {
		$('popupContainer').style.height = $('container').offsetHeight+'px';
		$('popupContentContainer').style.height = $('container').offsetHeight+'px';
	};


function loadPopup (page) {
	var url = "popup/" + page;
   var xmlhttp;
   var async = false;
   if (window.ActiveXObject)   // ActiveX version
   {
     xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");  // Internet Explorer 
   }
   else if (window.XMLHttpRequest)     // Object of the current windows
   { 
     xmlhttp = new XMLHttpRequest();     // Firefox, Safari, ...
   } 

   xmlhttp.open("GET", url, async);
   xmlhttp.send(url);
   
   $('popupContent').innerHTML = xmlhttp.responseText;
	
	$('popupContainer').style.height = $('container').offsetHeight+'px';
	$('popupContentContainer').style.height = $('container').offsetHeight+'px';
	
	//alert($('container').offsetHeight);
	
	
	//Effect.SlideDown('popupContainer', {afterFinish: showPopupContent});
	Effect.Appear('popupContentContainer');
}

function showPopupContent () {
	//Effect.Appear('popupContentContainer');
}

function swapInput(id) {
	document.getElementById('elementParentToSwap').innerHTML = '<input tabindex="2" id="swapedInput" type="password" name="mbPass" class="text" value="" style="color: black;" onkeypress="onEnter(event);" />';
	/* UGLY IE fix */
	if (navigator.appName=="Microsoft Internet Explorer") {
		document.getElementById('swapedInput').focus();
	}
	document.getElementById('swapedInput').focus();
}

function onEnter( evt ) {
	var keyCode = null;
	
	if( evt.which ) {
		keyCode = evt.which;
	} else if( evt.keyCode ) {
		keyCode = evt.keyCode;
	}
	if( 13 == keyCode ) {
		document.mbLogin.submit();
		return false;
	}
}

function showLargeImage (iRowNmbr, iImgUrl) {
	$('imageRow'+iRowNmbr).innerHTML = '<a class="closeEntlargement" href="#" onclick="Effect.BlindUp(\'imageRow'+iRowNmbr+'\'); return false;">Sluiten</a><img src="'+iImgUrl+'" alt="" />';
	
	if ($('imageRow'+iRowNmbr).style.display == 'none') 
		Effect.BlindDown('imageRow'+iRowNmbr);
	
	return false;
}
