$(document).ready(function(){
	//lightshow();
	(function lightshow () {
		$('#banner_1').animate({
			opacity: '0'
			}, 1800, 'linear', function() {
				$('#banner_2').animate({
				opacity: '0'
				}, 1800, 'linear', function() {
					$('#banner_2').animate({
					opacity: '1'
					}, 1800, 'linear', function() {
						$('#banner_1').animate({
						opacity: '1'
						}, 1800, 'linear', function() {
							lightshow();
					});
				});
			});
		});
	})();
	

	var activelink = page;
	$('#a1').hover(function(){
		if (activelink != 'banner_text_1') {
			$('#banner_text_1').animate ({
				opacity: '1'
				}, 200, function() {  });
			$("#banner_text_1").css('z-index' , '999');
			$('#' + activelink).animate ({
				opacity: '0'
				}, 50, function() { 
			});
			$('#' + activelink).css('z-index' , '0');
		}
		activelink = 'banner_text_1';
	});
		
	$('#a2').hover(function(){
		if (activelink != 'banner_text_2') {
			$('#banner_text_2').animate ({
				opacity: '1'
				}, 200, function() {  });
			$("#banner_text_2").css('z-index' , '999');
			$('#' + activelink).animate ({
				opacity: '0'
				}, 50, function() { 
			});
			$('#' + activelink).css('z-index' , '0');
		}
		activelink = 'banner_text_2';
	});
	
	$('#a3').hover(function(){
		if (activelink != 'banner_text_3') {
			$('#banner_text_3').animate ({
				opacity: '1'
				}, 200, function() {  });
			$("#banner_text_3").css('z-index' , '999');
			$('#' + activelink).animate ({
				opacity: '0'
				}, 50, function() { 
			});
			$('#' + activelink).css('z-index' , '0');
		}
		activelink = 'banner_text_3';
	});
	
	$('#a4').hover(function(){
		if (activelink != 'banner_text_4') {
			$('#banner_text_4').animate ({
				opacity: '1'
				}, 200, function() {  });
			$("#banner_text_4").css('z-index' , '999');
			$('#' + activelink).animate ({
				opacity: '0'
				}, 100, function() { 
			});
			$('#' + activelink).css('z-index' , '0');
		}
		activelink = 'banner_text_4';
	});
	
	$('#a5').hover(function(){
		if (activelink != 'banner_text_5') {
			$('#banner_text_5').animate ({
				opacity: '1'
				}, 200, function() {  });
			$("#banner_text_5").css('z-index' , '999');
			$('#' + activelink).animate ({
				opacity: '0'
				}, 100, function() { 
			});
			$('#' + activelink).css('z-index' , '0');
		}
		activelink = 'banner_text_5';
	});
	
	$('#header_top_logo_row').hover(function(){
		if (page != activelink) {
			$('#' + activelink).animate({
				opacity: '0'		
				}, 100, 'linear', function() { 
			});
			$('#' + activelink).css('z-index' , '0');
			$('#' + page).animate({
				opacity: '1'		
				}, 200, 'linear', function() { 
			});
			$('#' + page).css('z-index' , '999');
		}
		activelink = page;
	});
		
	$('#content_top_wrap').mouseleave(function(){
		if (page != activelink) {
			$('#' + activelink).animate({
				opacity: '0'		
				}, 100, 'linear', function() { 
			});
			$('#' + activelink).css('z-index' , '0');
			$('#' + page).animate({
				opacity: '1'		
				}, 200, 'linear', function() { 
			});	
			$('#' + page).css('z-index' , '999');
		}
		activelink = page;
	});
	$.extend({
		light_burst: function(){
			$('#light_shine').animate ({
				height: '800px',
				width: '800px',
				//left: '70%',
				marginTop: '-100px',
				marginLeft: '-300px',
				opacity: '0'
				}, 1900, function() {
					light_burst_clear();
			});
		}
	});
	
	function light_burst_clear() {
		document.getElementById('light_shine').style.display = 'none';
		document.getElementById('light_shine').style.zIndex = '-1';
	}
	function ieclear (){
		$('#banner_text_1').animate ({
				opacity: '0'
				}, 0, function() {
			});
		$('#banner_text_2').animate ({
				opacity: '0'
				}, 0, function() {
			});
		$('#banner_text_3').animate ({
				opacity: '0'
				}, 0, function() {
			});
		$('#banner_text_4').animate ({
				opacity: '0'
				}, 0, function() {
			});
		$('#banner_text_5').animate ({
				opacity: '0'
				}, 0, function() {
			});
		$('#banner_text_6').animate ({
				opacity: '0'
				}, 0, function() {
			});
	}
	function firstloadIE() {
		ieclear ();
		$('#' + page).animate ({
			opacity: '1'
		}, 200, function() {});
	}
	firstloadIE();
});

var page = null;
function toggle_menu(a) {
	document.getElementById(a).style.display = 'block';
	document.getElementById(a).style.zIndex = '999';
	document.getElementById(a).style.opacity = '1';
	page = a;
}

function checkurl() {
if(document.location.href.indexOf("#robert") >= 0){ 
		abouttoggle('robert');
	}
if(document.location.href.indexOf("#michael") >= 0){ 
		abouttoggle('michael');
	}
if(document.location.href.indexOf("#mary") >= 0){ 
		abouttoggle('mary');
	}
}
function abouttoggle(str){
	document.getElementById('toggle_michael').style.display = 'none';
	document.getElementById('toggle_robert').style.display = 'none';
	document.getElementById('toggle_mary').style.display = 'none';
	document.getElementById('content_toggle_michael').style.display = 'none';
	document.getElementById('content_toggle_mary').style.display = 'none';
	document.getElementById('content_toggle_robert').style.display = 'none';
	document.getElementById('about_1').style.color = '#636363';
	document.getElementById('about_2').style.color = '#636363';
	document.getElementById('about_3').style.color = '#636363';
	if (str == 'robert') {
		document.getElementById('toggle_robert').style.display = 'block';
		document.getElementById('content_toggle_robert').style.display = 'block';
		document.getElementById('about_1').style.color = '#ff6a2d';
	}
	if (str == 'michael') {
		document.getElementById('toggle_michael').style.display = 'block';
		document.getElementById('content_toggle_michael').style.display = 'block';
		document.getElementById('about_2').style.color = '#ff6a2d';
	}
	if (str == 'mary') {
		document.getElementById('toggle_mary').style.display = 'block';
		document.getElementById('content_toggle_mary').style.display = 'block';
		document.getElementById('about_3').style.color = '#ff6a2d';
	}
}
window.setTimeout('checkurl()',100);
