function openWindow() {
	popupWin = window.open('http://www.lakeparty.de/radio/player.php', '218665060', 'width=559,height=335,left=100,top=100,menubar=no,status=no,toolbar=no,hotkeys,location=no')
}
		
function ajaxMessagecenter( listing )
{
	var ifr = document.getElementById( 'main' );
	if( !!ifr.contentWindow.AM )
	{
		ifr.contentWindow.AM.displayListing( listing );
		return false;
	}
	// default to normal engagement
	return true;
}

var msgcount = 0;
var origtitle = document.title;
function setMessageBox(msgs) {
	var mel = document.getElementById('miinbox');
	if(msgs == 0){
		mel.parentNode.className = 'unread';
		if(document.title != origtitle)
		    document.title = origtitle;
		setTooltip('tooltip1','');
	}
	else{
		mel.parentNode.className = 'unread active';
		document.title = 'LP Neue Nachricht! - Lakeparty.de';
		setTooltip('tooltip1', '<a href="http://www.lakeparty.de/messagecenter.php" target="main" onclick="return ajaxMessagecenter(\'inbox\');" >' + msgs + ' neue Nachrichten<'+'/a>');
	}
	msgcount = msgs;
}

function reSwapMC(){
	var mel = document.getElementById('miinbox');
	if(msgcount == 0) {
		mel.parentNode.className = 'unread';
		setTooltip('tooltip1','');
	} else {
		mel.parentNode.className = 'unread active';
		setTooltip('tooltip1','<a href="http://www.lakeparty.de/messagecenter.php" target="main">' + msgcount + ' neue Nachrichten<'+'/a>');
	}
}

function setTooltip(id, text) {
	var ttel = document.getElementById(id);
	if(ttel.innerHTML != text) ttel.innerHTML = text;
}

function getMainLocation(){
	document.getElementById('mainloc').value = document.getElementById('main').contentWindow.location;
}

function lpnd(){
	document.getElementById('overDiv').style.visibility = 'hidden';

}

function olSwapInfo(title) {
    setTooltip('tooltip4', title);
    OLcurrentTooltip = title;
}

function olSetTooltip(title) {
	if(title != '') setTooltip('tooltip4',title);
	else			setTooltip('tooltip4',OLcurrentTooltip);
}
