

jQuery(document).ready(function(){
	
	// Homepage text slider
	
	$('#textSlide').cycle({ 
		fx: 'fade', 
		speed:  2500 
	 });
	
	// Make subnav list clickable
	
	$("#subNav li").click(function(){
		window.location=$(this).find("a").attr("href");return false;
	});
	
	// Sidebar accordion
	
	$("#internal #featuredContent").accordion({
	
		collapsible : "true",
		active: false
		
	});
	
	// Ajax contact form

	$('#registerForm').submit(function(){
	
		var action = $(this).attr('action');
		
		$('#registerForm #submit').attr('disabled','disabled').after('<img src="assets/img/ajax-loader.gif" class="loader" />');
		
		$("#message").slideUp(750,function() {
		$('#message').hide();			
		
		$.post(action, { 
			domainName: $('#domainName').val(),
			type: $('#type').val(),
			contactName: $('#contactName').val(),
			org: $('#org').val(),
			email: $('#email').val(),
			phoneNumber: $('#phoneNumber').val(),
			timezone: $('#timezone').val(),
			timeFrom: $('#timeFrom').val(),
			timeFromType: $('#timeFromType').val(),
			timeTo: $('#timeTo').val(),
			timeToType: $('#timeToType').val(),
			preferredContact: $('#preferredContact').val(),
			verify: $('#verify').val()
		},
			function(data){
				document.getElementById('message').innerHTML = data;
				$('#message').slideDown('slow');
				$('#registerForm img.loader').fadeOut('fast',function(){$(this).remove();});
				$('#registerForm #submit').attr('disabled',''); 
				if(data.match('success') != null) $('#registerForm .register, .enquiryInfo').slideUp('slow');
				
			}
		);
		
		});
		
		return false; 
	
	});
	
});













