window.addEvent('load', function() {
								   
$$('td').each(function(a)  {
		if ( a.get('align') != null ) {
			a.setStyle('text-align', a.get('align'));
		}
		
		if ( a.get('valign') != null ) {
			a.setStyle('vertical-align', a.get('valign'));
		}
	});

} );


window.addEvent('domready', function() {
	
	if ( $$("div.gallery")[0] != null) { 
	/* Mootools Plugin for Gallery Slide */
		var gallery8 = new slideGallery($$("div.gallery")[0], {
			steps: 1,
			mode: "circle",
			autoplay: true,
			duration: 6000,
			direction: "vertical"
		});
		
	}
	var e = 0;
	$$(".highlight_frame").each(function(k, iz) {
		
		var items = k.getElements("li");
		var highlight = items.getElements("div");
		var index = 1;
		
		items.setStyle('opacity', 0);
		items[0].setStyle('opacity', 1);
		
		(function() {	
			if ( items.length ) {
				(function() {
	 
					if ( index == items.length ) index = 0;
					
					if ( index == 0 ) key = items.length - 1;
					else key = index - 1;
					
					var k = items[index];
					var e = items[key];
					
					/* Effect of slide down of text of the item before */
					var myFx = new Fx.Tween(items[key], {duration: 2000, transition: 'back:in'});
					
					if ( e.getElement('div').hasClass('highlight_tag') ) {
						var etext =  e.getElement('div');
						var scrollEffect = new Fx.Morph(etext, {duration: 2000, transition: Fx.Transitions.Sine.easeOut});
						scrollEffect.start({
							'bottom' : [0, -200]
						});
						k.getElement('div').setStyle('bottom', -200);
					}
					
					myFx.start('opacity', [1, 0]);
					
					var myFx2 = new Fx.Tween(k, {duration: 1000, transition: 'back:in'});
					
					myFx2.start('opacity', [0,1]);
				
					if ( k.getElement('div').hasClass('highlight_tag') ) {
						var text =  k.getElement('div');
						var scrollEffect = new Fx.Morph(text, {duration: 1500, transition: Fx.Transitions.Sine.easeOut});
						scrollEffect.start({
							'bottom' : [-200, 0]
						})
					}
					
					++index;
					
				}).periodical(6000);
			}
		}).delay(1000+(iz*200));


	}); 
	
});


function SharePop(id) {
	
	if (document.getElementById(id).style.display == "block") {
		
		document.getElementById(id).style.display = "none";
		
	} else {
		
			document.getElementById(id).style.display = "block";
		
	}
}

function SharePopOnload(id) {
	
	document.getElementById(id).style.display = "block";
		
}

function MM_swapImage(id) {

	var new_image = document.getElementById(id).src;
	
	document.getElementById("campMainImage").src = new_image;

}
