 var feature_work_array = new Array();

feature_work_array[0] = new Array('fwc_0',
						 '<img src="images/mpilot_feature_kings.jpg"' +
					     'alt="King\'s : National VTE Exemplar website" title="King\'s : National VTE Exemplar website"' +
					     'width="260" height="100"' +
					     'class="feature_images" />' +
					     '<div id="feature_work_col_inner_0" class="feature_work_col_inner">' +
					     '<p class="feature_work_image_title">King\'s College London</p>' +
					     '<p class="feature_work_image_subtitle">National VTE Exemplar website</p>' +
					     '<p class="feature_work_image_p">Tasked to create from a clean-sheet a website to raise ' +
					     'awareness and deliver information to key audiences, Motorpilot Ltd helped structure ' +
					     'and define content within the site, to allow the client to engage users with clear ' +
					     'messages from a simple, easy to use interface.</p>' +
					     '<a class="portfolio_work_link" href="http://www.kingsthrombosiscentre.org.uk/">+ view site</a>' +
					     '</div>');

feature_work_array[1] = new Array('fwc_1',
		 				 '<img src="images/portfolio/mpilot_doh_ivig.jpg"' +
                         'alt="DoH : National IVIg website" title="DoH : National IVIg website"' +
                         'width="260" height="100"' +
                         'class="feature_images" />' +
                         '<div id="feature_work_col_inner_1" class="feature_work_col_inner">' +
                         '<p class="feature_work_image_title">Department of Health</p>' +
                         '<p class="feature_work_image_subtitle">National IVIg website</p>' +
                         '<p class="feature_work_image_p">Developing an individual identity that fits alongside existing ' +
                         'Department of Health guidelines, the website deploys a database driven, bespoke document ' +
                         'review system, radically streamlining previous processes and provding ease of information ' +
                         'capture for both client and users.</p>' +
                         '</div>');

feature_work_array[2] = new Array('fwc_2',
		 				 '<img src="images/portfolio/mpilot_ricardo_emleg.jpg"' +
                         'alt="Ricardo : Content management website" title="Ricardo : Content management website"' +
                         'width="260" height="100"' +
                         'class="feature_images" />' +
                         '<div id="feature_work_col_inner_2" class="feature_work_col_inner">' +
                         '<p class="feature_work_image_title">Ricardo Plc</p>' +
                         '<p class="feature_work_image_subtitle">Content management website</p>' +
                         '<p class="feature_work_image_p">Motorpilot Ltd developed a content management system, to deliver ' +
                         'information to users in an accessible, fast and cleanly designed manner. By integration ' +
                         'of intuitive dynamic navigation and database systems, the product was relaunched with ' +
                         'great success and praise from the client\'s consumers.</p>' +
                         '<a class="portfolio_work_link" href="http://www.emleg.com/">+ view site</a>' +
                         '</div>');

feature_work_array[3] = new Array('fwc_3',
		 				 '<img src="images/portfolio/mpilot_mt_site.jpg"' +
                         'alt="Media Technical : Website redeisgn &amp; development" title="Media Technical : Website redeisgn &amp; development"' +
                         'width="260" height="100"' +
                         'class="feature_images" />' +
                         '<div id="feature_work_col_inner_3" class="feature_work_col_inner">' +
                         '<p class="feature_work_image_title">Media Technical Ltd</p>' +
                         '<p class="feature_work_image_subtitle">Website redesign &amp; development</p>' +
                         '<p class="feature_work_image_p">Creation of a content management driven media centre allows ' +
                         'journalists access to the client\'s press releases, in parallel with the client\'s existing ' +
                         'distribution channels.</p>' +
                         '<p class="feature_work_image_p">A re-designed website provides a clean and efficient vehicle ' +
                         'for the dissemination of information.</p>' +
                         '<a class="portfolio_work_link" href="http://www.mediatechnical.com/">+ view site</a>' +
                         '</div>');

