window.onload = function()  
{
	//		$j("#slide_captions button").dropShadow({left: 2, top: 1, blur: 2, opacity: 1});
	$j(".CompareButton input value").dropShadow({left: 1, top: 7, blur: 1, opacity: 1});
}

function getElementsByClassName(classname, node)  {
    if(!node) node = document.getElementsByTagName("body")[0];
    var a = [];
    var re = new RegExp('\\b' + classname + '\\b');
    var els = node.getElementsByTagName("*");
    for(var i=0,j=els.length; i<j; i++)
        if(re.test(els[i].className))a.push(els[i]);
    return a;
}



/*  document.ready functions*/
$j(document).ready(function(){

	$j('.arrow').bind('click', function(){
		toggleCategoryHover($j(this).attr('id'));
																  });


	$j(".ProductActionAdd").hover(function(){
						  
		//button bounce like skype
        $j(this.getElementsByTagName('img'))
            // first jump 
            .animate({top:"-10px"}, 200).animate({top:"-4px"}, 200)
            // second jump
            .animate({top:"-7px"}, 100).animate({top:"-4px"}, 100)
            // the last jump
            .animate({top:"-6px"}, 100).animate({top:"-4px"}, 100);
    });

	$j('.horizontal-scroller a.horizontal-scroller-leftarrow').hover (
		function() { $j(this).animate({backgroundColor:'rgb(207, 35, 11)'}, { queue:false, duration:800 });},
		function() { $j(this).animate({backgroundColor:'#dddddd'}, { queue:false, duration:800 });}											
	);
	$j('.horizontal-scroller a.horizontal-scroller-rightarrow').hover (
		function() { $j(this).animate({backgroundColor:'rgb(207, 35, 11)'}, { queue:false, duration:800 });},
		function() { $j(this).animate({backgroundColor:'#dddddd'}, { queue:false, duration:800 });}											
	);	


	/*
		//not being used anymore
		
		//hover funtion to toggle visibility of ProductImage in the Right TopSeller List
		$j('#LayoutColumn3 .ProductList li.TopSeller').hover (
			function () {
				//$j(this).find("div[class='TopSellerNumber']").animate({ width : "130px"}, 100);
				var x = $j(this).find("div[class='ProductImage']");
				$j(x).slideToggle("fast");
			}, 			
			function () {
				var x = $j(this).find("div[class='ProductImage']");
				$j(x).slideToggle("fast");
			}
		);
	
	
		$j('.quickflip-wrapper').hover( function(ev) {
			//var $jtarget = document.getElementById(this.id);
			//$jtarget.quickFlipper();
			$j(ev.target).quickFlipper();
	
		});
	
	*/	
	
	jQuery.easing['BounceEaseOut'] = function(p, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	};
	// init carousels
	$j('#SideTopSellersList').cycle({fx:    'fade', delay: -2000});
	$j('#SideNewProductsList').cycle({fx:    'fade', delay: -2000});
	$j('#SideCategoryNewProductsList').cycle({fx:    'fade', delay: -2000});
	$j('#SideCategoryTopSellersList').cycle({fx:    'fade', delay: -2000});
	$j('#SideShopByBrandList').cycle({fx: 'fade', sync: false, delay: -2000, cssBefore:{'z-index': 0}, cssAfter:{'z-index': 0}});	
	
	/*	$j('#SideTopSellersList').jcarousel({
			vertical: true,
			auto:4,
			wrap: 'last',
			scroll: 2,
			easing: 'BounceEaseOut',
			animation: 1000
			
		});
	*/
	

}); 



