// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
/*
Event.addBehavior({
	'.tab, .btn_getloan, .btn_joinnetwork':function() {
		this.observe('mouseover', function(e) {
			this.addClassName('hover');
		});
		this.observe('mouseout', function(e) {
      this.removeClassName('hover');
    });
	}
});
*/

var Lead = {
	changeAll: function( args ) {
		value = $('check_all').checked;
		args.each(function(a) {
      $( "lead_" + a ).checked = value;
    });
	},
	clearLeads: function() {
		$('exported_leads').value = '';
	}
};


var Schools = {
	changeAll: function( args ) {
		value = $('check_all').checked;
		args.each(function(a) {
      $( "school_" + a ).checked = value;
    });
	},
	clearLeads: function() {
		$('exported_schools').value = '';
	}
};

var DealerInquiries = {
	changeAll: function( args ) {
		value = $('check_all').checked;
		args.each(function(d) {
      $( "dealer[" + d + "]" ).checked = value;
    });
	},
	clearDealers: function() {
		$('exported_dealers').value = '';
	}
};

var Assets = {
	changeAll: function( args ) {
		value = $('check_all').checked;
		args.each(function(d) {
      $( "user[" + d + "]" ).checked = value;
    });
	},
};

function change_zip_or_ps() {
	if ($F('country_select') == 'United States') {
		$('zip_or_ps').update( "zip code here:" )
	} else {
		$('zip_or_ps').update( "postal code here:" )
	}
}
function change_loan_country() {
	if ($F('auto_loan_country') == 'United States') {
		$('zip_or_ps_label').update( "Zip" )
	} else {
		$('zip_or_ps_label').update( "Postal Code" )
	}
}
