// scripts
function asNumber(pixValue){
    return parseInt(pixValue.replace('px',''));
}
function select_me(obj){	
	var selected_obj=jQuery(obj);
	var selector_string=obj.tagName.toLowerCase();
	selected_obj.parent().siblings().each(function(){
		jQuery(selector_string,this).addClass("not_chosen").removeClass("chosen");
	});
	selected_obj.addClass("chosen").removeClass("not_chosen");	
}

function zoomify(href){	
	if(navigator.appName == "Microsoft Internet Explorer"){
		dhtmlwindow.open("ajaxbox", "iframe", href, "|", "width=518px,height=618px,resize=0,scrolling=0, center=1");
	}else{
		dhtmlwindow.open("ajaxbox", "iframe", href, "|", "width=518px,height=618px,resize=0,scrolling=0, center=1");
	}
}

function pop_iframe(href){	
	dhtmlwindow.open("ajaxbox", "iframe", href, "|", "width=530px,height=620px,resize=1,scrolling=1, center=1");
}
function pop_div(identifier){	
	dhtmlwindow.open("ajaxbox", "div", identifier, "|", "width=530px,height=620px,resize=1,scrolling=1, center=1");
}
var bag_initial_width=null;
var login_initial_width = null;
var currency_initial_width = null;
var loginform_interval;
var shoppingbag_interval;
var currencyselector_interval;
var loginHasFocus=false;
var bagHasFocus=false;
var currencyHasFocus=false;

function showLoginForm(){
	clearTimeout(loginform_interval);
	hideShoppingBag(false);
	hideCurrencySelector(false);
	var frm=$('#login_form_holder');
	if(login_initial_width == null)
	{
		login_initial_width = frm.outerWidth();
		$("input",frm).focus(function(){loginHasFocus = true;}).blur(function(){loginHasFocus = false;})
	}else{
		frm.width(login_initial_width)
	}
	var par=$('.nav_shopping:first');
	var newX=(par.position().left +par.outerWidth() - login_initial_width);
	var newY = (par.position().top + par.outerHeight() -4);
	frm.css({'display':'block','top':newY+"px",'left':newX +'px'});
	$('#login_link .link_text').addClass("chosen").html('please enter your login details');
	loginform_interval = setTimeout("hideLoginForm(true)",6000);
}
function showCurrencySelector(){
	clearTimeout(currencyselector_interval);
	hideShoppingBag(false);
	hideLoginForm(false);
	var frm=$('#currency_selector_holder');
	if(currency_initial_width == null)
	{
		currency_initial_width = frm.outerWidth();
		frm.hover(function(){currencyHasFocus = true},function(){currencyHasFocus = false});
		$('#currency_selector_link').hover(function(){currencyHasFocus = true},function(){currencyHasFocus = false});
	}else{
		frm.width(currency_initial_width);
	}
	var par=$('.nav_shopping:first');
	var newX=(par.position().left +par.outerWidth() - login_initial_width);
	var newY = (par.position().top + par.outerHeight() -4);
	frm.css({'display':'block'});
	$('#currency_selector_link .link_text').addClass("chosen");
	currencyselector_interval = setTimeout("hideCurrencySelector(true)",3000);
}

function hideCurrencySelector(checkFocus){	
	clearTimeout(currencyselector_interval);
	var okToClose=false;	
	if(checkFocus){
		if(!currencyHasFocus){
			okToClose=true;
		}
	}else{
		 okToClose=true;
	}
	if(okToClose){
	$('#currency_selector_holder').css('display','none');
	$('#currency_selector_link .link_text').removeClass("chosen");
	}else{
		currencyselector_interval = setTimeout("hideCurrencySelector(true)",500);
	}
}	


