/* 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]=["/_files/_thumbs/0. miproHH101.png"]
		tooltips[1]=["/_files/_thumbs/1. miprowire101.png"]
		tooltips[2]=["/_files/_thumbs/2.hk.jpg"]
		tooltips[3]=["/_files/_thumbs/3.hkcd.jpg"]
		tooltips[4]=["/_files/_thumbs/4.58standlead.jpg"]
		tooltips[5]=["/_files/_thumbs/5.singleHHMAT.jpg"]
		tooltips[6]=["/_files/_thumbs/6. MHBOOM.jpg"]
		tooltips[7]=["/_files/_thumbs/7.SiSennHHHB.jpg"]
		tooltips[8]=["/_files/_thumbs/8.8waysennhrack.jpg"]
		tooltips[9]=["/_files/_thumbs/9.mipro8way.jpg"]
		tooltips[10]=["/_files/_thumbs/10.2spkampli.jpg"]
		tooltips[11]=["/_files/_thumbs/11.zeck.jpg"]
		tooltips[12]=["/_files/_thumbs/12.cdj500.jpg"]
		tooltips[13]=["/_files/_thumbs/13.dennoncd.jpg"]
		tooltips[14]=["/_files/_thumbs/14.jbl13.5.jpg"]
		tooltips[15]=["/_files/_thumbs/15.cobra10k.jpg"]
		tooltips[16]=["/_files/_thumbs/16.RCFtourung.jpg"]
		tooltips[17]=["/_files/_thumbs/17.dynap57k.jpg"]
		tooltips[18]=["/_files/_thumbs/18.dynap53k.jpg"]
		tooltips[19]=["/_files/_thumbs/19.p51200desk.jpg"]
		tooltips[20]=["/_files/_thumbs/20.powermate16.jpg"]
		tooltips[21]=["/_files/_thumbs/21.powermate12.jpg"]
		tooltips[22]=["/_files/_thumbs/22.powermate8.jpg"]
		tooltips[23]=["/_files/_thumbs/23.voxmic.jpg"]
		tooltips[24]=["/_files/_thumbs/24.diampmic.jpg"]
		tooltips[25]=["/_files/_thumbs/25.drumkitmics.jpg"]
		tooltips[26]=["/_files/_thumbs/26.8waymulti.jpg"]
		tooltips[27]=["/_files/_thumbs/"]
		tooltips[28]=["/_files/_thumbs/"]
		tooltips[29]=["/_files/_thumbs/"]
		tooltips[30]=["/_files/_thumbs/30.gobo.jpg"]
		tooltips[31]=["/_files/_thumbs/31.laserlights.jpg"]
		tooltips[32]=["/_files/_thumbs/32.twobar4can.jpg"]
		tooltips[33]=["/_files/_thumbs/33.twobar4flat.jpg"]
		tooltips[34]=["/_files/_thumbs/34.leduplight.jpg"]
		tooltips[35]=["/_files/_thumbs/35.largeleduplight.jpg"]
		tooltips[36]=["/_files/_thumbs/36.uvspot.jpg"]
		tooltips[37]=["/_files/_thumbs/37.redheadkit.jpg"]
		tooltips[38]=["/_files/_thumbs/38.skylight.jpg"]
		tooltips[39]=["/_files/_thumbs/39.smokemach.jpg"]
		tooltips[40]=["/_files/_thumbs/40.largesmokemachine.jpg"]
		tooltips[41]=["/_files/_thumbs/41.larsnow.jpg"]
		tooltips[42]=["/_files/_thumbs/42.fluid.jpg"]
		tooltips[43]=["/_files/_thumbs/43.largespot.jpg"]
		tooltips[44]=["/_files/_thumbs/44.stagelght.jpg"]
		tooltips[45]=["/_files/_thumbs/45.scarpa.jpg"]
		tooltips[46]=["/_files/_thumbs/46.largehorncarpa.jpg"]
		tooltips[47]=["/_files/_thumbs/17.recordingcarpa.jpg"]
		tooltips[48]=["/_files/_thumbs/48.6hornspk.jpg"]
		tooltips[49]=["/_files/_thumbs/49.12hornspk.jpg"]
		tooltips[50]=["/_files/_thumbs/50.CP330.jpg"]
		tooltips[51]=["/_files/_thumbs/51.euro446.jpg"]
		tooltips[52]=["/_files/_thumbs/52.megaphone.jpg"]
		tooltips[53]=["/_files/_thumbs/53.minivox.jpg"]
		tooltips[54]=["/_files/_thumbs/54.standardcon.jpg"]
		tooltips[55]=["/_files/_thumbs/55.mediumcon.jpg"]
		tooltips[56]=["/_files/_thumbs/56.largevenue.jpg"]
		tooltips[57]=["/_files/_thumbs/57.lecturn.jpg"]
		tooltips[58]=["/_files/_thumbs/58.designerlec.jpg"]
		tooltips[59]=["/_files/_thumbs/59.NEC2k.jpg"]
		tooltips[60]=["/_files/_thumbs/60.NEC5k.jpg"]
		tooltips[61]=["/_files/_thumbs/61.longthrow.jpg"]
		tooltips[62]=["/_files/_thumbs/62.2mscreen.jpg"]
		tooltips[63]=["/_files/_thumbs/63.4mprogscreen.jpg"]
		tooltips[64]=["/_files/_thumbs/64.rearprogsc.jpg"]
		tooltips[65]=["/_files/_thumbs/65.pres42stand.jpg"]
		tooltips[66]=["/_files/_thumbs/66.vcamst.jpg"]
		tooltips[67]=["/_files/_thumbs/67.ederolv8.jpg"]
		tooltips[68]=["/_files/_thumbs/68.videoswitch.jpg"]
		tooltips[69]=["/_files/_thumbs/69.600mstage.jpg"]
		tooltips[70]=["/_files/_thumbs/70.300mstage.jpg"]
		tooltips[71]=["/_files/_thumbs/71.1000spot.jpg"]
		tooltips[72]=["/_files/_thumbs/72.largespot.jpg"]
		tooltips[73]=["/_files/_thumbs/73.stagelght.jpg"]
		tooltips[74]=["/_files/_thumbs/74.ledkan.jpg"]
		tooltips[75]=["/_files/_thumbs/75.redheadkit.jpg"]
		tooltips[76]=["/_files/_thumbs/76.transit.jpg"]
		tooltips[77]=["/_files/_thumbs/"]
		tooltips[78]=["/_files/_thumbs/"]
		tooltips[79]=["/_files/_thumbs/"]
		tooltips[80]=["/_files/_thumbs/"]
		tooltips[81]=["/_files/_thumbs/"]
		tooltips[82]=["/_files/_thumbs/"]
		tooltips[83]=["/_files/_thumbs/"]
		tooltips[84]=["/_files/_thumbs/"]
		tooltips[85]=["/_files/_thumbs/"]
		tooltips[86]=["/_files/_thumbs/"]
		tooltips[87]=["/_files/_thumbs/"]
		tooltips[88]=["/_files/_thumbs/"]
		tooltips[89]=["/_files/_thumbs/"]
		tooltips[90]=["/_files/_thumbs/"]
		tooltips[91]=["/_files/_thumbs/"]
		tooltips[92]=["/_files/_thumbs/"]
		tooltips[93]=["/_files/_thumbs/"]
		tooltips[94]=["/_files/_thumbs/"]
		tooltips[95]=["/_files/_thumbs/"]
		tooltips[96]=["/_files/roleplay.jpg"]
		tooltips[97]=["/_files/shop.jpg"]
		tooltips[98]=["/_files/wallproj.jpg"]
		tooltips[99]=["/_files/neolryan.jpg"]
		tooltips[100]=["/_files/_thumbs/100.42plasma.jpg"]
		
	    
	    
		
		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]")
