var bookmarkurl="http://www.eBussi.de/";
var bookmarktitle="eBussi.de - Gib' doch mal ...";

function b(){//(c)eBussi.de
var lang;var name=navigator.appName;var version = navigator.appVersion;
 if (name=="Microsoft Internet Explorer" && version >= "4.0"){
  lang=(navigator.browserLanguage);
  if(document.all){window.external.AddFavorite(bookmarkurl,bookmarktitle)}
 }else{
  lang=(navigator.language);
  var msg='Bookmark: STRG+D!';
  alert(msg);}
}

function cw(){
	return true;
}
// *******************************************************
var soundfile="wav.wav"
function playsound(soundfile){
if (document.all && document.getElementById){document.getElementById("snd").src="";document.getElementById("snd").src='../media/'+soundfile+'.wav';
}else{obj=document.getElementById("mozsnd"+soundfile);if(obj.Play){obj.Play();};}
;}
function bindsound(tag, soundfile, masterElement){
	if (!window.event){return;}
	var source=event.srcElement
	while (source!=masterElement && source.tagName!="HTML"){
		if (source.tagName==tag.toUpperCase()){playsound(soundfile);break;}
		source=source.parentElement
	}
}
// *******************************************************
function smilie(text){
	//text =' '+text+' ';
	if (document.b_form.ebussi_text.createTextRange && document.b_form.ebussi_text.caretPos){
		var caretPos = document.b_form.ebussi_text.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1)==' '? text+' ':text;
		document.b_form.ebussi_text.focus();
	}else{
		document.b_form.ebussi_text.value += text; document.b_form.ebussi_text.focus();
	}
}
// *******************************************************
function PickTheColor(which) {
	color = showModalDialog('./c_pick.htm?LANG=DE&f=' + which,window,'dialogWidth:210px;dialogHeight:170px;status:0;scroll:0;help:0;');
	if(color !=""){
		if(document.b_form.bgr_col.value=="undefined"){document.b_form.bgr_col.value="";return;}
		if(document.b_form.txt_col.value=="undefined"){document.b_form.txt_col.value="";return;}

		if(which=="txt_col"){
		if(color !=""){
			document.b_form.txt_col.value=color;document.b_form.txt_col.style.background=""+color;document.all.VIEW_txt_col.style.background=""+color;}
		} else if(which=="bgr_col"){
			if(color !=""){	document.b_form.bgr_col.value=color;document.b_form.bgr_col.style.background=""+color;document.all.VIEW_bgr_col.style.background=""+color;}
		}else{return;}
	} else{
		return;
	}
	if(document.b_form.bgr_col.value=="undefined"){document.b_form.bgr_col.value="";}
	if(document.b_form.txt_col.value=="undefined"){document.b_form.txt_col.value="";}
	if(document.b_form.bgr_col.value==""){document.b_form.bgr_col.value="";}
	if(document.b_form.txt_col.value==""){document.b_form.txt_col.value="";}
}
// *******************************************************

var highlightcolor="lightyellow"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}
// *******************************************************
function insertAtCursor(myField, myValue, bbCode1, bbCode2, endOfLine) {
var bbb;
if (document.selection) {
//IE support
var str = document.selection.createRange().text;
myField.focus();
sel = document.selection.createRange();
sel.text = bbCode1 + myValue + bbCode2 + endOfLine;
if(myValue=='') { bbb=bbCode2.length; sel.moveStart('character',-bbb); sel.moveEnd('character',-bbb); }
sel.select();
return;
}
//MOZILLA/NETSCAPE support
else if (myField.selectionStart || myField.selectionStart == '0') {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
var bbb2, bbV;
if(myValue=='') myValue = myField.value.substring(startPos, endPos);
myField.value = myField.value.substring(0, startPos) + bbCode1 + myValue + bbCode2 + endOfLine + myField.value.substring(endPos, myField.value.length);
if(myValue=='') { bbb=bbCode1.length; myField.selectionStart=startPos+bbb; myField.selectionEnd=endPos+bbb; }
else { bbb=bbCode1.length; bbb2=bbCode2.length; bbV=myValue.length; myField.selectionStart=startPos+bbV+bbb+bbb2; myField.selectionEnd=startPos+bbV+bbb+bbb2; }
myField.focus();
return;
} else {
myField.value += myValue;
return;
}
}

function paste_strinL(strinL, isQuote, bbCode1, bbCode2, endOfLine){
if((isQuote==1 || isQuote==2) && strinL=='') alert(l_quoteMsgAlert);
else{
if (isQuote==1) {
bbCode1='[i]'; bbCode2='[/i]'; endOfLine='\n';
}
if (isQuote==2) {
bbCode1='[b]'; bbCode2='[/b]'; endOfLine='\n';
}
var isForm=document.forms["b_form"];
if (isForm) {
var input=document.forms["b_form"].elements["ebussi_text"];
insertAtCursor(input, strinL, bbCode1, bbCode2, endOfLine);
}
else;//alert(l_accessDenied);
}
}

function pasteSel() {
if(document.getSelection) selection=document.getSelection();
else if(document.selection) selection=document.selection.createRange().text;
else if(window.getSelection) selection=window.getSelection();
else selection='';
}
// *******************************************************
