function make(x){var msg="";msg='if(typeof('+x+')=="undefined") window.'+x+'="";';eval(msg);}

var space="<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"1\" width=\"1\">";
var space10="<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"10\" width=\"1\">";
var border_h = "<table border=0 cellpadding=0 cellspacing=0 width=100%><tr><td bgcolor=#000000 height=1>"+space+"</td></tr></table>";

var emoticonsStd = new Array(
"[]", "text.gif", "text", true,
":()", "say.gif", "say", true,
":-)", "smile.gif", "smile", true,
":)", "smile.gif", "smile", false,
"(o:", "smile.gif", "smile", false,
"(-:", "smile.gif", "smile", false,
";)", "wink.gif", "wink", false,
";-)", "wink.gif", "wink", true,
":D", "biggrin.gif", "big grin", false,
":-D", "biggrin.gif", "big grin", false,
":p", "tongue.gif", "razz", false,
":-p", "tongue.gif", "razz", false,
":-(", "frown.gif", "frown", true,
":(", "frown.gif", "frown", false,
":-|", "disappointed.gif", "disappointed", true,
":-/", "disappointed.gif", "disappointed", false,
":-\\", "disappointed.gif", "disappointed", false,
":-!", "disappointed.gif", "disappointed", false,
"(+)", "up.gif", "up", true,
"(-)", "down.gif", "down", true,
"->", "seealso.gif", "seealso", true,
"(*)", "light.gif", "light", true,
"(!)", "warning.gif", "warning", true,
"(?)", "question.gif", "question", true,
"???", "confused.gif", "confused", false,
"!!!", "cool.gif", "cool", true  )

function checkAccess(item){
make('render')
if(typeof window['render_'+padid] == "undefined") window['render_'+padid] = render ;
var fnd=false;
var label = item+'_no';
fnd=checkItem( window['render_'+padid] ,label);
if(fnd){
var needle="";
for(var i=0;i<roles.length;i++){
needle = item+'_'+roles[i];
if(checkItem( window['render_'+padid] ,needle)) fnd=false;
}
}
if(fnd)  return false; else return true;
}

function checkItem(arr,label){
if ( typeof(arr) != "undefined" && arr != null && arr.match(label) ) 	return  true; else return false ;
}

var sortLabel = new Array()
sortLabel.time = "nach Datum"
sortLabel.sender = "nach Absender"
sortLabel.recipient = "nach Empfänger"
sortLabel.type = "nach Art"
sortLabel.priority = "nach Priorität"
sortLabel.subject = "nach Betreff"
sortLabel.summary = "nach Zusammenfassung"
sortLabel.keywords = "nach Stichwörter"
sortLabel.message = "nach Beitrag"
sortLabel.url = "nach Link"
sortLabel.distribution = "nach lcom.pad2.distribution.label"
sortLabel.status = "nach Status"
sortLabel.startTime = "nach Beginn"
sortLabel.endTime = "nach Ende"
sortLabel.thread = "nach Bezug"


function isAuthenticatedEdit ()
{
var result = false;
if ( typeof(render) != "undefined" && render != null
&& render.match(/authenticatedEdit/i) && user == "unknown" ) {
result = true;
}
return result;
}


function getSay(msg)
{
if (msg.sender) return msg.sender.say;
if (!msg.attach) return "-";
for (var a=0; a<msg.attach.length; a++) {
if (msg.attach[a].name == "say") return msg.attach[a].value;
}
return "-";
}


function getUser(msg)
{
if (msg.sender) return msg.sender.user;
return "-";
}


function getSender(msg)
{
if (msg.sender) return msg.sender;
return null;
}


function getUserIcon(msg)
{
result = (msg.sender) ? msg.sender.icon : null;
if (result != null && result != "")
result = (result.substr(0,1)=="/") ? "/ibt/GC21/area=gc21/main/de" + result : "/ibt/var/core/ibt/user/icons/" + result
if(result == null) result="";
if(result.match("anonymous.gif")) result="";
return result;
}


function getSubject(msg)
{
result = "";
if (typeof(msg.emoticon) != "undefined" && msg.emoticon != null)
result += msg.emoticon + " ";
if (typeof(msg.subject) != "undefined" && msg.subject != null)
result += msg.subject;
if (result == "") result = "-";
result = expandMsg(result);
return result;
}


function isRead (msg, markTime)
{
if ( (typeof(msg)=="undefined")||(typeof(msg.read) == "undefined") )
return false;
if (typeof(markTime) == "undefined") {
return msg.read;
} else  {
return (msg.time < markTime || msg.read);
}
}

function getNewIconPath(msg, markTime)
{
var result = "/btn/i50/message/read.gif";
if (!isRead(msg, markTime))
result = "/btn/i50/message/unread.gif";
if ( isAuthenticatedEdit() ) result="/ibt/adm/core/ibt/lib/image/util/nix.gif";
return result;
}


function getNewIcon(msg, markTime)
{
return "<img src=\""+getNewIconPath(msg, markTime)+"\" border=\"0\" />";
}


function getNewLink(msg, markTime)
{
if (msg.time > markTime)
if ( isAuthenticatedEdit() ) return "";
else return "<a href=\"javascript:setRead("+msg.time+","+!isRead(msg, markTime)+")\">"+getNewIcon(msg, markTime)+"</a>";
else
return getNewIcon(msg, markTime);
}


function isMarked (msg)
{
if ( (typeof(msg)=="undefined")||(typeof(msg.marked) == "undefined") )
return false;
else
return (msg.marked);
}


function getMarkedIconPath(msg)
{
if ( isAuthenticatedEdit() ) return "/ibt/adm/core/ibt/lib/image/util/nix.gif";
if ( isMarked(msg) )
return "/btn/i50/message/marked.gif";
else
return "/btn/i50/message/unmarked.gif";
}


function getMarkedIconLabel(msg)
{
if ( isMarked(msg) )
return "Markiert";
else
return "Nicht Markiert";
}


function getMarkedIcon(msg)
{
var label = getMarkedIconLabel(msg);
return "<img src=\"" + getMarkedIconPath(msg) + "\" border=\"0\" alt=\"" + label + "\" title=\"" + label + "\" />";
}


function getMarkedLink(msg)
{
if ( isAuthenticatedEdit() ) return "";
else return "<a href=\"javascript:setMarked("+msg.time+","+!isMarked(msg)+")\" >"+getMarkedIcon(msg)+"</a>";
}


function getSummary(msg)
{
result = "";
if (typeof(msg.summary)!= "undefined" && msg.summary != null)
result = msg.summary;
if (result == "") result = "-";
result = expandMsg(result);
return result;
}


function getMessage(msg)
{
result = "";
if (typeof(msg.message)!= "undefined" && msg.message != null)
result = msg.message;
if (result == "") result = "-";
result = setTeaser(result);
result = expandMsg(result);
return result;
}


function getType(msg)
{
result = "";
if (typeof(msg.type)!= "undefined" && msg.type != null)
result = msg.type;
return result;
}


function getKeywords(msg)
{
result = "";
if (typeof(msg.keywords)!= "undefined" && msg.keywords != null)
result = msg.keywords;
if (result == "") result = "-";
result = expandMsg(result);
return result;
}


