﻿/*
*	St. Vincent Health System
*	Copyright © 2009, McMurry Inc.
*	http://www.mcmurry.com
*
*	Forms Javascript
*/
$(function () {
	$.datepicker.setDefaults($.extend({
		buttonImage: '/Resources/Common/Images/Icons/calendar.gif',
		buttonImageOnly: true,
		buttonText: 'Select a Date',
		changeMonth: true,
		changeYear: true,
		showButtonPanel: true,
		showOn: 'button'
	}));
	$('.datepicker-pastdate').datepicker({
		minDate: '-100y',
		maxDate: 0,
		yearRange: '-100:0'
	});
	$('.datepicker-yearpast').datepicker({
		minDate: '-1y',
		maxDate: 0,
		yearRange: '-1:0'
	});
	$('.datepicker-yearahead').datepicker({
		minDate: 0,
		maxDate: 365
	});
	$('.datepicker-pastdate, .datepicker-yearpast, .datepicker-yearahead').mask('99/99/9999');
	$('.txt-phone').mask('(999) 999-9999? x99999');
	$('.txt-zip').mask('99999');
	$('.txt-ssn').mask('999-99-9999');
	//show explanation txt box
	$('.explanation').hide();
	$('.physicianlimitations input:radio').click(function () {
		if ($(this).val() === "Yes")
			$(".physicianlimitations .explanation").show("fast");
		else
			$(".physicianlimitations .explanation").hide("fast");
	});
	$('.ConvictedOfCrime input:radio').click(function () {
		if ($(this).val() === "Yes")
			$(".ConvictedOfCrime .explanation").show("fast");
		else
			$(".ConvictedOfCrime .explanation").hide("fast");
	});
	$('.ComputerSkills input:radio').click(function () {
		if ($(this).val() === "Yes")
			$(".ComputerSkills .explanation").show("fast");
		else
			$(".ComputerSkills .explanation").hide("fast");
	});
	$('.NonInterestedGroup input:radio').click(function () {
		if ($(this).val() === "Yes")
			$(".NonInterestedGroup .explanation").show("fast");
		else
			$(".NonInterestedGroup .explanation").hide("fast");
	});
	$('.typeofwork-wrap input:radio').click(function () {
		if ($(this).val() === "Other")
			$(".typeofwork-wrap .explanation").show("fast");
		else
			$(".typeofwork-wrap .explanation").hide("fast");
	});
	$('.RelatedToEmployee input:radio').click(function () {
		if ($(this).val() === "Yes")
			$(".RelatedToEmployee .explanation").show("fast");
		else
			$(".RelatedToEmployee .explanation").hide("fast");
	});




});
