/* 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]=["#", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[1]=["images/image-a002.GIF", "Hn.B.L.Joshi (Governer, Uttar Pradesh)", {background:"white", font:"bold 12px Arial", border:"1px ridge darkblue", width:"100px"}]
		tooltips[2]=["images/image-a001.GIF", "Km. Mayawati (Chief Minister, Uttar Pradesh)", {background:"white", font:"bold 12px Arial", border:"1px ridge darkblue", width:"100px"}]
		tooltips[3]=["images/image-dm-003.GIF", "Abhishek Prakash (District Magistrate, Lakhimpur-Kheri)", {background:"white", font:"bold 12px Arial", border:"1px ridge darkblue", width:"100px"}]
		tooltips[4]=["images/i-profile.gif"]
		tooltips[5]=["images/i-dm.gif"]
		tooltips[6]=["images/i-adm.gif"]
		tooltips[7]=["images/i-office.gif"]
		tooltips[8]=["images/i-dudhwa.gif"]
		tooltips[9]=["images/i-holiday.gif"]
		tooltips[10]=["images/i-tele.gif"]
		tooltips[11]=["images/i-page-construct.gif"]
		tooltips[12]=["images/i-lokvani.gif"]
		tooltips[13]=["images/i-tehsil-divas.gif"]
		tooltips[14]=["images/i-bhulekh.gif"]
		tooltips[15]=["images/i-scholarship.gif"]
		tooltips[16]=["images/i-oldage.gif"]
		tooltips[17]=["images/i-ration.gif"]
		tooltips[18]=["images/i-basic-siksha.gif"]
		tooltips[19]=["images/i-gpf.gif"]
		tooltips[20]=["images/i-food-civil-supply.gif"]
		tooltips[21]=["#", "Telephone Numbers", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[22]=["images/i-rti.gif"]
		tooltips[23]=["images/i-zilapanch1.gif"]
		tooltips[24]=["#"]
		tooltips[25]=["images/i-form.gif"]
		tooltips[26]=["images/I-ANTIVIRUS.GIF"]
		tooltips[27]=["images/i-btc.gif"]
		tooltips[28]=["images/i-upboard.gif"]
		tooltips[29]=["images/i-places.gif"]
		tooltips[30]=["images/i-hotel.gif"]
		tooltips[31]=["images/i-reach.gif"]
		tooltips[32]=["images/i-contact.gif"]
		tooltips[33]=["images/i-forecast.gif"]
		tooltips[34]=["images/i-swan.gif"]
		tooltips[35]=["images/i-cmo.gif"]
		tooltips[36]=["images/i-ambedkar.gif"]
		tooltips[37]=["images/i-flood.gif"]
		tooltips[38]=["images/i-sbtc.gif"]
		tooltips[39]=["images/i-mawas.gif"]
		tooltips[40]=["images/i-iway.gif"]
		tooltips[41]=["images/i-ddiary.GIF"]
		tooltips[42]=["images/i-supply.GIF"]
		tooltips[43]=["images/i-arms.GIF"]
		tooltips[44]=["images/i-jansuchana.gif"]
		tooltips[45]=["images/i-bpl.gif"]
		tooltips[46]=["images/i-bhulekh.gif"]
		tooltips[47]=["images/i-election.gif"]
		tooltips[48]=["images/i-bor.gif"]
		tooltips[49]=["images/i-natural.gif"]
		tooltips[50]=["images/i-registry.gif"]
		tooltips[51]=["images/i-agriculture.gif"]
		tooltips[52]=["images/i-samajkalyan.gif"]
		tooltips[53]=["images/i-Results.gif"]
		tooltips[54]=["images/i-railway.gif"]
		tooltips[55]=["images/i-informatics.gif"]
		tooltips[56]=["images/i-udyog.gif"]
		tooltips[57]=["images/i-niveshmitra.gif"]
		tooltips[58]=["images/i-governer-desc.gif"]
		tooltips[59]=["images/i-cm-desc.gif"]
		tooltips[60]=["images/"]
		tooltips[61]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[62]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[63]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[64]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[65]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[66]=["images/image-a002.GIF", "Hn.B.L.Joshi (Governer, Uttar Pradesh)", {background:"white", font:"bold 12px Arial", border:"1px ridge darkblue", width:"100px"}]
		tooltips[67]=["images/image-a001.GIF", "Km. Mayawati (Chief Minister, Uttar Pradesh)", {background:"white", font:"bold 12px Arial", border:"1px ridge darkblue", width:"100px"}]
		tooltips[68]=["images/image-dm-003.GIF", "Abhishek Prakash (District Magistrate, Lakhimpur-Kheri)", {background:"white", font:"bold 12px Arial", border:"1px ridge darkblue", width:"100px"}]
		tooltips[69]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[70]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[71]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[72]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[73]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[74]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[75]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[76]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[77]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[78]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[79]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[80]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[81]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[82]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[83]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[84]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[85]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[86]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[87]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[88]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[89]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[90]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[91]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[92]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[93]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[94]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[95]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[96]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[97]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[98]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[99]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[100]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[101]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[102]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[103]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[104]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[105]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[106]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[107]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[108]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[109]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		tooltips[110]=["images/", "assign value", {background:"white", font:"bold 12px Arial", border:"5px ridge darkblue", width:"200px"}]
		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]")