function getDatebookType(msg)
{
result = "";
if (typeof(msg.type)!= "undefined" && msg.type != null) {
if(msg.type == "roomstart") result = "Nutzungsbeginn";
if(msg.type == "coursestart") result = "Kursbeginn";
if(msg.type == "courseend") result = "Kursende";
if(msg.type == "training") result = "Präsenzveranstaltung";
if(msg.type == "milestone") result = "Meilenstein";
if(msg.type == "deadline") result = "Einsendeschluss";
if(msg.type == "test") result = "Test";
if(msg.type == "misc") result = "Sonstiges";
}
return result;
}


function getTickerType(msg)
{
result = "";
if (typeof(msg.type)!= "undefined" && msg.type != null) {
if(msg.type == "bold") result = "Fett";
if(msg.type == "border") result = "Rahmen";
if(msg.type == "line") result = "Tickerzeile";
if(msg.type == "marquee") result = "Windows-Marquee";
if(msg.type == "status") result = "Statusticker";
if(msg.type == "telex") result = "Telex";
if(msg.type == "text") result = "Text";
}
return result;
}


function getDelay(msg)
{
var result="";
var delay = "";
for(var j=0;j<msg.attach.length;j++)
if (msg.attach[j].name == "delay") delay = msg.attach[j].value;
if (delay != "") {
if (delay == 1) result = "ab sofort"
else if (delay == 86400) result = "1 Tag"
else if (delay == 172800) result = "2 Tage"
else if (delay == 259200) result = "3 Tage"
else if (delay == 604800) result = "1 Woche"
else if (delay == 1209600) result = "2 Wochen"
else if (delay == 1814400) result = "3 Wochen"
else if (delay == 2419200) result = "4 Wochen"
else if (delay == 3024000) result = "5 Wochen"
else if (delay == 3628800) result = "6 Wochen"
else if (delay == 5184000) result = "2 Monate"
else if (delay == 7776000) result = "3 Monate"
}
return result;
}


function getUrl(msg,maxlength)
{
result = "";
if (typeof(msg.url)!= "undefined" && msg.url != null)
result = msg.url;
if (typeof(maxlength) != "undefined")
result = result.substring(0,maxlength);
return result;
}


function getRefCount(msg)
{
var result = "";
if(msg.refcount && msg.refcount != "undefined")
result = "(" + msg.refcount + ")";
return result;
}


function getFiles(msg)
{
var result = "";
var file_ext="";
if (checkAccess('files') && withPool() && msg.files) {
for (j=0; j<msg.files.length; j++) {
if (msg.files[j].name != "file") {
file_ext = msg.files[j].name.substr(msg.files[j].name.indexOf('.')+1).toLowerCase();
if (result != "" && typeof no_br!="undefined" && no_br=="false")
result += "<br>"
result += "<a target=\"_blank\" href=\"/ibt/GC21/var/core/ibt/pool/"+pool+"/"+escape(msg.files[j].value)+"?pad="+pad+"&amp;pad:time="+msg.time+"\" class=\"files "+file_ext+"\">"+expandMsg(msg.files[j].name)+"</a>"
}
}
}
return result;
}



function getMsgImg(msg)
{
var result = "";
var nameEnd = "";
var filename,filevalue,filevalue_l,filevalue_s,file_ext=""; //_s small, _l large
var filename_l='';
var filename_s='';
var file_others= divS('fileString');
var types = "gifGIFjpgJPGpngPNP";
if ( withPool() && msg.files) {
for (j=0; j<msg.files.length; j++) {
filevalue = msg.files[j].value;
filename = msg.files[j].name;
file_ext = filename.substr(filename.indexOf('.')+1).toLowerCase();
if (filename != "file") {
if(filename.indexOf('_s.')!=-1  && types.indexOf(file_ext)!=-1) {filename_s=filename; filevalue_s=filevalue;}
else if(filename.indexOf('_l.')!=-1  && types.indexOf(file_ext)!=-1) {filename_l=filename; filevalue_l=filevalue;}
else {
if (file_others !=  divS('fileString')) file_others += "<br>"; // attachment display used in getOpenImg()
file_others += "<a target=\"_blank\" href=\"/ibt/GC21/var/core/ibt/pool/"+pool+"/"+escape(msg.files[j].value)+"?pad="+pad+"&amp;pad:time="+msg.time+"\" class=\"files "+file_ext+"\">"+expandMsg(msg.files[j].name)+"</a>";
}
}
}
}
file_others +=divE();
if(filename_s!=""){
if(filename_s!="" && filename_s.split('_s')[0]==filename_l.split('_l')[0]){
result += '<a class="msgimga" href="javascript:getOpenImg(\''+escape(filevalue_l)+'\' , \''+escape(filename_l)+'\', pads[\''+pad+'\']['+i+'],\''+pool+'\')"><img onclick="" class="msgimg a" src="/ibt/GC21/var/core/ibt/pool/'+pool+'/'+escape(filevalue_s)+'?pad='+pad+'&amp;pad:time='+msg.time+'" title="'+filename_s+'"/></a>';
}else{
result += "<img class=\"msgimg\" src=\"/ibt/GC21/var/core/ibt/pool/"+pool+"/"+escape(filevalue_s)+"?pad="+pad+"&amp;pad:time="+msg.time+"\" title=\""+filename_s+"\"/>";
}
messages[i].file_others_set = file_others; //any attachments
}
return result;
}

function getOpenImg(filevalue_l,filename_l,msg,pool){

var stytxt='';  // style collector
if(document.styleSheets.length>=1){ //style sheets present
for(var i=0;i<document.styleSheets.length;i++){
if(typeof document.styleSheets[i].cssRules=="undefined")  { //MSIE
if(document.styleSheets[i].cssText=='')
stytxt+='@import url('+document.styleSheets[i].href+');';
else
stytxt+=document.styleSheets[i].cssText;
}else{ //Motzilla
if(typeof (document.styleSheets[i].href)!=null){ // link
stytxt+='@import url('+document.styleSheets[i].href+');';
}else{ //style
stytxt+=document.styleSheets[i].cssRules[0].cssText;
}
}
}
}

var newwin='<html><head><style rtype="text/css">'+stytxt+'</style></head><body>'
+'<p class="subjectpopup">'+msg.subject+'</p>'
+'<img class="msgimgpopup" src="/ibt/GC21/var/core/ibt/pool/'+pool+'/'+escape(filevalue_l)+'?pad='+pad+'&amp;pad:time='+msg.time+'" title="'+filename_l+'">'
+'<p class="msgpopup">'+msg.message+'</p>'
+ msg.file_others_set
+'</body></html>';
debug2(newwin)
}

var _console2 = null; //--for debugging rendered commands
function debug2(msg) {
_console2 = window.open("","console","width=600,height=700,resizable,scrollbars");
_console2.document.open("text/html");
_console2.focus();
_console2.document.writeln(msg);
_console2.document.close();
}

function getUiGroupFiles(msg)
{
var result = new uiGroup("arrange", "h");
if ( withPool() ) {
if (msg.files && msg.files.length > 0) {
for (var a=0; a<msg.files.length; a++) {
if (msg.files[a].name != "file") {
var pathHref="/ibt/var/core/ibt/pool/"+pool+"/"+escape(msg.files[a].value);
result.add(new uiValue("image", "/btn/i50/object/pad/attachment.gif", "imageHref", pathHref, "imageTitle", escape(msg.files[a].name), "target", "_blank"));
}
}
}
}
return result;
}


