/* <![CDATA[ */

// <a href="html-or.jpg" onclick="return popup(this,123,456)" title="..."
// oder
// <a href="html-or.jpg" onclick="return popup(this)" title="..."

// Grafiken Initalizieren Cashen
inArbeitGif= new Image();
inArbeitGif.src = "images/loading.gif";

fnTitel_1= new Image();
fnTitel_1.src = "css/window/top-middle.gif";

fnClose_Btn= new Image();
fnClose_Btn.src = "css/window/button-close-focus.gif";

fnMin_Btn= new Image();
fnMin_Btn.src = "css/window/button-min-focus.gif";

fnMax_Btn= new Image();
fnMax_Btn.src = "css/window/button-max-focus.gif";


function display_title() {
date = new Date();
var hours = date.getHours(); 
var message = '';
if (hours >= 0) { time_of_day = 'Guten Nacht, '; message='Morning Message';}
if (hours >=6) { time_of_day = 'Guten Morgen, '; message='Morning Message';}
if ((hours >= 12) && (hours < 17)) { time_of_day = 'Guten Tag, '; message='Afternoon Message'}
if (hours >= 17) { time_of_day = 'Guten Abend, '; message='Evening Message';} 
document.write('' + time_of_day + '');
}

var pop = null;

function popdown() {
  if (pop && !pop.closed) pop.close();
}

function popup(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 20 : 150;  // 150px*150px is the default size
  h = (h) ? h += 25 : 150;
  var args = 'width='+w+',height='+h+'toolbar=no,scrollbars=yes,menubar=no,location=no,resizable=yes';
  popdown();
  pop = window.open(url,'dream4ever',args);
  return (pop) ? false : true;
}

//window.onunload = popdown;
//window.onfocus = popdown;


var is_regexp = (window.RegExp) ? true : false;

function fetch_object(idname)
{
	if (document.getElementById)
	{
		return document.getElementById(idname);
	}
	else if (document.all)
	{
		return document.all[idname];
	}
	else if (document.layers)
	{
		return document.layers[idname];
	}
	else
	{
		return null;
	}
}

function toggle_collapse(objid)
{
	if (!is_regexp)
	{
		return false;
	}
  
	obj = fetch_object('collapseobj_' + objid);
	img = fetch_object('collapseimg_' + objid);
	cel = fetch_object('collapsecel_' + objid);
    forum_cat= fetch_object('forum_cat_' + objid);
	
	if (!obj)
	{
		if (img)
		{
			img.style.display = 'none';
		}
		return false;
	}

	if (obj.style.display == 'none')
	{
	  obj.style.display = '';	
    if(forum_cat)
     forum_cat.style.display = 'none'
        
      
		save_collapsed(objid, false);
		if (img)
		{
			img_re = new RegExp("_collapsed\\.gif$");
			img.src = img.src.replace(img_re, '.gif');
		}
		if (cel)
		{
			cel_re = new RegExp("^(thead|tcat)(_collapsed)$");
			cel.className = cel.className.replace(cel_re, '$1');
		}
	}
	else
	{ 
		save_collapsed(objid, true);
           obj.style.display = 'none';
        if(forum_cat)
         forum_cat.style.display='';
		if (img)
		{
			img_re = new RegExp("\\.gif$");
			img.src = img.src.replace(img_re, '_collapsed.gif');
		}
		if (cel)
		{
			cel_re = new RegExp("^(thead|tcat)$");
			cel.className = cel.className.replace(cel_re, '$1_collapsed');
		}
	}
	return false;
}


function save_collapsed(objid, addcollapsed)
{
	var collapsed = fetch_cookie(objid);

   if (!(addcollapsed))
	{
	  	expires = new Date();
	expires.setTime(expires.getTime() + (1000 * 86400 * 365));
	set_cookie(objid,'0', expires);
	}

	if (addcollapsed)
	{
		
      	expires = new Date();
	expires.setTime(expires.getTime() + (1000 * 86400 * 365));
	set_cookie(objid,'1', expires);
      
	}
}

function set_cookie(name, value, expires)
{
	document.cookie = name + '=' + escape(value) + '; path=/' + (typeof expires != 'undefined' ? '; expires=' + expires.toGMTString() : '');
}


function delete_cookie(name)
{
	document.cookie = name + '=' + '; expires=Thu, 01-Jan-70 00:00:01 GMT' +  '; path=/';
}



function fetch_cookie(name)
{
	cookie_name = name + '=';
	cookie_length = document.cookie.length;
	cookie_begin = 0;
	while (cookie_begin < cookie_length)
	{
		value_begin = cookie_begin + cookie_name.length;
		if (document.cookie.substring(cookie_begin, value_begin) == cookie_name)
		{
			var value_end = document.cookie.indexOf (';', value_begin);
			if (value_end == -1)
			{
				value_end = cookie_length;
			}
          // alert(unescape(document.cookie.substring(value_begin, value_end)));
			return unescape(document.cookie.substring(value_begin, value_end));
		}
		cookie_begin = document.cookie.indexOf(' ', cookie_begin) + 1;
		if (cookie_begin == 0)
		{
			break;
		}
	}
	return null;
}


function loadSecureCode(what){
     var getSecureCode = new Ajax('control.php',{method: 'post' ,data: 'ajaxaction=217', update: $(what), evalScripts:true,onRequest:function(){
		$(what).setHTML('<img src="images/secure.png" " border="0" title="loading" />');
					}});
      getSecureCode.request(); 
  }



