//--------------------------------------------------

img_path=swoop.pth+"content/html/silent-command/index.html?img_rand=";
img_rand=1;
img_slnt=null;
img_intv=null;
frm_clct=null;
frm_init=false;
obj_mfrm=null;
obj_nfrm=null;
nty_open=false;

//--------------------------------------------------

function silentCommand(obj){
	switch(obj.width+""+obj.height){
		case "11":
			// stay cool
			break;
		case "12":
			// Neue Erstanfragen
			break;
		case "13":
			// Neue Nachricht (PM)
			notify("13");
			break;
		case "14":
			// Klient im Wartezimmer
			break;
		case "15":
			// Chateinladung
			notify("15");
			break;
		case "21":
			// Login
			notify("21");
			break;
		case "19":
			// Pop-up-Blocker
			break;
		case "55":
			// Refresh Onliner
			if((typeof(frm_clct)==is_type._obj)&&(typeof(frm_clct.cnt)==is_type._obj)){
				if(typeof(frm_clct.cnt.swoop)==is_type._obj){
					obj=frm_clct.cnt.swoop.getObjById("frmcom");
					if(obj!=null){
						path=obj.src.split("&rnd=");
						obj.src=path[0]+"&rnd="+img_rand++;}}}
			break;
		default:
			// undefined state
			break;
		}
	}

//--------------------------------------------------

function notify(state){
	if(typeof(frm_clct.nty)==is_type._obj){
		path=frm_clct.nty.location.href.split("?");
		frm_clct.nty.location.href=path[0]+"?cmmd="+state;}}

//--------------------------------------------------

function silentReload(){
	if(typeof(img_slnt)==is_type._obj){
		img_slnt.src=img_path+img_rand++;}}

//--------------------------------------------------

function frminit(){
	frm_init=true;
	frm_clct={top:frames.head,cnt:frames.content,fed:frames.feed,nty:frames.notifier};
	obj_mfrm=swoop.getObjById("mfrm");
	obj_nfrm=swoop.getObjById("nfrm");
	img_slnt=new Image();
	img_slnt.onload=function(){
			silentCommand(this);}
	img_slnt.src=img_path;
	img_intv=window.setInterval("silentReload()", 30000);}

//--------------------------------------------------

function toggleNotifier(){
	if(frm_init){
		if(toggleNotifier.arguments.length>0){
			if(typeof(toggleNotifier.arguments[0])==is_type._bol){
				if(toggleNotifier.arguments[0]){
					nty_open=false;}
				else{nty_open=true;}}}
		if(nty_open){nty_open=false;
			nty_size="*";}
		else{nty_open=true;
			nty_size="115";}
		if(typeof(obj_nfrm)==is_type._obj){
			rows=obj_nfrm.rows.split(",");
			rows.splice(0,1,nty_size);
			obj_nfrm.rows=rows.join(",");}}}

//--------------------------------------------------