/*SnowFlakesBG.Start=function() {
	SnowFlakesBG.Container=$('bgMagic');
	//SnowFlakesBG.Container=document.body;
	SnowFlakesBG.createFlakes(17);
	SnowFlakesBG.Move();
}
SnowFlake.SpeedRatio=1.1;
SnowFlake.Speed={
	X:-0.3*SnowFlake.SpeedRatio,
	Y:-3*SnowFlake.SpeedRatio
}*/
/*
SnowFlake.Shapes={
	SnowFlake:'❄',
	TRIFOLIATE_SNOWFLAKE:'❅',
	CHEVRON_SNOWFLAKE:'❆'
};
SnowFlakesBG.AvailableShapes=[SnowFlake.Shapes.SnowFlake,
SnowFlake.Shapes.TRIFOLIATE_SNOWFLAKE,
SnowFlake.Shapes.CHEVRON_SNOWFLAKE
];*/

SnowFlakesBG=false;
magicBG={
	doMagic:function() {
		
		var settings=new FlyingObjectsSettings(
			'bgMagic','star', ['★', '☆', '✦', '✧', '✩', '✰', '✮', '✮'], 1.3, 0.03, -0.01
		);
		var AvaiableColors=['#CFC69D', '#7A7146', '#BCB490', '#7C7348'];
		settings.changeObj=function(flobj) {
		
			flobj.currentBottom=Math.rnd(-10, 95);
			flobj.currentLeft=Math.rnd(-10, 95);
			
			flobj.htmlHandle.style.color=AvaiableColors[Math.rnd(0, AvaiableColors.length-1, true)];
			flobj.htmlHandle.style.opacity=0;
			if (!flobj.htmlHandle.id) flobj.htmlHandle.id='star_'+parseInt(Math.random()*1000000000);
		}
		
		function showStar(flobj) {
			flobj.reset();
			Effects.SteppyChange.change(flobj.htmlHandle.id,
				'opacity', 1, {len:0,opacity:0, endEvHandlerInfo: {func:hideStar, param:flobj}},
				Effects.SteppyChange.PredefinedStepInfos.Opacity);
		}
		
		function hideStar(flobj) {
			//alert(flobj);return;
			
			Effects.SteppyChange.change(flobj.htmlHandle.id,
				'opacity', 0, {len:0,opacity:0, endEvHandlerInfo: {func:showStar, param:flobj}},
				Effects.SteppyChange.PredefinedStepInfos.Opacity);
			
		}
		
		settings.FlyingHandler=function(flobj, mbgObj) {
			flobj.reset();
			mbgObj.Settings.Container.appendChild(flobj.htmlHandle);
			showStar(flobj);
			return;
		}
		

		
		//creating the moon
		var theSun=document.createElement('DIV');
		theSun.innerHTML='☽';
		theSun.id='the_moon';
		$('bgMagic').appendChild(theSun);
		
		AtNightBG=new FlyingObjects(settings);
		AtNightBG.createFlyingObjects(17);
		AtNightBG.StartFlying();
	}
};