var i =0;
function setOnlinebox(reTime){
if (reTime =='')
  reTime = 6000000;

if (i=='0'){
setInterval("getOnlinebox('0')",reTime);
 i='1';
}
}


function getOnlinebox(ton){

new Request.HTML({url:'control.php', method: 'post',data:'ajaxaction=207&speak='+ton, update: $('online_mail'),evalScripts: true,
		onFailure:function(){
		
		},
		onRequest:function(){
		
		},
		onSuccess:function(){

		}
	}).send();


 }


function loadOnline(user_id){


new Request.HTML({url:'control.php', method: 'post',data:'ajaxaction=17&user_id='+user_id, update: $('user_info'),headers:'application/x-www-form-urlencoded',evalScripts: true,
		onFailure:function(){
		alert('Problem bei Laden');
		},
		onRequest:function(){
			$('user_info').set('html','<img src="images/loading.gif" border="0" title="loading" />');
		},
		onSuccess:function(){

		}
	}).send();

 }




function loadProfil(action,more,top,left,width,height) {
 var profilbox = new fenster({
  top:top,
  left:left,
  width:width, 
  height:height,
  closable:true,
  minimize:true,
  title:'Info',
  status:'',
  ajaxfile:'control.php',
  more:more,
  action:action
  });
  
profilbox.show();

}


function suchBox(action,more,left,top,width,height) 
{
  
var fnSuchbox = new fenster({
   top:top,
   left:left,
   width:width, 
   height:height,
   closable:true,
   minimize:true,
   title:'Suche',
   status:'Forum suche',
   ajaxfile:'control.php',
   more:more, 
  action:action
    });
  

fnSuchbox.show();


  }

function loadWindowContent(action,more,left,top,wnTitle,wnStatus,width,height) 
{
  
var fnContent = new fenster(
{
   top:top,left:left,width:width, height:height,closable:true,minimize:true,
    title:wnTitle,status:wnStatus,ajaxfile:'control.php', more:more,action:action
      }
    );
  
fnContent.show();

  }

function home_shoutbox() {

new Request.HTML({url:'shoutbox.php', method: 'post',data:'ajaxaction=217', update: $('home_content'),evalScripts: true,
		onFailure:function(){
		alert('Problem bei Laden');
		},
		onRequest:function(){
			$('home_content').set('html','<br /><table align="center" class="home_content" style="background-color:#fff; border:1px solid #333;  height:400px; width:400px"><tr><td align="center"><img src="images/loading.gif" name="inArbeitGif" border="0" title="loading" /></td></tr></table>');
		},
		onSuccess:function(){

		}
	}).send();

   }

function home_ForumTicker() {

new Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction=4', update: $('home_content'),evalScripts: true,
		onFailure:function(){
		alert('Problem bei Laden');
		},
		onRequest:function(){
			$('home_content').set('html','<br /><table align="center" class="home_content" style="background-color:#fff; border:1px solid #333;  height:400px; width:400px"><tr><td align="center"><img src="images/loading.gif" name="inArbeitGif" border="0" title="loading" /></td></tr></table>');
		},
		onSuccess:function(){

		}
	}).send();

   }

function home_video() {
new Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction=218', update: $('home_content'),evalScripts: true,
		onFailure:function(){
		alert('Problem bei Laden');
		},
		onRequest:function(){
			$('home_content').set('html','<br /><table align="center" class="home_content" style="background-color:#fff; border:1px solid #333;  height:400px; width:400px"><tr><td align="center"><img src="images/loading.gif" name="inArbeitGif" border="0" title="loading" /></td></tr></table>');
		},
		onSuccess:function(){

		}
	}).send();
   }

function home_game() {

new Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction=219', update: $('home_content'),evalScripts: true,
		onFailure:function(){
		alert('Problem bei Laden');
		},
		onRequest:function(){
			$('home_content').set('html','<br /><table align="center" class="home_content" style="background-color:#fff; border:1px solid #333;  height:400px; width:400px"><tr><td align="center"><img src="images/loading.gif" name="inArbeitGif" border="0" title="loading" /></td></tr></table>');
		},
		onSuccess:function(){

		}
	}).send();
   }

function home_newUser() {
 
new Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction=220', update: $('home_content'),evalScripts: true,
		onFailure:function(){
		alert('Problem bei Laden');
		},
		onRequest:function(){
			$('home_content').set('html','<br /><table align="center" class="home_content" style="background-color:#fff; border:1px solid #333;  height:400px; width:400px"><tr><td align="center"><img src="images/loading.gif" name="inArbeitGif" border="0" title="loading" /></td></tr></table>');
		},
		onSuccess:function(){

		}
	}).send();
   }

function home_suche() {


new Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction=224', update: $('home_content'),evalScripts: true,
		onFailure:function(){
		alert('Problem bei Laden');
		},
		onRequest:function(){
			$('home_content').set('html','<br /><table align="center" class="home_content" style="background-color:#fff; border:1px solid #333;  height:400px; width:400px"><tr><td align="center"><img src="images/loading.gif" name="inArbeitGif" border="0" title="loading" /></td></tr></table>');
		},
		onSuccess:function(){

		}
	}).send();
   }


function rate(id,mode,subid,backid,woid,rateselect) {


new Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction=212&mode='+mode+'&subid='+subid+'&backid='+backid+'&woid='+woid+'&rateselect='+rateselect, update: $(id),evalScripts: true,
		onFailure:function(){
		alert('Problem bei Laden');
		},
		onRequest:function(){
	
		},
		onSuccess:function(){

		}
	}).send();


new Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction=213', update: $('rate'+id),evalScripts: true,
		onFailure:function(){
		alert('Problem bei Laden');
		},
		onRequest:function(){
			$('rate'+id).set('html','<img src="images/loading.gif" border="0" title="loading" />');
		},
		onSuccess:function(){

		}
	}).send();

   }



function SetThanx(CAT_ID,THREAD_ID,POST_ID) {


new Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction=222&CAT_ID='+CAT_ID+'&THREAD_ID='+THREAD_ID+'&POST_ID='+POST_ID, update: $('getThanx'),evalScripts: true,
		onFailure:function(){
		alert('Problem bei Laden');
		},
		onRequest:function(){
			$('getThanx').set('html','<img src="images/loading.gif" border="0" title="loading" />');
		},
		onSuccess:function(){

		}
	}).send();

   }


function german_plz(){

landPlz=$('land').value;
obj=fetch_object('plz');

if (landPlz=='Germany')
  obj.style.display='';
 else
   obj.style.display='none';

}


function open_close_div(obj_div){

obj=fetch_object(obj_div);

  obj.style.display='';

}


function user_nick_status_clear() {

nickname=$('snickname').value;
if(nickname.length>1){
$('user_nick_status').set('html','');
	
    }
  }



function user_nick_status() {

nickname=$('snickname').value;
if(nickname.length>2){
new Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction=228&nickname='+nickname, update: $('user_nick_status'),evalScripts: true,
		onFailure:function(){
		alert('Problem bei Laden');
		},
		onRequest:function(){
			$('user_nick_status').set('html','<img src="images/loading.gif" name="inArbeitGif" border="0" title="loading" />');
		},
		onSuccess:function(){

		}
	}).send();
   }
  }


function vzLand() {

 vzLand_id=$('land_id').value;
if(vzLand_id!=''){
new Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction=229&land='+vzLand_id, update: $('land2'),evalScripts: true,
		onFailure:function(){
		alert('Problem bei Laden');
		},
		onRequest:function(){
			$('land2').set('html','<table align="center" class="home_content" style="background-color:#fff; border:1px solid #333;  height:400px; width:400px"><tr><td align="center"><img src="images/loading.gif" name="inArbeitGif" border="0" title="loading" /></td></tr></table>');
		},
		onSuccess:function(){

		}
	}).send();
   }
  }



function textCounter(field, countfield, maxlimit){
if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit);
else countfield.value = maxlimit - field.value.length;}
function eraseValue(field){ field.value = ''; }
function insert(aTag, eTag) {
  var input = document.forms['myForm'].elements['mail_text'];
  input.focus();
  /* für Internet Explorer */
  if(typeof document.selection != 'undefined') {
    /* Einfügen des Formatierungscodes */
    var range = document.selection.createRange();
    var insText = range.text;
    range.text = aTag + insText + eTag;
    /* Anpassen der Cursorposition */
    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();
  }
  /* für neuere auf Gecko basierende Browser */
  else if(typeof input.selectionStart != 'undefined')
  {
    /* Einfügen des Formatierungscodes */
    var start = input.selectionStart;
    var end = input.selectionEnd;
    var insText = input.value.substring(start, end);
    input.value = input.value.substr(0, start) + aTag + insText + eTag + input.value.substr(end);
    /* Anpassen der Cursorposition */
    var pos;
    if (insText.length == 0) {
      pos = start + aTag.length;
    } else {
      pos = start + aTag.length + insText.length + eTag.length;
    }
    input.selectionStart = pos;
    input.selectionEnd = pos;
  }
  /* für die übrigen Browser */
  else
  {
    /* Abfrage der Einfügeposition */
    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;
    }
    /* Einfügen des Formatierungscodes */
    var insText = prompt("Bitte geben Sie den zu formatierenden Text eAin:");
    input.value = input.value.substr(0, pos) + aTag + insText + eTag + input.value.substr(pos);
  }
}

function poopup(datei,name,breite,hoehe,noresize)

  {
        var posX=(screen.availWidth-breite)/2;
        var posY=(screen.availHeight-hoehe)/2;
         var resizable = (noresize==1) ? 0 : 1;
        window.open(datei,name,"resizable="+resizable+",scrollbars=1,width=" + breite + ",height=" + hoehe + "screenX=" + posX + ",screenY=" + posY + ",left=" + posX + ",top=" + posY + "");
      }

