	/*var activeLink="home";*/
	
	$(function() {
		// set opacity to nill on page load
		$("#navi span").css("opacity","0");
		//set home to active
		/*$("#navi li a.home span").stop().animate({
			opacity: 1
		}, 0);*/


		// on mouse over
		$("#navi span").hover(function () {
			// animate opacity to full
			$(this).stop().animate({
				opacity: 1
			}, "normal");
		},
		// on mouse out
		function () {
		// animate opacity to nill
		//currentOne=$(this).parent().get(0).id;
		//currentOne=currentOne.substring(4);
		//if (activeLink != currentOne){
			$(this).stop().animate({
				opacity: 0
			}, "slow");
		//}
		});
	
	
	/*$("#navi li a").click(function(event) {
		activeLink=this.id
		activeLink=activeLink.substring(4);
		setTimeout(function() { $("#navi li a."+activeLink+" span").stop().animate({opacity: 1}); }, 400);
		disHoverMenu();
	});*/
	
	
	
	});
	
	
	
	function disHoverMenu(){
	/*
		if (activeLink != "home") { $("#navi li a.home span").stop().animate({opacity: 0}); }
		if (activeLink != "services") { $("#navi li a.services span").stop().animate({opacity: 0}); }
		if (activeLink != "references") { $("#navi li a.references span").stop().animate({opacity: 0}); }
		if (activeLink != "about") { $("#navi li a.about span").stop().animate({opacity: 0}); }
		if (activeLink != "contact") { $("#navi li a.contact span").stop().animate({opacity: 0}); }
	*/
	}
	
	


//SHARE BUTTON-------------------------------------
$(document).ready(function() {
	$('#menu #addthis').show();
    $('#menu #addthis #addthis_center').animate({ width: "0px" }, 0 );
    
});
  
$(function(){

var onIt=1; 


$("#menu #addthis").mouseenter(function(event) {
	onIt=1;
	setTimeout(function() {
		if (onIt==1){   
 			$('#menu #addthis #addthis_center').animate({ width: "100px" }, 300 );
 			$('#menu #addthis #addthis_center .addthis_toolbox').fadeIn(300);
 		}
	}, 300);
});
 
$("#menu #addthis").mouseleave(function(event) {
onIt=0;
setTimeout(function() { 
	if (onIt==0){ 
		setTimeout(function() { 
 			$('#menu #addthis #addthis_center').animate({ width: "0px" }, 300 );
		}, 300);
 		$('#menu #addthis #addthis_center .addthis_toolbox').fadeOut(400);
 	}
}, 400);
}); 
 
});





//LOGIN-----------------------------------------
$(document).ready(function() {
    $('#menu #login #login_content').show();
	$('#menu #login').show();
	$('#menu #login #login_content').hide();
	$('#menu #login #login_close').hide();
	$('#menu #login #login_open').css('visibility', 'visible' );
});
$(function(){
	$('#menu #login #login_open').click(function(event) {
		$('#menu #login #login_close').css('visibility', 'visible' );
		$('#menu #login #login_content').show(300);
		$('#menu #login #login_close').show(100);
		$('#menu #login #login_open').css('visibility', 'hidden' );
	});
	$('#menu #login #login_close').click(function(event) {
		$('#menu #login #login_content').hide(300);
		$('#menu #login #login_close').hide(100);
		$('#menu #login #login_open').css('visibility', 'visible' );
	});
});


//LOGIN FORM DEFAULT TEXT-------------------------------------------
jQuery.fn.DefaultValue = function(text){
    return this.each(function(){
		//Make sure we're dealing with text-based form fields
		if(this.type != 'text' && this.type != 'password' && this.type != 'textarea')
			return;
		
		//Store field reference
		var fld_current=this;
		
		//Set value initially if none are specified
        if(this.value=='') {
        	$(this).css('color', '#99ddff' );
			this.value=text;
		} else {
			//Other value exists - ignore
			return;
		}
		
		//Remove values on focus
		$(this).focus(function() {
			if(this.value==text || this.value==''){
				$(this).css('color', '#eeeeff' );
				this.value='';
			}
		});
		
		//Place values back on blur
		$(this).blur(function() {
			if(this.value==text || this.value==''){
				this.value=text;
				$(this).css('color', '#99ddff' );
			}
		});
		
		//Capture parent form submission
		//Remove field values that are still default
		$(this).parents("form").each(function() {
			//Bind parent form submit
			$(this).submit(function() {
				if(fld_current.value==text) {
					fld_current.value='';
				}
			});
		});
    });
};

$(document).ready(function() {
	//Assign default value to form field #1
	$("#login #userfield").DefaultValue("username");
	$("#login #passfield").DefaultValue("password");
});

