$(document).ready(function(){
		
		
		$(".datePick").datepicker(		{showAnim: ''}	); 
		$(".datePick2").datepicker(		{showAnim: ''}	); 
		
		
		
		$(".aTab").click(function(){
			
			var showt = $(this).attr("name");
		
			$(this).parent().parent().parent().parent().find(".resultsDataWrp").removeClass("visible");
			$(this).parent().parent().parent().parent().find("." + showt).addClass("visible");
			$(this).parent().parent().find(".active").removeClass("active");
			$(this).parent().addClass("active");
		});
		
		$('#tabs .smallCarouselBlock').hide(); // Show the first div
		$('#tabs .smallCarouselBlock:first').show(); // Show the first div
		$('#tabs li:first').addClass('active'); // Set the class of the first link to active
		$('#tabs a').click(function(){ //When any link is clicked
			$('#tabs ul li').removeClass('active'); // Remove active class from all links
			$(this).parent().addClass('active'); //Set clicked link class to active
			var currentTab = $(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link
			$('#tabs .smallCarouselBlock').hide(); // Hide all divs
			$(currentTab).fadeIn(); // Show div with id equal to variable currentTab
		return false;
		});

		/* jquery tooltip */
		var arrayData  = ['A single trip travel insurance allows your travel abroad between two predesignated dates. An annual multi trip travel insurance policy allowa you travel as often as you wish in a calendar year from commencement providing no single trip exceeds the maximum trip duration shown on the policy wording', 'Maximum age at departure date for single trip travel insurance policies and age at policy commencement for annual multi trip travel insurance policies', 'Infant must be aged less than 2 at departure date for single trip travel insurance policies or at policy commencement for annual multi trip travel insurance policies', 'Child must be aged less than 18 at departure date for single trip travel insurance policies or at policy commencement date for annual multi trip travel insurance policies. Note some policies will cover up to the age of 20 providing the child is in full time education. Refer to the individual policy results for details or call 0844 249 9280', 'Provides addditonal wintersports cover including off piste skiing and boarding within designated resort boundaries', 'Our travel insurance policies cover a wide range of activty sports as standard. However some sports are considered more risky. Click here to see the defintions of whether your chosen sport is considered " Higher Risk" or not by our insurers. If it is you will need to check the "Action Sports" box when searching for a policy.'];
		$(".q").each(function (i) { $(this).simpletip({ fixed: true, content: arrayData[i] }); });

        $(".forhover").hover(
        function () {
            //$(this).addClass("quote-benefit-hilight");
            $(this).next().show();
            //$(".Medical-detail").addClass("quote-benefit-hilight");
        },
        function () {
            //$(this).removeClass("quote-benefit-hilight");
            $(this).next().hide();
            //$(".Medical-detail").removeClass("quote-benefit-hilight");
        });
        
/*	$(".fancyDropDw").click(function ()	{		$("#options").show();		$(".fancyDropDw").addClass("fancyDropDwH");	});	$("#options li span").click(function ()	{		$("#options").hide();		$(".fancyDropDw").removeClass("fancyDropDwH");		$('#drp_value').html($(this).attr("title"));	});*/	//$("table td:last").css('background', 'red');		$('#ui-datepicker-div tr').each(function() {            $(this).find('td:last').css('background', 'red');        });
});


$(function() {
	// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
	$( "#mail-modal, #quote-modal" ).dialog( "destroy" );

	$( "#mail-modal, #quote-modal" ).dialog({
		autoOpen: false,
		resizable: false,
		width: 450,
		height: 320,
		draggable: false,
		modal: true
	});
	
	$( ".saveQuoteBtn" ).click(function() {
		$( "#quote-modal" ).dialog( "open" );
		return false;
	});
	
	$( ".emailBtn" ).click(function() {
		$( "#mail-modal" ).dialog( "open" );
		return false;
	});

});

