Array.prototype.find=function(value){for(i=0;i<this.length;i++){if(this[i]==value){return i;}}
return-1;}
var s78_elements_selected=Array();function s78SelectIt(ele){if(s78_elements_selected.find(ele)==-1){ele.select();ele.style.color='#000000';s78_elements_selected.push(ele);}}
function s78RemoveSelections(){s78_elements_selected=Array();}
function s78OpenFileBrowser(url,title){var props="width=430,height=320,menubar=no,resizable=yes,scrollbars=yes";browser=window.open(url,title,props);if(browser.opener==false){browser.opener=self;}
browser.focus();}
function s78FileBrowserSelect(id,title){opener.document.getElementById('selected_file_id').value=id;opener.document.getElementById('selected_file_name').firstChild.data=title;new Effect.Highlight(opener.document.getElementById('selected_file_name'));window.close();}
function s78OpenInpageBrowser(myurl){var win=new Window('browser',{className:"alphacube",title:"Unilounge News",width:600,height:400,resizable:true,url:myurl,showEffectOptions:{duration:3}});win.show();win.setDestroyOnClose();win.showCenter();}
function s78OpenInpageBrowserWithId(myurl,myid){var win_old=Windows.getWindow(myid);if(win_old){win_old.toFront();}else{var win=new Window(myid,{className:"alphacube",title:"Unilounge News",width:600,height:400,resizable:true,url:myurl,showEffectOptions:{duration:3}});win.show();win.setDestroyOnClose();win.showCenter();}}
Effect.s78SwapElements=function(element,container){var div=document.getElementById(container);var nodeList=div.childNodes;var queue=Effect.Queues.get('divSwapScope');if(queue.toArray().length<1){if(Element.visible(element)==false){for(i=0;i<nodeList.length;i++){if(nodeList.item(i).nodeName=="DIV"&&nodeList.item(i).id!=element){if(Element.visible(nodeList.item(i))==true){Effect.SlideUp(nodeList.item(i),{queue:{position:'end',scope:'divSwapScope',limit:0}})}}}
Effect.SlideDown(element,{queue:{position:'end',scope:'divSwapScope',limit:0}})}else{Effect.SlideUp(element,{queue:{position:'end',scope:'divSwapScope',limit:0}})}}}
S78.do_tag=function(aTag,eTag,tf){tf.focus();if(typeof document.selection!='undefined'){var range=document.selection.createRange();var insText=range.text;range.text=aTag+insText+eTag;range=document.selection.createRange();if(insText.length==0){range.move('character',-eTag.length);}else{range.moveStart('character',aTag.length+insText.length+eTag.length);}
range.select();}else if(typeof tf.selectionStart!='undefined'){var start=tf.selectionStart;var end=tf.selectionEnd;var insText=tf.value.substring(start,end);tf.value=tf.value.substr(0,start)+aTag+insText+eTag+tf.value.substr(end);var pos;if(insText.length==0){pos=start+aTag.length;}else{pos=start+aTag.length+insText.length+eTag.length;}
tf.selectionStart=pos;tf.selectionEnd=pos;}else{var pos;var re=new RegExp('^[0-9]{0,3}$');while(!re.test(pos)){pos=prompt("Einfügen an Position (0.."+tf.value.length+"):","0");}
if(pos>tf.value.length){pos=tf.value.length;}
var insText=prompt("Bitte geben Sie den zu formatierenden Text ein:");tf.value=tf.value.substr(0,pos)+aTag+insText+eTag+tf.value.substr(pos);}}
function S78(){}
S78.make_bold=function(tf){S78.do_tag('*','*',tf);}
S78.make_italic=function(tf){S78.do_tag('_','_',tf);}
S78.make_list=function(tf){S78.do_tag('* ','',tf);}
S78.make_link=function(tf){tf.focus();if(typeof document.selection!='undefined'){var range=document.selection.createRange();var insText=range.text;range.text=' "'+insText+'":'+insText+' ';range=document.selection.createRange();if(insText.length==0){range.move('character',-1);}else{range.moveStart('character',2+insText.length+2+insText.length+1);}
range.select();}else if((typeof tf.selectionStart!='undefined')&&tf.selectionStart!=tf.selectionEnd){var start=tf.selectionStart;var end=tf.selectionEnd;var insText=tf.value.substring(start,end);tf.value=tf.value.substr(0,start)+' "'+insText+'":'+insText+' '+tf.value.substr(end);var pos;if(insText.length==0){pos=start+2;}else{pos=start+2+insText.length*2+2;}
tf.selectionStart=pos;tf.selectionEnd=pos;}else{var pos;if(typeof tf.selectionStart!='undefinde')pos=tf.selectionStart;else pos=tf.value.length;var insText=prompt("Bitte gib die URL ein:");tf.value=tf.value.substr(0,pos)+' "'+insText+'":'+insText+' '+tf.value.substr(pos);}}
