// 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 show_boximage(num)
{
    if(!document.getElementById) { return(true); }
    
    document.getElementById("boxmainimg").src = images[num].src;;

    return(false);
}

function showimagebox()
{   
    box = document.getElementById("imagebox");
    
    if(!box || !box.style)
    {
        return false;
    }

    imb1 = document.getElementById("mainframe1");

    if(imb1.filters)
    {
        t_imbox = setInterval("im_f_out_IE()", 1);
    }
    else if(imb1.style.opacity)
    {
        t_imbox = setInterval("im_f_out_MOZ()", 1);
    }
    else if(imb1.style.MozOpacity)
    {
        t_imbox = setInterval("im_f_out_MOZo()", 1);
    }
    
    return false;
}

function im_f_out_IE()
{
    imb1 = document.getElementById("mainframe1");
    imb2 = document.getElementById("mainframe2");
    imb3 = document.getElementById("mainframe3");
    
    alpha -= steps;
    if(alpha > 20)
    {
        imb1.filters.alpha.opacity = alpha;
        imb2.filters.alpha.opacity = alpha;
        imb3.filters.alpha.opacity = alpha;
    }
    else
    {
        alpha = 20;
        clearInterval(t_imbox);
        t_imbox = null;
        
        box = document.getElementById("imagebox");
        box.style.top     = "20px";
        box.style.display = "block";
    }
}

function im_f_out_MOZo()
{
    imb1 = document.getElementById("mainframe1");
    imb2 = document.getElementById("mainframe2");
    imb3 = document.getElementById("mainframe3");
    
    alpha -= steps;
    if(alpha > .222)
    {
        imb1.style.MozOpacity = alpha;
        imb2.style.MozOpacity = alpha;
        imb3.style.MozOpacity = alpha;
    }
    else
    {
        alpha = .222;
        clearInterval(t_imbox);
        t_imbox = null;
        
        box = document.getElementById("imagebox");
        box.style.top     = "20px";
        box.style.display = "block";
    }
}

function im_f_out_MOZ()
{
    imb1 = document.getElementById("mainframe1");
    imb2 = document.getElementById("mainframe2");
    imb3 = document.getElementById("mainframe3");
    
    alpha -= steps;
    if(alpha > .222)
    {
        imb1.style.opacity = alpha;
        imb2.style.opacity = alpha;
        imb3.style.opacity = alpha;
    }
    else
    {
        alpha = .222;
        clearInterval(t_imbox);
        t_imbox = null;
        
        box = document.getElementById("imagebox");
        box.style.top     = "20px";
        box.style.display = "block";
    }
}

function im_f_in_IE()
{
    imb1 = document.getElementById("mainframe1");
    imb2 = document.getElementById("mainframe2");
    imb3 = document.getElementById("mainframe3");
    
    alpha += steps;
    if(alpha <= 100)
    {
        imb1.filters.alpha.opacity = alpha;
        imb2.filters.alpha.opacity = alpha;
        imb3.filters.alpha.opacity = alpha;
    }
    else
    {
        alpha = 100;
        imb1.filters.alpha.opacity = alpha;
        imb2.filters.alpha.opacity = alpha;
        imb3.filters.alpha.opacity = alpha;
        
        clearInterval(t_imbox);
        t_imbox = null;
    }
}

function im_f_in_MOZo()
{
    imb1 = document.getElementById("mainframe1");
    imb2 = document.getElementById("mainframe2");
    imb3 = document.getElementById("mainframe3");
    
    alpha += steps;
    if(alpha <= 0.999)
    {
        imb1.style.MozOpacity = alpha;
        imb2.style.MozOpacity = alpha;
        imb3.style.MozOpacity = alpha;
    }
    else
    {
        alpha = 0.999;
        imb1.style.MozOpacity = alpha;
        imb2.style.MozOpacity = alpha;
        imb3.style.MozOpacity = alpha;

        clearInterval(t_imbox);
        t_imbox = null;
    }
}

function im_f_in_MOZ()
{
    imb1 = document.getElementById("mainframe1");
    imb2 = document.getElementById("mainframe2");
    imb3 = document.getElementById("mainframe3");
    
    alpha += steps;
    if(alpha <= 0.999)
    {
        imb1.style.opacity = alpha;
        imb2.style.opacity = alpha;
        imb3.style.opacity = alpha;
    }
    else
    {
        alpha = 0.999;
        imb1.style.opacity = alpha;
        imb2.style.opacity = alpha;
        imb3.style.opacity = alpha;

        clearInterval(t_imbox);
        t_imbox = null;
    }
}

function hideimgbox(item)
{
    var info = document.getElementById(item); if(!info || !info.style) return false;
	info.style.display = "none";
	
	imb1 = document.getElementById("mainframe1");
	if(imb1.filters)
    {
        t_imbox = setInterval("im_f_in_IE()", 1);
    }
    else if(imb1.style.opacity)
    {
        t_imbox = setInterval("im_f_in_MOZ()", 1);
    }
    else if(imb1.style.MozOpacity)
    {
        t_imbox = setInterval("im_f_in_MOZo()", 1);
    }
    
	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";
}