function getStatus(msg)
{
result = "";
if (typeof(msg.status)!= "undefined" && msg.status != null)
result = msg.status;
return result;
}


function getPoolStatus(msg)
{
result = "";
if (typeof(msg.status)!= "undefined" && msg.status != null) {
if (msg.status == "started") result = "In Bearbeitung";
if (msg.status == "ready") result = "Erledigt";
if (msg.status == "abInitio") result = "Nicht begonnen";
}
return result;
}


function getPoolStatusImage(msg)
{
result = "/ibt/adm/core/ibt/lib/image/util/nix.gif";
if (typeof(msg.status)!= "undefined" && msg.status != null) {
if (msg.status == "started") result = "/ibt/GC21/area=gc21/main/de/mode/ibt/style/lite/image/status/started.gif";
if (msg.status == "ready") result = "/ibt/GC21/area=gc21/main/de/mode/ibt/style/lite/image/status/ready.gif";
if (msg.status == "abInitio") result = "/ibt/GC21/area=gc21/main/de/mode/ibt/style/lite/image/status/abInitio.gif";
}
return result;
}


function getPriority(msg)
{
result = "";
if (typeof(msg.priority)!= "undefined" && msg.priority != null) {
if (msg.priority == "h") result = "Hoch";
if (msg.priority == "u") result = "Sehr hoch";
if (msg.priority == "m") result = "Normal";
if (msg.priority == "l") result = "Gering";
if (msg.priority == "d") result = "Sehr gering";
}
return result;
}


function getPriorityImage(msg)
{
result = "/ibt/adm/core/ibt/lib/image/util/nix.gif";
if (typeof(msg.priority)!= "undefined" && msg.priority != null) {
if (msg.priority == "h") result = "/ibt/style=myso/paint=myso/mode/ibt/style/myso/image/priority/h.gif";
if (msg.priority == "u") result = "/ibt/style=myso/paint=myso/mode/ibt/style/myso/image/priority/u.gif";
if (msg.priority == "m") result = "/ibt/style=myso/paint=myso/mode/ibt/style/myso/image/priority/m.gif";
if (msg.priority == "l") result = "/ibt/style=myso/paint=myso/mode/ibt/style/myso/image/priority/l.gif";
if (msg.priority == "d") result = "/ibt/style=myso/paint=myso/mode/ibt/style/myso/image/priority/d.gif";
}
return result;
}


function getRecipients(msg)
{
result = new String();
if (msg.recipients && typeof(msg.recipients)!= "undefined")
result = msg.recipients;
result = result.toString();
result = result.replace(","+getUser(msg), "")
return result;
}


function getMessageDate(msg)
{
result = new Date();
if (typeof(msg.time)!= "undefined" && msg.time > 0) {
result.setTime(msg.time)
result = datum(result)
} else {
result="-"
}
return result;
}


function getMessageDateShort(msg)
{
result = new Date();
if (typeof(msg.time)!= "undefined" && msg.time > 0) {
result.setTime(msg.time)
result = datumShort(result)
} else {
result="-"
}
return result;
}


function getMessageTimeShort(msg)
{
result = new Date();
if (typeof(msg.time)!= "undefined" && msg.time > 0) {
result.setTime(msg.time)
result = timeShort(result)
} else {
result="-"
}
return result;
}


function getMessageRefDate(msg)
{
result = new Date();
if (typeof(msg.reference)!= "undefined" && msg.reference > 0) {
result.setTime(msg.reference)
result = datum(result)
} else {
result="Kein Bezug"
}
return result;
}


function getStartTime(msg)
{
result = new Date();
if (typeof(msg.startTime)!= "undefined" && msg.startTime > 0) {
result.setTime(msg.startTime);
result = "<nobr>" + datum(result) + "</nobr>";
} else {
result=""
}
return result;
}


function getEndTime(msg)
{
result = new Date();
if (typeof(msg.endTime)!= "undefined" && msg.endTime > 0) {
result.setTime(msg.endTime);
result = "<nobr>" + datum(result) + "</nobr>";
} else {
result=""
}
return result;
}


function getActiveSince(msg)
{
result = new Date();
if (typeof(msg.activeSince)!= "undefined" && msg.activeSince > 0) {
result.setTime(msg.activeSince);
result = "<nobr>" + datum(result) + "</nobr>";
} else {
result=""
}
return result;
}


function getActiveUntil(msg)
{
result = new Date();
if (typeof(msg.activeUntil)!= "undefined" && msg.activeUntil > 0) {
result.setTime(msg.activeUntil);
result = "<nobr>" + datum(result) + "</nobr>";
} else {
result=""
}
return result;
}


function getMessageTime(msg)
{
if (typeof(msg.time)!= "undefined")
return msg.time;
return 0;
}


function getMessageRefTime(msg)
{
if (typeof(msg.reference)!= "undefined")
return msg.reference;
return 0;
}


function getImage(msg,maxwidth)
{
maxwidth = (maxwidth) ? " width=" + maxwidth : "";
if (typeof(msg.image) != "undefined" && msg.image != null && msg.image != "") {
result = (msg.image.substr(0,1)=="/") ? "/ibt/GC21/area=gc21/main/de" + msg.image : "/ibt/GC21/area=gc21/main/de/" + msg.image;
result = "<img class=\"img\" border=0"+maxwidth+" src=\"" + result + "\">";
} else
result = "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"1\" width=\"1\">";
return result;
}


function delMessage(time)
{
if (confirm("Nachrichten loeschen: Sind Sie sicher?"))
document.location.href="Pad.ibt?load=createResult.sxhtml&pad="+pad+"&time="+time+"&action=del"+parameter;
}

/*********
* this next section is related to teaser management
* this next section is related to imagepopup management
**********/



function setTeaser(result)
{
if(typeof pads=='undefined' && typeof messages!="undefined") window.pads=new Array()
pads[pad]=messages // stores multipul pads

var teaspoint=(typeof chrlmt !="undefined")?(typeof teaseoff=="undefined" ?chrlmt:null):null;

if(result.indexOf('<teaser/>')!=-1) teaspoint=result.indexOf('<teaser/>');
if(result.indexOf('<teaser>')!=-1) teaspoint=result.indexOf('<teaser>');
if(result.indexOf('\x3Cteaser/\x3E')!=-1) teaspoint=result.indexOf('\x3Cteaser/\x3E');

if(teaspoint !=null && teaspoint<= (result.length+3))
{
if(typeof teaspoint =="string") teaspoint++ //converting
var submsg = result.substr(0,teaspoint)
var cut = submsg.substr(0,submsg.lastIndexOf(" "))
if(submsg.lastIndexOf(" ")!=-1) result = setTeaserEnd(cut); // put ending on
}
return result;
}

function setTeaserEnd(cut_result)
{
var GVmsgMore = '...mehr';
if (GVmsgMore.indexOf('gc21.athr.flexipad.learnmore.label')!=-1) GVmsgMore = '...[+]';
if(typeof msgend =="string") GVmsgMore = msgend;
if(typeof unsnap!="undefined" && unsnap)// just for '...more' display
cut_result = cut_result +'<a class="teaser" href="'+unsnap+'">'+unescape(GVmsgMore)+'</a>';
else
cut_result = cut_result +'<a class="teaser" href="javascript:exp_teaser('+i+',\''+pad+'\')">'+unescape(GVmsgMore)+'</a>'
return cut_result;
}