function galeria_pop(datei,name,breite,hoehe,noresize)
{
 var posX=(screen.availWidth-breite)/2;
 var posY=(screen.availHeight-hoehe)/2;
 var resizable = (noresize==1) ? 0 : 1;
 var scrollbar = (document.all) ? 0 : 1;
 window.open(datei,name,"resizable="+resizable+",scrollbars="+scrollbar+",width=" + breite + ",height=" + hoehe + "screenX=" + posX + ",screenY=" + posY + ",left=" + posX + ",top=" + posY + "");
}






   function we()
   {
   var meindatum, tag, stunde, minute, sekunde, exttag, extstunde, extminute, extsekunde;
   meindatum=new Date;
   tag=meindatum.getDay();
   stunde=meindatum.getHours();
   minute=meindatum.getMinutes();
   sekunde=meindatum.getSeconds();

   soll_tag=5;
   soll_stunde=15;
   soll_minute=0;
   soll_sekunde=0;

   if ((tag>=soll_tag || tag==0) && stunde>=soll_stunde && minute>=soll_minute && sekunde>=soll_sekunde) {
   out="it`s weekend!";
   }
   else {
   zeit=tag*(24*60*60)+stunde*(60*60)+minute*(60)+sekunde;
   soll_zeit=soll_tag*(24*60*60)+soll_stunde*(60*60)+soll_minute*(60)+soll_sekunde;
   rest_zeit=soll_zeit-zeit;

   rest_tag=Math.floor(rest_zeit/(24*60*60));
   rest_zeit=rest_zeit-(rest_tag*(24*60*60));

   rest_stunde=Math.floor(rest_zeit/(60*60));
   rest_zeit=rest_zeit-(rest_stunde*(60*60));

   rest_minute=Math.floor(rest_zeit/(60));
   rest_zeit=rest_zeit-(rest_minute*(60));


   if (rest_tag!=1) exttag="s";
   else exttag="";
   if (rest_stunde!=1) extstunde="s";
   else extstunde="";
   if (rest_minute!=1) extminute="s";
   else extminute="";
   if (rest_zeit!=1) extzeit="s";
   else extzeit="";

   if (rest_tag!=0) outtag=rest_tag+" day"+exttag+", ";
   else outtag="";
   if (rest_stunde!=0) outstunde=rest_stunde+" hour"+extstunde+", ";
   else outstunde="";

   /*out="Noch "+outtag+""+outstunde+""+rest_minute+" Minute"+extminute+" und "+rest_zeit+" Sekunde"+extzeit+" bis zum Wochende!";*/
   out="only "+outtag+""+outstunde+""+rest_minute+" min"+extminute+" & "+rest_zeit+" sec"+extzeit+" left to weekend!";
   }
   document.getElementById('reinDamit').innerHTML=out;
   setTimeout("we()",1000);
   }



 var loaded = false;
   if (document.layers)
     document.write(
   '<STYLE>.rewritable { position: absolute; }<\/STYLE>'
     );
   function Clock (offsetSec, style) {
  this.id = Clock.cnt;
  Clock.clocks[Clock.cnt++] = this;
  this.offsetSec = offsetSec || 0;
  this.style = style || '';
  this.writeHTML();
  this.startTimer();
   }
   function Clock_writeHTML () {
   var html = '';
   if (document.layers) {
    html += '<SPAN';
    html += ' ID="Clock' + this.id + '"';
    html += ' CLASS="rewritable"';
    html += '>';
    html += '<SPAN';
    html += this.style ? ' CLASS="' + this.style + '"' : '';
    html += '>';
    html += this.formatTime();
    html += '<\/SPAN>';
    html += '<\/SPAN>';
  }
  else {
    html += '<SPAN';
    html += ' ID="Clock' + this.id + '"';
    html += this.style ? ' CLASS="' + this.style + '"' : '';
    html += '>';
    html += this.formatTime();
    html += '<\/SPAN>';
  }
  document.write(html);
  }
  Clock.prototype.writeHTML = Clock_writeHTML;
  function Clock_formatTime () {
  var time = new Date();
  time.setTime(time.getTime() + this.offsetSec * 1000);
  var hours = time.getHours();
  var minutes = time.getMinutes();
  var seconds = time.getSeconds();
  var html = '';
  html += hours < 10 ? '0' + hours : hours;
  html += ':';
  html += minutes < 10 ? '0' + minutes : minutes;
  html += ':';
  html += seconds < 10 ? '0' + seconds : seconds;
  return html;
  }
  Clock.prototype.formatTime = Clock_formatTime;
  function Clock_startTimer () {
  this.tid = setInterval('Clock.clocks[' + this.id + '].updateTime()',
  1000);
  }
  Clock.prototype.startTimer = Clock_startTimer;
  function Clock_updateTime () {
  if (document.all)
    document.all['Clock' + this.id].innerHTML = this.formatTime();
  else if (document.getElementById)
    document.getElementById('Clock' + this.id).firstChild.nodeValue =
      this.formatTime();
  else if (document.layers && loaded) {
    var l = document['Clock' + this.id];
    if (!l.ol) {
      var ol = l.ol = new Layer(l.clip.width);
      ol.clip.height = l.clip.height;
      ol.left = l.pageX; ol.top = l.pageY;
      ol.visibility = 'show';
      l.visibility = 'hide';
    }
    var ol = l.ol;
    var html = '';
    html += '<SPAN';
    html += this.style ? ' CLASS="' + this.style + '"' : '';
    html += '>';
    html += this.formatTime();
    html += '<\/SPAN>';
    ol.document.open();
    ol.document.write(html);
    ol.document.close();
  }
  }
  Clock.prototype.updateTime = Clock_updateTime;
  Clock.cnt = 0;
  Clock.clocks = new Array();
  function init () {
  loaded = true;
}

function setDatum(){
  var mydate=new Date()
   var year=mydate.getYear()
   if (year < 1000)
   year+=1900
   var day=mydate.getDay()
   var month=mydate.getMonth()
   var daym=mydate.getDate()
   if (daym<10)
   daym="0"+daym
   var dayarray=new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag")
   var montharray=new Array("Jan","Feb","M&auml;rz","Apr","Mai","Jun","Jul","Aug","Sep","Oct","Nov","Dez")
   document.write("<small><font face='Verdana' size='1'>"+dayarray[day]+" "+daym+". "+montharray[month]+" "+year+"</font></small>")
  }

window.addEvent('domready', function(){ var Tips1 = new Tips($$('.tips')) });
function del(url,datei){if( confirm("Soll die Datei "+ datei +" wirklich gelöscht werden?") ) window.location = url;}