function hideLoginForm(checkFocus){	
	clearTimeout(loginform_interval);
	var okToClose=false;	
	if(checkFocus){
		if(!loginHasFocus){
			okToClose=true;
		}
	}else{
		 okToClose=true;
	}
	if(okToClose){
		$('#login_form_holder').css('display','none');
		$('#login_link .link_text').removeClass("chosen").html('login');
	}else{
		loginform_interval = setTimeout("hideLoginForm(true)",3000);
	}
}	

function showShoppingBag(){	
	clearTimeout(shoppingbag_interval);
	hideLoginForm(false);
	hideCurrencySelector(false);
	bagHasFocus = false;
	var frm=$('#shopping_bag_holder').css('display','block');
	if(bag_initial_width == null){
		frm.bind("mouseover",function(){bagHasFocus = true;}).bind("mouseout",function(){bagHasFocus = false;})
		bag_initial_width = frm.outerWidth()
	}else{
		frm.width(bag_initial_width)
	}
	var par=$('.nav_shopping:first');
	var newX=(par.position().left +par.outerWidth() - bag_initial_width);
	var newY = (par.position().top + par.outerHeight() -4);
	frm.css({'top':newY+"px",'left':newX +'px'});
	$('#shopping_bag_link span').addClass("chosen");
	shoppingbag_interval = setTimeout("hideShoppingBag(true)",6000);	
}

function hideShoppingBag(checkFocus){
	clearTimeout(shoppingbag_interval)
	var okToClose=false;	
	if(checkFocus){
		if(!bagHasFocus){
			okToClose=true;
		}
	}else{
		 okToClose=true;
	}
	if(okToClose){
		$('#shopping_bag_holder').css('display','none');
		$('#shopping_bag_link span').removeClass("chosen");	
	}else{
		shoppingbag_interval = setTimeout("hideShoppingBag(true)",3000);
	}
}

/* match_heights() matches the height of the match_this container to that of the to_this container by stretching the stretch_this element */
(function($){   
 $.fn.stretchtomatch = function(opts) {  
    var defaults = {  
		match_this:null,
		to_this:null,
		stretch_this:null,		
		min_height:0
    };   
    var options = $.extend(defaults, opts);  
    return this.each(function() { 
		var selfref=$(this);
        var col_to_stretch=$(options.match_this,selfref);
        var pusher=$(options.stretch_this,selfref);
		var col_to_match=$(options.to_this,selfref);        
        function resize_me(){
			var pHeight = pusher.height();
            col_to_stretch.css('height','auto');
            var maxH = col_to_match.outerHeight();  
			if(maxH < options.min_height){
				maxH = options.min_height;
			}
            var curH = col_to_stretch.outerHeight() - pHeight;
			var newPH = maxH - curH;
            if(newPH != pHeight){				
				pusher.css('height',newPH+'px');
			}			
        }  
       	resize_me(); 
		$("img",col_to_stretch).bind("load",function(){resize_me();});
		$("img",col_to_match).bind("load",function(){resize_me();});
    });   
 };   
})(jQuery);

(function($){   
 $.fn.sendtobottom = function(opts) {  
    var defaults = {  
		stretch:null,
		holder:null,
		holder_elements:null
    };   
    var options = $.extend(defaults, opts);  
    return this.each(function() { 
		var selfref=$(this);
        var pnt=(options.holder == null)? selfref.parent().css('height','auto'): $(options.holder);
        var pusher=$(options.stretch, pnt);		
        function send_me(){
			var pHeight = pusher.height();
			var hToMatch=pnt.innerHeight();
			if(options.holder_elements !=null){
				hToMatch=0;
				$(options.holder_elements,pnt).each(function(){hToMatch+=$(this).outerHeight(true);})
			}
            var diff = hToMatch - (selfref.position().top + selfref.outerHeight())           
			var newH=pHeight + diff;
			if(newH<1){newH=1}		
			pusher.css({'height':newH+'px'});
			return diff;
        } 
		var d=send_me();		
		if($.browser.msie ){			
			while(d!=0){				
				d=send_me()
			}				
		}       	  		
		$("img",pnt).bind("load",function(){send_me();});		
    });   
 };   
})(jQuery);

