window.addEvent('domready', function() { 
	status = "INIT DOM READY";
	initIt();
})

function initIt() {
	initMenu();
}
function initMenu() {
	var menu = $$('a.menuItem');
	var i = 0;
	menu.each(function(element) {
		var myFx = new Fx.Tween(element, {duration:500, wait:false});
		element.addEvent('mouseenter', function(e){
			e.stop();
			myFx.start('color', '#ffffff');
		});
		element.addEvent('mouseleave', function(e){
			e.stop();
			myFx.start('color', '#a39e9e');
		});
		i++;
	});
//	$$('a.hover').setStyle('background-color','red');
}
function initToolTips() {
	var Tips3 = new Tips($$('.Tips3'), {
		showDelay: 400,
		hideDelay: 400,
		fixed: true
	});	
}
function loadCV(cvFile) {
	var url = cvFile;
	$(cvText).load(url);
}

function restoreCV() {
	var url = "who_we_are.html";
	$(cvText).load(url);
}

doRollovers = function(elements) {
	elements.each(function(thisel){
		var src = thisel.getProperty('src');
		src = src.replace('_normal','_over');
		var extension = src.substring(src.lastIndexOf('.'),src.length);
		thisel.getParent().setStyle('background','url('+src+') no-repeat');
		thisel.addEvent('mouseenter', function() {  this.fade('out'); });
		thisel.addEvent('mouseleave', function() { this.fade('in'); });
	});
};
function initScrollOrg() {
//	var scroll = new Scroller("cvPhotoGallery", {area: Math.round(cvPhotoGallery.getWidth() /5)});
	var scroll = new Scroller("cvPhotoGallery", {area:220});
	$('cvPhotoGallery').addEvent('mouseover', scroll.start.bind(scroll));
	$('cvPhotoGallery').addEvent('mouseout', scroll.stop.bind(scroll));
	scroll.addEvent('change', function(x,y) {window.status = (x);} );
}
function initScroll() {
/*	var mf = new MooFlow($('cvPhotoGallery'), {
		startIndex: 5,
		useSlider: true,
		useAutoPlay: true,
		useCaption: true,
		useResize: true,
		useWindowResize: true,
		useMouseWheel: true,
		useKeyInput: true
	});
*/
}