var gallery;


function siteInit() {
	
    
	var myMenu = new UvumiDropdown("nav",{
	closeDelay:200,
	mode:'vertical' //default was 'horizontal'
	});

	if($$('div.gallery')[0]) {
    	var gallery = new fadeGallery($$('div.gallery')[0], {
			speed: 1000,
			paging: false,
			autoplay: true,
			duration: 7000,
			onStart: function() {
				this.gallery.getElement(".info").set("html", '<!--<span style="color: lightblue; font-size: 12pt; font-weight: bold; display: block;">FEATURED PROJECT:</span>-->'+this.items[this.current].getElement("a").title);
				Cufon.replace('#info');
			},
			onPlay: function() { this.fireEvent("start"); }
			
		});
		
	}
	
	if($$('div.gallery-clients')[0]) {
    	var gallery = new fadeGallery($$('div.gallery-clients')[0], {
			speed: 1000,
			paging: false,
			autoplay: true,
			duration: 7000,
			onStart: function() {
				this.gallery.getElement(".info").set("html", this.items[this.current].getElement("a").title);
				Cufon.replace('#info');
			},
			onPlay: function() { this.fireEvent("start"); }
		   
		});
		
	}
	  
	
	if($$('div.gallery-expeditions')[0]) {
    	var gallery = new fadeGallery($$('div.gallery-expeditions')[0], {
			speed: 1000,
			paging: false,
			autoplay: true,
			duration: 5000
		});
		
	}
	
		
		if($$('div.gallery-projects.')[0]) {
	    	var gallery = new fadeGallery($$('div.gallery-projects')[0], {
				speed: 1000,
				paging: false,
				autoplay: true,
				duration: 7000,
				onStart: function() {
					this.gallery.getElement(".info").set("html", '<!--<span style="color: lightblue; font-size: 12pt; font-weight: bold; display: block;">PROJECT:</span>-->'+this.items[this.current].getElement("a").title);
					Cufon.replace('#info');
				},
				onPlay: function() { this.fireEvent("start"); }

		});
			            
   

	}
                   

	
	 if($('gallery-tenders')) {
			var gallery = new fadeGallery($('gallery-tenders'), {
				speed: 1600,
				paging: false,
				autoplay: true,
				duration: 3000
			});
	 }
   	
	if($$('div.gallery-activities')[0]) {
 
    	
		var gallery = new fadeGallery($$('div.gallery-activities')[0], {
			speed: 1600,
			paging: false,
			autoplay: true,
			duration: 3000
		}); 
		  
	   
	
	
		/*
		slides = $$('div.gallery-activities')[0].getElements('img');
		if (slides.length > 1) {
			$$('div.gallery-activities')[0].floom(slides, {
				slidesBase: '',
				sliceFxIn: {
					top: 20
				},
				progressbar: false
				
			});
		} 
		*/
		
	}
	
	if (document.getElementById("map")) {
		load();
    }
}

window.addEvent('domready', siteInit);