var bSwitchFA=false;
var myTips;
var myColor;
var myTipsNavi;
var myEventNavi;
var myUserLook;
var myWysiwyg;

var loadLiveSearch = function(action1,what) {new Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction='+action1+'&Search='+what,update: $('showSearch_ajaxcontent'),evalScripts:true,
	onRequest:function(){
		$('showSearch_ajaxcontent').set('html','<br /><table align="center" style="background-color:#fff; border:1px solid #333; height:100px; width:100px;"><tr><td align="center"><img src="images/loading.gif" border="0" title="loading" /></td></tr></table>');
	},
	onComplete:function(){
	}
}).send();}

var loadAjaxNav = function(action1,what) {new  Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction='+action1,update: $(what),evalScripts:true,
onSuccess:function(){
}}).send();}

var returnKalenderDate=function(returnId,returnDateDay,returnDateMonth,returnDateYear){

$(returnId+'_tag').value=returnDateDay;
$(returnId+'_monat').value=returnDateMonth;
$(returnId+'_jahr').value=returnDateYear;

}

function loadProfilEvent(action,BACK,ID2) {

POSLEFT=$(ID2).getPosition().x;
POSTOP=$(ID2).getPosition().y;

 var profilebox = new fenster({
 top:POSTOP,
   left:POSLEFT,
   width:200, 
   height:400,
   closable:true,
   minimize:true,
   title:'',
   status:'',
   ajaxfile:'control.php',
   more:BACK, 
   myDIV:'myCalDiv',
  action:action
  });
  
profilebox.show();

}

function showCalender(BACK,ID2) 
{
  

POSLEFT=$(ID2).getPosition().x;
POSTOP=$(ID2).getPosition().y;


var fnKalenderbox = new fenster({
   top:POSTOP,
   left:POSLEFT,
   width:200, 
   height:305,
   closable:true,
   minimize:true,
   title:'Kalender',
   status:'Wählen Sie Datum aus',
   ajaxfile:'control.php',
   more:BACK, 
   myDIV:'myCalDiv',
  action:37
    });
  

fnKalenderbox.show();


  }





function showEvent(EVENTID,ID2) 
{
  

POSLEFT=$(ID2).getPosition().x;
POSTOP=$(ID2).getPosition().y;


var fnEventbox = new fenster({
   top:POSTOP,
   left:POSLEFT,
   width:300, 
   height:300,
   closable:true,
   minimize:true,
   title:'Event',
   status:'',
   ajaxfile:'control.php',
   more:EVENTID, 
   myDIV:'myEventDiv',
  action:39
    });
  

fnEventbox.show();


  }




var editContent=function(WHAT,MAIN_ID,ELEMENT){

var temp=$(ELEMENT).get('html');
$(ELEMENT).set('html','');

input = new Element("input").setProperty('id','temp_'+ELEMENT);
input.value=temp;
input.inject($('editlink'),'before');

$('editlink').onclick=function(){
saveContent(WHAT,$('temp_'+ELEMENT).value,MAIN_ID,ELEMENT);
}
}

var saveContent = function(WHAT,TITLE,ID,ELEMENT) {new Request.HTML({url:'control.php', method: 'post',initfactor:2,data: 'ajaxaction='+WHAT+'&title='+encodeURIComponent(TITLE)+'&ID='+ID,onFailure:function(){},
onComplete:function(){

if(WHAT==19 || WHAT==21 || WHAT==23){
var temp=$('temp_'+ELEMENT).value;
$('temp_'+ELEMENT).remove();
$(ELEMENT).innerHTML=temp;

$('editlink').onclick=function(){
editContent(WHAT,ID,ELEMENT);
}
}else if(WHAT==20 || WHAT==22 || WHAT==24){
$('editlinkText').onclick=function(){
editContentText(WHAT,ID,ELEMENT);
}
}
}}).send();}

var markAll=function(KLASSE,SWITCH){
	var SwitchKlasse=$$('.'+KLASSE);
		SwitchKlasse.each(function(el){
			el.checked=SWITCH;
		});
}


var loadWYSIWYG=function(PATH,FORM,TEXTAREA){
	var mySel=['bold','underline','italic','forecolor','backcolor','Smilies','help'];
	if($('jsHTMLAREA')==null){
		myAsset=  new Asset.javascript('./htmlarea/loadhtmlarea.php', {id: 'jsHTMLAREA',
  		onload: function() {
		myWysiwyg=new HtmlArea(TEXTAREA,PATH,{form:FORM,ViewSource:false,toolbar:mySel,width:'450px',height:'200px'});
	   }
  		});
	}else{
		myWysiwyg=new HtmlArea(TEXTAREA,PATH,{form:FORM,ViewSource:false,toolbar:mySel,width:'450px',height:'200px'});
	}
}




var loadAjaxForum = function(action,what,Switch) {new Request.HTML({url:'control.php', data: 'post',data: 'ajaxaction='+action+'&forum_id='+Switch,update: $(what),
	onComplete:function(){
		temp='loadClick_'+Switch;
		var Suche=/minus/;
		var Ergebnis=Suche.test($(temp).getProperty("src"));

		if(Ergebnis){
			$(temp).setProperties({'src':'images/forum/plus.gif'});
		}else{
			$(temp).setProperties({'src':'images/forum/minus.gif'});
		}
	}}).send();
}


