<!--


// find out if ie runs in quirks mode
//
var docEl = (
             typeof document.compatMode != "undefined" && 
             document.compatMode        != "BackCompat"
            )? "documentElement" : "body";

// register event
// capture it for nc 4x (ok it's a dino)
//
function init_mousemove() {
    if(document.layers) document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove =	dpl_mouse_pos;
}

var mousePosX = 0;
var mousePosY = 0;

function dpl_mouse_pos(e) {

    // position where mousemove fired
    //
    var xPos    =  e? e.pageX : window.event.x;
	var yPos    =  e? e.pageY : window.event.y;

	
	// for ie add scroll position
	//
	if (document.all && !document.captureEvents) {
	    xPos    += document[docEl].scrollTop;
	    yPos    += document[docEl].scrollTop;
    }
    
    // display position
    //
    // document.maus.mousepos.value    =  "Left = " + xPos + " : Top = " + yPos;
    mousePosX = xPos;
    mousePosY = yPos;
    
    // for the dino pass event
    //
    if (document.layers) routeEvent(e);
}


function popup(file,windowname,width,height,top,left)
{
  window.open(''+file+'',''+windowname+'','width='+width+',height='+height+',top='+top+',left='+left+',resizable=yes,scrollbars=yes');
}

function rcc(url)
{
  rechteframe.location=''+url+'';
}

function lcc(url)
{
  document.location=''+url+'';
}

function popupdiv(menu)
{
    document.getElementById(""+menu+"").style.visibility='visible';
/*    window.alert('test');*/
}

function popdowndiv(menu)
{
    document.getElementById(""+menu+"").style.visibility='hidden';
}

var alarmOnlyStatus = 0;

function alarmOnly()
{
  if (alarmOnlyStatus == 0)
  {
    document.getElementById('fcklayer').style.visibility='hidden';
    document.getElementById('submitlayer').style.top='66';
    document.getElementById('submitlayer').style.left='159';
    document.newform.submit.value='Alarmierung speichern';
    document.newform.content.value='';
    document.newform.date.focus();
    parent.window.resizeTo(860,170);
    alarmOnlyStatus = 1;
  }
  else
  {
    document.getElementById('fcklayer').style.visibility='visible';
    document.getElementById('submitlayer').style.top='690';
    document.getElementById('submitlayer').style.left='10';
    document.newform.submit.value='Artikel speichern';
    document.newform.content.value='';
    document.newform.date.focus();
    parent.window.resizeTo(860,780);
    alarmOnlyStatus = 0;
  }
}

var allChecked = 0;

function markAllMembers(count)
{
 if (allChecked == 0)
 {
   for (var up = 1; up <= count; up++)
   {
     document.getElementById("email"+up).checked = true;
   }
   allChecked = 1;
  }
  else
  {
   for (var up = 1; up <= count; up++)
   {
     document.getElementById("email"+up).checked = false;
   }
   allChecked = 0;
  }
}


function changeButton(root,thisimage,status)
{
  if (status == 1)
  {
    document.getElementById(""+thisimage+"").src=''+root+'Image/administration/newsletter/buttons/'+thisimage+'_over.gif';
  }
  else if(status == 0)
  {
    document.getElementById(""+thisimage+"").src=''+root+'Image/administration/newsletter/buttons/'+thisimage+'_out.gif';
  }
}


function newMail()
{
   document.getElementById("newmail").style.visibility='visible';
   document.getElementById("newmail1").style.visibility='visible';
   document.mailform.betreff.focus();
}

function mail_send()
{
  document.mailform.action.value='senden';
  document.mailform.submit();
}

function mail_kontakte()
{
  if (document.mailform.anhang.value == '')
  { var file = 'no'; }
  else
  { var file = document.mailform.anhang.value; }
  
  popup('kontakte.php','Kontakte',200,650,150,620);
}

