// JavaScript Document

/*
all_locations_chk
location_table input
*/

function MOON() {
	var version = '1.0';
	return version;
}

MOON.general = {
	initCalendarTooltips:function() {
		$(".tip").tooltip({
			delay: 0, 
			showURL: false, 
			bodyHandler: function() { 
				return ($(this).attr('rel') != '')?$(this).attr('rel'):'No Info';
			}
		});	
	},
	
	initInputFocusHide:function() {
		$("input[name=exp_date_month]").focus( function (){
				if($(this).attr('value') == 'mm')
					$(this).attr('value','');
		});
		
		$("input[name=exp_date_year]").focus( function (){
				if($(this).attr('value') == 'yy')
					$(this).attr('value','');
		});
	}
};

MOON.search = {
	
	start:function() {
		MOON.search.initSearchForm();
	},
	
	initSearchForm:function() {
		$('#all_locations_chk').change(function() {
			$('.location_table input[@type=checkbox]:checked').attr('checked',!this.checked); 
		});
	}
};

$(document).ready(function(){
	MOON.search.start();
	MOON.general.initCalendarTooltips();
	MOON.general.initInputFocusHide();	
});

