$(document).ready(function (){
	
$('.imgBrand').imgpreload(function()
	{   
	  
		animBrand(1);
	});
	$('.imgBrand').mouseover(function(){
				
				 
				
				$(this).animate({
			'width': '135px',
			'height': '255px',
			'marginLeft' : '-40px',
			'marginTop' : '-40px'
				}, 150,'swing', function() {
				
				});	
				
				//showNewBG($(this).attr('ref'));
				
				
		});
		
		$('.imgBrand').mouseout(function(){
				
				
				
				$(this).animate({
					'width': '100px',
			'height': '188px',
			'marginLeft' : '-20px',
			'marginTop' : '-20px'
				}, 150,'swing', function() {
				
				});								  
				
		});
});
function animBrand(id){
	    if(id<=6)
		{
		$("#"+id+"Brand").animate({
			'width': '135px',
			'height': '255px',
			'marginLeft' : '-40px',
			'marginTop' : '-40px'
			}, 150,'linear', function() {

				finishMove(id);
				nid = id + 1;
				if(nid<=7) animBrand(nid);
				//finishMove(8 - id);
				
				
		});	
}
		 if(id<=7)
		 {
		last = 14 - id;
		$("#"+last+"Brand").animate({
			'width': '135px',
			'height': '255px',
			'marginLeft' : '-40px',
			'marginTop' : '-40px'
			}, 150,'linear', function() {
                 finishMove(13);
				 finishMove(last);
				
				
		});	
		 }
		 

}	

function finishMove(id){
	
	     
		$("#"+id+"Brand").animate({
			'width': '100px',
			'height': '188px',
			'marginTop' : '-20px',
			'marginLeft' : '-20px'
			}, 150,'linear', function() {
				
		});	
	
}
function moveleft()
{
var Y = $('#bc').position().left;
Y-=200;

$('#bc').stop().animate( { left:Y } , 1000 , function(){});

}
function moveright()
{
var Y = $('#bc').position().left;
Y+=200;

$('#bc').stop().animate( { left:Y } , 1000 , function(){});

}
