function DirtStarling( textDelay, redirectID, redirectTime )
{
    var DirtStarling = 
    {
    
        maxTextClasses  : 10,
        
        text_delay      : (textDelay)       ? textDelay     : false,
        
        text_showRandom : false,
        
        max_text_layers : 0,
        
        redirectPageId  : (redirectID)      ? redirectID    : false,
        
        redirectTime    : (redirectTime)    ? redirectTime  : false,
    
        text_showed     : new Array(),
        
        
        
        
        winHeight       : $(window).height(),
        winWidth        : $(window).width(),
        winMid          : $(window).width() / 2,
        
        logoHeight      : 0,
        logoWidth       : 0,
        logoMid         : 0,
        
        
        getWinHeight    : function() { return this.winHeight; },
        getWinWidth     : function() { return this.winWidth; },
        
        getLogoHeight   : function() { return this.logoHeight; },
        setLogoHeight   : function(v){ this.logoHeight = v; },
        
        getLogoWidth    : function() { return this.logoWidth; },
        setLogoWidth    : function(v){ 
            this.logoWidth  = v;
            this.logoMid    = v / 2; 
        },
        
        fitLogo : function()
        {
            var fitSize = $(window).height() - 40;
            $('#logo').css({height:fitSize});
            return fitSize;
        },      
        
        init_logo : function()
        {
            if(this.getWinHeight() < 1000)
            {
                this.setLogoHeight(this.fitLogo());
            } 
            else 
            {
                this.setLogoHeight($('#logo').height());
            };
            this.setLogoWidth($('#logo').width());
            
            
            $('#logoContent').css({width:this.getLogoWidth(), height:this.getLogoHeight()});
        
            $('#logo').hide();
            $('#logo').css({visibility:'visible'});
            $('#logo').fadeIn(1000);
        
            this.setTextContainers();
        },
        
        
        setTextContainers : function()
        {
            logoStartPix    = this.winMid - this.logoMid - 25;
            logoEndPix      = this.winMid + this.logoMid + 25;
            
            
            var r_width = this.getWinWidth() - logoEndPix;
            
            $('#leftContent').css({width:logoStartPix, height:this.getLogoHeight()});
            $('#rightContent').css({width:r_width, height:this.getLogoHeight()});            
        },
            
        
        getRandomClass : function()
        {
            var min = 1;
            var max = this.getMaxTextClasses();
            if( min > max ) { return( -1 ); };
            if( min == max ) { return( min ); };        
            var randNo = ( min + parseInt( Math.random() * ( max-min+1 ) ) );
            return randNo;
        },
        
    
        redirect : function()
        {
            //self.location.href = "?page_id=" + this.getRedirectPage();
            self.location.href = this.getRedirectPage();
        },
        
        
        showText : function()
        {
            var random      = this.text_showRandom;
            var maxLayer    = this.getMaxTextLayers();
            var showed      = this.getShowedLayers();
        
            //alert(showed);
        
            if(random){
                alert("SHOW Random");
            }
            else
            {
                $('#t' + showed.length).fadeIn('slow');
                showed.push( 't' + showed.length );
            }
            
            if(showed.length <= maxLayer){
                window.setTimeout("DS.showText()", this.getTextDelay() * 1000);
            }
        },
        
        
        getTextDelay        : function(){ return this.text_delay; },
        setTextDelay        : function(v){ this.text_delay = v; },    
        
        getMaxTextLayers    : function(){ return this.max_text_layers; },
        setMaxTextLayers    : function(v){ this.max_text_layers = (v) ? v : 0; },
        
        getShowedLayers     : function() { return this.text_showed; },
        
        getRedirectPage     : function(){ return this.redirectPageId; },
        setRedirectPage     : function(v){ this.redirectPageId = v; },
        
        getRedirectTime     : function(){ return this.redirectTime; },
        setRedirectTime     : function(v){ this.redirectTime = v; },
        
        
        getMaxTextClasses   : function(){ return this.maxTextClasses; },
        
        showRandom          : function(v){ this.text_showRandom = v; },
    
        
        /*** IE HACK ***/
        eof : "eof"
    };
    

    // INIT the redirection
    window.setTimeout("DS.redirect()", DirtStarling.getRedirectTime() * 1000);
    window.setTimeout("DS.showText()", DirtStarling.getTextDelay() * 1000);

    return DirtStarling;
};


//window.setTimeout("DS.show_text()", 2000);

