
var visibleDiv = $("div1");
            function toggle(newSrc){
                if($("div1").fx){$("div1").fx.stop();}
                if($("div2").fx){$("div2").fx.stop();}
                if(visibleDiv == $("div1")){
                    $("image2").src = newSrc;
                    $("div1").set('morph', {duration: 'long'});
					$("div2").set('morph', {duration: 'long'});
					$("div1").morph({'opacity':0});
                    $("div2").morph({'opacity':1});
					visibleDiv = $("div2");
                }else{
                    $("image1").src = newSrc;
                    $("div1").set('morph', {duration: 'long'});
					$("div2").set('morph', {duration: 'long'});					
                    $("div1").morph({'opacity':1});
                    $("div2").morph({'opacity':0});
                    visibleDiv = $("div1");
                }
            }

			
			periodical = new Class({
				initialize: function(dateString){
					this.count = 1;
					this.startTimer();
				},
				updateCount: function(){
					if (this.count==10)
						this.count=1;
					else
						this.count++;
					toggle('bgs/bg'+this.count+'.jpg');
				},
				stopTimer: function(){
					$clear(this.periodicalTimer);
				},
				startTimer: function(){
					this.periodicalTimer = this.updateCount.periodical(5000, this);
				}
			});		
			temp= new periodical;
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

