$(function()
{
	$('#Help').html('<div id="HelpDialog" title="help"><br /><p id="HelpContent"></p></div>');

	if ($('#HelpDialog').length)
	{
		$('#HelpDialog').dialog({
			bgiframe: true,
			autoOpen: false,
			modal: false,
			resizable: false,
			width: 500,
			buttons: {
				'close': function() {
					$('#HelpDialog').dialog('close');
				}
			}
		});
	}

	$('.helpTrigger').click(function(e)
	{
		/*if ($('#HelpDialog').dialog('isOpen'))
		{
			$('#HelpDialog').dialog('close');
		}
		else
		{*/
			content = '';
			switch ($(this).attr('id'))
			{
				case 'HelpActivities':
					$.ajax({
						url: 'index.php?a=Ajax&b=HelpData&c=Activities',
						async: false,
						success: function (data){
							content = data;
						}
					});
					break;

				case 'HelpOccupationCats':
					$.ajax({
						url: 'index.php?a=Ajax&b=HelpData&c=Occupations',
						async: false,
						success: function (data){
							content = data;
						}
					});
					break;
				
				case 'HelpAges':
					content = 'Select the appropriate age band for each person based upon the age at the start of cover.';
					break;

				case 'HelpYourName':
					content = 'Your <b>full name</b> as it would have appeared when registereing your details.';
					break;
			
				case 'HelpYourCompany':
					content = 'Your <b>company name</b> as it would have appeared when registering your details.';
					break;

				case 'HelpMyFavourites':
					content = 'Create your own favourite links within this site.';
					break;

				case 'HelpSearch':
					content = 'Enter alpha or numeric references or an Insured name to filter results.';
					break;

				case 'HelpAssuredPostcode':
					content = 'Insured\'s postcode as per registered address.';
					break;

				case 'HelpContactName':
					content = 'Alpha provides client covering letters with final documentation. This name will appear as the addressee on aforementioned letter/s.';
					break;

				case 'HelpContactPosition':
					content = 'Alpha provides client covering letters with final documentation. This name will appear as the addressee on aforementioned letter/s.';
					break;

				case 'HelpNonManual':
					content = 'Sedentary and all non-hazardous occupations or occupations where there is minimal physical effort. In this class will be found most &quot;white collar&quot; workers and personnel whose duties are office related, but not subject to other factors that would increase their risk. The most frequently written risks in this classification would be lawyers, office managers and clerical employees, commercial and city salesman who do not make deliveries.';
					break;

				case 'HelpLightManual':
					content = 'Non-Hazardous manual work e.g. mechanices, electricians, warehousemen, greengrocers etc. Also &quot;white collar&quot; workers, but whose occupations are subject to certain factors, making them more hazardous than the Non Manual class. Some of the risks in this class involve very light manual labour (excluding those who use machinery). Also in this class will be found such risks as travelling salesmen, surveyors and merchants.';
					break;

				case 'HelpHeavyManual':
					content = 'In this class will be found industrial workers, most of whom are skilled or semi-skilled workers, some of whom use machinery. The occupational hazard in this group, despite safety prevention measures in industrial plants and elsewhere, creates a hazard greater than the Manual class. In this group also will be found petrol station attendants; farmers who do not do manual labour; carpenters (excluding those who use power driven woodworking machinery); and taxi drivers.<br /><br />Industrial workers using heavy machinery and unskilled labourers, along with police and fire fighters will need to be <b>REFERRED TO UNDERWRITERS</b>.';
					break;

				case 'HelpDeath':
					content = 'Accidental death - lump sum benefit.';
					break;

				case 'HelpCaps':
					content = 'Lump sum payout for loss of limbs, eyesight and hearing for example.';
					break;

				case 'HelpTTDAcc':
					content = 'Disablement which temporarily and totally prevents the <b>Insured Person</b> from attending to the duties of his usual business or occupation.';
					break;

				case 'HelpTTDIll':
					content = 'Extend cover to include illness which is the sole cause of Your disablement.';
					break;

				case 'HelpEmployees':
					content = 'The total number of employees that require cover per occupational category.';
					break;

				case 'HelpWageroll':
					content = 'The total wageroll that represents each occupational category that requires this cover.';
					break;

				case 'HelpOpTime':
					content = 'The period of time that cover is in force during the Period of Insurance.';
					break;

				case 'HelpFixedSalary':
					content = 'Fixed - A fixed monetary sum insured per insured person.<br /><br />Salary - A percentage or multiple of salary which represents the sum insured.';
					break;

				case 'HelpTTDExcess':
					content = 'The period prior to the commencement of the Benefit Period for which no benefit is payable.';
					break;

				case 'HelpTTDPayable':
					content = 'The maximum period that TTD benefit is payable for.';
					break;

				case 'HelpAdminFee':
					content = 'You can choose to include an administration fee that you would ordinarily impose on the Insured. This will appear within our premium calculations; however, this is not handled or collected by Alpha Underwriting.';
					break;

				case 'HelpTripNumber':
					content = 'The total number of trips during the period of insurance.';
					break;

				case 'HelpTripNature':
					content = 'Non Manual: Non-Hazardous Occupations or occupations where there is minimal physical effort, such as shop workers.<br /><br />Light Manual: Non-Hazardous Manual work - HGV Drivers, Mechanics, Electricians Warehouseman, Greengrocers, and the like.<br /><br />Heavy Manual: Agricultural Workers, Laborers, Ground men and the like.';
					break;

				case 'HelpGeographicalLimits':
					content = '<b>Europe</b>: Means the continent of Europe west of the Ural Mountains including the Republic of Ireland, the Isle of Man, Channel Islands and all countries bordering the Mediterranean Sea, as well as Madeira and The Azores, including Spain, The Canaries, Turkey, Cyprus, Malta and Switzerland. For residents of the Isle of Man and Channel Islands travelling to the United Kingdom, the United Kingdom shall be considered as Europe.<br /><br /><b>Worldwide:</b> Anywhere in the world.';
					break;

				case 'HelpGeographicalLimitsSingle':
					content = '<b>United Kingdom</b>: England, Scotland, Wales and Northern Island<br /><br /><b>Europe</b>: Means the continent of Europe west of the Ural Mountains including the Republic of Ireland, the Isle of Man, Channel Islands and all countries bordering the Mediterranean Sea, as well as Madeira and The Azores, including Spain, The Canaries, Turkey, Cyprus, Malta and Switzerland. For residents of the Isle of Man and Channel Islands travelling to the United Kingdom, the United Kingdom shall be considered as Europe.<br /><br /><b>Worldwide excluding USA</b>: Means anywhere in the world except USA, Canada and the Caribbean<br /><br /><b>Worldwide</b>: Anywhere in the world.';
					break;

				case 'HelpPleasureTrips':
					content = 'Pleasure trips can be added and calculated on a per insured person basis.';
					break;

				case 'HelpInsuredPostcode':
					content = 'Insured\'s postcode as per usual place of residence.';
					break;

				case 'HelpSalary':
					content = 'Optional. Information supplied will predetermine maximum benefits permitted within this policy.';
					break;

				case 'HelpMaxDuration':
					content = 'The maximum trip duration for any one trip during the period of insurance.';
					break;

				case 'HelpBaggage':
					content = 'If this option is selected, we will pay up to the Sum Insured as shown in the Schedule of Benefits for the loss, theft or damage of Personal Baggage during a Trip. We will also pay up to the Sum Insured shown in the Schedule of Benefits for the loss or theft of money and travel documents.';
					break;

				case 'HelpWinter':
					content = 'Winter Sports Cover will extend to include:<br /><br /><ul><li>Winter Sports Equipment</li><li>Ski Pack</li><li>Piste Closure</li><li>Avalanche Closure</li></ul>';
					break;

				case 'HelpWinterSingle':
					content = 'Winter Sports cover will provide cover for the whole Period of Insurance.<br /><br />Cover extends to include:<br /><br /><ul><li>Winter Sports Equipment</li><li>Ski Pack</li><li>Piste Closure</li><li>Avalanche Closure</li></ul>';
					break;
	
				case 'HelpGolf':
					content = 'If this option is selected, cover extends to include:<br /><br /><ul><li>Golf Equipment</li><li>Golf Equipment Hire</li><li>Non Refundable Green Fees</li><li>Hole in One</li></ul>';
					break;

				case 'HelpExcessWaiver':
					content = 'By selecting excess waiver no excess will be payable in the event of a claim.';
					break;

				case 'HelpAirline':
					content = 'If selected, this section will provide cover for alternative travel arrangements in the event of insolvency of the scheduled airline booked to travel with.';
					break;

				case 'HelpCanx':
					content = 'Cover in the event that a trip is cancelled due to illness, bereavement or other circumstances detailed in the policy wording.';
					break;

				case 'HelpUnratedActivity':
					content = 'Type the activity to be included if it is not listed within A-D. Please note that your quotation will be referred to Underwriters for consideration';
					break;

				case 'HelpUnratedOccupation':
					content = 'If the occupation required is not listed within A-D, please type the occupation in the space provided. Please note that your quotation will be referred to Underwriters for consideration';
					break;

				case 'HelpAirspace':
					content = 'If selected, this section extends the policy to include cover for travel disruption in the event of a Natural Disaster such as a volcanic eruption, flood, tsunami, earthquake, hurricane or tornado. For full details, please refer to the policy wording.';
					break;
				
				case 'HelpDispute':
					content = 'If selected, this section extends the policy to pursue a breach of contract claim arising from a contract entered into by the Insured in order to seek compensation and or implementation of the contract from the following:<br /><br /><ul><li>Tour operator or Holiday Company</li><li>Travel Agent</li><li>A Car Hire company with whom a prebooked vehicle has been arranged</li><li>An Airline, Ferry, Train, Cruise liner or Coach Operator</li><li>A Hotelier or Property Owner</li></ul>';
					break;

				case 'HelpManualBusiness':
					content = 'Business trips that involve any manual work are not automatically covered. If selected, cover can be extended to include specified manual business trips.';
					break;

				case 'HelpBusinessEquipment':
					content = 'If this option is selected, cover extends to include:<br /><br /><ul><li>Business Equipment</li><li>Business Equipment Hire</li><li>Business Money</li></ul>';
					break;

				case 'HelpActivity':
					content = 'Activities automatically covered provided that you are not participating for monetary gain and/or in a professional capacity:<br /><br /><div style="overflow:auto; height:200px"><ul><li>Aerobics</li><li>Abseiling</li><li>Archery</li><li>Athletics</li><li>Badminton</li><li>Banana Boating</li><li>Baseball/Basketball</li><li>Bowling/Bowls</li><li>Camel Riding</li><li>Canoeing (including white water up to Grade 3)</li><li>Clay-pigeon shooting</li><li>Climbing (indoor wall only)</li><li>Cricket</li><li>Croquet</li><li>Cycling (not BMX/Mountain Biking)</li><li>Fishing</li><li>Fell Walking</li><li>Gliding (no cover for crew for pilots)</li><li>Golf</li><li>Gymnastics</li><li>Handball</li><li>Hill Walking</li><li>Horse riding (excluding competition, racing, jumping, hunting, eventing, polo and rodeo)</li><li>Hot air ballooning (organised pleasure ride only)</li><li>Ice skating (rink only)</li><li>Jet skiing</li><li>Kayaking (up to Grade 3)</li><li>Netball</li><li>Orienteering</li><li>Paint Balling</li><li>Parascending (towed by boat)</li><li>Racket Ball</li><li>Rifle Range Shooting</li><li>Rowing</li><li>Safari Trips (organised by tour operator and no guns)</li><li>Scuba diving to 18 metres</li><li>Snorkelling/Swimming</li><li>Surface water sports including dinghy or coastal sailing within 12 miles of the shore</li><li>Squash</li><li>Tennis/Table Tennis</li><li>Trampolining</li><li>Volley Ball</li><li>Water Polo</li><li>Water Skiing</li><li>White Water Rafting (up to Grade 3)</li></ul></div>';
					break;

				case 'HelpReference':
					content = 'Alpha Underwriting unique numeric reference.';
					break;

				case 'HelpOwner':
					content = 'Select your filter:<br /><ul><li>My Quotes</li><li>My Colleagues Quotes</li><li>All Quotes</li></ul>';
					break;

				case 'HelpNameSearch':
					content = 'In this field you can enter the Insured name, an Insured Person, the contact name or subsidiary company';
					break;

				case 'HelpDataTable':
					content = 'The table is flexible enough to be able to:<br /><br /><b>Sort by each heading</b>: click the respective heading to sort ascending/descending<br /><br /><b>Adjust size</b>: click and hold the heading divides to adjust column widths<br /><br /><b>Increase content</b>: tailor the number of results that the table holds. Select the options contained within the options at the bottom of the table';
					break;

				case 'HelpCreateDocument':
					content = 'Select which individual documents that you would like to combine to create a universal PDF that can be saved and/or distributed.';
					break;

				case 'HelpOwnerPolicies':
					content = 'Select your filter:<br /><ul><li>My Policies</li><li>My Colleagues Policies</li><li>All Policies</li></ul>';
					break;

				case 'HelpPresentation':
					content = 'If the risk in question is complex and you have your own pre populated presentation, you can upload this to our website for us to review and provide our comments and/or quotation.';
					break;

				default:
					content = 'Unknown help dialog';
			}
		//}
		$('#HelpContent').html(content);
		$('#HelpDialog').dialog('option', 'position', [e.pageX, e.pageY + 10]);
		$('#HelpDialog').dialog('open');
	});





});
