function startGallery() {
	
	if ($chk($$('.client')[0])) {
	
		var myGallery = new gallery($('myGallery'), {
			timed: true,
			showCarousel: false,
			showInfopane: true,
			slideInfoZoneOpacity: 1,
			embedLinks: false,
			fadeDuration: 750,
			delay: 10000
		});
	
	} else {
	
		var myGallery = new gallery($('myGallery'), {
			timed: true,
			showCarousel: false,
			showInfopane: true,
			slideInfoZoneOpacity: 1,
			embedLinks: false,
			fadeDuration: 750,
			delay: 4500
		});	
	
	};
	
	var slideshowlength=document.getElementsByClassName('slideElement').length;
	if (slideshowlength>1) {
		var startstop = new Element('a').addClass('startstop').addEvent('click',
			function(){
				if (myGallery.options.timed==true){
					myGallery.clearTimer();
					myGallery.options.timed=false;
					this.style.backgroundPosition="0 -50px"
				}
				else if (myGallery.options.timed==false){
					myGallery.options.timed=true;
					myGallery.timer = myGallery.nextItem.delay(0, myGallery);
					this.style.backgroundPosition="0 0"
												
				}
				
			}
		).injectInside($('header'));
	} else myGallery.options.timed=false;
}

function partnersInit() {
	if(!$('partners')) return;
	
	pText = $$('#partners p')[0];
	pBtn = new Element('div');
	pBtn.id = 'partnersBtn';
	pBtn.setHTML("PARTNERS");
	pBtn.injectInside('partners');
	pBtn.setOpacity(0.5);
	pText.setStyles('display: block; z-index: 999').setOpacity(0);
	pTextHeight = pText.getSize().size.y;
	pTextNewHeight = pText.getStyle('margin-top');	
	pTextNewHeight = pTextNewHeight.replace('px', '');
	pTextNewHeight = parseInt(pTextNewHeight)
	pTextNewHeight = pTextNewHeight - pTextHeight;
	pText.style.marginTop = pTextNewHeight + "px";
	// alert(pText.style.marginTop)
	pBtn.addEvent('mouseover', function(event){

	    pText.setOpacity(0.7);
	
		// if (myGallery.options.timed==true){
		// 	myGallery.clearTimer();
		// 	myGallery.options.timed=false;
		// 	startstop.style.backgroundPosition="0 -50px"
		// }
	
	});
	pBtn.addEvent('mouseout', function(event){
	    pText.setOpacity(0);
	});
	
};
	
window.onDomReady(startGallery);
window.onDomReady(partnersInit);
