$(document).ready(function(){
		
			//for login
			$('#nav_login iframe').width('180px');
			$('#nav_login iframe').height('180px');
			
			$('.login-open').each(function(){
					$(this).tooltip({ effect: 'fade', relative: true, offset: [258, 36], 
						events:{
							tooltip: "mouseover"
						}
					 });  		
			});
			
			$(document).click(function(e) {
				var el = $(e.target)
				if ($(".tooltip:visible").length && !el.parents(".tooltip").length && !el.is(".login-open")) {
					$(".tooltip").fadeOut();		
				}		
			});
			
			
		$("#footer .right a:last-child, #nav li:last-child, .b-feature:last").addClass("last");	
	
		//home header banners
		$(".b-feature img").hover(
				function() {
				$(this).stop().animate({"opacity": ".75"}, "medium");
				},
				function() {
				$(this).stop().animate({"opacity": "1"}, "medium");
				});
				
	/* clear and restore search fields */
			 $('#search input#search_term').val('Search');
			 $('input#newsletter_submit').wrap('<p id="nls_wrap"></p>');
			 $('#search_term').removeClass('clearClick').addClass('clickClear');
			 $('#newsletter_text').removeClass('clearClick').addClass('clickClear');
			 $('input.clickClear').focus(function() {
				startText = $(this).val();
				$(this).val('').addClass('focus');
			 });
			 $('input.clickClear').blur(function() {
				blurText = $(this).val();
				if (blurText == '') {
				   $(this).val(startText).removeClass('focus');
				};
			 });   
			 // color box launch
	//$('#comments .thickbox').colorbox({iframe:true,width:400, height:250});
	//$('.rsvp .thickbox ').colorbox({iframe:true,width:450, height:570});
	//@end  
});
