// FEHLER UNTERDRUECKEN
window.onerror=cancelError; function cancelError() { return true; }

// SELEKTION UNTERBINDEN
var omitformtags=["input", "textarea", "select"]
omitformtags=omitformtags.join("|")

if (typeof document.onselectstart!="undefined")
{
    document.onselectstart=new Function ("return false")
}
else
{
    document.onmousedown=disableselect
    document.onmouseup=reEnable
}

function disableselect(e)
{
    if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
    {
        return false
    }
}

function reEnable()
{
    return true
}
       
function show_image(num)
{
    if(!document.getElementById) { return(true); }
    
    document.getElementById("mainimg").src = images[num].src;;

    return(false);
}

function popup(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=0,";
    prob += "locationbar=0,";
    prob += "directories=0";

    win = window.open(page, winname, prob);
    win.focus();
    
    return false;
}

function highlight(item)
{
    document.getElementById(item).style.fontWeight = "bold";
}

function unhighlight(item)
{
    document.getElementById(item).style.fontWeight = "normal";
}

function doHL(item)
{
    alert(item.className); // carlistlight
}

function doLL(item)
{
}

function elemGlowIn(elem)
{   
    if(elem.ctim && elem.ctim != null) { clearInterval(elem.ctim); }
    elem.ctim = window.setInterval(function callFunc() { glow_in(elem); }, 30);
}

function elemGlowOut(elem, min)
{
    if(elem.ctim && elem.ctim != null) { clearInterval(elem.ctim); }
    elem.ctim = window.setInterval(function callFunc() { glow_out(elem, min); }, 30);
}

function glow_in(elem)
{
    if(elem.filters)
    {
        opac = parseFloat(elem.filters.alpha.opacity) + 5; if(opac >= 100) { opac = 100; }
        elem.filters.alpha.opacity = opac; if(opac == 100) { clearInterval(elem.ctim); elem.ctim = null; }
        return;
    }
    
    if(elem.style.opacity)
    {
        opac = parseFloat(elem.style.opacity) + 0.05; if(opac >= 1) { opac = 1; }
        elem.style.opacity = opac; if(opac == 1) { clearInterval(elem.ctim); elem.ctim = null; }
        return;
    }

    if(elem.style.MozOpacity)
    {
        opac = parseFloat(elem.style.MozOpacity) + 0.05; if(opac >= 1) { opac = 1; }
        elem.style.MozOpacity = opac; if(opac == 1) { clearInterval(elem.ctim); elem.ctim = null; }
        return;
    }
    
    clearInterval(elem.ctim);
}

function glow_out(elem, min)
{
    if(elem.filters)
    {
        opac = parseFloat(elem.filters.alpha.opacity) - 5; if(opac <= min) { opac = min; }
        elem.filters.alpha.opacity = opac; if(opac == min) { clearInterval(elem.ctim); elem.ctim = null; }
        return;
    }
    
    if(elem.style.opacity)
    {
        opac = parseFloat(elem.style.opacity) - 0.05; if(opac <= min) { opac = min; }
        elem.style.opacity = opac; if(opac == min) { clearInterval(elem.ctim); elem.ctim = null; }
        return;
    }
    
    if(elem.style.MozOpacity)
    {
        opac = parseFloat(elem.style.MozOpacity) - 0.05; if(opac <= min) { opac = min; }
        elem.style.MozOpacity = opac; if(opac == min) { clearInterval(elem.ctim); elem.ctim = null; }
        return;
    }
    
    clearInterval(elem.ctim);
}

