﻿//jQuery.fn.hotspot = function(hotimage, hotlink, hotname, hotprice) {


jQuery.fn.hotspot = function() {
$(this).each(function() {

// - Raj Parmer AUG 2010
 var thehotspot = this; 

  var hotlink = $(this).attr('href');
 var hotname = $(this).find('img').attr('name');
 var hotprice = $(this).find('img').attr('alt');
 var leftorright = $(this).attr('rel');

//if (hotimage === undefined)  { hotimage = '/images/default.jpg'; }
if (hotlink  === undefined)  { hotlink = '/'; }
if (hotname === undefined)   { hotname = 'product name'; }
if (hotprice === undefined)  { hotprice = '&pound;'; }
if (leftorright === undefined)  { leftorright = 'left'; }

// a.hotspots .thehotcell { text-align:center;display:none;position:absolute; z-index:9999; padding:30px  20px 20px 20px; width:210px; left:0;top:0;height:245px; background:url(/images/branding/slideshow_shadow.png);  margin-left:-115px; margin-top:-125px; }

if (leftorright === 'left')  {$(this).css({ 'background' : 'url(/images/branding/hot_left.gif) no-repeat'   }); $(this).find('.thehotcell').css({'margin-left' :' 2px'});     }
if (leftorright === 'right')  {$(this).css({ 'background' : 'url(/images/branding/hot_right.gif) no-repeat'   }); $(this).find('.thehotcell').css({'margin-left' :' -175px'}); }

$(this).find('.thehotcell').append('<span><!--' + hotname + '--><br /> ' + hotprice + '</span>');


$(thehotspot).hover(function () {

$(this).find('.thehotcell').show(); 

}, function (){ $(this).find('.thehotcell').hide();  }); 
 


});
} 


