//function profilwin(other_UID)
//{
//	var windowprops = "location=0,status=0,scrollbars=1,menubar=0,toolbar=0,resizable=1,width=640,height=600,left=20";
//	window.open(userIndex + url_separator + "site=profil" + url_separator + "other_UID=" + other_UID,"profil",windowprops);
//}

var menuStatus=0;
document.onmouseup = ProfileWinLocation;

function confirm_delete(text_string)
{
	var is_confirmed = confirm(text_string);
	if (is_confirmed){return true;}
	else { return false;}
}

function onlinewin()
{
	var windowprops = "location=0,scrollbars=1,menubar=0,toolbar=0,resizable=1,width=220,height=330,left=10";
	window.open(userIndex + url_separator + "site=online","onlinewindow", windowprops);
}

function openUserMedia(media, userstat, filetype, sx, sy,  admin)
{
	sizo="status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no,width="+sx+",height="+sy;
	if (admin)
	{
		mywin = window.open("getmedia.php?mid="+media+url_separator+"thumb=false"+url_separator+"type="+filetype, "_blank", sizo);
	}
	else
	{
		mywin = window.open("getusermedia.php?media=" + media + url_separator + "userstat=" + userstat,"_blank", sizo);
	}
	mywin.moveTo (0,0);
	if (window.focus) { mywin.focus();}
}

function openwin(newpage_link)
{
	var windowprops = "location=0,scrollbars=1,status=1,menubar=0,toolbar=0,resizable=1,width=750,height=600,left=20";
	window.open(newpage_link,"profil",windowprops);
}


/*
* Browsererkennung
* @param name Name
*/
function checkBrowserName(name)
{  	var agent = navigator.userAgent.toLowerCase();  	if (agent.indexOf(name.toLowerCase())>-1)
	{  		return true;  	}  	return false;  }  


function profilwin(other_UID)
{
	var windowprops = "location=0,status=0,scrollbars=1,menubar=0,toolbar=0,resizable=1,width=640,height=600,left=20"; 
	window.open(userIndex + url_separator + "site=profil" + url_separator + "other_UID=" + other_UID,"profil",windowprops);
}

/**
 *
 * @access public
 * @return void
 **/
function showProfileContext(condata){
	var menuwindow=document.getElementById("UserContext");
	menuwindow.innerHTML = '<span id="UserContextHead">&nbsp;' + condata.header + '</span><br /><ul>';
	for(var i=0;i<condata.url.length;i++) {
		menuwindow.innerHTML += '<li><a href="' + userIndex + url_separator + condata.url[i] + url_separator + condata.oUID[i] + '" onClick="closeUserContext()">' + condata.link[i] + '</a><br /></li>';
	}
	menuwindow.innerHTML += '</ul><br />';
	menuwindow.style.visibility='visible';
	menuStatus=1;
    return false;
}

/**
 *
 * @access public
 * @return void
 **/
function ProfileWinLocation(e){
	var menuwindow=document.getElementById("UserContext");
	var posx, posy;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) {
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) {
		posx = e.clientX + document.body.scrollLeft+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop+ document.documentElement.scrollTop;
	}
/*	menuwindow.style.left=(posx-10) + "px";
	menuwindow.style.top=(posy-5) + "px";
*/}

/**
 *
 * @access public
 * @return void
 **/
function hideProfileContext(e){
	if (!e) var e = window.event;
	var relTarg = e.relatedTarget || e.toElement;
	var tg = (window.event) ? e.srcElement : e.target;
	if (tg.nodeName != 'DIV') return;
	var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
	while (reltg != tg && reltg.nodeName != 'BODY')
		reltg= reltg.parentNode
	if (reltg== tg) return;
	if (menuStatus==1) setTimeout("closeUserConetxt();",250);
	return;
}

/**
 *
 * @access public
 * @return void
 **/
function closeUserConetxt(){
	document.getElementById('UserContext').style.visibility='hidden';
	menuStatus=0;
}