/* pngfix function (non - jquery) */
if(navigator.appVersion.indexOf('MSIE 5') >-1 || navigator.appVersion.indexOf('MSIE 6')>-1){
var clear="/images/spacer.gif" //path to clear.gif
pngfix=function(){var els=document.getElementsByTagName('*');var ip=/\.png/i;var i=els.length;while(i-- >0){var el=els[i];var es=el.style;if(el.src&&el.src.match(ip)&&!es.filter){es.height=el.height;es.width=el.width;es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+el.src+"',sizingMethod='crop')";el.src=clear;}else{var elb=el.currentStyle.backgroundImage;if(elb.match(ip)){var path=elb.split('"');var rep=(el.currentStyle.backgroundRepeat=='no-repeat')?'crop':'scale';es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+path[1]+"',sizingMethod='"+rep+"')";es.height=el.clientHeight+'px';es.backgroundImage='none';var elkids=el.getElementsByTagName('*');if (elkids){var j=elkids.length;if(el.currentStyle.position!="absolute")es.position='static';while (j-- >0)if(!elkids[j].style.position)elkids[j].style.position="relative";}}}}}
window.attachEvent('onload',pngfix);
}


/*
 * Superfish v1.4.8 - jQuery menu widget
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */

;(function($){
	$.fn.superfish = function(op){
		var sf = $.fn.superfish,
			c = sf.c,
			$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
			over = function(){
				var $$ = $(this), menu = getMenu($$);
				clearTimeout(menu.sfTimer);
				$$.showSuperfishUl().siblings().hideSuperfishUl();
			},
			out = function(){
				var $$ = $(this), menu = getMenu($$), o = sf.op;
				clearTimeout(menu.sfTimer);
				menu.sfTimer=setTimeout(function(){
					o.retainPath=($.inArray($$[0],o.$path)>-1);
					$$.hideSuperfishUl();
					if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
				},o.delay);	
			},
			getMenu = function($menu){
				var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
				sf.op = sf.o[menu.serial];
				return menu;
			},
			addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };			
			widthFix =function(ref){
				var $ref=$(ref);
				var disp= $ref.css('display');
				$ref.css('display','block');
				var maxW=0;
				$('li a',$ref).each(function(){
					var meRef=$(this);
					var origDisplay = meRef.css('display')
					meRef.css('display','inline-block').css('width','auto');
					if(meRef.outerWidth()>maxW){
						maxW = 	meRef.outerWidth();
					}
					meRef.css('display');
				})
				if(maxW >0){
					$('li',$ref).css('width',maxW+'px');
					$('div',$ref).css('width',maxW+'px');
					$ref.css('width',maxW+'px');				
				}	
				$ref.css('display',disp);
			};
			
		return this.each(function() {
			var s = this.serial = sf.o.length;
			var o = $.extend({},sf.defaults,op);
			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
				$(this).addClass([o.hoverClass,c.bcClass].join(' '))
					.filter('li:has(ul)').removeClass(o.pathClass);
			});
			sf.o[s] = sf.op = o;
			
			$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
				if (o.autoArrows) addArrow( $('>a:first-child',this) );				
			})
			.not('.'+c.bcClass)
				.hideSuperfishUl();
			if($.browser.msie && $.browser.version <7){
				widthFix($('li ul',this));	
				if(o.wearhome){	
					widthFix($(this));
				}
			}
			
			var $a = $('a',this);
			$a.each(function(i){
				var $li = $a.eq(i).parents('li');
				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
			});
			o.onInit.call(this);
			
		}).each(function() {
			menuClasses = [c.menuClass];
			if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
			$(this).addClass(menuClasses.join(' '));
		});
	};

	var sf = $.fn.superfish;
	sf.o = [];
	sf.op = {};
	sf.IE7fix = function(){
		var o = sf.op;
		if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
			this.toggleClass(sf.c.shadowClass+'-off');
		};
	sf.zIndexFix = function(){
		this.parent().siblings().css({'z-index':'1'});
		this.parent().css({'z-index':'2'});
		};
	sf.c = {
		bcClass     : 'sf-breadcrumb',
		menuClass   : 'sf-js-enabled',
		anchorClass : 'sf-with-ul',
		arrowClass  : 'sf-sub-indicator',
		shadowClass : 'sf-shadow'
	};
	sf.defaults = {
		hoverClass	: 'sfHover',
		pathClass	: 'overideThisToUse',
		pathLevels	: 1,
		delay		: 800,
		animation	: {opacity:'show'},
		speed		: 'normal',
		autoArrows	: false,
		dropShadows : false,
		disableHI	: false,		// true disables hoverIntent detection
		onInit		: function(){}, // callback functions
		onBeforeShow: function(){},
		onShow		: function(){},
		onHide		: function(){}
	};
	$.fn.extend({
		hideSuperfishUl : function(){
			var o = sf.op,
				not = (o.retainPath===true) ? o.$path : '';
			o.retainPath = false;
			var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
					.find('>ul').hide().css('visibility','hidden');
			o.onHide.call($ul);
			return this;
		},
		showSuperfishUl : function(){
			
			var o = sf.op,
				sh = sf.c.shadowClass+'-off',
				$ul = this.addClass(o.hoverClass)
					.find('>ul:hidden').css('visibility','visible').css('z-index','999');
			
			sf.IE7fix.call($ul);
			sf.zIndexFix.call($ul);			
			o.onBeforeShow.call($ul);
			var lnk=$("a",this);
			if(o.wear){
				if(lnk){
					$ul.css('position','absolute').css('left',lnk.position().left+'px').css('top',lnk.position().top + lnk.outerHeight()+'px').css('width',lnk.outerWidth() + 'px');
				}
			}			
			if(o.wearhome){				
				var lft = (this.parent().position().left )+'px';				
				var tp = this.position().top + 'px';
				$ul.css('position','absolute').css('left',(($ul.outerWidth()*-1))+'px').css('top',tp);			
			}
			
			$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
			return this;
		}
	});

})(jQuery);