var showPages=function(){
if($('showAllPages').getPosition().height < 1)
$('showAllPages').setStyles({'display':'inline','top':'10px','left':'10px'});
else{
$('showAllPages').setStyles({'display':'none','top':'10px','left':'10px'});
}
}

var loadForenticker=function(ID3){
myShowWindow('myForentickerDiv','Forenticker','ajaxaction=4',true,600,400,true,20,20,ID3);
}

var showItemDetails=function(ID){
var ShopTxt="Look it is very nice";
myShowWindow('myItemDetailDiv','Produkt Details',ShopTxt,false,600,400,true,'','',ID);
}

var loadSpecial=function(ChangeID,ACTION,UPDID){

		if(ChangeID==''){
			$(UPDID).set('html','');
		}else{
			loadAjaxContent(ACTION,UPDID,ChangeID);
		}
	}



var loadAjaxContent = function(action,what,more) {new Request.HTML({url:'control.php',method: 'post',data: 'ajaxaction='+action+'&more='+more,update: $(what),evalScripts:true,
		onRequest:function(){
			$(what).set('html','<br /><table align="center" style="background-color:#fff; border:1px solid #333; height:100px; width:100px;"><tr><td align="center"><img src="images/loading.gif" border="0" title="loading" /></td></tr></table>');
		},
		onComplete:function(){
			if(action==15){
				if($$('.EventNavi').length > 0){
					myEventNavi = new OwnTips($$('.EventNavi'), {
					maxTitleChars: 50,
					maxOpacity: 0.9,
					clickable: true,
					stayalive:true,
		    		takeajax:true,
					ajaxfile:'control.php',
					ajaxoption:'ajaxaction=14&datum',
					className: 'tooltipEvent'
					});
				}//ENDE IF
			}

		}
	}).send();
}

var loadEventNavi=function(){

loadAjaxContent(15,'EventKalNavi',$('EMonat').value+"_"+$('EJahr').value);
}

var myShowWindow=function(ID,TITLE,OPTION,TAKEAJAX,WIDTH,HEIGHT,MODAL,POSLEFT,POSTOP,ID2){


if(POSLEFT=='' && POSTOP=='' && ID2!=''){
POSLEFT=$(ID2).getPosition().x;
POSTOP=$(ID2).getPosition().y;
}

var fnEventbox = new fenster({
   top:POSTOP,
   left:POSLEFT,
   width:WIDTH, 
   height:HEIGHT,
   closable:true,
   minimize:true,
   title:TITLE,
   status:'',
   ajaxfile:'control.php',
   more:OPTION, 
   myDIV:ID,
   action:''
    });

fnEventbox.show();

}



function showEvent(EVENTID,ID2) 
{
  

POSLEFT=$(ID2).getPosition().x;
POSTOP=$(ID2).getPosition().y;


var fnEventbox = new fenster({
   top:POSTOP,
   left:POSLEFT,
   width:300, 
   height:300,
   closable:true,
   minimize:true,
   title:'Event',
   status:'',
   ajaxfile:'control.php',
   more:EVENTID, 
   myDIV:'myEventDiv',
  action:39
    });
  

fnEventbox.show();


  }


var ajaxContent=function(which,more){

	loadAjaxContent(which,'showFenster_ajaxcontent',more);

}


function getContent(which,content,more){

var getContentAjax = new Request.HTML({url:'control.php', method: 'post',data:'ajaxaction='+which+'&more='+more, update: $(content),evalScripts: true,
		onFailure:function(){
		
		},
		onRequest:function(){
		
		},
		onSuccess:function(){

		}
	});

    getContentAjax.send();
 }




//Content
var loadAjaxPag = function(action,UPDATE,Param,entries) {new Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction='+action+'&Param='+Param+'&entries='+entries,update: $(UPDATE+'_ajaxcontent'),evalScripts: true,
		onFailure:function(){
		alert('Problem');
		},
		onRequest:function(){
			$(UPDATE+'_ajaxcontent').set('html','<img src="images/loading.gif" border="0" title="loading" />');
		},
		onSuccess:function(){

		}
}).send();}



var SubmitForm = function(FIELD,VALUE,FormId,UPDATEAREA) {
	$(FIELD).value=VALUE;
    myWysiwyg.getSubmitHtml();

//if(getFehlerCheck(FormId)==false){

	new Request.HTML({url:'control.php', method: 'post',data:$(FormId),update: $('content_'+UPDATEAREA),headers:'application/x-www-form-urlencoded',evalScripts: true,
		onFailure:function(){
		alert('Problem');
		},
		onRequest:function(){
			$('content_'+UPDATEAREA).set('html','<img src="images/loading.gif" border="0" title="loading" />');
		},
		onSuccess:function(){

		}
	}).send();
//}

}

var SubmitFormRate = function(FormId,UPDATEAREA) {

	new Request.HTML({url:'control.php', method: 'post',data:$(FormId),update: $('content_'+UPDATEAREA),headers:'application/x-www-form-urlencoded',evalScripts: true,
		onFailure:function(){
		alert('Problem');
		},
		onRequest:function(){
			$('content_'+UPDATEAREA).set('html','<img src="images/loading.gif" border="0" title="loading" />');
		},
		onSuccess:function(){

		}
	}).send();

}

