/* Image w/ description tooltip v2.0
* Created: April 23rd, 2010. This notice must stay intact for usage 
* Author: Dynamic Drive at http://www.dynamicdrive.com/
* Visit http://www.dynamicdrive.com/ for full source code
*/


var ddimgtooltip={

	tiparray:function(){
		var tooltips=[]
		//define each tooltip below: tooltip[inc]=['path_to_image', 'optional desc', optional_CSS_object]
		//For desc parameter, backslash any special characters inside your text such as apotrophes ('). Example: "I\'m the king of the world"
		//For CSS object, follow the syntax: {property1:"cssvalue1", property2:"cssvalue2", etc}

		tooltips[0]=["http://i26.tinypic.com/bezcp5.jpg", "Hisham Zubeidi, M.D and founding director of MIT, <br />having completed an apprenticeship in Engineering, he <br />worked in industry before embarking on a change of<br /> career by entering the education sector. Having seen <br />the widely acclaimed success of Motor Industry Training<br /> Hisham oversaw the company's expansion into new <br />sectors whilst keeping the same ethos that brought <br />success.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[1]=["http://i26.tinypic.com/bezcp5.jpg", "Mike started as an apprentice at Vauxhall and <br/>progressed to become body & refinishing manager<br/> whilst teaching motor vehicle in the local <br/>Technical College. He progressed to become Dean <br/>of School at the college where he represented the<br/> college on many education committees and carried<br/> out consultancy work for a number of awarding <br/>bodies. He later joined a large training provider<br/> as a manager of their training school & he joined<br/> MIT in 2007 and is responsible for the delivery <br/>and quality control of all its programmes of <br/>study.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[2]=["http://i26.tinypic.com/bezcp5.jpg", "Richard has worked in the motor industry for the<br/> last 32 years. He has worked in all avenues of <br/>the trade, starting of in the parts department <br/>and progressing through the vehicle workshop and<br/> body shops. He has been involved in race and <br/>rally car preparation. He finished his hands on<br/> experience when he owned his own garage in <br/>Sussex. He joined MIT at it's inception in 1998 <br/>and is now the Centre Coordinator and Lead<br/> Internal Verifier.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[3]=["http://i26.tinypic.com/bezcp5.jpg", "Chris has been in the training industry for 15 <br/>years and started as a lecturer in IT, then <br/>Centre Management, IT Management and progressed<br/> into Contract Management. His main job role <br/>within MIT is to liaise with funding bodies to<br/> ensure MIT learners get the resources they <br/>require.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[4]=["http://i26.tinypic.com/bezcp5.jpg", "Holly joined MIT Skills in December 2009 after working <br/> for Toni & Guy for 10 years; her role involves managing <br/> the department as well as lecturing and assessing. She has <br/> been working in the hairdressing industry for 14 years and <br/> has been involved in delivering training to Apprentices and <br/> trainees for 8 years. Holly has a degree in Business Management, <br/> is a qualified Assessor and is trained up to Level 3 in Hairdressing..", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[5]=["http://i26.tinypic.com/bezcp5.jpg", "Ian joined MIT from the electrical contracting industry in<br/> 2009 as the Construction Manager; he is a qualified electrician<br/> and installation designer who prior to joining us was Quality<br/> Manager and NICEIC qualifying supervisor for one of the leading<br/> contractors in the South East. Ian is responsible for training<br/> delivery for electrical installation, plumbing and the <br/>construction trades", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[6]=["http://i26.tinypic.com/bezcp5.jpg", "Clive is Head of Motor Vehicle and has had many years <br/>experience in the Trade. He has been a Service Manager with <br/>a Mercedes Benz Dealership and run his own business restoring <br/>Classic British Sports Cars. He moved into teaching some six <br/>years ago to try and give something back to the Apprenticeship <br/>program. He finds this a very rewarding part of his career and <br/>gives him pleasure to see young people establish themselves in <br/>this business. He also writes courses for MIT so they can run <br/>training for experienced Technicians.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[7]=["http://i26.tinypic.com/bezcp5.jpg", "John joined MIT Skills in 2010 and has 40 years <br/> Engineering & Manufacturing industry experience <br/> with the last 15 years within apprenticeship <br/>training and development. He holds City & Guilds <br/>D32, D33 (A1) assessor and EAL D34 (V1) verifier <br/>awards and is a National Skills Academy for <br/>manufacturing accredited assessor/trainer for <br/>business Improvement techniques.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[8]=["http://i26.tinypic.com/bezcp5.jpg", "Lynne is Office/Quality Manager for MIT and has worked <br/>for the company for the last 6 years. Lynne has 7 years <br/>experience of the training industry working in administration <br/>and as a tutor in computer training and before that worked in <br/>the travel industry. Lynne works hard at keeping staff on track <br/>by keeping policy and procedures up to date and making sure that <br/>MIT get paid by the funding body.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[9]=["http://i26.tinypic.com/bezcp5.jpg", "Dhiraj is an NVQ Assessor in Light Vehicles Technicians <br/> and Customer Service. Has been with MIT for just over 2 years. <br/>Dhiraj has over 30 years of experience, since 14yrs of age, <br/>within the motor industry. His range of qualifications include <br/>Diploma in Automobile Engineering and NVQ Level 4 in management. <br/>He worked in parts, service and bodyshop from mechanic to parts <br/>person and then as manager, in small independent outlets and <br/>large main dealers. Has been in the training sector as Assessor <br/>for over 6 years.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[10]=["http://i26.tinypic.com/bezcp5.jpg", "Andy has worked with MIT for three years in the business<br/>development department working with and helping business <br/> who take on new learners and to make sure they are a safe <br/> environment to work in. He has IOSH H & S qualification <br/> and has 5 years experience working in this area. Andy <br/> also works very closely with local schools and careers <br/> advisors to help direct new learners towards the right <br/> career path.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[11]=["http://i26.tinypic.com/bezcp5.jpg", "Richard is the Senior Administrator with MIT. Richard has over <br/>12 years experience as an administrator in the training industry. <br/>He has gained qualifications in Administration and Customer Service <br/>and before joining MIT has worked on a variety of programmes helping <br/>learners with different needs.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[12]=["http://i26.tinypic.com/bezcp5.jpg", "Phil has been with MIT for 4 years and has over 30 years<br/>motor trade experience behind him. He started as an Apprentice <br/>and has worked in body shops, parts retail out lets, service<br/>reception, a data provider and a car auction before joining MIT.<br/>Phil has gained his Cert Ed and A1 award since joining us and has <br/>helped many learners achieve their level 2 and level 3 qualifications.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[13]=["http://i26.tinypic.com/bezcp5.jpg", "For the past five years Martin has been  <br/>working within in the motor vehicle training  <br/>sector. He completed his apprenticeship some  <br/>30 years ago and has worked for various garages  <br/>from technician to workshop foreman, he has always <br/>had a passion for motor.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[14]=["http://i26.tinypic.com/bezcp5.jpg", "Jeff is the learner support officer and has <br />been involved with training people for most <br />of his life in some form or other. He qualified <br />as a lecturer in engineering in 1999 and has <br />worked in colleges and schools before joining <br />MIT when they first started running their own <br />courses. As Learner Support Officer his role <br />involves monitoring the progress of MIT learners<br />and is there to help sort out any problems they may have.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[15]=["http://i26.tinypic.com/bezcp5.jpg", "Natalie joined MIT Skills <br />in October 2009 not long after she left school. She is <br /> currently doing a level 2 Apprenticeship in Business <br /> Administration. She works as an office junior in the<br />main office and hopes to become a fully qualified administrator.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[16]=["http://i26.tinypic.com/bezcp5.jpg", "Derek Shelley has been with MIT for the last <br/> 18 months as a Lecturer and Assessor. Derek’s <br/> experience varies from training 14-19 year olds, <br/> workshop controller (Heavy and light vehicles) <br/> and vehicle technician.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[17]=["http://i26.tinypic.com/bezcp5.jpg", "Doug has been a Lecturer with MIT for 5 years <br/> he has had a number of positions in the motor <br/> trade in 38 years including Technician, Supervisor,<br/> Garage Manager, Customer Care Manager, Works Controller,<br/> Parts Technical Supervisor, and Welding Coordinator. <br/> He has taught at every level in the motor trade from <br/> Apprentices to Managers and has worked in training for <br/> 12 years of his motor trade career.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		tooltips[18]=["http://i26.tinypic.com/bezcp5.jpg", "James is the work shop Technician at M.I.T. <br/> and has been in the motor trade for 4 years. <br/> He started out as an E2E student at M.I.T,then <br/> progressed to do his NVQ level 2 and NVQ level 3 <br/>while working in a garage full time to complete the qualification.", {background:"#FFFFFF", color:"black", border:"5px ridge darkblue", font:"bold 10px Arial"}]
		
		return tooltips //do not remove/change this line
	}(),

	tooltipoffsets: [20, -30], //additional x and y offset from mouse cursor for tooltips

	//***** NO NEED TO EDIT BEYOND HERE

	tipprefix: 'imgtip', //tooltip ID prefixes

	createtip:function($, tipid, tipinfo){
		if ($('#'+tipid).length==0){ //if this tooltip doesn't exist yet
			return $('<div id="' + tipid + '" class="ddimgtooltip" />').html(
				'<div style="text-align:center"><img src="' + tipinfo[0] + '" /></div>'
				+ ((tipinfo[1])? '<div style="text-align:left; margin-top:5px">'+tipinfo[1]+'</div>' : '')
				)
			.css(tipinfo[2] || {})
			.appendTo(document.body)
		}
		return null
	},

	positiontooltip:function($, $tooltip, e){
		var x=e.pageX+this.tooltipoffsets[0], y=e.pageY+this.tooltipoffsets[1]
		var tipw=$tooltip.outerWidth(), tiph=$tooltip.outerHeight(), 
		x=(x+tipw>$(document).scrollLeft()+$(window).width())? x-tipw-(ddimgtooltip.tooltipoffsets[0]*2) : x
		y=(y+tiph>$(document).scrollTop()+$(window).height())? $(document).scrollTop()+$(window).height()-tiph-10 : y
		$tooltip.css({left:x, top:y})
	},
	
	showbox:function($, $tooltip, e){
		$tooltip.show()
		this.positiontooltip($, $tooltip, e)
	},

	hidebox:function($, $tooltip){
		$tooltip.hide()
	},


	init:function(targetselector){
		jQuery(document).ready(function($){
			var tiparray=ddimgtooltip.tiparray
			var $targets=$(targetselector)
			if ($targets.length==0)
				return
			var tipids=[]
			$targets.each(function(){
				var $target=$(this)
				$target.attr('rel').match(/\[(\d+)\]/) //match d of attribute rel="imgtip[d]"
				var tipsuffix=parseInt(RegExp.$1) //get d as integer
				var tipid=this._tipid=ddimgtooltip.tipprefix+tipsuffix //construct this tip's ID value and remember it
				var $tooltip=ddimgtooltip.createtip($, tipid, tiparray[tipsuffix])
				$target.mouseenter(function(e){
					var $tooltip=$("#"+this._tipid)
					ddimgtooltip.showbox($, $tooltip, e)
				})
				$target.mouseleave(function(e){
					var $tooltip=$("#"+this._tipid)
					ddimgtooltip.hidebox($, $tooltip)
				})
				$target.mousemove(function(e){
					var $tooltip=$("#"+this._tipid)
					ddimgtooltip.positiontooltip($, $tooltip, e)
				})
				if ($tooltip){ //add mouseenter to this tooltip (only if event hasn't already been added)
					$tooltip.mouseenter(function(){
						ddimgtooltip.hidebox($, $(this))
					})
				}
			})

		}) //end dom ready
	}
}

//ddimgtooltip.init("targetElementSelector")
ddimgtooltip.init("*[rel^=imgtip]")
