// simple menuscript by jiaim, ID-Version

var stop="home";

function change_on(name)
{
if (document.getElementById(name) && name != stop)
{
document.getElementById(name).src = "images/btn_" + name + "_on.gif";
}}

function change_off(name)
{
if (document.getElementById(name) && name != stop)
{
document.getElementById(name).src = "images/btn_" + name + "_off.gif";
}}

function change_act(name)
{
if (document.getElementById(name) && name != stop)
{
change_unact(stop);
document.getElementById(name).src = "images/btn_" + name + "_on.gif";
stop = name;
}}

function change_unact(name)
{
if (document.getElementById(name))
{
document.getElementById(name).src = "images/btn_" + name + "_off.gif";
}}

// simple popup script by jiaim

function sitewin(source,w,h)
{
 var Name = "Taubert - Anwaltsoziet&auml;t";
 var Fensteroptionen = "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1";
 window.open(source,Name,Fensteroptionen + ',width=' + w + ',height=' + h);
 sitewin.focus();
}


// other popup script (modified)

var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus,sc){
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
switch (sc) { case 0: sc="no"; break; case 1: sc="yes"; break; default: case 2: sc="auto"; }
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=" + sc + ",location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
win=window.open(mypage,myname,settings);
win.focus();}


// picture popup by jiaim (with possible hyperlink)

function picwindow(source,w,h,mail,x1,y1,x2,y2,mailad)
  {
  if (mail)
     {
      maplink = "usemap='#mail'";
     }
  else { maplink = ""; mailad = "#"; }

  xsize = w + 0;		
  ysize = h + 0;

  xpos = (screen.width/2)-(xsize/2);
  ypos = (screen.height/2)-(ysize/2);
	
	NewWindow=window.open("","Picture","height="+ysize+",width="+xsize+",scrollbars=no,resizable=no,top="+ypos+",left="+xpos+"");
  NewWindow.document.write ("<map name='mail'><area shape='rect' coords='"+x1+","+y1+","+x2+","+y2+"' href='mailto:" + mailad + "' alt='eine mail schreiben'></map>");
	NewWindow.document.write ("<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td align='center'>");
  NewWindow.document.write ("<img " + maplink + "border='0' src='images/" + source + "' alt='' style='position:absolute; top:0px; left:0px;'></td></tr>");
	NewWindow.document.write ("</table>");
	NewWindow.document.write ("</body></html>");
	NewWindow.document.close();
  NewWindow.resizeTo(xsize,ysize);
  NewWindow.focus();
  }
  
  
// mailadressen-Verschl&uuml;sselung

function UnCryptMailto( s )
    {
        var n = 0;
        var r = "";
        for( var i = 0; i < s.length; i++)
        {
            n = s.charCodeAt( i );
            if( n >= 8364 )
            {
                n = 128;
            }
            r += String.fromCharCode( n - 1 );
        }
        return r;
    }

    function linkTo_UnCryptMailto( s )
    {
        location.href=UnCryptMailto( s );
    }


