
//	function getTotal(){
//		if (window.document.header){
//			window.document.header.SetVariable("totalM",357492);
//			window.document.header.SetVariable("onlineM",202);
//			window.document.header.SetVariable("inchatM",459);
//		}
//	}

//	getTotal();

	function DeleteConfirm() {
		return confirm('Är du säker?');	
	}
	
	function getElementPositionSize(elemID){
		var offsetTrail = document.getElementById(elemID);
		var offsetLeft = 0;
		var offsetTop = 0;
		while(offsetTrail){
			offsetLeft+=offsetTrail.offsetLeft;
			offsetTop+=offsetTrail.offsetTop;
			offsetTrail = offsetTrail.offsetParrent;
		}
		if (navigator.userAgent.indexOf("Mac")!=-1 && typeof document.body.leftMargin != "undefined"){
			offsetLeft+=document.body.leftMargin;
			offsetTop+=document.body.topMargin;
		}
		return {left:offsetLeft,top:offsetTop};
	}

	function showHightLight(){
		pos = getElementPositionSize('mail');

		if (pos.top == 0){
			pos.top = 20;
		}
		document.getElementById('hightlight').style.left = pos.left+30;
		document.getElementById('hightlight').style.top = pos.top+10;
		document.getElementById('hightlight').style.display = 'block';
	}

	function hideHightLight(){
		document.getElementById('hightlight').style.display = 'none';
	}
	
	
	function showCardPopup(member_id) {
		//window.open('/card/?intMemberID=' + member_id + '&is_popup=1','popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=525,height=670,screenX=150,screenY=150,top=20,left=150');
		var args = showCardPopup.arguments;
		if (document.getElementById) {
			var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
		}
		if (x) {
			x.onreadystatechange = function() {
				if (x.readyState == 4 && x.status == 200) {
					response = x.responseText;
					card = document.getElementById('card_popup');
					card_back = document.getElementById('card_popup_back');
					if (card != null) {
						card.innerHTML = '<table align="center" width=><tr><td valign="middle">' + response + '</td></tr></table>';
						card.style.display = 'block';
						card.style.top = document.body.scrollTop;
						card_back.style.display = 'block';
						card_back.style.top = document.body.scrollTop;
						trace_scroll = true;
						trace_keys = true;
					}
					return;
				}
			}
		}
		x.open("GET", '/card/?intMemberID=' + member_id + '&is_popup=1', true);
		x.send(null);
		
	}
	function hideCardPopup() {
		card = document.getElementById('card_popup');
		card_back = document.getElementById('card_popup_back');
		if (card != null) {
			card.innerHTML = '';
			card.style.display = 'none';
			card_back.style.display = 'none';
			trace_scroll = false;
			trace_keys = false;
		}
	}
	
	var trace_scroll = true;
	var trace_keys = false;
	
	function OnScroll() {
		if (trace_scroll) {
			card = document.getElementById('card_popup');
			card_back = document.getElementById('card_popup_back');
			card_back.style.top = document.body.scrollTop;
			card.style.top = document.body.scrollTop;
		}
	}
	
	function OnKeyPress(event) {
		if (trace_keys) {
			if (event.keyCode == 27) {
				hideCardPopup();
			}
		}
	}
	
function onOpenWindow(URI, width, height){
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	if (!width) { width = 300; }
	if (!height) { height = 300; }
	var left = (screen.width/2) - width/2;
	var top = (screen.height/2) - height/2;
	var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+(width+20)+',height='+(height+15)+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
	var popUpWin = window.open( URI, "popUpWin", styleStr );
}
			
	