

		


		
		
		
	
	
	
		
		
	


			function sIFR() {
		var fdetect = deconcept.SWFObjectUtil.getPlayerVersion();
		if (fdetect['major'] != 0) {
			$.sifr({
				path: '/images/skin/',
				save: true
			});
			$('.dosifr').sifr({ font: 'skinv1-font1', color: '#58A01F', fontSize:'24px' });
		}
	}	
	
	jQuery().ready(function() {

		$('#sortable tr:odd, .sortable tr:odd').addClass('odd');
		$('#sortable tr:even, .sortable tr:even').addClass('even');

		$("a.iframe").fancybox({
			'hideOnContentClick'	: false,
			'width'			: Math.min(860, $(window).width() - 60),
			'height'			: $(window).height() - 60,
			'autoDimensions'		: false,
			'overlayShow'			: true,
			'zoomSpeedIn'			: 600,
			'zoomSpeedOut'			: 500,
			'easingIn'				: 'easeOutBack',
			'easingOut'				: 'easeInBack',
			'callbackOnStart'		: function () { $.fn.fancybox.showLoading(); }
		});  

		$('ul#slideshow').animatedinnerfade({
			speed: 1000,
			timeout: 4000,
			type: 'sequence',
			containerheight: '80px',
			containerwidth: '230px',
			animationSpeed: 5000,
			animationtype: 'fade',
			bgFrame: 'none',
			controlBox: 'none',
			displayTitle: 'none'
		});

		$('input[type=text]').live("focus", function(){ 
			if($(this).hasClass("autotext") && $(this).val() == this.defaultValue) $(this).removeClass("autotext-default").val('');
		});
		$('input[type=text]').live("blur", function(){
			if($(this).hasClass("autotext") && $(this).val() == '')  $(this).addClass("autotext-default").val(this.defaultValue);
		});
		$('input.autotext').addClass("autotext-default");
		
	//	$('input[name$="_dob"]').datepicker({firstDay: 1, dateFormat: 'mm/dd/yy', showOn: 'focus', buttonImageOnly: false});
		
		$("#spousebtn").click(function() {
			var spouse = '<div><strong style="font-size:14px;">Spouse</strong><br />'+
						'<div style="padding-bottom:5px;">'+
						'<select class="Fields" name="spouse_gender">'+
						'<option value="male">Male</option> '+
						'<option value="female">Female</option>'+
						'</select><br />'+
						'Date of Birth:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" class="Fields autotext" size="13" name="spouse_dob" value="mm/dd/yyyy" /><br />'+
						'<input type="text" class="Fields autotext" size="13" name="spouse_heightFT" value="Height: Feet" /> '+
						'<input type="text" class="Fields autotext" size="13" name="spouse_heightIN" value="Height: Inches" /><br />'+						
						'<input type="text" class="Fields autotext" size="13" name="spouse_weight" value="Weight: Lbs" /><br />'+						
						'Tobacco Use? <input type="radio" name="spouse_smoker" value="yes" /> Yes &nbsp; <input type="radio" name="spouse_smoker" value="no" /> No'+
						' (<a href="#" onclick="$(this).parent().parent().remove(); $(\'#spousebtn\').show(); return false;">remove</a>)</div></div>'
			
			$('input.autotext').addClass("autotext-default");
		//	$('input[name$="_dob"]').datepicker({firstDay: 1, dateFormat: 'mm/dd/yy', showOn: 'focus', buttonImageOnly: false});			
			$("#spouse").append(spouse);

			$("#spousebtn").hide();
		});

		$("#childbtn").click(function() {
			var kid = 	'<div><strong style="font-size:14px;">Child '+ ($(".kid").length+1) +'</strong><br />'+
						'<div class="kid" style="padding-bottom:5px;">'+
						'<select class="Fields" name="dependent'+ ($(".kid").length+1) +'_gender">'+
						'<option value="male">Male</option>'+
						'<option value="female">Female</option>'+
						'</select><br />'+
						'Date of Birth: <input type="text" class="Fields autotext" size="13" name="dependent'+ ($(".kid").length+1) +'_dob" value="mm/dd/yyyy" /> '+
						' (<a href="#" onclick="$(this).parent().parent().remove(); return false;">remove</a>)</div></div>'
			
			$("#kids").show().append(kid);
			$('input.autotext').addClass("autotext-default");
		//	$('input[name$="_dob"]').datepicker({firstDay: 1, dateFormat: 'mm/dd/yy', showOn: 'focus', buttonImageOnly: false});			
		});
		
		quotecheck = function (frm) {
			fieldCheck = new Array()
			fieldCheck.push(['firstName', 'First Name']);
			fieldCheck.push(['lastName', 'Last Name']);
			fieldCheck.push(['work_phone', 'Phone']);
			fieldCheck.push(['email', 'Email']);
			fieldCheck.push(['zip', 'Zip code']);
			fieldCheck.push(['applicant_dob', 'Date of Birth']);
			fieldCheck.push(['applicant_smoker', 'Smoker?']);
			fieldCheck.push(['applicant_heightFT', 'Height - Feet']);
			fieldCheck.push(['applicant_heightIN', 'Height - Inches']);						
			fieldCheck.push(['applicant_weight', 'Weight - Lbs']);									
			
			$("[name='spouse_dob']").each(function(index) {
				fieldCheck.push([$(this).attr("name"), 'Spouse: Date of Birth']);
				fieldCheck.push(['spouse_heightFT', 'Spouse: Height - Feet']);
				fieldCheck.push(['spouse_heightIN', 'Spouse: Height - Inches']);						
				fieldCheck.push(['spouse_weight', 'Spouse: Weight - Lbs']);
				fieldCheck.push(['spouse_smoker', 'Spouse: Smoker?']);				
			});

			$(".kid>input").each(function(index) {
				fieldCheck.push([$(this).attr("name"), 'Child '+ (parseInt(index)+1) + ' Date of Birth']);
			});
			  
			if (fieldChecker(frm)) { $("a.qpop").trigger("click"); return false; }
			else return false;
		}

		$("a.qpop").fancybox({
			'hideOnContentClick'	: false,
			'width'					: Math.min(860, $(window).width() - 60),
			'height'				: $(window).height() - 60,
			'autoScale'				: false,
			'autoDimensions'		: false,
			'overlayShow'			: true,
			'zoomSpeedIn'			: 600,
			'zoomSpeedOut'			: 500,
			'easingIn'				: 'easeOutBack',
			'easingOut'				: 'easeInBack',
			'callbackOnStart'		: function () { $.fn.fancybox.showLoading(); },
			'callbackOnShow'		: function () { $("#qpopup").remove(); $("[name=qpopframe]").load(function() { $('.fancy_loading').hide();  }); document.qtf.submit(); }			
		});  
 
		$("img").pngfix();		

	});

	

	

