		
		Shadowbox.loadSkin('classic', '/js/shadowbox/skin');
		Shadowbox.loadLanguage('en', '/js/shadowbox/lang');
		window.onload = Shadowbox.init;			
	
		$(document).ready(function() { 
		//jQuery FancyZoom
			$.fn.fancyzoom.defaultsOptions.imgDir='/js/ressources/';//very important must finish with a /
			$('#gallery a').fancyzoom(); 
			$('a.tozoom').fancyzoom({Speed:1000});
			$('a').fancyzoom({overlay:0.8});
			$("img.fancyzoom").fancyzoom();
				
		//jQuery sliding brokerge sections
		$('#asaa_tech0_handle').click(function(){$('#asaa_img0').hide();$('#asaa_tech0').toggle('slow')});
		$('#asaa_img0_handle').click(function(){$('#asaa_tech0').hide();$('#asaa_img0').toggle('slow')});
		$('#asaa_tech1_handle').click(function(){$('#asaa_img1').hide();$('#asaa_tech1').toggle('slow')});
		$('#asaa_img1_handle').click(function(){$('#asaa_tech1').hide();$('#asaa_img1').toggle('slow')});
		$('#asaa_tech2_handle').click(function(){$('#asaa_img2').hide();$('#asaa_tech2').toggle('slow')});
		$('#asaa_img2_handle').click(function(){$('#asaa_tech2').hide();$('#asaa_img2').toggle('slow')});
		$('#asaa_tech3_handle').click(function(){$('#asaa_img3').hide();$('#asaa_tech3').toggle('slow')});
		$('#asaa_img3_handle').click(function(){$('#asaa_tech3').hide();$('#asaa_img3').toggle('slow')});
		$('#asaa_tech4_handle').click(function(){$('#asaa_img4').hide();$('#asaa_tech4').toggle('slow')});
		$('#asaa_img4_handle').click(function(){$('#asaa_tech4').hide();$('#asaa_img4').toggle('slow')});

		$('#asaa_tech5_handle').click(function(){$('#asaa_img5').hide();$('#asaa_tech5').toggle('slow')});
		$('#asaa_img5_handle').click(function(){$('#asaa_tech5').hide();$('#asaa_img5').toggle('slow')});
		$('#asaa_tech6_handle').click(function(){$('#asaa_img6').hide();$('#asaa_tech6').toggle('slow')});
		$('#asaa_img6_handle').click(function(){$('#asaa_tech6').hide();$('#asaa_img6').toggle('slow')});
		$('#asaa_tech7_handle').click(function(){$('#asaa_img7').hide();$('#asaa_tech7').toggle('slow')});
		$('#asaa_img7_handle').click(function(){$('#asaa_tech7').hide();$('#asaa_img7').toggle('slow')});
		$('#asaa_tech8_handle').click(function(){$('#asaa_img8').hide();$('#asaa_tech8').toggle('slow')});
		$('#asaa_img8_handle').click(function(){$('#asaa_tech8').hide();$('#asaa_img8').toggle('slow')});		

		$('#fleet_jets_handle').click(function(){$('#fleet_heli').hide();$('#fleet_yacht').hide();$('#fleet_limo').hide();$('#fleet_coach').hide();$('#fleet_jets').toggle('slow')});
		$('#fleet_heli_handle').click(function(){$('#fleet_yacht').hide();$('#fleet_limo').hide();$('#fleet_coach').hide();$('#fleet_jets').hide();$('#fleet_heli').toggle('slow')});
		$('#fleet_yacht_handle').click(function(){$('#fleet_heli').hide();$('#fleet_limo').hide();$('#fleet_coach').hide();$('#fleet_jets').hide();$('#fleet_yacht').toggle('slow')});
		$('#fleet_limo_handle').click(function(){$('#fleet_yacht').hide();$('#fleet_heli').hide();$('#fleet_coach').hide();$('#fleet_jets').hide();$('#fleet_limo').toggle('slow')});
		$('#fleet_coach_handle').click(function(){$('#fleet_yacht').hide();$('#fleet_limo').hide();$('#fleet_heli').hide();$('#fleet_jets').hide();$('#fleet_coach').toggle('slow')});		
		  
		  // pre-submit callback 
			function showRequest(formData, jqForm, options) { 
			    var queryString = $.param(formData);  
			    //alert('About to submit: \n\n' + queryString); 
			    return true; 
			}; 
			 
			// post-submit callback 
			function showResponse(responseText, statusText)  { 
				$("#subscribe_form").hide();
			    //alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + 
			       // '\n\nThe output div should have already been updated with the responseText.'); 
			
			};
		  
		//jQuery form control
    		$('#full_form_launch').click(function() { 			
				var enq_type = $("input[@name='enq_type']:checked").val();
        		if(enq_type == "charter"){
        				var content_to_open = "full_form_charter.php";
        				var open_height = 550;
	        			var open_width = 600;
					}else if(enq_type == "fractions"){
						var content_to_open = "full_form_fractions.php";	
						var open_height = 450;
	        			var open_width = 600;			
					} else if(enq_type== "sales"){
						var content_to_open = "full_form_sales.php";
						var open_height = 450;
	        			var open_width = 600;	
					}	else {
						alert('you have not selected an ENQUIRY TYPE');
						return false;
					}					
					 jQuery.post('/includes//form_handlers/set_init.php',
				 	{
				 	name_init:$('#enq_name_init').val(),
				 	email_init:$('#enq_email_init').val(),
				 	number_init:$('#enq_number_init').val(),
				 	action:'set_init'
				 	}
    				 );					
					Shadowbox.open({
	        			player:     'iframe',
	       		 		title:      '',
	        			content:    '/includes/' + content_to_open,
	        			height:     open_height,
	        			width:      open_width
	   				 });
	   		//give page an analytics name
	   				 pageTracker._trackPageview("/launch_main_enquiry_form" );
	   				 
	   				 return false;							
    		});
    		
    		//jQuery form control
    		$('#request_brochure').click(function() { 
    		
    				var content_to_open = "full_form_request.php";
					var open_height = 450;
	        		var open_width = 600;												
					Shadowbox.open({
	        			player:     'iframe',
	       		 		title:      '',
	        			content:    '/includes/' + content_to_open,
	        			height:     open_height,
	        			width:      open_width
	   				 });
	   				 return false;							
    		});
    		$('#request_brochure_sitemap').click(function() { 
    				var content_to_open = "full_form_request.php";
					var open_height = 450;
	        		var open_width = 600;												
					Shadowbox.open({
	        			player:     'iframe',
	       		 		title:      '',
	        			content:    '/includes/' + content_to_open,
	        			height:     open_height,
	        			width:      open_width
	   				 });
	   				 return false;							
    		});
    		$('#request_brochure_footer').click(function() { 
    				//var content_to_open = "full_form_request.php?id=599300121";
    				var content_to_open = "full_form_request.php";
					var open_height = 450;
	        		var open_width = 600;												
					Shadowbox.open({
	        			player:     'iframe',
	       		 		title:      '',
	        			content:    '/includes/' + content_to_open,
	        			height:     open_height,
	        			width:      open_width
	   				 });
	   				 return false;							
    		});
    		
    	
	
	//validate form
	var v = jQuery("#subscribe_form").validate({
			submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
					target:        '#subscribe_success',   // target element(s) to be updated with server response 
       			 	beforeSubmit:  showRequest,  // pre-submit callback 
        			success:       showResponse  // post-submit callback 
				});
			}
		});

 

    		
    		     
}); 