/* hoverIntent */
(function($){
	/* hoverIntent by Brian Cherne */
	$.fn.hoverIntent = function(f,g) {
		// default configuration options
		var cfg = {
			sensitivity: 7,
			interval: 100,
			timeout: 0
		};
		// override configuration options with user supplied object
		cfg = $.extend(cfg, g ? { over: f, out: g } : f );

		// instantiate variables
		// cX, cY = current X and Y position of mouse, updated by mousemove event
		// pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
		var cX, cY, pX, pY;

		// A private function for getting mouse position
		var track = function(ev) {
			cX = ev.pageX;
			cY = ev.pageY;
		};

		// A private function for comparing current and previous mouse position
		var compare = function(ev,ob) {
			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
			// compare mouse positions to see if they've crossed the threshold
			if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
				$(ob).unbind("mousemove",track);
				// set hoverIntent state to true (so mouseOut can be called)
				ob.hoverIntent_s = 1;
				return cfg.over.apply(ob,[ev]);
			} else {
				// set previous coordinates for next time
				pX = cX; pY = cY;
				// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
				ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
			}
		};

		// A private function for delaying the mouseOut function
		var delay = function(ev,ob) {
			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
			ob.hoverIntent_s = 0;
			return cfg.out.apply(ob,[ev]);
		};

		// A private function for handling mouse 'hovering'
		var handleHover = function(e) {
			// next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
			var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
			while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }
			if ( p == this ) { return false; }

			// copy objects to be passed into t (required for event object to be passed in IE)
			var ev = jQuery.extend({},e);
			var ob = this;

			// cancel hoverIntent timer if it exists
			if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }

			// else e.type == "onmouseover"
			if (e.type == "mouseover") {
				// set "previous" X and Y position based on initial entry point
				pX = ev.pageX; pY = ev.pageY;
				// update "current" X and Y position based on mousemove
				$(ob).bind("mousemove",track);
				// start polling interval (self-calling timeout) to compare mouse coordinates over time
				if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}

			// else e.type == "onmouseout"
			} else {
				// unbind expensive mousemove event
				$(ob).unbind("mousemove",track);
				// if hoverIntent state is true, then call the mouseOut function after the specified delay
				if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
			}
		};

		// bind the function to the two event listeners
		return this.mouseover(handleHover).mouseout(handleHover);
	};
	
})(jQuery);

