// JavaScript Document
$(document).ready(function(){
						   
						   a = 0;
						     timer = setInterval(anim, 9000); 
							function anim(){
						   		a++; 
								
								if (a < 3){
									
									
											
							$('ul.slide_me').animate({'margin-left': -(960 * a)}, 3000);}
							else if (a > 3){a = 0; $('ul.slide_me').animate({'margin-left': -(960 * a)}, 3000); }
							
							 }
							 
					
							$('a.soc').click(function(){$('#reg_reg').show(); $('#reg_prom').hide(); $(this).addClass('active'); $('a.prom').removeClass('active'); return false ;})
							$('a.prom').click(function(){$('#reg_prom').show(); $('#reg_reg').hide(); $(this).addClass('active'); $('a.soc').removeClass('active'); return false ;})
							
							
							$('#products_show').jScrollPane({verticalDragMaxHeight: 50,
																			   })
							 timer_of = setInterval(offer, 6000);
							 t = 0;
							 function offer(){
								
							 if(t == '0'){$('#offer_1').stop().animate({'opacity': 0 }, 1000); $('#offer_2').stop().animate({'opacity': 1 }, 1000); t++;}
							 else if (t == '1'){$('#offer_2').stop().animate({'opacity': 0 }, 1000); $('#offer_1').stop().animate({'opacity': 1 }, 1000); t--;}
							
							 }
						   
							
										$('a[rel*=facebox]').facebox();
										
										$('a.galeria_link').click(function(){var url = $(this).attr('href');$('a.galeria_link').removeClass('active');$(this).addClass('active'); $('#gallery').load(url, function(){$('a[rel*=facebox]').facebox();}) ; return false})

							var b = 0;
							 $('a.a_l2').click(function(){if(b > 0){b--;} $('#reg_prom ul').animate({'margin-left': -(290 * b)}, 600);return false})
							$('a.a_r2').click(function(){if(b < 3){b++;}; $('#reg_prom ul').animate({'margin-left': -(290 * b)}, 600); return false})	 


							})

							
							
