/* 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]=["info.gif", "What loved one wouldn't succumb to the temptation of this box filled with three layers of luscious chocolates? Unless you choose otherwise, the uppermost layer is an assortment of 12 heart-shaped chocolates, including milk chocolate Supreme with hazelnut praline, black Mystique vanilla Bourbon caramel, white Toquade filled with chocolate ganache, and red Amore ganache scented with bergamot, flavors designed to appeal to those with the most refined taste. The middle layer is filled with 15 signature numbered chocolates, 0 through 11 plus three Z chocolates, and the last layer is another 15 praline chocolates. This little treasure chest of polished mahogany comes embellished with an inlaid golden heart and another wooden heart on the drawstring of the bag enclosing it, sure to captivate before it's even opened. Add to the allure by engraving a few words on a brass plate affixed to the box.", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[1]=["info.gif", "The wise words, 'What use are cartridges in battle? I always carry chocolate instead.' penned by George Bernard Shaw (1856-1950), are etched in French on the side of this lovely mahogany box, which carries with it a 15-chocolate assortment of proprietary zChocolat recipes. Should it serve you better, you can personalize your chocolate assortment by selecting a more exotic combination assortment, all pralines, all milk or dark chocolates, or you can substitute 20 orangettes, 40 chocamandines, 14 truffles or a supply of 12 colorful hearts. A sincere acknowledgement of respect or gratitude, this polished mahogany box can be customized with an engraving of a name, date or message of your choice.", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[2]=["info.gif", "Do you know someone whose spirit needs mending or whose body needs time to heal? This Survival Pack will help them through. The perfect pick-me-up for any of life's challenges, this pack can be customized to include an assortment of all 15 numbered zChocolates, or all pralines, milk or dark chocolates, chocamandine, orangettes, truffles or a mix of festive colored hearts. A red flashlight keychain with a compass and whistle is also included in each box. There's nothing quite like this chocolate prescription from zChocolat to ease any pain, any worry... and replace it with a smile.", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[3]=["info.gif", "The perfect wedding favor or dinner party gift, this all-natural basswood box contains four of our favorite chocolates. Discover our famous Z chocolate, a combination of a crunchy pralinï ½ with a sweet and salty caramel, followed by number 0, a slow-roasted hazelnut-almond pralinï½, number 1, a vanilla ganache infused with lavender, and number 2, an unforgettable Italian gianduja pralinï ½.", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[4]=["info.gif", "Adorned with a serigraph of the Pont Neuf in 1845 and a quote* in French by Stendhal (1783-1842), this grand mahogany box is filled with an impressive 45 chocolates. Each of the three layers can contain all 15 numbered zChocolates or all pralines, milk, or dark chocolates, or 20 orangettes, 40 chocamandines, 14 truffles or 12 heart-shaped chocolates. Savor this amazing variety of subtle pralines and rich, decadent ganaches or crunchy chocamandines, while contemplating the words of Stendhal on chocolate and water impressed on the side of the box. This is a truly unique and memorable gift for lovers of literature and lovers of fine chocolate alike. (*) Rassi is going to have someone poison Fabrice who is at the citadel. Put some chocolate in your pocket and take along a bottle of water. Go up to the citadel and give me back my life by telling the General Fabio Conti that you will break up with his daughter if he does not let you give this water and chocolate to Fabrice in person.", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[5]=["info.gif", "When the simplest thought of your love brings a smile to your face, let it show with this striking assortment of 12 heart-shaped chocolates with a bold 'Z' cut on top. Included are milk chocolate Supreme with hazelnut praline, black Mystique vanilla Bourbon caramel, white Toquade filled with chocolate ganache, and red Amore ganache scented with bergamot. These sensuous hearts are presented within the embrace of an elegant mahogany box bearing a gold inlaid heart, handcrafted as exquisitely as the chocolates. You can even add a short engraved message on a brass plate. The box, the wooden heart on the drawstring pouch, and the chocolates are made in France using traditional finger-joint assembly for the box, hand carving for the heart, and zealous adherence to purity for the chocolates: all-natural ingredients, no preservatives, very little sugar, no alcohol and 100% pure cocoa butter. A gift as pure and enduring as your love, the Touchï¿½ box can be refilled with any assortment of zChocolates... to entice your recipient into falling in love over and over again.", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[6]=["info.gif", "Sputnik-15 will help you embark on a first foray into our zChocolate selection. Choose your assortment: a traditional or a more exotic assortment of 15 numbered zChocolates, all pralines, milk or dark chocolates, 20 orangettes, 40 chocamandines, 14 truffles or 12 hearts. The chocolates will be efficiently packaged in a reflective silver-colored box ideal for sampling or a clever and appealing gift.", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[7]=["info.gif", "Twice the size of Sputnik-15, this shining silvery box in the Star Collection leads you to the discovery of even more of our unique and out-of-this-world chocolates. By including not one, but two layers of 15 chocolates, even the most devoted chocolate enthusiast can comfortably share the ethereal taste experience... or not. Both layers are customizable to include 15 more traditional or more exotic numbered zChocolates or all pralines, milk or dark chocolates. Alternatively, each layer can hold 20 orangettes, 40 chocamandines, 14 truffles or 12 hearts. Learn how to customize the assortment of this box.", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[8]=["info.gif", "Celebrating a successful launch? Throwing a huge party? Trying to wow someone with a truly stellar gift? Take them on a voyage of chocolate discovery with the radiant Luna box, which packs 4 layers of chocolates, ensuring enough chocolate to fuel your plan. Customize each layer to hold an assortment of 15 more traditional or more exotic numbered zChocolates or all pralines, milk or dark chocolates. Alternatively, each can hold 20 delectable orangettes, 40 inviting chocamandines, 14 heavenly truffles or 12 memorable hearts.", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[9]=["info.gif", "Enchant any gathering of discriminating chocoholics by presenting this sensational mixture of chocolates snuggled in bags of gold and chocolate brown satin within an exquisite polished mahogany box that's even customizable with an image. As pleasing to the eye as to the palate, this zBox covers the range of exotic flavors and exceptional textures zChocolat has to offer--including our truffles--as part of the same gift. Its contents are an assortment of 16 dark, milk and white Z chocolates, another of the 15 numbered chocolates in combo 1, our more traditional recipes, plus an extra Z chocolate, a bag of 14 divinely rich hazelnut praline truffles and another of 65 delectable chocolate covered almonds (chocamandines). This veritable feast for the senses will nourish an unforgettable chocolate tasting experience.", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[10]=["info.gif", "When you want to give the best but can't decide, send this mahogany zBox filled with every single piece of chocolate perfected by zChocolat. The luxurious box is hand crafted in France with the same exquisite attention to detail as our chocolates, and can be customized with an image and a message of your choice. Tucked within the box, the dazzling array of chocolates is sorted into nine selections in individual satin bags, which can be opened to savor individually, sample all together, or even give as separate gifts. The selections are 16 assorted dark, milk and white Z chocolates, another bag of combo 1, our more traditional numbered chocolate recipes plus an extra Z chocolate, 16 all dark chocolates, 16 all milk chocolates, 16 assorted heart-shaped chocolates, 14 truffles, 65 chocamandines, 25 orangettes, and 16 assorted dark, milk, and white chocolate mendiants, a traditional confection of Provence decorated with candied fruit and nuts.", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[11]=["info.gif", "Perfect for discriminating tastes, this deluxe mahogany box is filled with Christmas confections from Provence. A departure from common gift baskets, the hand crafted zBox is filled with four elegant drawstring satin bags, each containing very special chocolates. One satin bag is filled with traditional numbered chocolate recipes, and an additional Z chocolate. Another bag contains 14 rich hazelnut praline French truffles and a third, 65 delectable chocolate covered almonds (chocamandines). Evoking festive European traditions, the last bag contains 16 assorted dark, milk, and white chocolate mendiants, a holiday confection of Provence that's decorated with candied fruit and nuts. Whether parceled out as individual gifts to those dreaming of these memorable confections or presented with a flourish at a holiday gathering, this zBox brings a twinkle to the eye and exclaims, 'Happy Christmas to all!", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[12]=["info.gif", "Arouse the senses and fulfill every desire for the most romantic, decadent chocolates in the world with this richly polished mahogany box filled with a cache of zChocolat's most beloved chocolate selections. Nestled within four luxurious red and white satin pouches is a dizzying assortment of 16 rich and mouth-watering heart-shaped chocolates romantically stamped with a Z on top, 15 exquisite French hazelnut praline truffles, one of each of zChocolat's signature chocolates Z through 15, and 65 chocamandines! Handmade with loving attention to every last elegant detail, including a heart-shaped cutout and the option of a personalized message on a brass plate, this indulgent gift box is a standout among traditional Valentine's Day chocolate gifts and one that will be impossible to resist.", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[13]=["info.gif", "A very romantic gift, the Touchï¿½ x2 is a double trove of chocolates snuggled together inside a polished mahogany box. One of the assortments is a lovely combination of 12 heart-shaped chocolates (milk chocolate Supreme with hazelnut praline, black Mystique vanilla Bourbon caramel, white Toquade filled with chocolate ganache, and red Amore ganache scented with bergamot). It's paired with a combination of 15 of our signature milk and dark numbered chocolates. The lid of the box displays a cut-away golden heart, which is echoed by a carved wooden heart on the drawstring bag enclosing the gift. For an enduring memento of your affection, add a brass plate to share a sentiment in an engraving, like 'just for you from me'.", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[14]=["info.gif", "Decorated for the holidays, this Christmas-themed mahogany box will delight any lover of unique gourmet treats. Presenting 15 of our numbered zChocolat recipes or a personalized chocolate assortment of your choice, the box is wrapped in our elegant gold wrapping paper and enclosed in a sophisticated black satin drawstring bag. Wonderful French touches of a lavender sachet and an etching on the side (the quote featured on our Wisdom box) complete the presentation. Everything in this gift, from the chocolates and box to the wrapping, is handmade. A wonderful way to acknowledge anyone important to you over the holidays, this gift box can also be engraved with a message of your choice. Both the lavender sachet and the handmade wrapping are complimentary with this pack (a $16 value).", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[15]=["info.gif", "Adorned with a serigraph of the Notre Dame cathedral in 1650 and a quote* by Honorï¿½ de Balzac (1799-1850) in French (on thieves and chocolate, no less!), this lovely mahogany box is filled with two layers of the ultimate in fine French chocolate. Impress your gift recipient by customizing each layer to contain a traditional or more exotic assortment of 15 zChocolates or all pralines, milk, or dark chocolates. Alternatively, each can hold 20 orangettes, 40 chocamandines, 14 truffles or 12 colorful heart-shaped chocolates. Further personalize the gift by including an engraving of a name or special date or message. This is the perfect way to commemorate a romantic honeymoon, a special anniversary or a birthday that arrived almost before you knew it. Once the chocolates have been sampled, refill the box with options from our Sampler and Refill Collection.(*) 'The next morning, after nightfall, eleven devoted companions hoisted themselves up to the cliff-top, each of them carrying a dagger, a ration of chocolate and all the tools needed for the house-breaker's trade.", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[16]=["info.gif", "", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[17]=["info.gif", "", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[18]=["info.gif", "", {background:"#ffffff", width:"200px", font:"11px Arial"}]
		tooltips[19]=["info.gif"]
		tooltips[14]=["../dynamicindex17/bridge.gif", "Bridge to somewhere.", {background:"white", font:"bold 12px 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]")
