/*
var Site = {

        start: function(){
                //basic usage, assumes that div#snow dimensions have been explicitly specified
                //div#snow is the container for the snowfall, needs to be created by hand
               
                //extended usage, all options are used
                new TextSnow({
                        container:$(document.body),//container where you want the snowfall
                        inject:'before',//insert stage inside, top, before or after the container

                        stage:{
                                //any number of css rules
                                styles:{
                                        background:'red',
                                        width: $(document.body).getSize().x-50,
                                        height:$(document.body).getSize().y,
                           
                                },
                                padding: 1//horisontal stage padding
                        },

                        snow:{
                                ammount: 30,//number of snowflakes
                                speed:[1,2,3],//speed with wich individual snowflakes fall

                                //any number of css rules
                                styles: {
                                        'position': 'absolute'
                                },

                                symbol: ['*', 
                                		 '.', 
                                		 '<img src="http://static.schwarzmedia.de/js/snow/img/snow0.gif" />', 
                                		 '<img src="http://static.schwarzmedia.de/js/snow/img/snow1.gif" />',
                                		 '<img src="http://static.schwarzmedia.de/js/snow/img/snow2.gif" />',
                                		 '<img src="http://static.schwarzmedia.de/js/snow/img/snow3.gif" />',
                                		 '<img src="http://static.schwarzmedia.de/js/snow/img/snow5.gif" />',
                                		 '<img src="http://static.schwarzmedia.de/js/snow/img/snow7.gif" />',
                                		 '<img src="http://static.schwarzmedia.de/js/snow/img/snow8.gif" />',
                                		 '<img src="http://static.schwarzmedia.de/js/snow/img/snow9.gif" />'],//an array of flake symbols, html can be used as well
                                color:['#fff','#eee','#eed'],//flake color
                                fontFamily:['Impact', 'Times New Roman', 'Georgia'],//different flake shape
                                fontSize:[20,22],//font size in pixels
                                direction:'left',//left,right,straight
                                sinkSpeed:50//how fast the snow is falling (lower number = higher speed)
                        }
                });
        }
};
window.addEvent('domready', Site.start);

var TextSnow = new Class({
	
		options: {
			
			container:null,
			inject:'top',//insert stage inside, top, before or after the container

			stage:{
				//any number of css rules
				styles:{
					background:'none', 
					width: null, 
					height: null, 
					display: 'block', 
					position: 'relative', 
					overflow: 'hidden'
				},
				padding: 1//horisontal stage padding
			},
			
			snow:{
				ammount: 30,//number of snowflakes
				speed:[1,2,3],//speed with wich individual snowflakes fall
				
				//any number of css rules
				styles: {
					'position': 'absolute'
				},
				
				symbol: ['*'],//an array of flake symbols, html can be used as well
				color:['#fff','#eee','#eed'],//flake color
				fontFamily:['Impact', 'Times New Roman', 'Georgia'],//different flake shape
				fontSize:[20,22],//font size in pixels
				direction:'left',//left,right,straight
				sinkSpeed:50//how fast the snow is falling
			}
			
		},

		initialize: function(options){
				this.stage = new Object();
				this.snow = new Array();

				this.setOptions(options);
				this.createStage();
				this.createSnow();
				this.animateSnow.periodical(this.options.snow.sinkSpeed, this);
		},
		
		createStage: function(){
			this.stage = new Element('div', {
					'styles': this.options.stage.styles,
					'id' : 'text-snow-stage'
			});
			
			if(this.options.stage.styles.height == null) {
				this.options.stage.styles.height = this.options.container.getSize().size.y.toInt();
			} 
			
			if(this.options.stage.styles.width == null) {
				this.options.stage.styles.width = this.options.container.getSize().size.x.toInt();
			} 

			this.stage.setStyles({'height': this.options.stage.styles.height, 'width': this.options.stage.styles.width});
		//	this.stage['inject'+this.options.inject.capitalize()](this.options.container);
		},
		
		createSnow: function(){

			var stagePadding = this.options.stage.styles.width/100*this.options.stage.padding;
			var stepX = (this.options.stage.styles.width - stagePadding/2) / this.options.snow.ammount;
			var posX = stepX/2;
			var stepY = 0;
			var posY = 0;
			var variateX = [stepX/-3, stepX/3];
			
			for (i = 0; i < this.options.snow.ammount; i++) {
				
				var flake = new Element('div', {'styles': this.options.snow.styles});
				
				if(stepY >= 100) stepY = 0;
				posY =  this.options.stage.styles.height/-100*stepY;
				stepY += 25;
				
				flake.setStyles({
					'font-family': this.options.snow.fontFamily.getRandom(),
					'font-size': this.options.snow.fontSize.getRandom(),
					'color': this.options.snow.color.getRandom(),
					'top':posY,
					'left':posX
				});
				
				posX += stepX + variateX.getRandom();
				
				flake.set('html',this.options.snow.symbol.getRandom());
				flake.injectInside(this.options.container);
				this.snow[i] = flake;
			}
			
		},
		
		animateSnow: function(){
			var floor = this.options.stage.styles.height;
			var stagePadding = this.options.stage.styles.width/100*this.options.stage.padding;
			
			this.snow.each(function(flake, i) {
			
				var top = flake.getStyle('top').toInt() + this.options.snow.speed.getRandom();
				top = top >= floor ? 0 : top;
				flake.setStyle('top', top);
				
				if(this.options.snow.direction == 'left') {
					var left = flake.getStyle('left').toInt() - [1,2].getRandom();
					left = (left < stagePadding/2) ? this.options.stage.styles.width - stagePadding/2 : left;
				} else if(this.options.snow.direction == 'right'){
					var left = flake.getStyle('left').toInt() + 1;
					left = (left > this.options.stage.styles.width - stagePadding/2) ? stagePadding/2 : left;
				} else {
					var left = flake.getStyle('left').toInt();
				}
				
				flake.setStyle('left', left);

			}, this);
		}
});
TextSnow.implement(new Options, new Events);
*/

