
;(function($){
	$(function(){

	/************* CODE FOR INPUT EFFECTS  ********/
		$('input:text').focus(function(){
			if(this.value==this.defaultValue){this.value=''}
		})
		$('input:text').blur(function(){
			if(!this.value){this.value=this.defaultValue;}
		})
		$('input:password').focus(function(){
			if(this.value==this.defaultValue){this.value=''}
		})
		$('input:password').blur(function(){
			if(!this.value){this.value=this.defaultValue;}
		})
		$('textarea').focus(function(){
			if(this.value==this.defaultValue){this.value=''}
		})
		$('textarea').blur(function(){
			if(!this.value){this.value=this.defaultValue;}
		})
		/************* END CODE FOR INPUT EFFECTS  ********/
		
		/* Begin dropdown funciton*/
		
		$('.top-navigation > ul > li').mouseenter(function(){
			
			var width = $(this).attr("offsetWidth");
			if ($.browser.mozilla)
			{
				var leftOffset = "-" + (230 - width) + "px";
			} else {
				var leftOffset = "-" + (218 - width) + "px";
			}
			
			if($(this).children('ul').length){
				
				//if (console) console.log(width);
				if ($(this).hasClass('last')) {
					$(this).children('ul').css({'left':leftOffset});
				} else {
					$(this).children('ul').css({'left':0});
				}
				$(this).addClass('dropdown');
			}
		});
		$('.top-navigation > ul > li > ul > li').mouseenter(function(){
			if($(this).children('ul').length){
				$(this).children('ul').css({'left':246})
				$(this).addClass('dropdown')
			}
		})
		$('.top-navigation ul  li').mouseleave(function(){
			if($(this).children('ul').length){
				$(this).children('ul').css({'left':'-999999px'});
				$(this).removeClass('dropdown');
			}
		})
		
		/* End dropdown funciton*/
							   
	})// END OF DOCUMENT READY FUNCTION

})(jQuery)