/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-10-06 20:11:15 +0200 (Sa, 06 Okt 2007) $
 * $Rev: 3581 $
 *
 * Version: @VERSION
 *
 * Requires: jQuery 1.2+
 */

(function($){
	
$.dimensions = {
	version: '@VERSION'
};

// Create innerHeight, innerWidth, outerHeight and outerWidth methods
$.each( [ 'Height', 'Width' ], function(i, name){
	
	// innerHeight and innerWidth
	$.fn[ 'inner' + name ] = function() {
		if (!this[0]) return;
		
		var torl = name == 'Height' ? 'Top'    : 'Left',  // top or left
		    borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right
		
		return num( this, name.toLowerCase() ) + num(this, 'padding' + torl) + num(this, 'padding' + borr);
	};
	
	// outerHeight and outerWidth
	$.fn[ 'outer' + name ] = function(options) {
		if (!this[0]) return;
		
		var torl = name == 'Height' ? 'Top'    : 'Left',  // top or left
		    borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right		
		options = $.extend({ margin: false }, options || {});		
		return num( this, name.toLowerCase() )
				+ num(this, 'border' + torl + 'Width') + num(this, 'border' + borr + 'Width')
				+ num(this, 'padding' + torl) + num(this, 'padding' + borr)
				+ (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0);
	};
});

// Create scrollLeft and scrollTop methods
$.each( ['Left', 'Top'], function(i, name) {
	$.fn[ 'scroll' + name ] = function(val) {
		if (!this[0]) return;
		
		return val != undefined ?
		
			// Set the scroll offset
			this.each(function() {
				this == window || this == document ?
					window.scrollTo( 
						name == 'Left' ? val : $(window)[ 'scrollLeft' ](),
						name == 'Top'  ? val : $(window)[ 'scrollTop'  ]()
					) :
					this[ 'scroll' + name ] = val;
			}) :
			
			// Return the scroll offset
			this[0] == window || this[0] == document ?
				self[ (name == 'Left' ? 'pageXOffset' : 'pageYOffset') ] ||
					$.boxModel && document.documentElement[ 'scroll' + name ] ||
					document.body[ 'scroll' + name ] :
				this[0][ 'scroll' + name ];
	};
});

$.fn.extend({
	position: function() {
		var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results;
		
		if (elem) {
			// Get *real* offsetParent
			offsetParent = this.offsetParent();
			
			// Get correct offsets
			offset       = this.offset();
			parentOffset = offsetParent.offset();
			
			// Subtract element margins
			offset.top  -= num(elem, 'marginTop');
			offset.left -= num(elem, 'marginLeft');
			
			// Add offsetParent borders
			parentOffset.top  += num(offsetParent, 'borderTopWidth');
			parentOffset.left += num(offsetParent, 'borderLeftWidth');
			
			// Subtract the two offsets
			results = {
				top:  offset.top  - parentOffset.top,
				left: offset.left - parentOffset.left
			};
		}
		
		return results;
	},
	
	offsetParent: function() {
		var offsetParent = this[0].offsetParent;
		while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && $.css(offsetParent, 'position') == 'static') )
			offsetParent = offsetParent.offsetParent;
		return $(offsetParent);
	}
});

