var mySlogans = {
	
	on: 8000,
	off: 500,

	slogans: new Array(
		['active-rigorous-and','objective-research'],
		['we-relish-tough','assignments'],
		['we-believe-in','added-value']
	),

	current_index: null,
	current_slogan: new Array(),
	
	rotate: function(s) {
		
		try {
				
			if (!s) {
					
				$('#' + this.current_slogan[1]).fadeOut(1000,
					function() {
						$('#' + mySlogans.current_slogan[0]).fadeOut(1000,
							function() {
								
								$('#slogans').empty();
								setTimeout('mySlogans.rotate(1)',mySlogans.off);
							}
						);
					}
				);
				
			} else {
						
				if (!this.current_index) {
					this.current_index = Math.floor(Math.random()*this.slogans.length);
				}
						
				if (this.current_index>=this.slogans.length-1) {
					this.current_index=0;
				} else {
					this.current_index++;
				}
						
				this.current_slogan = this.slogans[this.current_index];
			
				for (var i=0; i<this.current_slogan.length; i++) {
					var item = $('<div>');
					item.attr('id',this.current_slogan[i]).appendTo($('#slogans'));
				}
						
				$('#' + this.current_slogan[0]).fadeIn(1000,
					function() {
						$('#' + mySlogans.current_slogan[1]).fadeIn(1000,
							function() {
								setTimeout('mySlogans.rotate(0)',mySlogans.on);
							}
						);
					}
				);
			}
			
		} catch (e){}		
	}
}
