/* 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}

		//Index page news menu_button
		tooltips[0]=["http://www.mandrmarine.com/R301011/images/news_images/factory_hub.jpg", "Being loyal to the policy of getting closer to its customers, retail network,<br />minimize the transportation costs and end prices, the world class Marine <br /> and Safety Equipment Manufacturer from Greece, Lalizas launches a brand new and fully operational Logistics Center pallet storage slots in Belgium, Europe. ",
					 {background:"#DDECFF", width:"500px", color:"black", border:"5px ridge darkblue"}]
		
		//Index Page   MEET US          menu_button
		tooltips[1]=["http://www.mandrmarine.com/R301011/images/news_images/meetus_map.jpg", "Want to meet us ? <BR /> We will be calling here in late Oct Early November",
					 {background:"#FFFFFF", color:"black", border:"5px ridge darkblue"}]
		
		//Index Page offers menu_button
		tooltips[2]=["http://www.mandrmarine.com/R301011/images/advert_images/C7001040570_main.jpg", "Special Offer Now <br /> Only €53.82",
					 {background:"#FFFFFF", color:"black", border:"5px ridge darkblue"}]

		
    	//Index Home boats menu_button
		tooltips[3]=["http://www.mandrmarine.com/R301011/images/index-home-boats.jpg",
					"M and R Marine Ltd <br /> are proud to introduce to you it's range for 2011/12 and onwards <br /> Yachts : A fine range of quality yachts starting with the Skipper 650 and Arion 29 and for 2012 from the <br /> family run company of Northman the brand new Maxus range of yachts from 21ft up to 33ft. <br /> Power : We can provide you with a power boat to suit your needs and budget be it a 6m sports boat up to a 40ft flybridge - whatever your heart's desire.",
					{background:"#DDECFF", width:"400px", color:"black", border:"5px ridge darkblue"}]
		
		//Index Home chandlery menu_button
		tooltips[4]=["http://www.mandrmarine.com/R301011/images/shop.jpg", "For all of Your Chandlery Needs <BR /> We supply life jackets fenders shackles - you name it - nationwide next day delivery Only €10.00",
					{background:"#FFFFFF", width:"220px", color:"black", border:"5px ridge darkblue"}]
		
		//Index Home services menu_button
		tooltips[5]=["http://www.mandrmarine.com/R301011/images/lifejackets.jpg", "We will service your life jackets, flares <BR /> Life Raft, RIB and Outboard",
					{background:"#FFFFFF", width:"220px", color:"black", border:"5px ridge darkblue"}]
		
		//Index Home charter menu_button
		tooltips[6]=["http://www.mandrmarine.com/R301011/images/charter.jpg", "We have partnered with one of the biggest Polish chartering companies satisfying 8000 clients annually. <BR /> Why not enjoy a different holiday to the usual hum drum experience",
					  {background:"#FFFFFF", width:"220px", color:"black", border:"5px ridge darkblue"}]
				
		//tooltips[6]=["R301011/images/lifejackets.jpg", "We will service your <BR />life jacket<BR />flare disposal<BR />Life Raft<BR />Outboard Engine",
					//{background:"#FFFFFF", width:"420px" color:"black", border:"5px ridge darkblue"}]
		
		//tooltips[3]=["http://www.mandrmarine.com/R301011/images/charter.jpg", "We have partnered with one of the biggest Polish chartering companies satisfying 8000 clients annually. <BR /> Why enjoy a different holiday to the usual hum drum experience",
					  //{background:"#FFFFFF", width:"220px", color:"black", border:"5px ridge darkblue"}]
		
		//Yachts Page SK 650C menu_button
		tooltips[7]=["http://www.mandrmarine.com/R301011/images/yachts/sk650c_1.jpg",
					"Skipper Yacht SK650c<br /> 4 Berth Trailer Sailer",
					{background:"#FFFFFF", width:"160px", color:"black", border:"5px ridge darkblue"}]

		//Yachts Page SK A29C menu_button
		tooltips[8]=["http://www.mandrmarine.com/R301011/images/yachts/ska29c_1.jpg",
					"Skipper Yacht SKA29c<br /> 6 Berth Family Yacht",
					{background:"#DDECFF", width:"160px", color:"black", border:"5px ridge darkblue"}]
		
		//Yachts Page MX 240C menu_button
		tooltips[9]=["http://www.mandrmarine.com/R301011/images/yachts/mx240c_1.jpg", 
					"Northman Yachts MX240C<BR /> 4 Berth Trailer Sailer",
					{background:"#DDECFF", width:"160px", color:"black", border:"5px ridge darkblue"}]

		//Yachts Page MX 280C menu_button
		tooltips[10]=["http://www.mandrmarine.com/R301011/images/yachts/mx280c_1.jpg",
					 "Northman Yachts MX280C<BR /> Family 6 Berth Sailer",
					 {background:"#FFFFFF", width:"160px", color:"black", border:"5px ridge darkblue"}]

		//Yachts Page MX 330C menu_button
		tooltips[11]=["http://www.mandrmarine.com/R301011/images/yachts/mx330c_1.jpg",
					 "Northman Yachts MX330C<BR /> 6 Berth Cruiser Sailer",
					 {background:"#DDECFF", width:"160px", color:"black", border:"5px ridge darkblue"}]

		//Power Page SK 700C menu_button
		tooltips[12]=["http://www.mandrmarine.com/R301011/images/power/sk700w_9.jpg",
					 "Skipper Cruiser SK700c<br /> 2 Berth Walk Around",
					 {background:"#FFFFFF", width:"160px", color:"black", border:"5px ridge darkblue"}]

		//Power Page GL 700W menu_button
		tooltips[13]=["http://www.mandrmarine.com/R301011/images/power/gl700w_9.jpg",
					 "Galeon Cruiser GL700w<br /> 2 Berth Walk Around",
					 {background:"#DDECFF", width:"160px", color:"black", border:"5px ridge darkblue"}]
		
		//Power Page GL 730W menu_button
		tooltips[14]=["http://www.mandrmarine.com/R301011/images/power/gl730w_9.jpg", 
					 "Galeon Cruiser GL730w<BR /> A Quality Sports Cruiser",
					 {background:"#DDECFF", width:"160px", color:"black", border:"5px ridge darkblue"}]

		//Power Page GL 515W menu_button
		tooltips[15]=["http://www.mandrmarine.com/R301011/images/power/gl515w_9.jpg",
					 "Galeon Cruiser GL515w <BR /> Compact Cruiser",
					 {background:"#FFFFFF", width:"160px", color:"black", border:"5px ridge darkblue"}]

		//Power Page GL 530W menu_button
		tooltips[16]=["http://www.mandrmarine.com/R301011/images/power/gl530w_9.jpg",
					 "Galeon Cruiser GL530W <BR /> Bow Rider Cruiser",
					 {background:"#DDECFF", width:"160px", color:"black", border:"5px ridge darkblue"}]

		//Brokerage Page Yacht menu_button
		//tooltips[20]=["../images/brokerage/brokerage.jpg", "Have You Got a Brokerage Yacht For Sale<br /> Call Us Now On<br /> 087 416 9373.",
		tooltips[20]=["http://www.mandrmarine.com/R301011/images/brokerage/brokerage.jpg", "Have You Got a Brokerage Yacht For Sale<br /> Call Us Now On<br /> 087 416 9373.",
					 {background:"#DDECFF", width:"300px", color:"black", border:"5px ridge darkblue"}]
		
		//Brokerage Page Power menu_button
		tooltips[21]=["http://www.mandrmarine.com/R301011/images/brokerage/brokerage_power.jpg", "Have You Got a Brokerage Power Boat For Sale<br /> Call Us Now On<br /> 087 416 9373.",
					 {background:"#DDECFF", width:"300px", color:"black", border:"5px ridge darkblue"}]

		//Brokerage Page Engine menu_button
		tooltips[22]=["http://www.mandrmarine.com/R301011/images/brokerage/brokerage.jpg", "Have You Got a Brokerage Engine For Sale<br /> Call Us Now On<br /> 087 416 9373.",
					 {background:"#DDECFF", width:"300px", color:"black", border:"5px ridge darkblue"}]

		//Brokerage Page Trailer menu_button
		tooltips[23]=["http://www.mandrmarine.com/R301011/images/brokerage/brokerage.jpg", "Have You Got a Brokerage Trailer For Sale<br /> Call Us Now On<br /> 087 416 9373.",
					 {background:"#DDECFF", width:"300px", color:"black", border:"5px ridge darkblue"}]
		
		//Brokerage Page Chandlery menu_button
		tooltips[24]=["http://www.mandrmarine.com/R301011/images/brokerage/brokerage.jpg", "Have You Got Brokerage Chandlery For Sale<br /> Call Us Now On<br /> 087 416 9373.",
					 {background:"#DDECFF", width:"300px", color:"black", border:"5px ridge darkblue"}]
		
		
			//Index page news menu_button
//		tooltips[14]=["http://www.mandrmarine.com/R301011/images/news_images/factory_hub.jpg", "Being loyal to the policy of getting closer to its customers, retail network,<br />minimize the transportation costs and end prices, the world class Marine <br /> and Safety Equipment Manufacturer from Greece, Lalizas launches a brand new and fully operational Logistics Center pallet storage slots in Belgium, Europe. ",
		//			 {background:"#DDECFF", width:"500px", color:"black", border:"5px ridge darkblue"}]
		
		//Index Page events menu_button
		///tooltips[15]=["http://www.mandrmarine.com/R301011/images/news_images/meetus_map.jpg", "Want to meet us ? <BR /> We will be in the Midland area in July",
					// {background:"#FFFFFF", color:"black", border:"5px ridge darkblue"}]
		
		//Index Page offers menu_button
//		tooltips[16]=["http://www.mandrmarine.com/R301011/images/advert_images/C7001040570_main.jpg", "Special Offer Now <br /> Only €53.82",
		//			 {background:"#FFFFFF", color:"black", border:"5px ridge darkblue"}]

//		//Chandlery Page news menu_button
//		tooltips[17]=["http://www.mandrmarine.com/R301011/images/news_images/factory_hub.jpg", "Being loyal to the policy of getting closer to its customers, retail network,<br />minimize the transportation costs and end prices, the world class Marine <br /> and Safety Equipment Manufacturer from Greece, Lalizas launches a brand new and fully operational Logistics Center pallet storage slots in Belgium, Europe. ",
//					 {background:"#DDECFF", width:"500px", color:"black", border:"5px ridge darkblue"}]
		
//		//Chandlery Page events menu_button
//		tooltips[18]=["http://www.mandrmarine.com/R301011/images/news_images/meetus_map.jpg", "Want to meet us ? <BR /> We will be in the Midland area in July",
//					 {background:"#FFFFFF", color:"black", border:"5px ridge darkblue"}]
		
//		//Chandlery Page offers menu_button
//		tooltips[19]=["http://www.mandrmarine.com/R301011/images/advert_images/C7001040570_main.jpg", "Special Offer Now <br /> Only €53.82",
//					 {background:"#FFFFFF", color:"black", border:"5px ridge darkblue"}]

		
		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]")
