function show_image(num)
{
    if(!document.getElementById) { return(true); }
    
    document.getElementById("mainimg").src = images[num].src;;

    return(false);
}

function showdetails(page, width, height, winname)
{
    sWidth = screen.width;
    sHeight = screen.height;

    xPos = (sWidth  - width)  / 2;
    yPos = (sHeight - height) / 2;
    yPos -= 50;

    prob  = "left="+xPos+",";
    prob += "top="+yPos+",";
    prob += "screenX="+xPos+",";
    prob += "screenY="+yPos+",";
    prob += "width="+width+",";
    prob += "height="+height+",";
    prob += "menubar=0,";
    prob += "toolbar=0,";
    prob += "statusbar=0,";
    prob += "scrollbars=1,";
    prob += "resizable=1,";
    prob += "locationbar=0,";
    prob += "directories=0";

    win = window.open(page, winname, prob);
    win.focus();
    
    return false;
}

function showdynflip(page, width, height, winname)
{
    sWidth = screen.width;
    sHeight = screen.height;

    xPos = (sWidth  - width)  / 2;
    yPos = (sHeight - height) / 2;
    yPos -= 50;

    prob  = "left="+xPos+",";
    prob += "top="+yPos+",";
    prob += "screenX="+xPos+",";
    prob += "screenY="+yPos+",";
    prob += "width="+width+",";
    prob += "height="+height+",";
    prob += "menubar=0,";
    prob += "toolbar=0,";
    prob += "statusbar=0,";
    prob += "scrollbars=0,";
    prob += "resizable=0,";
    prob += "locationbar=0,";
    prob += "directories=0";

    win = window.open(page, winname, prob);
    win.focus();
    
    return false;
}

function statusText(text)
{
    window.status = text;
    return true;
}

function bookmark(url, title)
{
    if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4))
    {
        window.external.AddFavorite(url,title);
    }
    else if (navigator.appName == "Netscape")
    {
        alert("Bitte drücken Sie Strg+D auf Ihrer Tastatur, um dieses Fahrzeug zu Ihren Favoriten hinzuzufügen.");
    }
    else
    {
        alert("Bitte drücken Sie Strg+T auf Ihrer Tastatur, um dieses Fahrzeug zu Ihren Favoriten hinzuzufügen.");
    }
}

function fitwin()
{
    xsize = 800;
    ysize = 600;
    
    ScreenWidth = screen.width;
    ScreenHeight = screen.height;
    
    xpos = (ScreenWidth/2)-(xsize/2);
    ypos = (ScreenHeight/2)-(ysize/2);

    window.moveTo(xpos,ypos);
    window.resizeTo(xsize,ysize);
}

function outline(id)
{
    if(document.getElementById(id).style.display == "none")
    {
        document.getElementById(id).style.display = "";
        return false;
    }
    else
    {
        document.getElementById(id).style.display = "none";
        return false;
    }
    return true;
}

function show_image_gallery()
{
    sWidth  = screen.width;
    sHeight = screen.height;

    width  = 750;
    height = 570;
    
    xPos = (sWidth  - width)  / 2;
    yPos = (sHeight - height) / 2;
    yPos -= 50;

    prob  = "left="+xPos+",";
    prob += "top="+yPos+",";
    prob += "screenX="+xPos+",";
    prob += "screenY="+yPos+",";
    prob += "width="+width+",";
    prob += "height="+height+",";
    prob += "menubar=0,";
    prob += "toolbar=0,";
    prob += "statusbar=0,";
    prob += "scrollbars=1,";
    prob += "resizable=1,";
    prob += "locationbar=0,";
    prob += "directories=0";
    
    page  = "/gallery.html";
    
    win = window.open(page, "Gallery", prob);
    win.focus();
    
    return false;
}

function show_finanz_values()
{
    sWidth  = screen.width;
    sHeight = screen.height;

    width  = 340;
    height = 500;
    
    xPos = (sWidth  - width)  / 2;
    yPos = (sHeight - height) / 2;
    yPos -= 50;

    prob  = "left="+xPos+",";
    prob += "top="+yPos+",";
    prob += "screenX="+xPos+",";
    prob += "screenY="+yPos+",";
    prob += "width="+width+",";
    prob += "height="+height+",";
    prob += "menubar=0,";
    prob += "toolbar=0,";
    prob += "statusbar=0,";
    prob += "scrollbars=1,";
    prob += "resizable=0,";
    prob += "locationbar=0,";
    prob += "directories=0";
    
    page  = "/finanzierung.html";

    win = window.open(page, "Finanzierung", prob);
    win.focus();
    
    return false;
}

function scd(k, l)
{
    if(l.href.indexOf("~") == -1)
    {
        l.href = l.href.replace(/.html/, "~"+k+".html");
    }
}