var AutoImageResize=function(RESIZEWIDTH,RESIZEHEIGHT){

$$('#pageContent img').each(function(el){

    if (el.getProperty('src').test('.php')){
      el.destroy();
    }

	if(el.getCoordinates().width >=RESIZEWIDTH || el.getCoordinates().height >=RESIZEHEIGHT){


	var saveWidth=el.getCoordinates().width;
	var saveHeight=el.getCoordinates().height;

	teiler=saveWidth/320;
	teiler=Math.round(teiler);
	if(teiler < 1) teiler=1
	var newWidth=saveWidth/teiler;

	teiler1=saveHeight/240;
	teiler1=Math.round(teiler);
	if(teiler1 < 1) teiler1=1
	var newHeight=saveHeight/teiler1;

	el.setStyles({'width':newWidth+'px','height':newHeight+'px'});
	myTEXT="<table cellpadding=0 cellspacing=0 width=95% align=center><tr><td align=center><img src="+el.getProperty('src')+" width="+saveWidth+" height="+saveHeight+" /></td></tr></table>";

	new Element('div').setProperties({'class':'imgResize'}).setStyles({'left':'0px','width': (newWidth-2)+'px','height':'30px'}).set('html','Originalgröße: '+saveWidth+' x '+saveHeight+' px <br /> Grossansicht: <a href="javascript:;" class="navlink" onclick="myShowWindow(\'imageResizeDiv\',\'Original\',\''+myTEXT+'\',false,'+(saveWidth+20)+','+(saveHeight+50)+',true,10,10,\'\');">hier klicken</a>').inject(el,'after');
	}

});

}

var loadAccord=function(){
var myAccordion = new Accordion(
		$$('.tab'), $$('.stretcher'), {display:'all-closed',height:true,opacity:false,
		fixedHeight:150,duration: 700,
		onActive:function(toggles1){
			myColor= $(toggles1).getStyle("color");
			toggles1.setStyle('color', '#F00E61');

		 },
		onBackground:function(toggles1){
			 toggles1.setStyle('color', myColor);

		 }
});


if($('navmail')!=null){
  $('navmail').addEvent('click', function(){
   // if($('navmailoutput').get('html')==''){
   		loadAjaxNav('7','navmailoutput');
   	//}
  });
}

if($('admininfo')!=null){
  $('admininfo').addEvent('click', function(){
     // if($('admininfooutput').get('html')==''){
     	 loadAjaxNav('8','admininfooutput');
      //}
  });
}
if($('buddyinfo')!=null){
  $('buddyinfo').addEvent('click', function(){
    //if($('buddyinfooutput').get('html')==''){
    	loadAjaxNav('9','buddyinfooutput');
    //}
  });
}
if($('chatinfo')!=null){
    $('chatinfo').addEvent('click', function(){
   // if($('chatinfooutput').get('html')==''){
    loadAjaxNav('10','chatinfooutput');
   // }
   });
}

keepItCool();
}

var keepItCool=function(){

$$('.tab').each(function(element) {

	var fx = new Fx.Morph(element, {duration:200, wait:false});

	element.addEvent('mouseenter', function(){
		fx.start({
			'margin-left': 20,
			'margin-right': 20,
			'background-color': '#7A7A7A'

		});
	});

	element.addEvent('mouseleave', function(){
		fx.start({
			'margin-left': 0,
			'margin-right': 0,
			'background-color': '#ADACAC'
		});
	});

});

}


var showWikifenster=function(){
var w = window.open('about:blank', 'ergebnis', 'status=no,menubar=no,scrollbars=yes,screenX=300,screenY=150,width=400,height=400');
w.focus();
}

var getWikiHandler=function(){


}

createDescr=function(CLASS){

	$$('.'+CLASS).each(function(el){

        var saveTitle=el.getProperty('title');

       el.addEvent('mouseenter', function(){
         var Title='';
         var TEXT='';

         el.removeProperty('title');
         if (saveTitle.test('::')){
				var dual = saveTitle.split('::');
				Title = '<b>'+dual[0].trim()+'</b><br />';
				TEXT= dual[1].trim();
			}else{
			TEXT=saveTitle;
			}

         $('showDescr').set('html',Title+TEXT);
       });
       el.addEvent('mouseleave', function(){
         el.setProperty('title',saveTitle);
         $('showDescr').set('html','');
       });

	});
}

//JSMENU
function subNav(id,is,disp,zi){
		//var setbg = (bg == 1 || bg == 3) ? "url(/img/div/bg_" + id + ".gif) no-repeat" : "transparent";
		//$(id).setStyles({'zIndex':zi});
		if(is == 1)	{
			//Safari + 10px
			var moretop=0;
			var moreleft=0;
			if (Browser.Engine.webkit){
			 moretop=10;
			 moreleft=10;
			}

			$(id+'_sub').setStyles({'display':disp,'zIndex':zi,'top':($(id).getCoordinates().bottom + moretop),'left':($(id).getCoordinates().left+moreleft)});
		}
}


