jQuery(window).load(function() {
	
	particlesJS('particles-js', {
	  "particles": {
		"number": {
		  "value": 150,
		  "density": {
			"enable": true,
			"value_area": 800
		  }
		},
		"color": {
		  "value": "#ffffff"
		},
		"shape": {
		  "type": "circle",
		  "stroke": {
			"width": 0,
			"color": "#000000"
		  },
		  "polygon": {
			"nb_sides": 5
		  },
		  "image": {
			"width": 100,
			"height": 50
		  }
		},
		"opacity": {
		  "value": 1,
		  "random": false,
		  "anim": {
			"enable": true,
			"speed": 1,
			"opacity_min": 0.6,
			"sync": false
		  }
		},
		"size": {
		  "value": 5,
		  "random": true,
		  "anim": {
			"enable": false,
			"speed": 40,
			"size_min": 0.1,
			"sync": false
		  }
		},
		"line_linked": {
		  "enable": true,
		  "distance": 100,
		  "color": "#ffffff",
		  "opacity": 0.3,
		  "width": 1
		},
		"move": {
		  "enable": true,
		  "speed": 2,
		  "direction": "none",
		  "random": false,
		  "straight": false,
		  "out_mode": "out",
		  "bounce": false,
		  "attract": {
			"enable": false,
			"rotateX": 600,
			"rotateY": 1200
		  }
		}
	  },
	  "interactivity": {
		"detect_on": "canvas",
		"events": {
		  "onhover": {
			"enable": false,
			"mode": "repulse"
		  },
		  "onclick": {
			"enable": false,
			"mode": "push"
		  },
		  "resize": true
		},
		"modes": {
		  "grab": {
			"distance": 400,
			"line_linked": {
			  "opacity": 1
			}
		  },
		  "bubble": {
			"distance": 400,
			"size": 40,
			"duration": 2,
			"opacity": 8,
			"speed": 3
		  },
		  "repulse": {
			"distance": 200,
			"duration": 0.4
		  },
		  "push": {
			"particles_nb": 4
		  },
		  "remove": {
			"particles_nb": 2
		  }
		}
	  },
	  "retina_detect": true
	});	
	
	jQuery('.rt-block.services').appear(function() {
		
		var add_delay = 1;
		jQuery(this).css({'animation-delay' : add_delay + 's'});
		jQuery(this).addClass('fadeInUp');
		
		jQuery(this).find('.sprocket-strips-s-block').each(function() {
			
			add_delay += 0.5;
			jQuery(this).addClass('fadeInUp');
			jQuery(this).css({'animation-delay' : add_delay + 's'});
		});
		
	}, {accY: -200});
	
	jQuery('.rt-block.about-us .dtr').appear(function() {

		jQuery(this).addClass('fade-in-stain');
		
		jQuery(this).find('img').css({'animation-delay' : '0.75s'});
		
		if(jQuery(this).hasClass('row-odd')) {
			jQuery(this).find('img').addClass('fadeInRight');
		}
		else {
			jQuery(this).find('img').addClass('fadeInLeft');
		}
		
	}, {accY: -200});
	
	var global_add_delay = 0;
	var global_col_count = 0;
	
	jQuery('.rt-block.projects .sprocket-strips-s-block').appear(function() {
		
		jQuery(this).removeClass('animated').addClass('animated-visible');
		
		//var add_delay = 0;
		
		jQuery(this).each(function() {
			
			jQuery(this).addClass('flipInY');
			jQuery(this).css({'animation-delay' : global_add_delay + 's'});
			global_col_count++;
			global_add_delay += 0.3;
			
			if(global_col_count == 4) {
				global_col_count = 0;
				global_add_delay = 0;
			}
		});
		
	}, {accY: -200});
	
	jQuery('.rt-block.latest-blog').appear(function() {
		
		jQuery(this).removeClass('animated').addClass('animated-visible');
		
		var add_delay = 0.3;
		
		jQuery(this).find('.owl-item').each(function() {
			
			jQuery(this).addClass('fadeInUp');
			jQuery(this).css({'animation-delay' : add_delay + 's'});
			add_delay += 0.3;
		});
		
	}, {accY: -200});
	
	
	
	jQuery('.rt-block.iran-map').appear(function() {
		
		
		
		var add_delay = 0;
		
		jQuery(this).find('svg path').each(function() {
			//jQuery(this).removeClass('animated').addClass('animated-visible');
			jQuery(this).addClass('fadeIn');
			jQuery(this).css({'animation-delay' : add_delay + 's'});
			add_delay += 0.15;
		});
		
		add_delay -= 1;
		
		jQuery(this).find('.branch-blink').addClass('fadeIn').css({'animation-delay' : '6.5s'});
		
	}, {accY: -200});
	
	jQuery('.rt-block.floating-contact .contact-button em').click(function() {
		jQuery('.rt-block.floating-contact .contact-desc').fadeToggle(500);
	});
});