var Site = {
	start: function(){

  window.fbAsyncInit = function() {
    FB.init({appId: 'your app id', status: true, cookie: true,
             xfbml: true});
  };
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +
      '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
		
		Browser.fixPNG($$('#logo img,  #donate img'));
$$('a, input[type=image]').addEvents({'focus':function () {this.blur()}  });
//new SmoothScroll({ duration:700 }, window);
/*var myGallery = new gallery($('header_img'), {
				timed: true,
 showArrows: false,
 showInfopane: false,
showCarousel: false,
embedLinks: false,
 delay: 5000,
 fadeDuration: 3000
});*/
 var data = {
	      'head1.jpg': { }, 
	      'head3.jpg': {  }, 
	      'head4.jpg': {  }, 
	      'head5.jpg': { },
		     'head6.jpg': { },
			  'head7.jpg': { },
			  'head8.jpg': { }

	    };
	    var myShow = new Slideshow.KenBurns('header_bg', data, { captions: false, duration: 6000,controller: true, height: 210, hu: '/fileadmin/styles/sm/img/', width: 985 });

					
Fx.Font = new Class({
	initialize: function(elements, smallid,middleid, bigid, growsize){
		this.growsize = growsize || 2; 
		this.elements = [];
		
		this.currentSize=0;
 		elements.each(function(el){
			//store the fontsize of 'el'
			//this.currentSize = el.getStyle('font-size').toInt();
		this.currentSize = 12;
	var fontsize=Cookie.read('fontsize');
			
	if (!Cookie.read('fontsize')==""){
	el.setStyle('font-size',fontsize+'px');			
	}
		

			
			this.elements.push([el,this.currentSize]);									   
		},this);
		
		$(bigid).onclick = function(){this.big()}.bind(this);
		$(middleid).onclick = function(){this.middle()}.bind(this);
		$(smallid).onclick = function(){this.small()}.bind(this);
	},
	big: function(){
		this.elements.each(function(el){
	el[0].tween('font-size',this.currentSize+this.growsize+this.growsize);			
		},this);
		
		 Cookie.write('fontsize', this.currentSize+this.growsize+this.growsize, {duration: 10});
	},
	middle: function(){
		this.elements.each(function(el){
	el[0].tween('font-size',this.currentSize+this.growsize);			
		},this);
		
	 Cookie.write('fontsize', this.currentSize+this.growsize, {duration: 10});
	},
	small: function(){
		this.elements.each(function(el){
	el[0].tween('font-size',this.currentSize);	
		},this);
		
 Cookie.write('fontsize', this.currentSize, {duration: 10});

	
	}						
});


   new Fx.Font($$('body'),$('small'),$('middle'),$('big'),2);


var latestnews = new Accordion($$('h2.acc'), $$('div.acc'), {
			display:0,
			show: 0,
			opacity: false,
			duration: 800, 
onActive: function(toggler, i) {toggler.addClass('arrow_open');},
onBackground: function(toggler, i) {toggler.removeClass('arrow_open');}
				}  );

$$('h2.acc').setStyles('cursor','hand');
	
		var iNewsSwitchLeft = 1;
var NewsSwitchLeft=function()
		{	latestnews.display(iNewsSwitchLeft)
			iNewsSwitchLeft++;
			if (iNewsSwitchLeft == 3)
				iNewsSwitchLeft = 0;
		}


/*$$('h2.acc').each(function(toggler){
        toggler.addEvent('mouseover', function(){
        toggler.fireEvent('click');
    });
});	*/

//var interval = NewsSwitchLeft.periodical(5000);	
$$('div.acc').addEvents({

'mouseover':function () {
//$clear(interval);
},
'mouseleave': function () {	
//interval = NewsSwitchLeft.periodical(5000);
}
	});

}
};

window.addEvent('domready', Site.start);
var Site = {
	start: function(){
		
		Browser.fixPNG($$('#logo img,  #donate img'));
$$('a, input[type=image]').addEvents({'focus':function () {this.blur()}  });
//new SmoothScroll({ duration:700 }, window);
/*var myGallery = new gallery($('header_img'), {
				timed: true,
 showArrows: false,
 showInfopane: false,
showCarousel: false,
embedLinks: false,
 delay: 5000,
 fadeDuration: 3000
});*/
 var data = {
	      'head1.jpg': { }, 
	      'head3.jpg': {  }, 
	      'head4.jpg': {  }, 
	      'head5.jpg': { },
		     'head6.jpg': { },
			  'head7.jpg': { }
	    };
	    var myShow = new Slideshow.KenBurns('header_bg', data, { captions: false, duration: 6000,controller: true, height: 210, hu: '/fileadmin/styles/sm/img/', width: 985 });

					
Fx.Font = new Class({
	initialize: function(elements, smallid,middleid, bigid, growsize){
		this.growsize = growsize || 2; 
		this.elements = [];
		
		this.currentSize=0;
 		elements.each(function(el){
			//store the fontsize of 'el'
			//this.currentSize = el.getStyle('font-size').toInt();
		this.currentSize = 12;
	var fontsize=Cookie.read('fontsize');
			
	if (!Cookie.read('fontsize')==""){
	el.setStyle('font-size',fontsize+'px');			
	}
		

			
			this.elements.push([el,this.currentSize]);									   
		},this);
		
		$(bigid).onclick = function(){this.big()}.bind(this);
		$(middleid).onclick = function(){this.middle()}.bind(this);
		$(smallid).onclick = function(){this.small()}.bind(this);
	},
	big: function(){
		this.elements.each(function(el){
	el[0].tween('font-size',this.currentSize+this.growsize+this.growsize);			
		},this);
		
		 Cookie.write('fontsize', this.currentSize+this.growsize+this.growsize, {duration: 10});
	},
	middle: function(){
		this.elements.each(function(el){
	el[0].tween('font-size',this.currentSize+this.growsize);			
		},this);
		
	 Cookie.write('fontsize', this.currentSize+this.growsize, {duration: 10});
	},
	small: function(){
		this.elements.each(function(el){
	el[0].tween('font-size',this.currentSize);	
		},this);
		
 Cookie.write('fontsize', this.currentSize, {duration: 10});

	
	}						
});


   new Fx.Font($$('body'),$('small'),$('middle'),$('big'),2);


var latestnews = new Accordion($$('h2.acc'), $$('div.acc'), {
			display:0,
			show: 0,
			opacity: false,
			duration: 800, 
onActive: function(toggler, i) {toggler.addClass('arrow_open');},
onBackground: function(toggler, i) {toggler.removeClass('arrow_open');}
				}  );

$$('h2.acc').setStyles('cursor','hand');
	
		var iNewsSwitchLeft = 1;
var NewsSwitchLeft=function()
		{	latestnews.display(iNewsSwitchLeft)
			iNewsSwitchLeft++;
			if (iNewsSwitchLeft == 3)
				iNewsSwitchLeft = 0;
		}


/*$$('h2.acc').each(function(toggler){
        toggler.addEvent('mouseover', function(){
        toggler.fireEvent('click');
    });
});	*/

//var interval = NewsSwitchLeft.periodical(5000);	
$$('div.acc').addEvents({

'mouseover':function () {
//$clear(interval);
},
'mouseleave': function () {	
//interval = NewsSwitchLeft.periodical(5000);
}
	});

}
};

window.addEvent('domready', Site.start);


