function hompi(id){
var hompiwin=null;
myleft=screen.width/2-900/2; mytop=screen.height/2-540/2;
settings="width=900,height=540,top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
hompiwin=window.open("/hompi.php?id=" + id,'hompi',settings); hompiwin.focus(); hompiwin=null;
}

function showpic(prefix,filename){
var picwin=null;
settings="width=100,height=100,top=100,left=100,scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
picwin=window.open(prefix+"html/pic.php?pic=" + filename,'pic',settings); picwin.focus(); picwin=null;
}

function mailbox(dest){
var mailwin=null;
settings="width=640,height=380,top=100,left=100,scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
mailwin=window.open("/html/mailbox.php?dest=" + dest +"&land=1",'mail',settings); mailwin.focus(); mailwin=null;
}

function onlinelist(){
var owin=null;
settings="width=190,height=480,top=100,left=100,scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
owin=window.open("/html/onlinelist.php",'olist',settings); owin.focus(); owin=null;
}

function per_video(){
var vwin=null;
myleft=screen.width/2-652/2; mytop=screen.height/2-521/2;
settings="width=652,height=521,top=" + mytop + ",left="+myleft+",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
vwin=window.open("/per_video.php",'olist',settings); vwin.focus(); vwin=null;
}

var bridge = "";
var new_messages = 0;
var nm_shown = 0;
var nm_state = 0;
var nm_running = 0;

function doNM() {
if(nm_shown<30 && new_messages>0){
if(nm_state==0){
	document.title = "Cyplanet - Dein Zuhause 2.0";nm_state=1;
}else{
	document.title = "Neue Nachricht(en) erhalten";nm_state=0;nm_shown++;
}}
setTimeout("doNM()", 2000);
}

/////////////////////////////////////////////////////////////////////////////////////////

var sgi = 0; var greez = new Array; var holdSG = 0;


function doSG() {
if(!holdSG){
sgi++; if(sgi==greez.length) sgi=1;
document.getElementById("SofortGruss").innerHTML=greez[sgi];
setTimeout("clearSG()", 4000);
}else{
setTimeout("clearSG()", 200);
}
}

function clearSG() {

if(!holdSG){
document.getElementById("SofortGruss").innerHTML="&nbsp;";
setTimeout("doSG()", 200);
}else{
setTimeout("clearSG()", 200);
}
}

function changeSG(turn){
sgi=sgi+turn; if(sgi==greez.length) sgi=1; if(sgi==0) sgi=greez.length-1;
document.getElementById("SofortGruss").innerHTML=greez[sgi];
}

/////////////////////////////////////////////////////////////////////////////////////////

function call(){

var xmlHttp = null;

// Mozilla, Opera, Safari sowie Internet Explorer 7
if (typeof XMLHttpRequest != 'undefined') { xmlHttp = new XMLHttpRequest(); }

if (!xmlHttp) {
    // Internet Explorer 5, 5.x oder 6
    try { xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {
        try { xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { xmlHttp  = null; }
    }
}

if (xmlHttp) {
xmlHttp.open('GET', '/call.php', true);
bridge="";
xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState == 4) { bridge=""; bridge=xmlHttp.responseText; bridge=bridge.split("#",3); 

if(bridge){
new_messages=bridge[0];

var nm_icon=document.getElementById('new_icon').src;
var nm_mess=document.getElementById('new_m').innerHTML;

if(bridge[1]!="undefined") document.getElementById('member_online').innerHTML='<font color="#7D7D7D">'+bridge[1]+' Member online</font>';
if(bridge[2]!="undefined") document.getElementById('guests_online').innerHTML=bridge[2]+' Gäste';

if(new_messages>0){
	if(!nm_running){ nm_shown = 0; setTimeout("doNM()", 1000); nm_running=1; }
	if(nm_icon!="/images/ico_mail1.gif") nm_icon="/images/ico_mail1.gif";
	if(new_messages>1){ en="en"; }else{ var en=""; }
	if(nm_mess!='<b>'+new_messages+'</b> neue Nachricht'+en) nm_mess='<b>'+new_messages+'</b> neue Nachricht'+en;
}else{
	nm_icon="/images/ico_mail.gif";
	nm_mess='<b>0</b> neue Nachrichten';
	document.title = "Cyplanet - Dein Zuhause 2.0";
}

document.getElementById('new_icon').src=nm_icon;
document.getElementById('new_m').innerHTML=nm_mess;
if(document.getElementById('new_m2')) document.getElementById('new_m2').innerHTML=nm_mess;
}

}
    };
    xmlHttp.send(null);
}

setTimeout("call()", 5000);
}

function hover_img(obj,file){ obj.src=file; }