var $j = jQuery.noConflict();

$j(document).ready(function(){
	
	/**
	 * RAPPEL IMMÉDIAT
	 */
	if ($j('#instant_recall').length == 1) {
		var form 	= $j('#instant_recall');
		var phone 	= form.find('input[name=phone]');
		
		var phoneHelp = phone.val();
		phone.focus(function(){
			if ($j(this).val() == phoneHelp) {
				$j(this).val('');
			}
		});
		phone.blur(function(){
			if ($j(this).val() == '') {
				$j(this).val(phoneHelp);
			}
		});
	}
	
	/**
	 * CONSUMABLES
	 */
	if ($j('form[name=consumables]').length == 1) {
		$j('#toner_colors').change(function(){
			if ($j(this).attr('checked')) {
				$j('#toner_cyan').attr('checked', true);
				$j('#toner_magenta').attr('checked', true);
				$j('#toner_yellow').attr('checked', true);
			}
			else {
				$j('#toner_cyan').attr('checked', false);
				$j('#toner_magenta').attr('checked', false);
				$j('#toner_yellow').attr('checked', false);
			}
		});
	}
	
	/**
	 * CONTACT
	 */
	if ($j('form[name=contact]').length == 1) {
		var inputContactPerson = $j('input[name=contact_person]');
		if (inputContactPerson.length == 1) {
			inputContactPerson.click(function(){
				$j('input[name=contactMode]').val('true');
			});
		}
	}
});