function num(el, prop) {
	return parseInt($.css(el.jquery?el[0]:el,prop))||0;
};

})(jQuery);





(function($){   
 $.fn.maintainPosition = function(opts) {  
    var defaults = {  
		top:null,
		left:null,
		right:null,
		bottom:null,
		relative_to:'html'
    };   
    var o = $.extend(defaults, opts);
  
    return this.each(function(e) { 
		var selfref=$(this);		
		function position_me(){		
			if(o.left !=null){
				selfref.css('left', $(o.relative_to).position().left + o.left+'px');
			}
			if(o.right !=null){
				selfref.css('left', $(o.relative_to).position().left + $(o.relative_to).outerWidth()- selfref.outerWidth() - o.right+'px');
			}
			if(o.top != null){
				selfref.css('top', $(o.relative_to).position().top +  o.top+'px');
			}
			if(o.bottom != null){
				selfref.css('top', $(o.relative_to).position().top + $(o.relative_to).outerHeight() - selfref.outerHeight() - o.bottom+'px');
			}			
		}
		position_me();
		$(window).bind('resize',function(e){position_me(e);})
		$('img',window).bind('load',function(e){position_me(e);})
    });   
 };   
})(jQuery);


(function($){   
 $.fn.setPopups= function(opts) {  
    var defaults = {  
		showThis:".item_summary",
		trackThis:".item_image"
    };   
    var o = $.extend(defaults, opts);  
    return this.each(function() { 
		var selfref=$(this);
		var showElement = $(o.showThis,selfref);
		var trackElement = $(o.trackThis,selfref);
		showElement.css("position","absolute");		
		trackElement.attr("alt","");
		trackElement.attr("title","");		
		function showIt(e){
			if($.browser.msie){
				showElement.css({top:(e.pageY -trackElement.offset().top+5)+"px",left:(e.pageX - trackElement.offset().left+5)+"px"});
			}else if($.browser.safari){
				var xOffset =($('body').parent().outerWidth() - $('body').outerWidth())/2;
				var yOffset = showElement.outerHeight() + 5;
				if(xOffset <0){xOffset =0;}
				showElement.css({top:(e.pageY - yOffset - trackElement.offset().top)+"px",left:(e.pageX - xOffset - trackElement.offset().left+5)+"px"});
			}else{
				var xOffset =($('body').parent().outerWidth() - $('body').outerWidth())/2;				
				var yOffset = showElement.outerHeight() + 5;
				if(xOffset <0){xOffset =0;}
				showElement.css({top:(e.pageY - yOffset - trackElement.offset().top)+"px",left:(e.pageX - trackElement.offset().left)+"px"});
				
			}
			showElement.show();
			showElement.css({opacity:0})
			showElement.animate({opacity:1},200,"linear");
		}
		function hideIt(e){
			showElement.animate({opacity:0},100,"linear",function(){showElement.hide();})
		}
		trackElement.hoverIntent(function(e){showIt(e);},function(e){hideIt(e);})
    });   
 };   
})(jQuery);


$(document).ready(function(){
	$(".dropdown_menu").superfish({hoverClass:"dropdown_hover",wear:true});	//  sets up the dropdown menus on the catalogue navigation
	$("#homepage_menu ul").superfish({hoverClass:"home_menu_hover",wearhome:true,autoArrows:true});	// sets up the homepage navigation	
	$(".CatalogueDetails .Item, .Related_Products .Item").setPopups(); //adds hover behaviour to the catalogue & cross sell product images
	$(document).stretchtomatch({match_this:".column_left",to_this:".column_right",stretch_this:".stretcher",min_height:560});
	$("#homepage_menu").maintainPosition({top:300,right:0,relative_to:".home_container"}); //sets and maintains the position of the navigation on the homepage		
	setTimeout(function(){$(window).trigger('resize');$(".product_navigation").sendtobottom({stretch:".nav_spacer", holder:".ProductDetails", holder_elements:".detail, .CrossSell"});},50);
});