function exp_teaser(i,pad){
var GVmsgLess = 'Verbergen';
if (GVmsgLess.indexOf('gc21.athr.flexipad.close.label')!=-1) GVmsgLess = '[-]';
if(typeof msgendless =="string") GVmsgLess = msgendless;
var div_cont = document.getElementById(pads[pad][i].time)
if(typeof pads[pad][i].teasStore=="undefined" || pads[pad][i].teasStore=="") { //it's presently in short form
pads[pad][i].teasStore = div_cont.innerHTML ; // store short form
pads[pad][i].msgRowHeight = div_cont.parentNode.clientHeight || div_cont.parentNode.offsetHeight ; // store msgRow height


div_cont.parentNode.style.height = pads[pad][i].msgRowHeight;//correction for IE6
var div_org_ht = div_cont.clientHeight
div_cont.innerHTML = expandMsg(pads[pad][i].message)  +'<a class="teaser" href="javascript:exp_teaser('+i+',\''+pad+'\')">' + GVmsgLess +'</a>'; // write full message
div_cont.parentNode.style.height = div_cont.parentNode.scrollHeight  ;
}else{ // was in full form, now close it
div_cont.innerHTML = pads[pad][i].teasStore ; // write short form
pads[pad][i].teasStore = ""; //empty store
div_cont.parentNode.style.height = pads[pad][i].msgRowHeight;
}
}


function setRead(time, setRead)
{
document.location.href="Pad.ibt?load=createResult.sxhtml&pad="+pad+"&time="+time+"&action=set&read="+setRead+parameter;
}


function setMarked(time, setMarked)
{
document.location.href="Pad.ibt?load=createResult.sxhtml&pad="+pad+"&time="+time+"&action=set&marked="+setMarked+parameter;
}


function expandBR(str)
{
if (typeof str=="undefined" || str==null || str=="") return ""
var a = str.split("<BR>")
var r = a[0]
for (var i=1; i<a.length; i++) r+=a[i] + "\n"
return r;
}


function indentBR(str)
{
if (typeof str=="undefined" || str==null || str=="") return ""
var a = (str + "\n").split("<BR>")
var r = ""
for (var i=0; i<a.length; i++) r+="&gt; "+a[i] + "\n"
return r;
}


function expandLink(prefix, str)
{
if (typeof str=="undefined" || str==null || str=="") return ""
var i=0 ;
var n=0 ;
var h;
var arw = ">";
while ( ( h = str.indexOf(prefix, i) ) >= 0) {
var e=str.indexOf(" ", h)
if (e<0) e=str.length ;
var href=str.substring(h,e)
var lastChars =  str.substring((h-6) , (h-1))
if( lastChars == "href=" ){
if(str.indexOf("&gt;")!=-1) arw = "&gt;" ;
(str.indexOf("a"+arw, h)!=-1)? e= str.indexOf("a"+arw, h) : e= str.indexOf("A"+arw, h) ;
i=e+2;
}else{
var link="<A TARGET=_window HREF=\"" + href + "\">" + href.replace(prefix,'') + "</A>"
str= str.substring(0,h) + link + str.substring(e,str.length)
i = h + link.length
}
}
return str
}


function expandLinks(str)
{
str = expandLink("ftp://", str);
str = expandLink("http://", str);
str = expandLink("https://", str);
str = expandLink("mailto:", str);
str = expandLink("Javascript://", str);
return str;
}


function expandIcon(name, image, str)
{
if (typeof str=="undefined" || str==null || str=="") return ""
var a = str.split(name);
var r = a[0];
for (var i=1; i<a.length; i++)
r+= iconImg(image) +  a[i]
return r;
}

function iconImg(image)
{
return "<IMG BORDER=0 SRC=\"/ibt/adm/core/ibt/lib/image/emoticon/" + image + "\">"
}

function expandIcons(icons, str)
{
for (var i=0; i<icons.length; i+=4)
str = expandIcon( icons[i], icons[i+1], str)
return str
}


function getIcons(category)
{
return emoticonsStd
}


function expandMsg(str)
{
return expandLinks( expandIcons( emoticonsStd, str))
}


function w(text)
{ document.write(text) }


function selectIcon(icons)
{
w("<TABLE WIDTH=\"100%\"><TR><TD>")
checked=""
for (var i=0; i<icons.length; i+=4) {
if (icons[i+3]) {
w( "<NOBR><INPUT TYPE=RADIO NAME=icon VALUE=\"" + icons[i] + "\"" + checked + "> "  )
w( iconImg(icons[i+1]) + "</NOBR>" )
}
}
w("</TD></TR></TABLE>")
}

function iconIntoSubject()
{
var f=document.form
var icon=""
if (typeof f.icon != "undefined" ) {
for (var i=0; i<f.icon.length; i++) {
if (f.icon[i].checked) {
icon=f.icon[i].value + " "
break
}
}
f.subject.value = icon + f.subject.value
}
}


function iconHelp(icons)
{
w("<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>")
w("<TR><TD><B>KÃƒÆ’Ã‚Â¼rzel</B></TD><TD><B>Icon</B></TD><TD><B>Bedeutung</B></TD></TR>" )
for (var i=0; i<icons.length; i+=4) {
if ( icons[i+3] )
w("<TR><TD> <TT>" + icons[i] + "</TT> </TD><TD ALIGN=CENTER> " + iconImg(icons[i+1]) + " </TD><TD> " + icons[i+2] + " </TD></TR>" )
}
w("</TABLE>")
}


function datum(termin)
{
var datumstring= "<span class=\"date\">"+datumShort(termin) + "</span>  <span class=\"time\">" + timeShort(termin)+"</span>" ;
return (datumstring)
}


function datumShort(termin)
{
var date = new Date()
date.setTime (termin);
var tag = date.getDate();
tag = ((tag<10) ? "0" : "") + tag;
var monat = date.getMonth()+1;
monat = ((monat<10) ? "0" : "") + monat;
var jahr = date.getFullYear();
var datumstring= jahr + "-" + monat + "-" + tag;
return (datumstring)
}


function timeShort(termin)
{
var date = new Date()
date.setTime (termin);
var stunde = date.getHours();
stunde = ((stunde<10) ? "0" : "") + stunde;
var minute = date.getMinutes();
minute = ((minute<10) ? ":0" : ":") + minute;
var datumstring = stunde + minute;
return (datumstring)
}


function nobr(str)
{ if (str=="") return ""
a = (str + "\n").split("<BR>");
r = ""
for (var i=0; i<a.length ; i++)
r+="&gt; "+a[i] + "\n";
return r;
}


function nobr0(str)
{ if (str=="") return ""
a = (str + "\n").split("<BR>");
r = ""
for (var i=0; i<a.length ; i++)
r+=a[i] + "\n";
return r;
}


function nobrEdit(str)
{
if (str=="") return ""
a = (str + "\n").split("<br>");
r = ""
for (var i=0; i<a.length; i++) {
b = a[i].split("<BR>")
for (var j=0; j<b.length; j++)
r+=b[j] + "\n"
}
return r;
}


