// © 2000,2001,2002 Rainard Buchmann, sebag mbH, http://www.sebag.de

var nr=0, basis='http://www.sebag-buchmann.de/schildibrett/';

function setID(t) {
	top.sessID = t
}

function init() {
}

function Anfang() {
}

function infowin(tx) {
	w=window.open (tx, "info", "width=400,height=300,resizable=yes,scrollbars=yes")
	w.focus()
}

function an(nm) {
	IE=navigator.appName.indexOf("Microsoft")!=-1
	if (top.frames.Head) {
		win=top
	}
	else {
		win=opener.top
	}
	if (IE) {
		frm=win.frames.Head.chat
	}
	else {
		frm=win.frames.Head.document.chat
	}
	x=frm.body.value
//	x=x.replace (/\s/g, "+")
	x=escape(x)
	if (win.username == "") {alert ("um Nachrichten schicken zu können, muss man angemeldet sein"); return;}
	if (frm) {
		if ((frm.body.value == "") && (win.zusatz != "info")) {alert ("bitte Text angeben"); return;}
		s=win.schchat+"?aktion=postchat"
		s+="&adressat="+nm
		s+="&sessID="+win.sessID
		s+="&body="+x
		if (win.zusatz) {
			s+="&zusatz="+win.zusatz
		}
		if (win.zusatz == "info") {
			infowin(s)
		} else {
			win.frames.main.location.href=s
			frm.body.value=""
		}
	}
}


function a(uhr,na,text) {
	top.inhalt += '<tr';
	if (nr == 0) {
		nr=1
		proz=' width="10%"'
	}
	else {
		if (nr == 1) {
			nr=2
			proz=''
			top.inhalt += ' bgcolor=#F0F0F0'
		}
		else {
			nr=1
		}
	}
	top.inhalt += '><td'+proz+'><i>'+uhr+'</i></td><td'+proz+'>'
	if (na) {
		top.inhalt += '<a href="JavaScript:top.an('+"'"+na+"'"+');">'
		top.inhalt += '<img src="pic/'+na+'.gif" border=0 hspace=0 vspace=0 width=16 height=10 alt="">'
		top.inhalt += na+'</a>'
	}
	else {
		top.inhalt += '&nbsp;'
	}
	top.inhalt += '</td><td>'+text+'</td></tr>\n'
}


function a2(uhr,na,text) {
	a(uhr,na,text)
	document.write (top.inhalt)
	top.inhalt = ''
}

function tanf(zusatz) {
	nr = 0
	top.inhalt = '<html><head>'
	top.inhalt += '<base href="'+basis+'chat/index.htm">\n'
	top.inhalt += '<link rel="stylesheet" href="chatstyle.css" type="text/css">'
	top.inhalt += '</head>'
	top.inhalt += '<body background="bground.gif" bgproperties="fixed"><p>'
	top.inhalt += zusatz
	top.inhalt += '<table border="0" cellspacing="0" cellpadding="2" width="95%" align="center">\n'
}

function tend() {
	top.inhalt += '</table></body></html>\n';
	top.frames.Body.location.replace ('JavaScript:top.inhalt;')
}	

function b(na) {
	if (na) {
		document.write ('<a href="JavaScript:an(',"'",na,"'",');">')
		document.write ('<img src="'+basis+'/chat/pic/',na,'.gif" border=0 hspace=2 vspace=0 width=16 height=10 alt="',na,'">')
		document.write ('</a>')
	}
}
