/**
 * wisit - http://www.wisit.com
 * Copyright (C) 2009 wisit
 *
 * V 0.1 wisit css/profile/extern
*/
script = function(){
    var slideshow = new SlideShow();
    $(document).ready(function(){
        ie6DIVhover.hover();
    });
};

SlideShow = function () {
    timObjectjQ.methodeInterval();
};

timObjectjQ = {
    divclass : "timObject-headimg",
    time : 15000, // bildwechsel Zeit
    runcount : 0,
    bild : new Array(),
    timeout : 0 ,
    "DEBUG" : function(){
        var text =   " divclass :" + this.divclass
        +" time :" + this.time
        +" runcount :" + this.runcount
        +" bild.length :" + this.bild.length;
        alert(text);
    },
    "getbilder" : function(){
        var _this = this;
        var bild = new Array();
        var i = 0;
        $('.'+this.divclass).each(function(){
            var id = $(this).attr('id');
            bild[i] = id;
            i++;
        });
        this.bild = bild;
    },
    "setruncount" : function(){
        var _this = this;
        this.runcount = this.runcount + 1;
    //return(this.runcount);
    },
    "methodeInterval" : function(){
        var _this = this;
        _this.getbilder();
        this.timeout = setInterval("timObjectjQ.methodewechsel()",this.time);
    },
    "methodewechsel" : function(){
        var _this = this;
        this.setruncount();
        var x = _this.runcount;
        var raus = 0;
        var rein = 1;
        if (x >= _this.bild.length) {
            raus = _this.bild[(x-1)];
            rein = _this.bild[1];
            _this.runcount = 0;
            
            raus = _this.bild[(x)];
            $("#"+raus).hide("slow");
            $("#"+rein).show("slow");   
        }
        if (x <= 0 ) {
            rein = _this.bild[0];
            $("#"+rein).show("slow");
            
            //raus = _this.bild[1];
            
        } else  {
        //        if (x < _this.bild.length) {
            raus = _this.bild[(x-1)];
            rein = _this.bild[x];
            
            $("#"+raus).hide("slow");
            $("#"+rein).show("slow");            
            
        }

//        $("#"+rein).slideDown("slow");
//        $("#"+raus).slideUp("slow");
  
    },
    "goagan" : function(){
    
        var _this = this;
        // auto stop
        clearInterval(_this.timeout);
        _this.methodewechsel();

    }
};

ie6DIVhover = {
    divclass : "main-menu-description",
    divclasshover : "main-menu-item.item0",
    divclasshover1 : "main-menu-item.item1",
    divclasshover2 : "main-menu-item.item2",
    divclasshover3 : "main-menu-item.item3",
    "hover" : function(){
        $('.'+this.divclasshover).hover(
            function(){
                $("#start .main-menu-item.item0 .main-menu-description").css({
                    'top' : '509px'
                });
            },
            function(){
                $("#start .main-menu-item.item0 .main-menu-description").css({
                    'top' : '-509px'
                });
            }
            );
        $('.'+this.divclasshover1).hover(
            function(){
                $("#start .main-menu-item.item1 .main-menu-description").css({
                    'top' : '509px'
                });
            },
            function(){
                $("#start .main-menu-item.item1 .main-menu-description").css({
                    'top' : '-509px'
                });
            }
            );
        $('.'+this.divclasshover2).hover(
            function(){
                $("#start .main-menu-item.item2 .main-menu-description").css({
                    'top' : '509px'
                });
            },
            function(){
                $("#start .main-menu-item.item2 .main-menu-description").css({
                    'top' : '-509px'
                });
            }
            );
        $('.'+this.divclasshover3).hover(
            function(){
                $("#start .main-menu-item.item3 .main-menu-description").css({
                    'top' : '509px'
                });
            },
            function(){
                $("#start .main-menu-item.item3 .main-menu-description").css({
                    'top' : '-509px'
                });
            }
            );
    }
};