feature_work_array[4] = new Array('fwc_4',
		 				 '<img src="images/portfolio/mpilot_lifeblood_cms.jpg"' +
        				 'alt="Lifeblood : Content management website" title="Lifeblood : Content management website"' +
        				 'width="260" height="100"' +
        				 'class="feature_images" />' +
        				 '<div id="feature_work_col_inner_4" class="feature_work_col_inner">' +
        				 '<p class="feature_work_image_title">Lifeblood - Thrombosis Charity</p>' +
        				 '<p class="feature_work_image_subtitle">Content management website</p>' +
        				 '<p class="feature_work_image_p">Collaborated with the client to define and create a brand that ' +
        				 'can be used to raise national and international awareness of this Charity. ' +
        				 'The site is based around a content management system allowing ' +
        				 'easy deployment of information to its key target audiences.</p>' +
                    	 '<a class="portfolio_work_link" href="http://www.thrombosis-charity.org.uk/">+ view site</a>' +
                    	 '</div>');

feature_work_array[5] = new Array('fwc_5',
		 				 '<img src="images/portfolio/mpilot_jag_hmi.jpg"' +
		 				 'alt="Jaguar Land Rover : Human Machine Interface (HMI)" title="Jaguar Land Rover : Human Machine Interface (HMI)"' +
		 				 'width="260" height="100"' +
		 				 'class="feature_images" />' +
		 				 '<div id="feature_work_col_inner_5" class="feature_work_col_inner">' +
		 				 '<p class="feature_work_image_title">Jaguar Land Rover</p>' +
		 				 '<p class="feature_work_image_subtitle">Human Machine Interface (HMI)</p>' +
		 				 '<p class="feature_work_image_p">Utilising web technologies to interact with the vehicle\'s engine ' +
		 				 'management system, the application provides information to the driver concerning the ' +
		 				 'powertrains modes of operation via the vehicle\'s touch-screen interface. ' +
		 				 'The vehicle was shown at the London Motor Show 2008</p>' +
                		 '</div>');

feature_work_array[6] = new Array('fwc_6',
		 				 '<img src="images/portfolio/mpilot_bm_site.jpg"' +
       				 	 'alt="Brian Mason : Website redesign &amp; development" title="Brian Mason : Website redesign &amp; development"' +
       				 	 'width="260" height="100"' +
       				 	 'class="feature_images" />' +
       				 	 '<div id="feature_work_col_inner_6" class="feature_work_col_inner">' +
       				 	 '<p class="feature_work_image_title">Brian Mason Technology Ltd</p>' +
       				 	 '<p class="feature_work_image_subtitle">Website redesign &amp; development</p>' +
       				 	 '<p class="feature_work_image_p">Collaborated with client to define the brand and create a corporate ' +
       				 	 'identity, including logo design, business cards, stationary and presentation templates. ' +
       				 	 'Deployment of a simple, flexible and easy to manage website was key, ' +
       				 	 'allowing the client to build awareness.</p>' +
       				 	 '<a class="portfolio_work_link" href="http://www.bmtechno.co.uk/">+ view site</a>' +
                		 '</div>');

feature_work_array[7] = new Array('fwc_7',
		 				 '<img src="images/portfolio/mpilot_sanofi_event.jpg"' +
       				 	 'alt="Sanofi Aventis : Event website &amp; CD-ROM" title="Sanofi Aventis : Event website &amp; CD-ROM"' +
       				 	 'width="260" height="100"' +
       				 	 'class="feature_images" />' +
       				 	 '<div id="feature_work_col_inner_7" class="feature_work_col_inner">' +
       				 	 '<p class="feature_work_image_title">Sanofi Aventis</p>' +
       				 	 '<p class="feature_work_image_subtitle">Event website &amp; CD-ROM</p>' +
       				 	 '<p class="feature_work_image_p">To allow dissemination of key addresses from the client\'s event. A ' +
       				 	 'bespoke micro-site was built containing a series of videos and associated textural narration.</p>' +
                    	 '<p class="feature_work_image_p">In addition, the website was also built to be delivered via CD-ROM, ' +
                    	 'contained within client\'s booklet. Other tasks included design of CD-ROM and booklet covers.</p>' +
                		 '</div>');

