				$(document).ready(function() {
					$("dl.cx-def-featured").mouseenter(function () {
						
						var flyoutEl		= $("dl.cx-def-additional",this);
						var thisEl		= $(this);
						var featuredItemWidth 	= thisEl.outerWidth(true);
						var featuredItemHeight 	= thisEl.outerHeight(true);
						var flyOutWidth 	= flyoutEl.outerWidth(true);
						var flyOutHeight 	= flyoutEl.outerHeight(true);
						var offsetLeftPos 	= thisEl.position().left;
						var offsetTopPos 	= thisEl.offset().top;
						var pageScroll 		= getPageScroll();
						var windowWidth 	= $(window).width();
						var windowHeight 	= $(window).height();
						
						var flyoutE2		= $(".cx-def-pointer",this);
						var thisE2		= $(this);
						var featuredItemWidth2 	= thisE2.outerWidth(true);
						var featuredItemHeight2 	= thisE2.outerHeight(true);
						var flyOutWidth2 	= flyoutE2.outerWidth(true);
						var flyOutHeight2 	= flyoutE2.outerHeight(true);
						var offsetLeftPos2 	= thisE2.position().left;
						var offsetTopPos2 	= thisE2.offset().top;

						//check the right hand side. do we need a left hand check as well?
						if ( (windowWidth - (offsetLeftPos+featuredItemWidth)) <= (flyOutWidth)){
							flyoutEl.css("left",(-1 * (flyOutWidth)));
							flyoutE2.css("left",(-1 * (flyOutWidth2)));
						}
						//check top
						if (pageScroll > offsetTopPos){
							flyoutEl.css("top",parseInt(pageScroll - offsetTopPos));
						}
						//and bottom
						else if( (offsetTopPos + featuredItemHeight) > (pageScroll + windowHeight) ){
							flyoutEl.css("top",-1 * parseInt( flyOutHeight - ( (pageScroll + windowHeight) - offsetTopPos) ) );
						}
						//handle the middle of the page scenario
						else{
							if( (offsetTopPos + flyOutHeight) > (pageScroll + windowHeight) ){
								
								flyoutEl.css("top",-1 * parseInt( (offsetTopPos + flyOutHeight) - (pageScroll + windowHeight) ) );
							}
							else{
								flyoutEl.css("top",0);
							}							
						}
						
						//check top for pointer
						if (pageScroll > offsetTopPos2){
							flyoutE2.css("top",parseInt(pageScroll - offsetTopPos2 +10));
						}
						//and bottom for pointer
						else if( (offsetTopPos2 + featuredItemHeight2) > (pageScroll + windowHeight) ){
							flyoutE2.css("top",-1 * parseInt( flyOutHeight2 - ( (pageScroll + windowHeight) - offsetTopPos2) +10) );
						}
						//handle the middle of the page scenario for pointer
						else{
							if( (offsetTopPos2 + flyOutHeight2) > (pageScroll + windowHeight) ){
								
								flyoutE2.css("top",-1 * parseInt( (offsetTopPos2 + flyOutHeight2) - (pageScroll + windowHeight) + 10) );
							}
							else{
								flyoutE2.css("top",10);
							}							
						}
						
						//for IE7 and under
						if ($.browser.msie && (parseInt($.browser.version) <= 7)){
							thisEl.css("z-index",20);
							thisEl.prevAll().css("z-index",10);
							thisEl.nextAll().css("z-index",10);
							thisE2.css("z-index",20);
							thisE2.prevAll().css("z-index",10);
							thisE2.nextAll().css("z-index",10);
							$("div#cx-def-featured-items-header select").hide();
						}
						flyoutEl.stop(true,true).delay(500).show(1);
						flyoutE2.stop(true,true).delay(500).show(1);
					})
					.mouseleave(function () {
						$("dl.cx-def-additional",this).stop(true,true).delay(500).hide(1);
						$(".cx-def-pointer",this).stop(true,true).delay(500).hide(1);
						//for IE7 and under
						if ($.browser.msie && (parseInt($.browser.version) <= 7)){
							$("div#cx-def-featured-items-header select").show();
						}
					});
							$("#ctyx-hotpicks .cx-dealod-link").click( function(){
									close_dealod( $(this) );
							});
				});

				function getPageScroll() {
					var yScroll;
					if (self.pageYOffset) {
							yScroll = self.pageYOffset;
					} else if (document.documentElement && document.documentElement.scrollTop) {
							yScroll = document.documentElement.scrollTop;
					} else if (document.body) {
							yScroll = document.body.scrollTop;
					}
					return yScroll;
				}

