
var defaultfile = "index.html";


if (document.URL.substring(0,4) == "http")
    var root = "http://www.quad-art.ch/";
else
    var root = "file:///Users/me/Sites/quad-art.ch/dev/";

var itemcount = 0;

var filename = document.URL.substring(root.length,document.URL.length);

// if filename ends with a /, we are the default file of a server subdirectory
if (filename.substring(filename.length-1,filename.length) == "/")
    filename += defaultfile;

// if filename is empty, we are at the server root directory
if (filename == "")
    filename = defaultfile;

// cut off everything after #
var ind = filename.indexOf('#',0);
if (ind > 0)
    filename = filename.substring(0,ind);

// cut off everything after ?
var ind = filename.indexOf('?',0);
if (ind > 0)
    filename = filename.substring(0,ind);


// rote kugel heller
var outImage = "bilder/kugel_rot_klein.gif";
var inImage = "bilder/kugel_weiss_klein.gif";

var itemCount = 0;


function replaceImage(htmlImage,fileImage) {
    document.images[htmlImage].src = fileImage;
    }
        

function add(inName,inURL) {
    
    theName = "nav" + itemCount;
    
    if (filename != inURL) {
        document.write('<TR>');
        document.write('<TD ALIGN="center" VALIGN="middle">');
        document.write('<IMG SRC="' + outImage + '" NAME="' + theName + '" WIDTH="20" HEIGHT="20">');
        document.write('</TD><TD>');
        document.write('<A CLASS="navLink" HREF="' + inURL + '" ONMOUSEOVER="replaceImage(\'' + theName + '\',\'' + inImage + '\');" ONMOUSEOUT="replaceImage(\'' + theName + '\',\'' + outImage + '\');">' + inName + '</A>');
        document.write('</TD>');
        document.write('</TR>');
        }
    else {
        document.write('<TR>');
        document.write('<TD ALIGN="center" VALIGN="middle">');
        document.write('<IMG SRC="' + inImage + '" NAME="' + theName + '" WIDTH="20" HEIGHT="20">');
        document.write('</TD><TD CLASS="navTitle">');
        document.write(inName);
        document.write('</TD>');
        document.write('</TR>');
        }
        
    itemCount++;
    }


function insertNavigation()
    {    
    document.write('<TABLE CELLSPACING=0 CELLPADDING=2 BORDER=0>');
    
    add("quad-art.ch","index.html");
    add("Brettspiele","brettspiele.html");
    add("Glocken","glocken.html");
    add("cuboro","cuboro.html");
    add("Holzmodelle","holzmodelle.html");
    add("Vogelpfeifen","vogelpfeifen.html");
    add("Wanderwege","wanderwege.html");
    add("Uhren","uhren.html");
    add("Tische","tische.html");
    add("Kontakt","kontakt.html");
    
    document.write('</TABLE>');
    }
    

function prepareContent()
    {
    document.write('<A NAME="top"></A>');

    // start of main table
    document.write('<TABLE CELLSPACING=0 CELLPADDING=20 BORDER=0 WIDTH=800>');
    document.write('<TR>');

    // start of navigation cell
    document.write('<TD VALIGN="top" ALIGN="left">');

    // insert navigation
    insertNavigation();

    // end of navigation cell
    document.write('</TD>');

    // start of content cell
    document.write('<TD VALIGN="top" ALIGN="left" COLSPAN=2>');
}


function finishContent(inArrow)
    {
    document.write('<BR><BR><BR><BR>');
    document.write('<CENTER>');

    // write arrow
    if (inArrow == true) {
        document.write('<A HREF="#top" CLASS="symbol" TITLE="Zur&uuml;ck zum Seitenanfang">&uarr;</A>');
        document.write('<BR>');
        }
        
    // write disclaimer
    document.write('<SPAN CLASS="disclaimer">&copy; 2003 quad-art. Alle Rechte vorbehalten.<BR>webdesign at meworld.ch</SPAN>');
    document.write('</CENTER>');

    // end of content cell
    document.write('</TD>');
    
    // end of main table
    document.write('</TR>');
    document.write('</TABLE>');
    }
    

