//   var i=1;
   var n=0;    //browser
   var ie=0;   //browser
   var w1=0;   //wopen, name des geoeffneten Fensters
   var imgobj=""; //wopen, parameter fuer zur weiterverarbeitung im neuen Fenster
   var oldpos=0; //alte Mapposition
   var doc="",newX="",newY="",newLocation="";
   var newWindow = 0;
   var newMovie = "";
   var macie;
   if (navigator.userAgent.indexOf("Mac")!=-1 && navigator.appName.indexOf("Netscape")==-1) macie = true;
   else macie = false;

function browser()
//Browsererkennung
{     n = (document.layers) ? 1:0;
      ie = (document.all) ? 1:0;
}

function scroll (anker)
//Aufruf: menu.html
//Wirkung: Bewegt die scrollmap.html horizontal
               {  // if (newWindow!=0 && newWindow.closed!=true) newWindow.close();
                  switch (anker)
                                             {
                                             case'home':
                                                   rollscroll(0-screenwidth()/2);
                                                   parent.frames[3].location.href="home.html";
                                                break;
                                             case'about':
                                                   rollscroll(875-screenwidth()/2);
                                                   parent.frames[3].location.href="about.html";
                                                break;
                                             case'inside':
                                                   rollscroll(1790-screenwidth()/2);
                                                   parent.frames[3].location.href="inside.html";
                                                break;
                                             case'fragen':
                                                   rollscroll(2615-screenwidth()/2);
                                                   parent.frames[3].location.href="fragen.html";
                                                break;
                                             case'info':
                                                   rollscroll(3185-screenwidth()/2);
                                                   parent.frames[3].location.href="droge.html";
                                                break;
                                             case'outside':
                                                   rollscroll(3785-screenwidth()/2);
                                                   parent.frames[3].location.href="links.html";
                                                break;
					     case'contact':
                                                   rollscroll(4515-screenwidth()/2);
                                                   parent.frames[3].location.href="contact.html";
                                                break;
                                          }
              }

function screenwidth ()
//breite von Frame: 'contentunten'
                                {
                                        browser();
                                     if (n)
                                            return top.contentoben.window.innerWidth;
                                     else
                                            return top.contentoben.document.all.seite.offsetWidth;
                                }


function pop(insertDoc,x,y)
{    if (newWindow!=0 && newWindow.closed!=true) newWindow.close();
				 
     doc = (insertDoc=="")? "" : insertDoc;
	 newLocation = (macie)? "content/popAll.html" : "popAll.html";
     newX = x + 120;
     newY = y + 105;
     newWindow = window.open(newLocation,"Kiffnix","width="+newX+",height="+newY+",locationbar=no,menubar=no,screenX=100,screenY=100");
     newWindow.moveTo(100,100);
}


function rollscroll(newpos)
{
        var speed=12;
        if (oldpos<=newpos)
                {
                 for(i=oldpos/speed; i<=newpos/speed;i++)
                         top.contentoben.window.scrollTo(i*speed,0);
                }
        else
                for (i=oldpos/speed; i>=newpos/speed;i--)
                        top.contentoben.window.scrollTo(i*speed,0);
        oldpos=newpos;
}


function wResize (Ereignis)
//Reloaded die Seite bei veraenderung der Groesse
                {
                 //alert("resize");
                                 location.reload();
                 return true;
                }