window.addEvent('domready', function(){

if($$('.MainNav').length>0){
	$$('.MainNav').each(function(element){
	   $(element).setStyles({'opacity':'0.8'});
	    if($(element.id+'_sub')!=null){
	     $(element.id+'_sub').addEvent('mouseenter',function(){
    	    subNav(element.id,1,'block',13);

     	});
     	 $(element.id+'_sub').addEvent('mouseleave',function(){
     	   subNav(element.id,1,'none',3);
     	});

	     $(element.id).addEvent('mouseenter',function(){
    	    subNav(element.id,1,'block',13);

     	});
    	 $(element.id).addEvent('mouseleave',function(){
     	   subNav(element.id,1,'none',3);
     	});
	   }
	});
}




if($$('.descr').length >0){
createDescr('descr');
}

if($('revolverContainer')!=null){
var revolver = new MooRevolver("revolverContainer", { "fade": true,
			"arrowLeft":"prev",
			"arrowRight":"next" });

		revolver.getNext.periodical(4000, revolver);
}

if($('liveSearch')!=null){
	var searchtxt = $('liveSearch');

	$('liveSearch').addEvents({
			'focus': function() {
				if(searchtxt.value=='Ihre Suche') searchtxt.value='';
	 					myBeginnText='Live Suche initialisiert ...';
 					    myShowWindow('showSearch','Live Suche',myBeginnText,false,500,400,false,300,100,'');

			},
			'keyup': function() {
			   if(searchtxt.value.length >= '3'){
					window.setTimeout("loadLiveSearch('26','"+searchtxt.value+"')", 1000);
     			}
			}
	});
}


//var myMenu = new ImageMenu($$('#kwick .kwick'),{openWidth:200});

if($$('.tool').length > 0){
myTips = new OwnTips($$('.tool'), {
			maxTitleChars: 50,
			maxOpacity: 0.9,
			clickable: false,
			stayalive:true
		});
}





if($$('.naviTop').length > 0){
myTipsNavi = new OwnTips($$('.naviTop'), {
			maxTitleChars: 50,
			maxOpacity: 1,
			timeOut:2000,
			clickable: false,
			stayalive:true,
			className: 'tooltipEvent'
		});
}

if($$('.EventNavi').length > 0){
myEventNavi = new OwnTips($$('.EventNavi'), {
			maxTitleChars: 50,
			maxOpacity: 1,
			clickable: true,
			stayalive:true,
		    takeajax:true,
			ajaxfile:'control.php',
			ajaxoption:'ajaxaction=14&datum',
			className: 'tooltipEvent'
		});
}


if($$('.cpTool').length > 0){

myUserLook = new OwnTips($$('.cpTool'), {
			fxDuration: 1000,
			maxTitleChars: 50,
			maxOpacity: 0.9,
			clickable: true,
			stayalive:true,
		    takeajax:true,
			ajaxfile:'control.php',
			ajaxoption:'ajaxaction=18&cPage',
			className: 'tooltipEvent'
		});
}

if($$('.ToolContent').length > 0){
myTipsNavi = new OwnTips($$('.ToolContent'), {
			maxTitleChars: 50,
			maxOpacity: 0.9,
			clickable: false,
			stayalive:false
		});
}

//modul_member.php
if($$('.stretcher').length > 0){

loadAccord();

}

if($('openFA')!=null){
$('openFA').addEvent('click', function(){
	if(bSwitchFA){
	$('innerFA').setStyle('display','inline');
	bSwitchFA=false;
	}else{
	$('innerFA').setStyle('display','none');
	bSwitchFA=true;
	}
	});
}

});//ENDE DOMONLOAD



var suchBox=function(ID2){
myShowWindow('mySearchDiv','Forumsuche','ajaxaction=210',true,218,301,false,'','',ID2);

}

function loadProfil(action,more,h,b,width,height) {
 myShowWindow('myProfilDiv','','ajaxaction='+action+'&more='+more,true,width,height,false,b,h,'');

}

function loadProfilpic(e,action,more,b,h) {


 myShowWindow('myProfilDiv','Profil Bild','ajaxaction='+action+'&more='+more,true,b,h,false,e.screenX,e.screenY,'');

}



var pop = null;

function popdown() {
  if (pop && !pop.closed) pop.close();
}

function popup(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 20 : 150;  // 150px*150px is the default size
  h = (h) ? h += 25 : 150;
  var args = 'width='+w+',height='+h+'toolbar=no,scrollbars=yes,menubar=no,location=no,resizable=yes';
  popdown();
  pop = window.open(url,'dream4ever',args);
  return (pop) ? false : true;
}

//window.onunload = popdown;
//window.onfocus = popdown;


var is_regexp = (window.RegExp) ? true : false;


function rate(id,mode,subid,backid,woid,rateselect) {


new Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction=212&mode='+mode+'&subid='+subid+'&backid='+backid+'&woid='+woid+'&rateselect='+rateselect, update: $(id),evalScripts: true,
		onFailure:function(){
		alert('Problem bei Laden');
		},
		onRequest:function(){
	
		},
		onSuccess:function(){

		}
	}).send();


new Request.HTML({url:'control.php', method: 'post',data: 'ajaxaction=213', update: $('rate'+id),evalScripts: true,
		onFailure:function(){
		alert('Problem bei Laden');
		},
		onRequest:function(){
			$('rate'+id).set('html','<img src="images/loading.gif" border="0" title="loading" />');
		},
		onSuccess:function(){

		}
	}).send();

   }

function createplayer(video,preview,id,start) {
var rnd =new Date().getTime();
var flash_video = new SWFObject("flash/player.swf","single","640","390","7");
	flash_video.addParam("allowfullscreen","true"); 
    flash_video.addParam("menu","true");
    flash_video.addParam("width","390"); 
    flash_video.addParam("height","640");
    flash_video.addVariable("autostart",start);
    flash_video.addVariable("logo.linktarget","http://www.dream4ever.eu");
    flash_video.addVariable("logo.link","_blank");
    flash_video.addVariable("logo","flash/logo.png");
    flash_video.addVariable("logo.hide","false");
	flash_video.addVariable("file",video, rnd);
	flash_video.addVariable("image",preview);
	flash_video.write(id);
}


/* ]]> */