function mail_anhang()
{
  if (document.mailform.anhang.value == '')
  { var file = 'no'; }
  else
  { var file = document.mailform.anhang.value; }
  
  popup('anhang.php?file='+file+'','Anhang',400,150,250,250);
}

function mail_save()
{
  document.mailform.action.value='speichern';
  document.mailform.submit();
}

function showEmpfaenger()
{
   var empfaenger_string = document.mailform.empfaenger_show.value;
   document.getElementById("show_empfaenger").innerHTML = empfaenger_string;
}

function showEmpfaengerExt()
{
   var empfaenger_string = window.opener.document.forms.mailform.empfaenger_show.value;
   window.opener.document.getElementById("show_empfaenger").innerHTML = empfaenger_string;
}

function addGroup(ngid,show)
{
   var empfaenger_show = window.opener.document.forms.mailform.empfaenger_show.value;
   empfaenger_show = empfaenger_show+show+'; ';
   window.opener.document.forms.mailform.empfaenger_show.value = empfaenger_show;
   showEmpfaengerExt();
   var empfaenger = window.opener.document.forms.mailform.empfaenger.value;   
   empfaenger = empfaenger+'; '+ngid;
   window.opener.document.forms.mailform.empfaenger.value = empfaenger;  
}

function addMember(mid,show)
{
   var empfaenger_show = window.opener.document.forms.mailform.empfaenger_show.value;
   empfaenger_show = empfaenger_show+show+'; ';
   window.opener.document.forms.mailform.empfaenger_show.value = empfaenger_show;
   showEmpfaengerExt();
   var empfaenger = window.opener.document.forms.mailform.empfaenger.value;   
   empfaenger = empfaenger+'; '+mid;
   window.opener.document.forms.mailform.empfaenger.value = empfaenger;  
}

function hideNewsletter()
{
   document.getElementById("newmail").style.visibility='hidden';
   document.getElementById("newmail1").style.visibility='hidden';
   document.getElementById("shortnav1").style.visibility='hidden';
   document.getElementById("shortnav").style.visibility='visible';
}

function showShortnav1()
{
   document.getElementById("shortnav1").style.visibility='visible';
   document.getElementById("shortnav").style.visibility='hidden';
}

function addEvent()
{
  var top    = mousePosY-80;
  var left   = mousePosX-200;
  var width  = 280;
  var height = 400;
  window.open('./addEvent.php','Add','width='+width+',height='+height+',top='+top+',left='+left+',dependent=no,menubar=no,resizable=yes,scrollbars=no,status=yes,toolbar=no');
}

function addEventByDate(date)
{
  var top    = mousePosY-80;
  var left   = mousePosX-200;
  var width  = 280;
  var height = 400;
  window.open('./addEvent.php?date='+date+'','Add','width='+width+',height='+height+',top='+top+',left='+left+',dependent=no,menubar=no,resizable=yes,scrollbars=no,status=yes,toolbar=no');
}

function editEventsByDate(date)
{
  var top    = mousePosY-80;
  var left   = mousePosX-200;
  var width  = 280;
  var height = 400;
  window.open('./editEvents.php?date='+date+'','Edit','width='+width+',height='+height+',top='+top+',left='+left+',dependent=no,menubar=no,resizable=yes,scrollbars=no,status=yes,toolbar=no');
}

function calendarContext(id)
{
	window.alert("id: "+id);
}

function showDetails(day)
{
  if (document.getElementById("details_"+day+"").innerHTML != "empty")
  {
    var top  = mousePosY-175;
    var left = mousePosX-155;

    document.getElementById("details_"+day+"").style.visibility='visible';
    document.getElementById("details_"+day+"").style.top=''+top+'px';
    document.getElementById("details_"+day+"").style.left=''+left+'px';
  }
}

function hideDetails(day)
{
  if (document.getElementById("details_"+day+"").innerHTML != "empty")
  {
    document.getElementById("details_"+day+"").style.visibility='hidden';
  }
}

//-->