
function minimize(index){
	id = "td" + index;
	document.getElementById(id).style.display="none";
}

function maximize(index){
	id = "td" + index;
	document.getElementById(id).style.display="";
}

function minimize2(index){
	id = "td" + index;
	document.getElementById(id).style.display="none";
	document.getElementById("td-sub" + index).style.display="none";
}

function maximize2(index){
	id = "td" + index;
	document.getElementById(id).style.display="";
	document.getElementById("td-sub"+index).style.display="";
}

function centerElement(id, theWidth, theHeight){
	
	standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body 
	scroll_top=(true)? standardbody.scrollTop : window.pageYOffset
	scroll_left=(true)? standardbody.scrollLeft : window.pageXOffset
	docwidth=(true)? standardbody.clientWidth : (/Safari/i.test(navigator.userAgent))? window.innerWidth : Math.min(domclientWidth, window.innerWidth-16)
	docheight=(true)? standardbody.clientHeight: window.innerHeight
	document.getElementById(id).style.left= scroll_left+(docwidth-theWidth)/2+"px";
	document.getElementById(id).style.top=  scroll_top + (docheight - theHeight)/2+"px";
	document.getElementById(id).style.display = "";
	
}

function closeElement(divId){
	document.getElementById(divId).style.display="none";
}

function close(containerDivId, divId){
	//player.sendEvent('STOP');
	document.getElementById(containerDivId).innerHTML = "<div id='playerDiv' name='playerDiv'>This text will be replaced</div>";
	document.getElementById(divId).style.display="none";
}

function logoutFromTopMenu(){
	if(document.getElementById("loginTopMenuDivDummyDiv")){
		sendRequestCallFunctionAfter('loginTopMenuDivDummyDiv', '/user/logout', 0, "changeBackToLogin()");
	}
}

function changeBackToLogin(){
	if(document.getElementById("loginTopMenuDivDummyDiv")){
		document.getElementById("loginTopMenuDivDummyDiv").innerHTML="";
		document.getElementById("loginTopMenuDivDummyDiv").style.display="none";
		document.getElementById("loginTopMenuDivDummyDiv").style.width="0px";
		document.getElementById("loginTopMenuDivDummyDiv").style.height="0px";
	}
	if(document.getElementById("loginTopMenuDiv")){
		document.getElementById("loginTopMenuDiv").innerHTML = "<a style='color:blue' href='/user/login.php'>Login</a>&nbsp;&nbsp;&nbsp;&nbsp;";
	}
	networklogout();
}

function changeBackToLogout(){
	if(document.getElementById("loginTopMenuDiv")){
		document.getElementById("loginTopMenuDiv").innerHTML = "<a style='color:blue' href='javascript:logoutFromTopMenu()'>Logout</a>&nbsp;&nbsp;&nbsp;&nbsp;";
	}
}


