function showmenu(nr, menupunkte, start)
{
  if (document.getElementById('menu'+nr).style.display == 'none')
  {
    document.getElementById('menu'+nr).style.display = 'block';
    var i;
    for(i = start; i<=menupunkte; i++)
    {
      if(i!=nr) document.getElementById('menu'+i).style.display = 'none';
    }
  }
  else
  {
    hidelayer("editPage"+nr);
    document.getElementById('menu'+nr).style.display='none';
  }
}

///////////////////////////////////////////////////////////////////////////

function showpicture (id, width, height) {
  if(id != undefined && id != "" && width != "0" && height != "0") {
    var win = window.open("index.php?bg_full="+id,'bgfull',"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+width+",height="+(parseInt(height)+50));
    xpos = (screen.width/2)-(width/2);
    ypos = (screen.height/2)-(height/2);
    win.moveTo(xpos,ypos)
    win.focus();
  }
}

///////////////////////////////////////////////////////////////////////////

function ShowPic(aSrc, aWidth, aHeight, aTitle, aText)
{
  picwin=window.open("","PicWindow","width="+aWidth+",height="+aHeight+",menubar=no,locationbar=no,resizable=yes,status=no,scrollbars=yes");
  with (picwin.document)
  { open();
    writeln("<html><head><title>"+aTitle+"</title>");
    writeln("<style type='text/css'>a {text-decoration:none;font-weight:bold;color:#000000;background-color:#C0C0C0}</style>");
    writeln("</head><body leftmargin='0' topmargin='0'>");
    writeln("<table cellpadding=0 cellspacing=0>");
    writeln("<tr><td colspan='2' style='padding-bottom:10'><img src='"+aSrc+"'></td></tr>");
    writeln("<tr><td align='left' valign='bottom'>"+aText+"</td>");
    writeln("<td align='right' valign='bottom'><a href='#' onclick='self.close()'>Schlie&szlig;en</a></td></tr></table>");
    writeln("</body></html>");
    close();
  }
  picwin.focus();
}

function ShowPdf(aSrc, aWidth, aHeight, aTitle)
{
  picwin=window.open(aSrc,"Dolument","width="+aWidth+",height="+aHeight+",menubar=no,locationbar=no,resizable=yes,status=no,scrollbars=yes");
  picwin.focus();
}
/////////////////////////////////////////////////////////////////////////////


function PopUp(ziel)
{
  var URL = ziel;
  var Name = "Vorschau";
  var Fensteroptionen = "toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1";
  var Breite = 1024;
  var Hoehe = 650;
  picwin=window.open(URL, 'Name', Fensteroptionen + ',width=' + Breite + ',height=' + Hoehe);
  picwin.focus();
}

function PopUp2(ziel)
{
  var URL = ziel;
  var Name = "SMS-Ticker";
  var Fensteroptionen = "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1";
  var Breite = 750;
  var Hoehe = 600;
  picwin=window.open(URL, 'Name', Fensteroptionen + ',width=' + Breite + ',height=' + Hoehe);
  picwin.focus();
}

function addPictureToContent(url) {
  var obj = new Object({url:url})
  setPicURL (obj)
}

function addPicture(url) {
  parent.window.addPictureToContent(url);
}

/////////////////////////////////////////////////////////////////////////////

function changeColor (color) {
  document.forms[0].hgfarbe.value=color;
  document.forms[0].farbe.value=color;
  document.getElementById('chgcol').style.backgroundColor = color;
}

function changeFont (font) {
  document.getElementById('chgcol').style.fontFamily = font;
}

function changeFontColor (fontcolor) {
  document.forms[0].schriftfarbe.value=fontcolor;
  document.forms[0].f_farbe.value=fontcolor;
  document.getElementById('chgcol').style.color = fontcolor;
}


function changeColor2 (color) {
  document.forms[0].farbe.value=color;
  document.getElementById('chgcol').style.backgroundColor = color;
}

/////////////////////////////////////////////////////////////////////////////

function changeColor3 () {
  if (document.forms[0].farbe.value.search(/\W|_|[g-z]/i)!=-1)
  {
    document.forms[0].farbe.value='';
    document.forms[0].fehler.value='Ihre Eingabe enthält ungültige Zeichen.';
    document.forms[0].fehler2.value='Bitte verwenden Sie nur Ziffern und Buchstaben von A bis F.';
  }
  else
  {
    if (document.forms[0].farbe.value.length==6)
    {
      document.getElementById('chgcol').style.backgroundColor='#'+document.forms[0].farbe.value;
      document.forms[0].fehler.value='';
      document.forms[0].fehler2.value='';
    }
  }
}

function changeColor4 () {
  for(i=0;i<document.forms[0].farbfeld.length;++i)
  {
    if(document.forms[0].farbfeld.options[i].selected == true)
    {
     color = document.forms[0].elements['farbe' + (i+1)].value;
     document.forms[0].farbe.value=color;
     document.getElementById('chgcol').style.backgroundColor = color;
    }
  }
}

function changeColor5 () {
  if (document.forms[0].farbe.value.search(/\W|_|[g-z]/i)!=-1)
  {
  	document.forms[0].hgfarbe.value='';
  }
  else
  {
    if (document.forms[0].farbe.value.length==6)
    {
    	document.forms[0].hgfarbe.value=document.forms[0].farbe.value;
      document.getElementById('chgcol').style.backgroundColor='#'+document.forms[0].farbe.value;
    }
  }
}

function changeColor6 () {
  if (document.forms[0].f_farbe.value.search(/\W|_|[g-z]/i)!=-1)
  {
  	document.forms[0].schriftfarbe.value='';
  }
  else
  {
    if (document.forms[0].f_farbe.value.length==6)
    {
    	document.forms[0].schriftfarbe.value=document.forms[0].f_farbe.value;
      document.getElementById('chgcol').style.color='#'+document.forms[0].f_farbe.value;
    }
  }
}

function make_table() {
  var hx = new Array(6);
  hx[0]="00";
  hx[1]="33";
  hx[2]="66";
  hx[3]="99";
  hx[4]="CC";
  hx[5]="FF";
  var colors = new Array(216);

  i=0;

  for (r=0; r<=5; r++) {
    for( g=0; g<=5; g++) {
      for( b=0; b<=5; b++) {
        i++;
        colors[i]=hx[r]+hx[g]+hx[b];
      }
    }
  }

  document.write("<TR>");
  for (i=1; i<=216; i++) {
    if ( (i-1) % 36 == 0 && i != 1) {
      document.write("</tr>\n");
      if (i != 216) {
        document.write("<tr>");
      }
    }
    document.write("<TD BGCOLOR=" + '"' + colors[i] +  '"' + "><A HREF='#' onMouseOver='window.status=" + '"' +  colors[i] + '"' + "; return true'"  + " onMouseOut='window.status=" + '""' + "; return true'" + " onClick='changeColor2(" + '"' + colors[i] +  '"' + "); return false'><img src='spacer.gif' width='14' height='14' border='0'></A></TD>");
  }
}


function make_table2() {
  var hx = new Array(6);
  hx[0]="00";
  hx[1]="33";
  hx[2]="66";
  hx[3]="99";
  hx[4]="CC";
  hx[5]="FF";
  var colors = new Array(216);

  i=0;

  for (r=0; r<=5; r++) {
    for( g=0; g<=5; g++) {
      for( b=0; b<=5; b++) {
        i++;
        colors[i]=hx[r]+hx[g]+hx[b];
      }
    }
  }

  document.write("<TR>");
  for (i=1; i<=216; i++) {
    if ( (i-1) % 18 == 0 && i != 1) {
      document.write("</tr>\n");
      if (i != 216) {
        document.write("<tr>");
      }
    }
    document.write("<TD BGCOLOR=" + '"' + colors[i] +  '"' + "><A HREF='#' onMouseOver='window.status=" + '"' +  colors[i] + '"' + "; return true'"  + " onMouseOut='window.status=" + '""' + "; return true'" + " onClick='changeColor(" + '"' + colors[i] +  '"' + "); return false'><img src='spacer.gif' width='14' height='14' border='0'></A></TD>");
  }
}



function make_table3() {
  var hx = new Array(6);
  hx[0]="00";
  hx[1]="33";
  hx[2]="66";
  hx[3]="99";
  hx[4]="CC";
  hx[5]="FF";
  var colors = new Array(216);

  i=0;

  for (r=0; r<=5; r++)
  {
    for( g=0; g<=5; g++)
    {
      for( b=0; b<=5; b++)
      {
        i++;
        colors[i]=hx[r]+hx[g]+hx[b];
      }
    }
  }

  document.write("<TR>");
  for (i=1; i<=216; i++)
  {
    if ( (i-1) % 18 == 0 && i != 1)
    {
      document.write("</tr>\n");
      if (i != 216)
      {
        document.write("<tr>");
      }
    }
    document.write("<TD BGCOLOR=" + '"' + colors[i] +  '"' + "><A HREF='#' onMouseOver='window.status=" + '"' +  colors[i] + '"' + "; return true'"  + " onMouseOut='window.status=" + '""' + "; return true'" + " onClick='changeFontColor(" + '"' + colors[i] +  '"' + "); return false'><img src='spacer.gif' width='14' height='14' border='0'></A></TD>");
  }
}

//////////////////////////////////////////////////////////////////////////////

function neuesFenster(meineSeite,meinName,w,h,filmnr,projekt)
{
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  Fenster=window.open(meineSeite,meinName,"height="+h+",width="+w+",top="+TopPosition+",left="+LeftPosition+",scrollbars=no,resizable=no");
  Fenster.focus();
}

///////////////////////////////////////////////////////////////////////////////

function showlayer(id) {
  if(document.getElementById(id)) {
    document.getElementById(id).style.display = 'block';
  }
}
function hidelayer(id) {
  if(document.getElementById(id)) {
    document.getElementById(id).style.display = 'none';
  }
}

///////////////////////////////////////////////////////////////////////////////

function ortswahl()
{
  document.regform.elements["registerdaten[ort]"].value=document.regform.elements["Orte"].value;
}

function plzwahl()
{
  document.regform.elements["registerdaten[plz]"].value=document.regform.elements["PLZ"].value;
}