feature_work_array[8] = new Array('fwc_8',
		 				 '<img src="images/portfolio/mpilot_ricardo_campaign.jpg"' +
       				 	 'alt="Ricardo : Campaign website" title="Ricardo : Campaign website"' +
       				 	 'width="260" height="100"' +
       				 	 'class="feature_images" />' +
       				 	 '<div id="feature_work_col_inner_8" class="feature_work_col_inner">' +
       				 	 '<p class="feature_work_image_title">Ricardo Plc</p>' +
       				 	 '<p class="feature_work_image_subtitle">Campaign website</p>' +
       				 	 '<p class="feature_work_image_p">Develop an online campaign to record events leading up to and past ' +
       				 	 'the landspeed record attempt of the JCB DieselMax vehicle and to raise awareness of the ' +
       				 	 'client\'s involvement. A rich media site was developed, containing video content and ' +
       				 	 'information on all aspects of the engines behind the record attempt. </p>' +
                		 '</div>');

feature_work_array[9] = new Array('fwc_9',
		 				 '<img src="images/portfolio/mpilot_roche_cdrom.jpg"' +
           				 'alt="Roche : Interactive information CD-ROM" title="Roche : Interactive information CD-ROM"' +
           				 'width="260" height="100"' +
           				 'class="feature_images" />' +
           				 '<div id="feature_work_col_inner_9" class="feature_work_col_inner">' +
           				 '<p class="feature_work_image_title">Roche</p>' +
           				 '<p class="feature_work_image_subtitle">Interactive information CD-ROM</p>' +
           				 '<p class="feature_work_image_p">Providing information in a clean and concise manner, a rich media ' +
           				 'interface allowed users to easily navigate the range of material being disseminated by the ' +
           				 'client. Audio and video content were integrated, allowing users to receive ' +
           				 'information in a format most suitable.</p>' +
                		 '</div>');

feature_work_array[10] = new Array('fwc_10',
		 				  '<img src="images/portfolio/mpilot_ibex_brochure.jpg"' +
       			          'alt="IBEX : Interactive brochure website" title="IBEX : Interactive brochure website"' +
       			          'width="260" height="100"' +
       			          'class="feature_images" />' +
       			          '<div id="feature_work_col_inner_10" class="feature_work_col_inner">' +
       			          '<p class="feature_work_image_title">IBEX Vehicles</p>' +
       			          '<p class="feature_work_image_subtitle">Interactive brochure website</p>' +
       			          '<p class="feature_work_image_p">Build awareness and provide information for ths unique family of ' +
       			          'all terrain vehicles.</p>' +
       			          '<p class="feature_work_image_p">A dynamic website allows interaction with the audience and allows ' +
       			          'the many facets of this vehicle to be promoted.</p>' +
       			          '<a class="portfolio_work_link" href="http://www.ibexvehicles.com/">+ view site</a>' +
                		  '</div>');

feature_work_array[11] = new Array('fwc_11',
		 				  '<img src="images/portfolio/mpilot_icsmsu_cms.jpg"' +
       				 	  'alt="ICSMSU : Content management website" title="ICSMSU : Content management website"' +
       				 	  'width="260" height="100"' +
       				 	  'class="feature_images" />' +
       				 	  '<div id="feature_work_col_inner_11" class="feature_work_col_inner">' +
       				 	  '<p class="feature_work_image_title">Imperial College School of Medicine</p>' +
       				 	  '<p class="feature_work_image_subtitle">Content management website</p>' +
       				 	  '<p class="feature_work_image_p">Large amounts of data and frequent updates, ' +
       				 	  'required a content management system to be deployed. Bespoke features were developed ' +
       				 	  'allowing integration of the site login with the main college database. Facebook applications ' +
       				 	  'were developed to allow integration of social networking.</p>' +
       				 	  '<a class="portfolio_work_link" href="http://www.icsmsu.com/">+ view site</a>' +
                		  '</div>');

