/* 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[36]=["styles/images/issue36.png", "<strong>Issue 36</strong><br><br> <strong>The magazine is in its  new, brighter format</strong> - with more pages, more news, your letters and new  features. <br> <strong>Pictured on the cover</strong> is Colin  Donnell, star of Pride and Prejudice: the new musical, which is featured in  this edition.<br> <strong>Also in this edition </strong>-  our writers' verdict on the TV adaptation Lost in Austen; Casanova and Jane -  seduction and romance; and a plea to help find one letter of the alphabet in  Jane's own handwriting", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[39]=["styles/images/issue39.png", "<strong>Issue 39</strong><br>May-Jun 2009<br><br> <strong>A Problem Like Maria</strong> -  The Prince and Mrs Fitzherbert<br> <strong>Pride &amp; Prejudice &amp; Zombies</strong> - Read Joc Bury's review of the controversial new book <br> <strong>Taking A Peek</strong> - Regency erotica  revealed <br> <strong>Jane And Her Juvenilia</strong> - Publishing  Jane's early writing <br> <strong>Pictured on the cover</strong> of the new  issue is Maria Fitzherbert, the not-so-secret wife of the future King George  IV. <br> <strong>Also in this edition</strong> - vote for  the Regency World Awards; the new educational facility at Jane Austen's House  Museum; Maggie Lane looks at openness and reserve in Jane's writing; Tom  Lefroy's enthusiasm for white coats and Tom Jones; and Sue Wilkes on women's  magazines.", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[40]=["styles/images/issue40.png", "<strong>Issue 40</strong><br>Jul-Aug 2009<br><br><strong> Triumphant at Ten</strong> - Jane Austen Centre's first decade <br><strong> Royal Wedding Night Disaster</strong> - The scandal of George and Caroline <br><strong> Jane's Fame</strong> - How Jane Austen conquered the world <br><strong> Global Warming </strong>- What Jane can teach us about climate change <br><strong> Pictured on the cover</strong> is Lizzy, the meeter-and-greeter at the Jane Austen Centre, Bath, one of the most photographed images of the city. <br><strong> Also in this edition:</strong> an exclusive preview of September's Jane Austen Festival; the life and times of Mary Shelley, Frankenstein's creator; and Sir Francis Burdett MP: the dark side of a Regency character.", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[41]=["styles/images/issue41.png", "<strong>Issue 41</strong><br>Sep-Oct 2009<br><br><strong> EMMA: The first official pictures!</strong> -  Exclusive images from the forthcoming BBC series<br><strong> Pride and Pilgrimage</strong> -  Visiting Austen film locations<br><strong> Right Royal Satire</strong> -  Lord Baker's collection of Georgian cariactures<br><strong> Bastards and By-Blows</strong> -  Illegitimacy in Regency times<br><strong> Blogging Jane </strong>-  How might Jane Austen have embraced the internet? <br><strong> Genius, Wit and Taste</strong> -  Maggie Lane continues her series on key concepts in Jane's novels<br><strong> Audio Books </strong>-  Our exciting reader offer<br><strong> Pictured on the cover</strong> is a caricature of George III, from the collection of Lord Baker. <br><strong> Also in this edition:</strong> Regency World Awards - the results, and Matthew Parris, from The Times.", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[42]=["styles/images/issue42.png", "<strong>Issue 42</strong><br>Nov-Dec 2009<br><br><strong> Emma: The Full Story</strong> -  Pictures, interviews, news and gossip from the BBC's new costume drama<br><strong> A Midwinter Night's Dream </strong>-  Carrie Bebris's Mr & Mrs Darcy mystery written exclusively for JARW<br><strong> Regency Christmas</strong> -  How Jane and her family would have marked the festive season<br><strong> The Only Widow in Bath</strong> -  Maggie Lane looks at Jane Austen's treatment of women who had lost their husbands<br><strong> The Other Side of The Regency</strong> -  Sue Wilkes considers how 'ordinary people' survived while the Prince Regent was enjoying the high life<br><strong> Pictured on the cover</strong> are Jonny Lee Miller and Romola Garai, stars of the BBC's new Emma<br><strong> Also in this edition:</strong> Jane Austen Festival round-up; My Jane Austen; plus news from JAS and JASNA.", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[43]=["styles/images/issue43.png", "<strong>Issue 43</strong><br>Jan-Feb 2010<br><br><strong> Sex in the City</strong> - read how London was built on the wages of sin <br><strong> Jane's 'Civil Rogue' </strong>- Maggie Lane looks at the work of the publisher John Murray <br><strong> When the Bubble Burst</strong> - how the South Sea Bubble affected Jane's generation <br><strong> Three Creole Ladies </strong>- Empress Josephine, Fanny Nisbet and Jane Leigh Perrot <br><strong> Figures of Good </strong>- comparing Mansfield Park with Iris Murdoch's A Fairly Honourable Defeat <br><strong> Prince of Prints</strong> - Inside Ackermann's Repository <br><strong> Plus: </strong>test your Austen knowledge with our great new quiz; and all the regular features, including book reviews, My Jane Austen and news from JAS and JASNA", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[44]=["styles/images/issue44.png", "<strong>Issue 44</strong><br>Mar-Apr 2010<br><br><strong> FREE -  your copy of music that was performed when Jane Austen lived in Bath<br> Franz Joseph Haydn </strong>-  the composer describes his visit to Bath in 1794<br><strong> Jane Austen, Music Lover?</strong> - Maggie Lane explores the author's knowledge of music<br><strong> What was on Jane's iPod?</strong> -  David Owen Norris examines some new discoveries<br><strong> Thomas Linley: Mozart's Boyhood Rival</strong> -  The composer who was considered as talented as Mozart<br><strong> Tidings of My Harp</strong> -  Instruments and social status<br><strong> A Golden Time</strong> -  Kelly M McDonald chronicles the work of the Knyvett family<br><strong> Matters of Taste</strong> - Sense and Sensibility examined", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[45]=["styles/images/issue45.png", "<strong>Issue 45</strong><br>May-Jun 2010<br><br><strong> Bright Star</strong> - the story behind Jane Campion's film about John Keats and Fanny Brawne <br><strong> Peterloo Massacre</strong> - what happened when the citizens of Manchester demanded the vote <br><strong> Woman to Woman </strong>- when friendship between two ladies crossed a boundary <br><strong> Cracking the Coade </strong>- the story of Eleanor Coade and her artificial stone <br><strong> How reading aloud</strong> was a popular pastime in Jane Austen's era <br> <strong>Plus </strong>our regular quiz, competition and book reviews, as well as news from Jane Austen societies around the world", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[46]=["styles/images/issue46.png", "<strong>Issue 46</strong><br>Jul-Aug 2010<br><br><strong> Austen or Bronte?</strong> - Maggie Sullivan, editrix of AustenBlog.com, discusses media suggestions that 'Bronte is the new Austen' <br><strong> The Bath Bugabo (or little green man)</strong> - Cathryn Spence, from the American Museum in Bath, writes about an eccentric man who terrified ladies in both Bath and Brighton <br><strong> Where there's a Will</strong> - A look at the final wishes of some of Jane Austen's family <br><strong> Only a Grandmother</strong> - Maggie Lane talks about Jane's treatment of grandparents in her writing <br><strong> Plus </strong>our regular quiz, competition and book reviews, as well as news from Jane Austen societies around the world", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]		
		tooltips[47]=["styles/images/issue47.png", "<strong>Issue 47</strong><br>Sep-Oct 2010<br><br><strong> The Latin Touch</strong> - How Jane's fame is spreading in Brazil <br><strong> A Very Secret Diary</strong> - Anne Lister's love for a woman has been turned into a film <br><strong> A Cornish Exile</strong> - The life and times of Charles Austen, Jane's seafaring brother <br><strong> Jane's Best Jest</strong> - Comparing Emma with Mansfield Park <br><strong> Required reading</strong> - No Georgian gentleman could afford to miss Gentleman's Magazine", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[48]=["styles/images/issue48.png", "<strong>Issue 48</strong><br>Nov-Dec 2010<br><br><strong> All I want for Christmas</strong> - Seasonal Gifts for the Austen fan in your life. <br><strong> Festival comes to town</strong> - Marvellous images from this year's Jane Austen Festival, Bath. <br><strong> Sex Appeal in the novels </strong>- Discover which of Jane Austen's Character's have it... <br><strong> Royal Crescent Hotel, Bath</strong> - The pleasure of working in a Georgian building. <br><strong> Thanks for all the fish</strong> - Do Douglas Adams and Jane Austen have much in common?", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[49]=["styles/images/issue49.png", "<strong>Issue 49</strong><br>Jan-Feb 2011<br><br><strong> Sense and Sensibility at 200 </strong>-  leading writers look at the history, relevance, importance and morality in Jane Austen's first published novel. <br><strong> Festival comes to town </strong>-  Marvellous images from this year's Jane Austen Festival, Bath. <br><strong> What price Paradise?</strong> -  life as a Jewish person in Regency England<br><strong> Wives by Advertisement</strong> -  the risks and rewards of Georgian lonely hearts' adverts. <br><strong> Jane Austen and Robert Burns</strong> -  what she really thought about the Scottish poet.", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[50]=["styles/images/issue50.png", "<strong>Issue 50</strong><br>Mar-Apr 2011<br><br><strong> JARW at Fifty</strong> - The Jane Austen community worldwide celebrates the 50th edition of Jane Austen's Regency World <br><strong> Sandy Lerner interview </strong>- The entrepreneur who rescued Chawton House speaks exclusively about the pleasure and pain of such a significant project <br><strong> Regency royal weddings </strong>- What Prince William and Kate Middleton can learn from Georgian nuptials <br><strong> Home comforts </strong>- Maggie Lane on how Jane Austen's books show how ideas about the home were changing. <br><strong> Clerical fathers</strong> - Contrasting the lives of George Austen and Patrick Brontλ.", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[51]=["styles/images/issue51.png", "<strong>Issue 51</strong><br>May-Jun 2011<br><br><strong> <strong>Americans in Bath</strong> - Celebrating 50 years of the American Museum in Britain.<br> <strong>Battle wounds and bedlam</strong> - Living  with illness in Georgian times.<br> <strong>Loitering with James</strong> - Maggie Lane asks if Jane Austen helped her brother with his periodical, <em>The Loiterer</em>.<br> <strong>Amanda Vickery interview</strong> - Meet the academic who has brought the Georgians to life on TV.<br> <strong>Correspondence culture</strong> - Kelly M McDonald on the art of letter writing.", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[52]=["styles/images/issue52.png", "<strong>Issue 52</strong><br>Jul-Aug 2011<br><br> <strong>Preview of the Jane  Austen Festival</strong>, taking place in Bath in September<br> <strong>Painting a play</strong> - Somerset  Maugham's fantastic collection of Georgian theatrical paintings is safe<br> <strong>Jane's forgotten brother</strong> - What  became of George Austen?<br> <strong>How the seaside</strong> is depicted in  Jane Austen's novels<br> <strong>The day rioters attacked</strong> the Lunar Society of Birmingham<br> <strong>How did Cassandra Austen</strong> handle  her sister's legacy, and how will ours be handled when we are gone?", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[53]=["styles/images/issue53.png", "<strong>Issue 53</strong><br>Sep-Oct 2011<br><br> <strong>Jane Austen and Kate Middleton </strong>- how they are related.<br> <strong>Stetsons for JASNA</strong> as members  prepare to gather in Texas.<br> <strong>Gorgeous Gainsborough</strong> - a new  exhibition of the portraitist's landscapes.<br /> <strong>Dealing with illness and death</strong> in  the Regency era.<br> <strong>How Jane Austen uses characters</strong> overhearing conversations as a literary device.<br> <strong>The bird man of Lyme Regis</strong> and his incredible drawings.", {width:"350px", background:"#fcfcfc", font:"12px Arial"}]
		tooltips[54]=["styles/images/issue54.png", "<strong>Issue 54</strong><br>Nov-Dec 2011<br><br> <strong>Andrew Davies </strong>reveals to the JASNA conference how he 'sexed-up' Pride & Prejudice.<br> <strong> A new series of Garrow's Law,</strong> the Georgian courtroom drama, hits the TV screens.<br> <strong> The Night Before Christmas </strong> - seasonal writing from 1800s America.<br /> <strong> Stunning pictures</strong> from the Jane Austen Festival in Bath.<br> <strong>Do the men </strong>in Sense & Sensibility disappoint, asks Maggie Lane.<br> <strong> Take a new look</strong> at the events that led to the start of the Regency.", {width:"350px", background:"#fcfcfc", font:"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]")
