
    var i=2;
    var intervalZeit = 1000;
    var loadingImages=new Array();

    function showSideWing() {
    if($('sidewing_content')){
        if(!Element.visible($('sidewing_content'))){
            new Ajax.Request('/dvdch/sidewing.php?show=1', {asynchronous:true});
            $$('.sidewing')[0].style.width = '0px';
            $('sidewing_content').hide();
            $('rightcontent').show();
            new Effect.Morph($$('.sidewing')[0], {style:'width:170px',duration:0.7, afterFinish:function(){
                new Effect.SlideDown($('sidewing_content'), {duration:0.7});
            }
            });
        }
    }
    }
    
    
    function hideSideWing(){
        new Ajax.Request('/dvdch/sidewing.php?hide=1', {asynchronous:true});
         new Effect.SlideUp('sidewing_content', {duration:0.7,afterFinish:function(){
            new Effect.Morph($$('.sidewing')[0], {style:'width:20px',duration:0.7,afterFinish:function(){
                Event.observe($$('.sidewing_shadow')[0], 'click', showSideWing, false);
            }});
        }});
        

    }
    
    function preloadLoading()
    {
        for (i=1;i<=10;i++)
        {
            loadingImages[i]=new Image();
            loadingImages[i].src= "/dvdch/templates/1/sys_imgs/loading.gif";
        }



    }
    
    function imageLoading()
    {
        document.getElementById("loading").style.display = "block";
        setTimeout("setLoadingBar("+i+")", intervalZeit);
        return true;        
    }
    
    function showLoding() {
       // if (document.search.qry.value == "" && document.search.gen.selectedIndex == 0 && document.search.classi.selectedIndex == 0)
       //{
       //     alert ("Bitte Suchbegriff eingeben,\nein Genre oder Status auswählen.");
       //     return false;
       // }
       // else {
            document.getElementById("loading").style.display = "block";
            setTimeout("setLoadingBar("+i+")", intervalZeit);
            return true;    
       // }
    }

    function setLoadingBar(step)
    {
        if (step > 10) step = 2;
        document.getElementById('loadingBar').src = loadingImages[step].src;
        var str = "";
        for (i=1;i<=step;i++) str += " +";
        window.status ="Bitte warten " + str;
        step++;
        setTimeout("setLoadingBar("+step+")", intervalZeit);
    }  
    
    
detailwin=false;
function popup(theURL)
{
if(detailwin&&detailwin.closed==false)
detailwin.close()
 var l = (screen.availWidth - 300) / 2;
 var t = (screen.availHeight - 300) / 2;
 detailwin = window.open(theURL,"fenster","menubar=no,toolbar=no,locationbar=no,statusbar=no,scrollbars=no,height=350, width=300,left="+l+",top="+t+";");
 detailwin.focus();
}