function emoticons(inputSelect, icons)
{
inputSelect["value"] = "";
for (var i=0; i<icons.length; i+=4)
if (icons[i+3])
inputSelect.add(new uiValue("type", "data", "label", iconImg(icons[i+1]), "name", icons[i]));
inputSelect.add(new uiValue("type", "data", "label", "-", "name", ""));
}


function withPool()
{
if ( typeof(pool) == "undefined" ) return false;
if ( pool == null ) return false;
if ( pool == "" ) return false;
if ( pool == false ) return false;
if ( pool == "false" ) return false;
if ( pool == "null" ) return false;
return true;
}


function scrollDown()
{
if ( window.scroll ) window.scroll(1,9999)
if ( window.scrollTo ) setTimeout("window.scrollTo(1,9999)", 1);
}


function printPadtitle(actionLabel, padView, target)
{
if(checkAccess('head') && typeof localOrder =='undefined' && render==null){
if (typeof(padView) == "undefined") padView = "";
if (typeof(actionLabel)=="undefined") actionLabel = "";
if (typeof(target)=="undefined") target = "_self";
make('buttons');
make('buttonsRight')
make('buttonsLeft')
buttons = getTitleButtons();
buttonsRight = printButtonsRight(buttons,padView,target);
buttonsLeft = printButtonsLeft(buttons,padView,target);
var paneWidth = (type=="gc21chat") ? "100%" : "90%";
w("<table border=0 cellspacing=0 cellpadding=0 width="+paneWidth+"><tr>"
+ "<td bgcolor=#000000 height=1 width=1>"+space+"</td>"
+ "<td bgcolor=#000000 height=1 width=10000 colspan=2 >"+space+"</td>"
+ "<td bgcolor=#000000 height=1 width=1>"+space+"</td></tr>"
+ "<tr valign=top>"
+ "<td rowspan=3 width=1 bgcolor=#000000>"+space
+ "</td><td valign=top bgcolor=#e5e5e5>"
+ "<table border=0 width=\"100%\" cellpadding=5 cellspacing=0><tr><td align=left class=lay-buttons-nav-pad-title>"
+ "<b>"+title+"</b>");
if (actionLabel != "") {
w("&nbsp;&bull;&nbsp;"+actionLabel);
}
w("</td></tr></table>"
+ "</td><td valign=top bgcolor=#e5e5e5 align=right>"
+ "<table border=0 cellpadding=5 cellspacing=0><tr><td class=lay-buttons-nav-pad-title>"
+ typelabel
+ "</td></tr></table>"
+ "</td><td rowspan=3 width=1 bgcolor=#000000>"+space
+ "</td></tr><tr>"
+ "<td colspan=2 bgcolor=#000000 height=1>"+space
+ "</td></tr><tr><td valign=top bgcolor=#f3f3f3 align=left class=lay-buttons-nav-pad>"
+ "<table border=0 cellpadding=0 cellspacing=0><tr><td>"
+ buttonsLeft
+ "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" width=1 height=24></td></tr></table>"
+ "</td><td valign=top bgcolor=#f3f3f3 align=right class=lay-buttons-nav-pad>"
+ "<table border=0 cellpadding=0 cellspacing=0><tr><td>"
+ "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" width=1 height=24>"
+ buttonsRight
+ "</td></tr></table>"
+ "</td></tr>"
+ "<tr><td colspan=4 bgcolor=#000000 height=1>"
+ space+"</td></tr></table>");
}
}


function printButtonsRight(buttons,padView,target)
{
var result = "";
var aButtons = new Array();
if(buttons != "")
aButtons = buttons.split(",");
var rButtons = new Array();
for(i=0;i<aButtons.length;i++){
if(aButtons[i] == "search" && checkAccess('search')) rButtons.search = true;
if(aButtons[i] == "help" && checkAccess('help')) rButtons.help = true;
if(aButtons[i] == "thelp" && checkAccess('thelp')) rButtons.thelp = true;
}
if (padView == "tree") {
if (rButtons.search) result += searchButton(pad, viewParam, "topframe");
if (rButtons.help) result += helpButton(type, "view");
if (rButtons.thelp) result += thelpButton(type, "view");
} else {
if (rButtons.search) result += searchButton(pad, parameter ,target)
if (rButtons.help) result += helpButton(type, target)
if (rButtons.thelp) result += thelpButton(type, target)
}
return result;
}


function printButtonsLeft(buttons,padView,target)
{
var result = "";
var aButtons = new Array();
if(buttons != "")
aButtons = buttons.split(",");
var lButtons = new Array();
for(i=0;i<aButtons.length;i++){
if(aButtons[i] == "create" && checkAccess('create')) lButtons.create = true;
if(aButtons[i] == "overview" && checkAccess('overview')) lButtons.overview = true;
if(aButtons[i] == "details" && checkAccess('details')) lButtons.details = true;
if(aButtons[i] == "tree" && checkAccess('tree')) lButtons.tree = true;
if(aButtons[i] == "archive" && checkAccess('archive')) lButtons.archive = true;
if(aButtons[i] == "about" && checkAccess('about')) lButtons.about = true;
if(aButtons[i] == "print" && checkAccess('print')) lButtons.print = true;
if(aButtons[i] == "summary" && checkAccess('summary')) lButtons.summary = true;
if(aButtons[i] == "stream" && checkAccess('stream')) lButtons.stream = true;
if(aButtons[i] == "poll" && checkAccess('poll')) lButtons.poll = true;
if(aButtons[i] == "inbox" && checkAccess('inbox')) lButtons.inbox = true;
if(aButtons[i] == "outbox" && checkAccess('outbox')) lButtons.outbox = true;
if(aButtons[i] == "rss" && checkAccess('rss')) lButtons.rss = true;
}
if (padView=="tree") {
if (lButtons.create) result += createButton(pad, parameter,"view")
if (lButtons.overview) result += overviewButton(pad, viewParam, "topframe")
if (lButtons.details) result += detailsButton(pad, viewParam, "topframe")
if (lButtons.tree) result += treeButton(pad, viewParam, "topframe")
if (lButtons.summary) result += summaryButton(pad, viewParam, "topframe")
if (lButtons.stream) result += streamButton(pad, viewParam, "topframe")
if (lButtons.poll) result += pollButton(pad, viewParam, "topframe")
if (lButtons.inbox) result += inboxButton(pad, viewParam, "topframe")
if (lButtons.outbox) result += outboxButton(pad, viewParam, "topframe")
if (lButtons.archive) result += archiveButton(pad, viewParam, "topframe")
if (lButtons.about) result += aboutButton(pad, "", "topframe")
if (lButtons.print) result += printButton(pad, "&sort=thread&reverse=false", "_blank")
if (lButtons.rss) result += rssButton(type, viewParam, "view");
} else {
if (lButtons.create) result += createButton(pad, parameter ,"_self")
if (lButtons.overview) result += overviewButton(pad, viewParam ,target)
if (lButtons.details) result += detailsButton(pad, viewParam ,target)
if (lButtons.tree) result += treeButton(pad, viewParam ,target)
if (lButtons.summary) result += summaryButton(pad, viewParam, target)
if (lButtons.stream) result += streamButton(pad, viewParam, target)
if (lButtons.poll) result += pollButton(pad, viewParam, target)
if (lButtons.inbox) result += inboxButton(pad, viewParam, target)
if (lButtons.outbox) result += outboxButton(pad, viewParam, target)
if (lButtons.archive) result += archiveButton(pad, viewParam, target)
if (lButtons.about) result += aboutButton(pad, "", target)
if (lButtons.print) result += printButton(pad, viewParam, "_blank")
if (lButtons.rss) result += rssButton(type, parameter, target)
}
return result;
}


