// JavaScript Document

$(document).ready(function(){
				

		
	//Fix IE6 background image flicker
	//document.execCommand("BackgroundImageCache",false,true);
      
	$('#flashBanner').flash(
        { src: 'flash/banner_v2.swf',
          width: 237,
          height: 371 }, 
    	{ update: false }
    );

		
		
   //for changing account form
   $('#account2').hide();
   if($('#account2').length!=0){		
		$('#loginbtn').click(function(){
			$('#account2').slideDown('slow');
			$('#account1').slideUp('slow');
			return false;
		});
	}

						   
								
	// button rollover effects							
	$('.btn').mouseover(function(){
		$(this).css({'background-position': '0 -21px'});
	});	
	$('.btn').mousedown(function(){
		$(this).css({'background-position': '0 -42px'});
	});	
	$('.btn').mouseup(function(){
		$(this).css({'background-position': '0 -21px'});
	});	
	$('.btn').mouseout(function(){
		$(this).css({'background-position': '0 0'});
	});
	
	
	//Removes empty divs from top products for slide show
	$('#topProducts .products div').each(function(){
		if($(this).html()==''){
			$(this).remove();
		}
	});
	//creates the slide show of top sold products
	
	$('#topProducts .products').cycle({ 
		fx:    'scrollLeft',
		random: 1,
		speed:   2000, 
		timeout: 10000,
		delay: -3000 ,
		pause:   1 
	});
	
	
			if($('.subscriptionMsg').html()){
				
			var destination = $('#subscriptionAnchor').offset().top;
			$('html, body').animate({ scrollTop: destination}, 'fast');

			}
		
	
});
