       m_id = 0;
       var id_now = '';

function flip(id,flip_id){
 if((document.getElementById(id).style.display=='block')){
  document.getElementById(id).style.display='none';
 }else{
  document.getElementById(id).style.display='block';
 }
  //document.getElementById(flip_id).style.backgroundImage='url(../../../images/banners/progressbar.gif)';
  if(flip_id!=""){
   change_header(id+'_link');
  }
}

function change_header(id){
  if(document.getElementById(id).innerHTML=="»"){
   document.getElementById(id).innerHTML='&laquo';
   document.getElementById(id+'_2').innerHTML='&raquo';
  }else{
   document.getElementById(id).innerHTML='&raquo';
   document.getElementById(id+'_2').innerHTML='&laquo';
  }
}


				function createRequestObject()
				{
					var init;
					var browser = navigator.appName;

					if(browser == "Microsoft Internet Explorer")
					{
						init = new ActiveXObject("Microsoft.XMLHTTP");
					}
					else
					{
						init = new XMLHttpRequest();
					}
					return init;
				}

				function HTTPRequest(src_path, id)
				{
					http = createRequestObject();
					http.open('get', 'includes/ajax.php?src=' + src_path);
                                         id_now=id;
					http.onreadystatechange = handleResponse;
					http.send(null);
				}

				function handleResponse()
				{
                                  id=id_now;
					if(http.readyState == 4)
					{
						if(http.status == 200)
						{
                               				document.getElementById(id).innerHTML = http.responseText;
     						}
						else
						{
							document.getElementById(id).innerHTML = 'Error while getting the file!';
						}
					}
				}

       function openWindow(theme)

       {

         var win = new Window(m_id++, {className: theme,  width:350, height:400, zIndex: 100, resizable: true, title: "Normales Fenster", showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true})

         win.getContent().innerHTML= "sssss";

         win.showCenter();

       }



       function openSmiliesGB()

       {

         var win = new Window(m_id++, {className: 'alphacube',  width:350, height:400, zIndex: 100, resizable: true, title: "Gästebuch-Smilies", showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, url: "<? include(includes/smilies_gb.php); ?>"})

         win.showCenter();

       }



       function openAlert()

       {

         Dialog.alert("<strong style='color:red;'>Achtung</strong>Test eines Alert Fensters, alle anderen Elemente sind jetzt gesperrt",

             {windowParameters: {className: "alphacube", width:300}, okLabel: "OK",

              ok:function(win) {return true;}});

       }



function ausblenden(elementname){

if(document.getElementById(elementname).style.display=='block'){

 document.getElementById(elementname).style.display='none';

 }else{

 document.getElementById(elementname).style.display='block';

 }

}





function einfuegen(Smilie, Smilie2, Smilie3){

if(Smilie3=='pn'){

 var input = document.f_message.nachricht;

}



if(Smilie3=='gb'){

 var input = document.f_gb.nachricht;

}

  input.focus();

  if(typeof document.selection != 'undefined') {

    var range = document.selection.createRange();

    var insText = range.text;

    range.text = Smilie + insText + Smilie2;

    range = document.selection.createRange();

    if (insText.length == 0) {

      range.move('character', -Smilie2.length);

    } else {

      range.moveStart('character', Smilie.length + insText.length + Smilie2.length);

    }

    range.select();

  }

  else if(typeof input.selectionStart != 'undefined')

  {

    var start = input.selectionStart;

    var end = input.selectionEnd;

    var insText = input.value.substring(start, end);

    input.value = input.value.substr(0, start) + Smilie + insText + Smilie2 + input.value.substr(end);

    var pos;

    if (insText.length == 0) {

      pos = start + Smilie.length;

    } else {

      pos = start + Smilie.length + insText.length + Smilie2.length;

    }

    input.selectionStart = pos;

    input.selectionEnd = pos;

  }

  else

  {

    var pos;

    var re = new RegExp('^[0-9]{0,3}$');

    while(!re.test(pos)) {

      pos = prompt("Einfügen an Position (0.." + input.value.length + "):", "0");

    }

    if(pos > input.value.length) {

      pos = input.value.length;

    }

    var insText = prompt("Bitte geben Sie den zu formatierenden Text ein:");

    input.value = input.value.substr(0, pos) + aTag + insText + eTag + input.value.substr(pos);

  }

}