function printMessageUiButtons()
{
var buttons = ""
buttons = getMessageButtons()
var aButtons = new Array();
if(buttons != "")
aButtons = buttons.split(",");
var mButtons = new Array();
for(j=0;j<aButtons.length;j++){
if(aButtons[j] == "reply") mButtons.reply = true;
if(aButtons[j] == "update") mButtons.update = true;
if(aButtons[j] == "edit") mButtons.edit = true;
if(aButtons[j] == "delete") mButtons.del = true;
if(aButtons[j] == "scratch") mButtons.scratch = true;
}
result =  new uiGroup("arrange", "r")
if (mButtons.reply)
result.add(new uiValue("image", "/btn/i50/object/action/reply/out.gif", "imageHref", "Pad.ibt?load=createInput.sxhtml&time="+msg.time+"&pad="+pad+parameter+"&sendAction=reply", "imageTitle", "Beantworten"))
if (mButtons.update)
result.add(new uiValue("image", "/btn/i50/object/action/update/out.gif", "imageHref", "Pad.ibt?load=createInput.sxhtml&time="+msg.time+"&pad="+pad+parameter+"&sendAction=update", "imageTitle", "Aktualisieren"))
if (mButtons.edit)
result.add(new uiValue("image", "/btn/i50/object/action/edit/out.gif", "imageHref", "Pad.ibt?load=editInput.sxhtml&time="+msg.time+"&pad="+pad+parameter, "imageTitle", "Bearbeiten"))
if (mButtons.del)
result.add(new uiValue("image", "/btn/i50/object/action/delete/out.gif", "imageHref", "javascript:delMessage("+msg.time+")", "imageTitle", "Löschen"))
if (mButtons.scratch)
result.add(new uiValue("image", "/btn/i50/object/action/delete/out.gif", "imageHref", "Pad.ibt?load=createResult.sxhtml&action=scratch&time="+msg.time+"&pad="+pad+parameter, "imageTitle", "Löschen"))
return result;
}


function printSortLinks(href)
{
if(checkAccess('sort') && typeof localOrder =='undefined' && render==null){
var out = "";
var cat = new Array();
cat = sortLinks[type].split(",");
if (cat != "")
for (i=0;i<cat.length;i++){
if (type == "webmail" && padView =="inbox" && cat[i] == "recipient")
continue;
if (type == "webmail" && padView =="outbox" && cat[i] == "sender")
continue;
out += "<nobr>" + sortLabel[cat[i]] + " ";
if (cat[i] == "thread") {
out += sortLink(pad, "invthread", "false", href, sortParam);
out += sortLink(pad, "thread", "false", href, sortParam);
} else {
out += sortLink(pad, cat[i], "false", href, sortParam);
out += sortLink(pad, cat[i], "true", href, sortParam);
}
out += "</nobr> | ";
}
out = out.substring(0,(out.lastIndexOf(" | ")))
if (out != "")
printLinks("Sortieren nach:", out);
}
}


function printFilterLinks(href, showArray, param, view)
{
if(checkAccess('filter') && typeof localOrder =='undefined' && render==null){
var out = "";
if (!param) param = sortString;
if (typeof(padView ) == "undefined") padView="overview";
if (view == "sinceless") {
if (showArray["newIcon"]) {
out += (unread=="true") ? "<a href=\"Pad.ibt?load="+href+"&pad="+pad+param+"&unread=false\">Alle</a>" :  "<a href=\"Pad.ibt?load="+href+"&pad="+pad+param+"&unread=true\">Nur neue</a>";
out += "&nbsp;&nbsp;"
out += (lastTime>mark) ? "<a href=\"Pad.ibt?load="+href+"&pad="+pad+param+"&mark="+lastTime+"\">Alles gelesen</a>&nbsp;&nbsp;" : "";
}
} else {
if (showArray["newIcon"]) {
out += (unread=="true") ? "<a href=\"Pad.ibt?load="+href+"&pad="+pad+"&padView="+padView+param+"&unread=false\">Alle</a>" :  "<a href=\"Pad.ibt?load="+href+"&pad="+pad+"&padView="+padView+param+"&unread=true&since=mark\">Nur neue</a>";
out += "&nbsp;&nbsp;"
out += (lastTime>mark) ? "<a href=\"Pad.ibt?load="+href+"&pad="+pad+"&padView="+padView+param+"&mark="+lastTime+"\">Alles gelesen</a>&nbsp;&nbsp;" : "";
}
if (showArray["newIcon"] && view == "tree") out+="|&nbsp;";
if (view == "tree") {
out += "&nbsp;<a href=\"javascript:expandAll()\">Alle öffnen</a>&nbsp;&nbsp;";
if (showArray["newIcon"])
out += "<a href=\"javascript:expandNew()\">Ungelesene öffnen</a>&nbsp;&nbsp;";
out += "<a href=\"javascript:collapseAll()\">Alle schließen</a>";
}
}
if (out.length > 0)
printLinks("Beiträge anzeigen:", out);
}
}


function createButton(pad, otherParam, target)
{
if (typeof(pad)!="undefined") {
if (typeof(render)!="undefined" && render!=null) {
if (padView=="overview" && render.match("overviewWithoutCreate"))
return "";
}
if (typeof(target)=="undefined") target = "_self";
make('param');
param = pad;
if(typeof(otherParam)!="undefined") param += otherParam;
href = "<a href=\"Pad.ibt?action=about&load=createInput.sxhtml";
if (type=="webmail" || type=="biff") {
href += "&users=./%23role/student";
}
href += "&action=about&pad="+param+"\" target=\""+target+"\"><img src=\"/btn/i50/object/action/create/out.gif\" title=\"Neu\" alt=\"Neu\" border=0></a>";
return href;
} else {
return null;
}
}


function overviewButton(pad, otherParam, target)
{
if (typeof(pad)!="undefined") {
if (typeof(target)=="undefined") target = "_self";
param = pad;
if(typeof(otherParam)!="undefined") param += otherParam;
if (type!="webmail" && type!="pool" && type!="reminder"){
make('hrefParameter');
hrefParameter = "load=overviewLayout.sxhtml&padView=overview&select=subject&pad="+param ;}
else
hrefParameter = "load=overviewLayout.sxhtml&padView=overview&pad="+param
href = "<a href=\"Pad.ibt?"+hrefParameter+"\" target=\""+target+"\"><img src=\"/btn/i50/object/action/overview/out.gif\" title=\"Übersicht\" alt=\"Übersicht\" border=0></a>";
return href;
} else {
return null;
}
}