window.addEvent('domready', function() {
	var prev_image = new Image(50, 80);
	prev_image.src = 'images/mpilot_prev_arrow_on.png';
	var next_image = new Image(50, 80);
	next_image.src = 'images/mpilot_next_arrow_on.png';
	
	var prev = $('feature_button_prev');
	var next = $('feature_button_next');
	var wall = $('feature_work_main_inner');
	
	$('fwc_4').set({'id': feature_work_array[feature_work_array.length - 1][0],
		        'html': feature_work_array[feature_work_array.length - 1][1]
	           });
	$('fwc_0').set('html', feature_work_array[0][1]);
	$('fwc_1').set('html', feature_work_array[1][1]);
	$('fwc_2').set('html', feature_work_array[2][1]);
	$('fwc_3').set('html', feature_work_array[3][1]);
	
	var setVerticalSlideOn = function(i) {
		eval('$(\'feature_work_col_inner_' + i + '\').addEvents({' +
	    	 '\'mouseenter\': function(){' +
	    	 '$(\'feature_work_col_inner_' + i + '\').get(\'tween\', {property: \'height\', duration: 500}).start(\'145px\');' +
	    	 '},' +
	    	 '\'mouseleave\': function(){' +
	    	 '$(\'feature_work_col_inner_' + i + '\').get(\'tween\', {property: \'height\', duration: 1000}).start(\'45px\');' +
	    	 '}' +
	    	 '});');
	}
	
	for (var i = 0; i <= 3; i++) {
		setVerticalSlideOn(i);
	}
	setVerticalSlideOn(feature_work_array.length - 1);
	
	var prevClick = function(){
		prev.set('src', prev_image.src);
		var wall_left_orig = wall.getStyle('left').toInt();
		wall_left_new = wall_left_orig - 300;
		wall_left_new = wall_left_new + 'px';
		var old_id_int = wall.getFirst('div').get('id').replace('fwc_', '').toInt();
		var new_id_int = old_id_int - 1;
		if (feature_work_array[new_id_int] == undefined) {
			new_id_int = feature_work_array.length - 1;
			var new_id = feature_work_array[feature_work_array.length - 1][0];
		} else {
			var new_id = feature_work_array[new_id_int][0];
		}
		var last = wall.getLast('div');
		last.set('id', new_id);
		last.set('html', feature_work_array[new_id_int][1]);
		last.inject(wall, 'top');
		setVerticalSlideOn(new_id_int);
		wall.setStyle('left', wall_left_new);
		prev.removeEvent('click', prevClick);
		next.removeEvent('click', nextClick);
		wall.get('tween', {property: 'left', duration: 2000}).start(wall_left_orig).chain(function(){
			prev.addEvent('click', prevClick);
			next.addEvent('click', nextClick);
			prev.set('src', 'images/mpilot_prev_arrow_off.png');
		});
	}
	
	var nextClick = function(){
		next.set('src', next_image.src);
		var wall_left_orig = wall.getStyle('left').toInt();
		wall_left_new = wall_left_orig + 300;
		wall_left_new = wall_left_new + 'px';
		var old_id_int = wall.getLast('div').get('id').replace('fwc_', '').toInt();
		var new_id_int = old_id_int + 1;
		if (feature_work_array[new_id_int] == undefined) {
			new_id_int = 0;
			var new_id = 'fwc_0';
		} else {
			var new_id = feature_work_array[new_id_int][0];
		}
		var first = wall.getFirst('div');
		first.set('id', new_id);
		first.set('html', feature_work_array[new_id_int][1]);
		first.inject(wall, 'bottom');
		setVerticalSlideOn(new_id_int);
		wall.setStyle('left', wall_left_new);
		prev.removeEvent('click', prevClick);
		next.removeEvent('click', nextClick);
		wall.get('tween', {property: 'left', duration: 2000}).start(wall_left_orig).chain(function(){
			prev.addEvent('click', prevClick);
			next.addEvent('click', nextClick);
			next.set('src', 'images/mpilot_next_arrow_off.png');
		});
	}
	
	prev.addEvent('click', prevClick);
	
	next.addEvent('click', nextClick);

});