var itms = 0;
	var itemwidth = 125;
	var otherwidth = 625;
	var itemlistwidth = 0;
	var ind = 0;	
	var ind_act = ind;
	var erk = 0;
	var ind_act_c = 0;
	var timer = 0;
	var timer2 = 0;
	var r = 4;
	var x= 1 ;
	var ii = 0;
	var y = 1;
	
$.noConflict();
  
jQuery(document).ready(function () {
	
var h=get_cookie('h');

	 if ( jQuery('#sw_62_shop_proposer').length && jQuery('.sw_48_1_preview_img_outer').length ){
	
	
	

	   jQuery(".scr_prev").css({display:"block"});
		jQuery(".scr_next").css({display:"block"});
		
	var itm = jQuery("#sw_62_shop_proposer").find(".shop_item");
		 itm.each(function(i){		
		itms++;		
	});
	
	itemlistwidth = itms*itemwidth;
	speed = itms.length*200;
	ind_act_c = -itemlistwidth;
	erk = itemlistwidth;

		var clono = jQuery("#sw_62_shop_proposer").html();
	jQuery("#sw_62_shop_proposer").html(clono+clono);
	//jQuery(".shop_item_list:first").addClass('clon');
	
	jQuery(".shop_item_list:first").css({left:ind,'z-index':'10'});
	
	jQuery(".shop_item_list:last").css({left:ind_act_c+'px','z-index':'1'});
	 }
});
	function go(d,c){
	/*
						if(c==1 && y==1){
						ii++;
						x=1; 							
							timer = setInterval( "scr("+d+","+c+")", 200 );							
						}
						else{
						ii=0;
						clearInterval( timer );
						}
						*/
	}
	
	function scr_re(d,c){
					
					jQuery(".shop_item_list:first").stop();
					jQuery(".shop_item_list:last").stop();
					ind_act = ind;
					if(d==1){
							ind_act_c = itemlistwidth;
						}
					else{
							ind_act_c = 0-itemlistwidth;
					}		

						jQuery(".shop_item_list:first").css({left:ind});
						jQuery(".shop_item_list:last").css({left:ind_act_c+'px'});
						x=1;

										
						if(c==1){
							timer = setInterval( "scr("+d+","+c+")", 60 );					
						}
						
	}
	function scr(d,c){
		//alert(x+"#"+ind_act+"#"+erk)
		if(d==1 && x==1 && y==1){
					x=0;				
					if(ind_act>-itemlistwidth)	{
					
						if(ind_act==0){
						ind_act_c = itemlistwidth;
						jQuery(".shop_item_list:last").css({left:ind_act_c+'px'});
						}

						ind_act = ind_act-1*itemwidth;			
						ind_act_c = ind_act_c-1*itemwidth;									

						jQuery(".shop_item_list:first").animate( { left:ind_act+"px"}, 600 ,"swing",function(){x=1;go(d,c)} );
						jQuery(".shop_item_list:last").animate( { left:(ind_act_c)+"px"}, 600 ,"swing",function(){x=1;go(d,c);} );
						return false;
						
					}	

					else {
							scr_re(1,c);
					}
						
					
		}
		else if(d==0 && x==1 && y==1){		
					x=0;
					if(ind_act<erk)	{

					if(ind_act==0){
						ind_act_c = 0-itemlistwidth;
						jQuery(".shop_item_list:last").css({left:ind_act_c+'px'});
						}

						ind_act = ind_act+1*itemwidth;
						ind_act_c = ind_act_c+1*itemwidth;						

						jQuery(".shop_item_list:first").animate( { left:ind_act+"px"}, 600 ,"swing",function(){x=1;go(d,c)} );
						jQuery(".shop_item_list:last").animate( { left:(ind_act_c)+"px"}, 600 ,"swing",function(){x=1;go(d,c)} );
						return false;
						
					}
					else{
						scr_re(0,c);
					}
					
		}
			
	}

function clr(){
	clearInterval( timer );
	jQuery(".shop_item_list:first").stop();
	jQuery(".shop_item_list:last").stop();
	y=0;
	x=0;
	return true;
	}

function init_scr(dd,c){
	y=1;
	x=1;	
	jQuery(".shop_item_list:first").stop();
	jQuery(".shop_item_list:last").stop();
	timer = setInterval( "scr("+dd+","+c+")", 60 );		
	}