function detailsButton(pad, otherParam, target)
{
if (typeof(pad)!="undefined") {
if (typeof(target)=="undefined") target = "_self";
param = pad;
if(typeof(otherParam)!="undefined") param += otherParam;
href = "<a href=\"Pad.ibt?load=detailsLayout.sxhtml&action=read&padView=details&pad="+param+"\" target=\""+target+"\"><img src=\"/btn/i50/object/action/details/out.gif\" title=\"Details\" alt=\"Details\" border=0></a>";
return href;
} else {
return null;
}
}


function treeButton(pad, otherParam, target)
{
if (typeof(pad)!="undefined") {
if (typeof(target)=="undefined") target = "_self";
param = pad;
if(typeof(otherParam)!="undefined") param += otherParam;
href = "<a href=\"frameset2.sxhtml?padView=tree&pad="+param+"\" target=\""+target+"\"><img src=\"/btn/i50/object/action/tree/out.gif\" title=\"Strukturansicht\" alt=\"Strukturansicht\" border=0></a>";
return href;
} else {
return null;
}
}


function aboutButton(pad, otherParam, target)
{
if (typeof(pad)!="undefined") {
if (typeof(target)=="undefined") target = "_self";
href = "<a href=\"/ibt/GC21/area=gc21/main/de/sico/core/ibt/object/about.cos?select.id="+pad+"\" target=\""+target+"\"><img src=\"/btn/i50/object/action/about/out.gif\" title=\"Info\" alt=\"Info\" border=0></a>";
return href;
} else {
return null;
}
}


function archiveButton(pad, otherParam, target)
{
if (typeof(pad)!="undefined") {
if (typeof(target)=="undefined") target = "_self";
param = pad;
param += "&until=0&max=-10"
if(typeof(otherParam)!="undefined") param += otherParam;
href = "<a href=Pad.ibt?load=archiveLayout.sxhtml&pad="+param+" target=\""+target+"\"\"><img src=\"/btn/i50/object/action/archive/out.gif\" title=\"Archiv\" alt=\"Archiv\" border=0></a>";
return href;
} else {
return null;
}
}


function printButton(pad, otherParam)
{
if (typeof(pad)!="undefined") {
param = pad;
if(typeof(otherParam)!="undefined") param += otherParam;
href = "<a href=\"Pad.ibt?load=printLayout.sxhtml&pad="+param+"\" target=_blank><img src=\"/btn/i50/object/action/print/out.gif\" title=\"Drucken\" alt=\"Drucken\" border=0></a>";
return href;
} else {
return null;
}
}


function searchButton(pad, otherParam, target)
{
if (typeof(pad)!="undefined") {
if (typeof(target)=="undefined") target = "_self";
make('param');
param = pad;
if(typeof(otherParam)!="undefined") param += otherParam;
make('href');
href = "<a href=\"Pad.ibt?load=searchInput.sxhtml&users=./%23role/student&action=about&pad="+param+"\" target=\""+target+"\"><img src=\"/btn/i50/object/action/search/out.gif\" title=\"Durchsuchen\" alt=\"Durchsuchen\" border=0></a>";
return href;
} else {
return null;
}
}


function helpButton(type, target)
{
if (typeof(type)!="undefined") {
if (typeof(target)=="undefined") target = "_self";
href = "<a href=\"/ibt/GC21/area=gc21/main/de/sico/help/login/de/student/object/pad2/"+type+".sxhtml\" target=\""+target+"\"><img src=\"/btn/i50/object/action/help/out.gif\" title=\"Hilfe\" alt=\"Hilfe\" border=0></a>";
return href;
} else {
return null;
}
}


function thelpButton(type, target)
{
if (typeof(type)!="undefined") {
if (typeof(target)=="undefined") target = "_self";
href = "<a href=\"/ibt/GC21/area=gc21/main/de/sico/help/login/de/handle/object/pad2/"+type+".sxhtml\" target=\""+target+"\"><img src=\"/btn/i50/object/action/help/!attend/out.gif\" title=\"Hilfe für Tutoren\" alt=\"Hilfe für Tutoren\" border=0></a>";
return href;
} else {
return null;
}
}


function summaryButton(pad, otherParam, target)
{
if (typeof(pad)!="undefined") {
if (typeof(target)=="undefined") target = "_self";
param = pad;
if(typeof(otherParam)!="undefined") param += otherParam;
href = "<a href=\"Pad.ibt?load=summaryLayout.sxhtml&padView=summary&pad="+param+"\" target=\""+target+"\"><img src=\"/btn/i50/object/action/summary/out.gif\" title=\"Zusammenfassung\" alt=\"Zusammenfassung\" border=0></a>";
return href;
} else {
return null;
}
}


function streamButton(pad, otherParam, target)
{
if (typeof(pad)!="undefined") {
if (typeof(target)=="undefined") target = "_self";
param = pad;
if(typeof(otherParam)!="undefined") param += otherParam;
href = "<a href=\"frameset2.sxhtml?load=streamLayout.sxhtml&padView=stream&pad="+param+"\" target=\""+target+"\"><img src=\"/btn/i50/object/action/stream/out.gif\" title=\"Mitverfolgen\" alt=\"Mitverfolgen\" border=0></a>";
return href;
} else {
return null;
}
}


function pollButton(pad, otherParam, target)
{
if (typeof(pad)!="undefined") {
if (typeof(target)=="undefined") target = "_self";
param = pad;
if(typeof(otherParam)!="undefined") param += otherParam;
href = "<a href=\"frameset2.sxhtml?load=pollLayout.sxhtml&padView=poll&pad="+param+"\" target=\""+target+"\"><img src=\"/btn/i50/object/action/poll/out.gif\" title=\"Abfragen\" alt=\"Abfragen\" border=0></a>";
return href;
} else {
return null;
}
}


function inboxButton(pad, otherParam, target)
{
if (typeof(pad)!="undefined") {
if (typeof(target)=="undefined") target = "_self";
param = pad;
if(typeof(otherParam)!="undefined") param += otherParam;
href = "<a href=\"Pad.ibt?load=overviewLayout.sxhtml&padView=inbox&pad="+param+"\" target=\""+target+"\"><img src=\"/btn/i50/object/action/inbox/out.gif\" title=\"Posteingang\" alt=\"Posteingang\" border=0></a>";
return href;
} else {
return null;
}
}


function outboxButton(pad, otherParam, target)
{
if (typeof(pad)!="undefined") {
if (typeof(target)=="undefined") target = "_self";
param = pad;
if(typeof(otherParam)!="undefined") param += otherParam;
href = "<a href=\"Pad.ibt?load=overviewLayout.sxhtml&padView=outbox&pad="+param+"\" target=\""+target+"\"><img src=\"/btn/i50/object/action/outbox/out.gif\" title=\"Postausgang\" alt=\"Postausgang\" border=0></a>";
return href;
} else {
return null;
}
}


function rssButton(type, otherParam, target)
{
if (typeof(pad)!="undefined") {
if (typeof(target)=="undefined") target = "_self";
param = pad;
if(typeof(otherParam)!="undefined") param += otherParam;
href = "<a href=\"Pad.ibt?load=rssLayout.sxhtml&pad="+pad+"\" target=\""+target+"\"><img src=\"/btn/i50/object/action/rss/out.gif\" title=\"RSS Abonnieren\" alt=\"RSS Abonnieren\" border=0></a>";
return href;
} else {
return null;
}
}



