	$(document).ready(function(){
		
		// $('form').submit(function(){
		// On submit disable its submit button
	 	// $('input[type=submit]', this).attr('disabled', 'disabled');
		// });
		
		// advance form
		$("#menu_containerLeftSearchBar").mouseover( 
			function () 
			{ 
				$("#search_advancedBox").show();
				$("#menu_containerLeftSearchFormAdvanced01").hide();
			}
		);
		
		$("#content_container, #page_logo").mouseover( 
			function () 
			{ 
				$("#menu_containerLeftSearchFormAdvanced01").show();
				$("#search_advancedBox").hide();
			}
		);
				
		$("#menu_containerLeftSearchFormAdvancedHide").click( 
			function () 
			{ 
				$("#menu_containerLeftSearchFormAdvanced01").show();
				$("#search_advancedBox").hide();
			}
		);
		
		$('#selectedDatepicker1').datepicker({
			useThemeRoller: true,
			alignment: 'bottomRight', 
			beforeShow: readSelected1,
			onSelect: updateSelected1, 
			minDate: new Date(2010, 1 - 1, 1),
			maxDate: new Date(2011, 12 - 1, 31), 
			showOn: 'both',
			showOtherMonths: true,
			nextText: '',
			showButtonPanel: true,
			buttonImageOnly: true,
			buttonImage: '/include/images/calendar.gif',
			buttonText: 'Select A Date'
		}); 
			 
		// Prepare to show a date picker linked to three select controls  
		function readSelected1() {  
			$('#selectedDatepicker1').val($('#selectMonth1').val() + '/' +  $('#selectDay1').val() + '/' + $('#selectYear1').val());  
			return {};  
		}  
		  
		// Update three select controls to match a date picker selection  
		function updateSelected1(date) {  
			$('#selectMonth1').val(date.substring(0, 2));  
			$('#selectDay1').val(date.substring(3, 5));  
			$('#selectYear1').val(date.substring(6, 10));  
		}
		
		$('#selectedDatepicker2').datepicker({
			useThemeRoller: true,
			alignment: 'bottomRight', 
			beforeShow: readSelected2,
			onSelect: updateSelected2, 
			minDate: new Date(2010, 1 - 1, 1),
			maxDate: new Date(2011, 12 - 1, 31), 
			showOn: 'both',
			showOtherMonths: true,
			nextText: '',
			showButtonPanel: true,
			buttonImageOnly: true,
			buttonImage: '/include/images/calendar.gif',
			buttonText: 'Select A Date'
		}); 
			 
		// Prepare to show a date picker linked to three select controls  
		function readSelected2() {  
			$('#selectedDatepicker2').val($('#selectMonth2').val() + '/' +  $('#selectDay2').val() + '/' + $('#selectYear2').val());  
			return {};  
		}  
		  
		// Update three select controls to match a date picker selection  
		function updateSelected2(date) {  
			$('#selectMonth2').val(date.substring(0, 2));  
			$('#selectDay2').val(date.substring(3, 5));  
			$('#selectYear2').val(date.substring(6, 10));  
		}
		
		$("#memberLogin").colorbox({iframe:true, width:420, height:420});
		$("a.itineraryWindow").colorbox({iframe:true, width:400, height:300});
		$("a.commentWindow").colorbox({iframe:true, width:530, height:530});
		$("a.photoWindow").colorbox({iframe:true, width:500, height:500});
		$("#memberLogin,a.itineraryWindow,a.commentWindow,a.photoWindow").click(function(){
			$().bind('cbox_closed', function(){
				window.location.reload( true );
			})
		}); 
		$("a[rel='lightbox']").colorbox({transition:"none", width:"75%", height:"75%"});

		$("#searchBar_fieldGraphic").qtip({
			content: {
				url: '/include/tooltip.cfm?tooltipText=searchBar_fieldGraphic'
			},
			tip: 'topLeft',
			style: {
				width: 300,
				background: '#fcfef8',
				padding: 10,
				tip: 'topLeft',
				border: {
					width: 6,
					radius: 5,
					color: '#7bbb04'
				}
			}
		});		
		$("#seasonal_sfLocation").qtip({
			content: {
				url: '/include/tooltip.cfm?tooltipText=searchBar_fieldGraphic'
			},
			tip: 'topLeft',
			style: {
				width: 300,
				background: '#fcfef8',
				padding: 10,
				tip: 'topLeft',
				border: {
					width: 6,
					radius: 5,
					color: '#7bbb04'
				}
			}
		});		
		$("#sfRadius").qtip({
			content: {
				url: '/include/tooltip.cfm?tooltipText=sfRadius'
			},
			tip: 'topLeft',
			style: {
				width: 300,
				background: '#fcfef8',
				padding: 10,
				tip: 'topLeft',
				border: {
					width: 6,
					radius: 5,
					color: '#7bbb04'
				}
			}
		});					
		$("#sfTags").qtip({
			content: {
				url: '/include/tooltip.cfm?tooltipText=sfTags'
			},
			tip: 'topLeft',
			style: {
				width: 300,
				background: '#fcfef8',
				padding: 10,
				tip: 'topLeft',
				border: {
					width: 6,
					radius: 5,
					color: '#7bbb04'
				}
			}
		});		
		$("#sfExact").qtip({
			content: {
				url: '/include/tooltip.cfm?tooltipText=sfExact'
			},
			tip: 'topLeft',
			style: {
				width: 300,
				background: '#fcfef8',
				padding: 10,
				tip: 'topLeft',
				border: {
					width: 6,
					radius: 5,
					color: '#7bbb04'
				}
			}
		});		
		$("#sfNoSports").qtip({
			content: {
				url: '/include/tooltip.cfm?tooltipText=sfNoSports'
			},
			tip: 'topLeft',
			style: {
				width: 300,
				background: '#fcfef8',
				padding: 10,
				tip: 'topLeft',
				border: {
					width: 6,
					radius: 5,
					color: '#7bbb04'
				}
			}
		});		
		$("#sfFilter").qtip({
			content: {
				url: '/include/tooltip.cfm?tooltipText=sfFilter'
			},
			tip: 'topLeft',
			style: {
				width: 300,
				background: '#fcfef8',
				padding: 10,
				tip: 'topLeft',
				border: {
					width: 6,
					radius: 5,
					color: '#7bbb04'
				}
			}
		});		
		
	});