function sortLink(pad, sort, reverse, load, otherParam, target)
{
var iconsPath = "/ibt/style=myso/paint=myso/mode/ibt/style/myso/image";
if (typeof(pad)!="undefined") {
target = (typeof(target)!="undefined") ? " target="+target+" " : ""
var param = "pad="+pad;
if(typeof(sort)!="undefined") param += "&sort="+sort;
if(typeof(reverse)!="undefined") param += "&reverse="+reverse;
if(typeof(load)!="undefined")
param += "&load="+load
else
param += "&load=overviewLayout.sxhtml"
if(typeof(otherParam)!="undefined") param += otherParam;
href = "<a href=\"Pad.ibt?"+param+"\""+target+">"
if (reverse=="true" || sort == "invthread")
href += "<img src=\""+iconsPath+"/sort/up.gif\" border=0 width=10></a>"
else
href += "<img src=\""+iconsPath+"/sort/down.gif\" border=0 width=10></a>"
return href;
} else {
return null;
}
}


function printLinks(label, links)
{
if(typeof(label)=="undefined") label = "";
if(typeof(links)=="undefined") links = "";
w("<table cellpadding=0 cellspacing=0 border=0>"
+ "<tr><td height=5 colspan=2><img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"5\"></td></tr>"
+ "<tr><td valign=top><b>"+label+"&nbsp;</b></td><td valign=top>"
+ links
+ "</td></tr>");
w("</table>");
}


function printRssMessage()
{
var href = location.host;
if (location.href.indexOf("login") < 0) {
href += "/ibt/ibt/pad.ibt?action=xml&format=rss&pad=";
} else {
href += "/ibt/login/Pad.ibt?action=xml&format=rss&pad=";
}
var parts = pad.split("/");
href+=parts[0];
for (var i=1;i<parts.length;i++) {
href += "%2F"+parts[i];
}
var podcastHref = "http://"+href;
var rssHref = "rss://"+href;
var feedHref = "feed://"+href;
w( "<table cellpadding=0 cellspacing=0 border=0>"
+ "<tr><td height=10><img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"10\"></td></tr>"
+ "<tr><td>");
w( "Dieses Forum kann als RSS Feed abonniert werden. Es gibt verschiedene Möglichkeiten, solche Feeds zu lesen."
+ "<br/><br/><b>iTunes</b><br/>"
+ "Um dieses Forum als Podcast in <b>iTunes</b> zu abonnieren, gehen Sie wie folgt vor:"
+ "<ul><li>Öffnen Sie iTunes</li>"
+ "<li>Öffnen Sie im Menü \"Erweitert\" den Menüpunkt \"Podcast abonnieren...\" </li>"
+ "<li>Kopieren Sie dann folgende URL in das Eingabefeld:"
+ "<nobr><img src=\"/ibt/GC21/area=gc21/main/de/sico/lcom/ibt/pad2/pad/icons/itunes.gif\"/> <a href=\""+podcastHref+"\">"+podcastHref+"</a></nobr></li>"
+ "</ul>"
+ "<b>RSS Reader</b><br/>"
+ "Um dieses Forum als RSS Feed in Ihrem <b>RSS Reader</b> zu abonnieren, klicken Sie auf eine der folgenden Links, je nachdem ob Ihr RSS Reader \"RSS\"- oder \"Feed\"-URLs unterstzützt oder kopieren Sie die entsprechende URL in Ihren Reader. "
+ "<ul><li>RSS Link: "
+ "<nobr><img src=\"/ibt/GC21/area=gc21/main/de/sico/lcom/ibt/pad2/pad/icons/rss.gif\"/> <a href=\""+rssHref+"\">"+rssHref+"</a></nobr></li>"
+ "<li>Feed Link: "
+ "<nobr><img src=\"/ibt/GC21/area=gc21/main/de/sico/lcom/ibt/pad2/pad/icons/feed.gif\"/> <a href=\""+feedHref+"\">"+feedHref+"</a></nobr></li>"
+ "</ul>");
w("</td></tr></table>");
}


function printDescription()
{
if(description!=null && description!="")
w("<font size=-1>"+description+"</font><br><br>");
}


function getDetailsHref()
{
var result = "Pad.ibt?load=detailsLayout.sxhtml&action=read&time="+msg.time+"&pad="+pad+parameter;
return result;
}


function dataValue(label, name)
{
return new uiValue("label", label, "name", name);
}


function specialOverview()
{
parameter = sortString + unreadString + viewString;
sortParam = unreadString + viewString;
viewParam = sortString + unreadString;
for ( i=0; i<messages.length; i++ ) {
msg = messages[i];
timeMessages[msg.time] = msg;
msg.timelist = msg.time + ",";
msg.refcount = 0;
msg.lastUpdate = msg.time;
msg.read = isRead(msg, mark);
if (msg.reference==0)
any = true;
}

for ( i=0; i<messages.length; i++ ) {
msg = messages[i];
if (msg.reference != 0 && !timeMessages[msg.reference])
msg.reference = 0;
if (msg.reference != 0) {
mainMsg = timeMessages[msg.reference];
while (mainMsg.reference != 0 && timeMessages[mainMsg.reference])
mainMsg = timeMessages[mainMsg.reference];
if (mainMsg.reference == 0 && mainMsg.time != msg.time) {
if (msg.time > mainMsg.time)
mainMsg.lastUpdate = updateTime.setTime(msg.time);
mainMsg.marked = (mainMsg.marked || msg.marked);
mainMsg.read = (mainMsg.read && isRead(msg, mark));
mainMsg.refcount += 1;
mainMsg.timelist += msg.time + ","
}
}
}
if (unread == "true") {
any = false;
for ( i=0; i<messages.length; i++) {
if ( !isRead(messages[i]) && (messages[i].lastUpdate > mark) ) {
any = true;
break;
}
}
}
}

function editLink(padid){ // this must stay for backward compatibility V.2.2.006
var pre,text;
if(window[padid+'_roles']==null) window[padid+'_roles']=new Array();
window[padid+'_roles'][window[padid+'_roles'].length] = 1;
var links={cont_reg:'Contribute',cont_ano:'Anonymous contribution'}
for(typ in links){
text="";
if(typeof window[padid+'_'+typ]=='string' && checkItem(window[padid+'_roles'].toString(),window[padid+'_'+typ])){ // parameter found
var section=document.getElementById(padid+'_'+typ)
if(section==null){
var dv = document.createElement('SPAN');
dv.id = padid+'_'+typ;
dv.appendChild(document.createTextNode(links[typ]));
document.body.appendChild(dv);
section=document.getElementById(padid+'_'+typ)
}
if(section.childNodes[0].nodeName!="A"){
text=section.innerHTML ;
var lnk = document.createElement('A');
lnk.className = typ ;
pre =(typ!='cont_ano') ? '/ibt/login/GC21/area=gc21/main/de' : '/ibt/GC21/area=gc21/main/de' ;
lnk.href = pre+'/sico/gc21/lcom/ibt/flexipad_frame/board/Pad.ibt?load=detailsLayout.xhtml&pad='+pad
lnk.target = '_blank';
section.innerHTML ="";
section.appendChild(lnk);
lnk.appendChild(document.createTextNode(text));
}
}
}
}
