$(document).ready(function() {
	if ($('.menu_stars').size() > 0) {
		if (detectIE() && !detectIE6())
			stars.init_ie();
		else
			stars.init();
		stars.auto_move();
	}
});

var stars = {
	number: 5, // количество активных звезд
	links: ['/about/pavlovo_podvorie.html', '/about/gymnasium.html', '/about/communications.html', '/plan/', '/about/project.html'], // ссылки со звезд
	titles: ['Павлово Подворье', 'Гимназия', 'Коммуникации', 'План поселка', 'О проекте'], // текст ссылок со звезд
	size1: {w: 277, h: 265}, // большой размер звезды
	size2: {w: 171, h: 164}, // средний размер звезды
	size3: {w: 139, h: 134}, // маленький размер звезды
	speed: 1000, // скорость движения
	pause: 3000, // задержка
	timer: '',
	is_anim: false,
	init_other: function() {
		$('.menu_stars .star_minus1').eq(0).css({
			'top': '175px',
			'left': '72px'
		});
		$('.menu_stars .star_minus1').eq(1).css({
			'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
			'left': 685 - stars.size1.w / 2 - stars.size2.w - stars.size3.w - 20 + 'px',
			'opacity': 0
		});
		$('.menu_stars .star_plus1').eq(0).css({
			'top': '175px',
			'left': '1238px'
		});
		$('.menu_stars .star_plus1').eq(1).css({
			'top': '109px',
			'left': '1347px',
			'opacity': 0
		});
		$('.menu_stars .star_minus2').eq(0).css({
			'top': '109px',
			'left': '0px'
		});
		$('.menu_stars .star_minus2').eq(1).css({
			'top': '175px',
			'left': '72px',
			'opacity': 0
		});
		$('.menu_stars .star_plus2').eq(0).css({
			'top': '109px',
			'left': '1347px'
		});
		$('.menu_stars .star_plus2').eq(1).css({
			'top': '49px',
			'left': '1313px',
			'opacity': 0
		});
		$('.menu_stars .star_minus3').eq(0).css({
			'top': '49px',
			'left': '25px'
		});
		$('.menu_stars .star_minus3').eq(1).css({
			'top': '109px',
			'left': '0px',
			'opacity': 0
		});
		$('.menu_stars .star_plus3').eq(0).css({
			'top': '49px',
			'left': '1313px'
		});
		$('.menu_stars .star_plus3').eq(1).css({
			'top': '0px',
			'left': '1198px',
			'opacity': 0
		});
		$('.menu_stars .star_minus4').eq(0).css({
			'top': '0px',
			'left': '125px'
		});
		$('.menu_stars .star_minus4').eq(1).css({
			'top': '49px',
			'left': '25px',
			'opacity': 0
		});
		$('.menu_stars .star_plus4').eq(0).css({
			'top': '0px',
			'left': '1198px'
		});
		$('.menu_stars .star_plus4').eq(1).css({
			'top': '-10px',
			'left': '1178px',
			'opacity': 0
		});
	},
	init: function() {
		var ext = (detectIE6()) ? 'gif' : 'png';
		
		stars.init_other();
		
		for (var i=0; i<stars.number; i++) {
			$('.menu_stars').append('<a href="' + stars.links[i] + '" class="star" style="display: none;"><img src="img/star' + i + '.' + ext + '" /><span class="star_title"><span>' + stars.titles[i] + '</span></span></a>');
		}
		$('.star').each(function(index) {
			if (index == 0) {
				$(this).css({
					'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
					'left': 685 - stars.size1.w / 2 - stars.size2.w - stars.size3.w - 20 + 'px',
					'opacity': 0.6
				});
				$(this).find('img').css({
					'width': stars.size3.w + 'px',
					'height': stars.size3.h + 'px'
				});
			}
			else if (index == 1) {
				$(this).css({
					'top': 430 - stars.size1.h / 2 - stars.size2.h / 2 + 5 + 'px',
					'left': 685 - stars.size1.w / 2 - stars.size2.w - 10 + 'px',
					'opacity': 0.8
				});
				$(this).find('img').css({
					'width': stars.size2.w + 'px',
					'height': stars.size2.h + 'px'
				});
			}
			else if (index == 2) {
				$(this).css({
					'top': 430 - stars.size1.h + 'px',
					'left': 685 - stars.size1.w / 2 + 'px',
					'opacity': 1
				});
				$(this).find('img').css({
					'width': stars.size1.w + 'px',
					'height': stars.size1.h + 'px'
				});
			}
			else if (index == 3) {
				$(this).css({
					'top': 430 - stars.size1.h / 2 - stars.size2.h / 2 + 5 + 'px',
					'left': 685 + stars.size1.w / 2 + 10 + 'px',
					'opacity': 0.8
				});
				$(this).find('img').css({
					'width': stars.size2.w + 'px',
					'height': stars.size2.h + 'px'
				});
			}
			else if (index == 4) {
				$(this).css({
					'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
					'left': 685 + stars.size1.w / 2 + stars.size2.w + 20 + 'px',
					'opacity': 0.6
				});
				$(this).find('img').css({
					'width': stars.size3.w + 'px',
					'height': stars.size3.h + 'px'
				});
			}
			else {
				$(this).css({
					'top': '175px',
					'left': '1238px',
					'opacity': 0
				});
				$(this).find('img').css({
					'width': '60px',
					'height': '103px'
				});
			}
			$(this).show();
		});

		$('.star').hover(function() {
			stars.no_move();
			stars.hover_over($(this));
		}, function() {
			stars.hover_out($(this));
			stars.auto_move();
		});
	},
	init_ie: function() {
		var ext = 'png';
		
		stars.init_other();
		
		for (var i=0; i<stars.number; i++) {
			$('.menu_stars').append('<a href="' + stars.links[i] + '" class="star" style="display: none;"><img src="img/star' + i + '.' + ext + '" /><span class="star_title"><span>' + stars.titles[i] + '</span></span></a>');
		}
		$('.star').each(function(index) {
			if (index == 0) {
				$(this).css({
					'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
					'left': 685 - stars.size1.w / 2 - stars.size2.w - stars.size3.w - 20 + 'px'
				});
				$(this).find('img').css({
					'width': stars.size3.w + 'px',
					'height': stars.size3.h + 'px'
				});
			}
			else if (index == 1) {
				$(this).css({
					'top': 430 - stars.size1.h / 2 - stars.size2.h / 2 + 5 + 'px',
					'left': 685 - stars.size1.w / 2 - stars.size2.w - 10 + 'px'
				});
				$(this).find('img').css({
					'width': stars.size2.w + 'px',
					'height': stars.size2.h + 'px'
				});
			}
			else if (index == 2) {
				$(this).css({
					'top': 430 - stars.size1.h + 'px',
					'left': 685 - stars.size1.w / 2 + 'px'
				});
				$(this).find('img').css({
					'width': stars.size1.w + 'px',
					'height': stars.size1.h + 'px'
				});
			}
			else if (index == 3) {
				$(this).css({
					'top': 430 - stars.size1.h / 2 - stars.size2.h / 2 + 5 + 'px',
					'left': 685 + stars.size1.w / 2 + 10 + 'px'
				});
				$(this).find('img').css({
					'width': stars.size2.w + 'px',
					'height': stars.size2.h + 'px'
				});
			}
			else if (index == 4) {
				$(this).css({
					'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
					'left': 685 + stars.size1.w / 2 + stars.size2.w + 20 + 'px'
				});
				$(this).find('img').css({
					'width': stars.size3.w + 'px',
					'height': stars.size3.h + 'px'
				});
			}
			else {
				$(this).css({
					'top': '196px',
					'left': '1243px'
				});
				$(this).find('img').css({
					'width': '42px',
					'height': '62px'
				});
			}
			$(this).show();
		});

		$('.star').hover(function() {
			stars.no_move();
			stars.hover_over_ie($(this));
		}, function() {
			stars.hover_out_ie($(this));
			stars.auto_move();
		});
	},
	move_other: function() {
		$('.star_title').hide();
		
		$('.star_minus1').eq(0).animate({
			'top': '109px',
			'left': '0px',
			'opacity': 0
		}, stars.speed, function() {
			$('.star_minus1').eq(0).css({
				'top': '175px',
				'left': '72px',
				'opacity': 1
			});
		});
		$('.star_minus1').eq(1).animate({
			'top': '175px',
			'left': '72px',
			'opacity': 1
		}, stars.speed, function() {
			$('.star_minus1').eq(1).css({
				'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
				'left': 685 - stars.size1.w / 2 - stars.size2.w - stars.size3.w - 20 + 'px',
				'opacity': 0
			});
		});
		$('.star_plus1').eq(0).animate({
			'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
			'left': 685 + stars.size1.w / 2 + stars.size2.w + 20 + 'px',
			'opacity': 0
		}, stars.speed, function() {
			$('.star_plus1').eq(0).css({
				'top': '175px',
				'left': '1238px',
				'opacity': 1
			});
		});
		$('.star_plus1').eq(1).animate({
			'top': '175px',
			'left': '1238px',
			'opacity': 1
		}, stars.speed, function() {
			$('.star_plus1').eq(1).css({
				'top': '109px',
				'left': '1347px',
				'opacity': 0
			});
		});

		$('.star_minus2').eq(0).animate({
			'top': '49px',
			'left': '25px',
			'opacity': 0
		}, stars.speed, function() {
			$('.star_minus2').eq(0).css({
				'top': '109px',
				'left': '0px',
				'opacity': 1
			});
		});
		$('.star_minus2').eq(1).animate({
			'top': '109px',
			'left': '0px',
			'opacity': 1
		}, stars.speed, function() {
			$('.star_minus2').eq(1).css({
				'top': '175px',
				'left': '72px',
				'opacity': 0
			});
		});
		$('.star_plus2').eq(0).animate({
			'top': '175px',
			'left': '1238px',
			'opacity': 0
		}, stars.speed, function() {
			$('.star_plus2').eq(0).css({
				'top': '109px',
				'left': '1347px',
				'opacity': 1
			});
		});
		$('.star_plus2').eq(1).animate({
			'top': '109px',
			'left': '1347px',
			'opacity': 1
		}, stars.speed, function() {
			$('.star_plus2').eq(1).css({
				'top': '49px',
				'left': '1313px',
				'opacity': 0
			});
		});

		$('.star_minus3').eq(0).animate({
			'top': '0px',
			'left': '125px',
			'opacity': 0
		}, stars.speed, function() {
			$('.star_minus3').eq(0).css({
				'top': '49px',
				'left': '25px',
				'opacity': 1
			});
		});
		$('.star_minus3').eq(1).animate({
			'top': '49px',
			'left': '25px',
			'opacity': 1
		}, stars.speed, function() {
			$('.star_minus3').eq(1).css({
				'top': '109px',
				'left': '0px',
				'opacity': 0
			});
		});
		$('.star_plus3').eq(0).animate({
			'top': '109px',
			'left': '1347px',
			'opacity': 0
		}, stars.speed, function() {
			$('.star_plus3').eq(0).css({
				'top': '49px',
				'left': '1313px',
				'opacity': 1
			});
		});
		$('.star_plus3').eq(1).animate({
			'top': '49px',
			'left': '1313px',
			'opacity': 1
		}, stars.speed, function() {
			$('.star_plus3').eq(1).css({
				'top': '0px',
				'left': '1198px',
				'opacity': 0
			});
		});

		$('.star_minus4').eq(0).animate({
			'top': '-10px',
			'left': '155px',
			'opacity': 0
		}, stars.speed, function() {
			$('.star_minus4').eq(0).css({
				'top': '0px',
				'left': '125px',
				'opacity': 1
			});
		});
		$('.star_minus4').eq(1).animate({
			'top': '0px',
			'left': '125px',
			'opacity': 1
		}, stars.speed, function() {
			$('.star_minus4').eq(1).css({
				'top': '49px',
				'left': '25px',
				'opacity': 0
			});
		});
		$('.star_plus4').eq(0).animate({
			'top': '49px',
			'left': '1313px',
			'opacity': 0
		}, stars.speed, function() {
			$('.star_plus4').eq(0).css({
				'top': '0px',
				'left': '1198px',
				'opacity': 1
			});
		});
		$('.star_plus4').eq(1).animate({
			'top': '0px',
			'left': '1198px',
			'opacity': 1
		}, stars.speed, function() {
			$('.star_plus4').eq(1).css({
				'top': '-10px',
				'left': '1178px',
				'opacity': 0
			});
		});
	},
	move: function() {
		if (!stars.is_anim) {
			stars.is_anim = true;

			var star_first = $('.star').eq(0);
			star_first.remove();
			$('.menu_stars').append(star_first);
			star_first.hover(function() {
				stars.no_move();
				stars.hover_over($(this));
			}, function() {
				stars.hover_out($(this));
				stars.auto_move();
			});
			
			$('.star').each(function(index) {
				if (index == 5) {
					$(this).animate({
						'top': '175px',
						'left': '72px',
						'opacity': 0
					}, stars.speed);
					$(this).find('img').animate({
						'width': '60px',
						'height': '103px'
					}, stars.speed, function() {
						star_first.css({
							'left': '1238px'
						});
					});
				}
				else if (index == 0) {
					$(this).animate({
						'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
						'left': 685 - stars.size1.w / 2 - stars.size2.w - stars.size3.w - 20 + 'px',
						'opacity': 0.6
					}, stars.speed);
					$(this).find('img').animate({
						'width': stars.size3.w + 'px',
						'height': stars.size3.h + 'px'
					}, stars.speed);
				}
				else if (index == 1) {
					$(this).animate({
						'top': 430 - stars.size1.h / 2 - stars.size2.h / 2 + 5 + 'px',
						'left': 685 - stars.size1.w / 2 - stars.size2.w - 10 + 'px',
						'opacity': 0.8
					}, stars.speed);
					$(this).find('img').animate({
						'width': stars.size2.w + 'px',
						'height': stars.size2.h + 'px'
					}, stars.speed);
				}
				else if (index == 2) {
					$(this).animate({
						'top': 430 - stars.size1.h + 'px',
						'left': 685 - stars.size1.w / 2 + 'px',
						'opacity': 1
					}, stars.speed, function() { stars.is_anim = false; });
					$(this).find('img').animate({
						'width': stars.size1.w + 'px',
						'height': stars.size1.h + 'px'
					}, stars.speed);
				}
				else if (index == 3) {
					$(this).animate({
						'top': 430 - stars.size1.h / 2 - stars.size2.h / 2 + 5 + 'px',
						'left': 685 + stars.size1.w / 2 + 10 + 'px',
						'opacity': 0.8
					}, stars.speed);
					$(this).find('img').animate({
						'width': stars.size2.w + 'px',
						'height': stars.size2.h + 'px'
					}, stars.speed);
				}
				else if (index == 4) {
					$(this).animate({
						'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
						'left': 685 + stars.size1.w / 2 + stars.size2.w + 20 + 'px',
						'opacity': 0.6
					}, stars.speed);
					$(this).find('img').animate({
						'width': stars.size3.w + 'px',
						'height': stars.size3.h + 'px'
					}, stars.speed);
				}
			});
			
			stars.move_other();
		}
	},
	move_ie: function() {
		if (!stars.is_anim) {
			stars.is_anim = true;
			
			var star_first = $('.star').eq(0);
			star_first.remove();
			$('.menu_stars').append(star_first);
			star_first.hover(function() {
				stars.no_move();
				stars.hover_over_ie($(this));
			}, function() {
				stars.hover_out_ie($(this));
				stars.auto_move();
			});
			
			$('.star').each(function(index) {
				if (index == 5) {
					$(this).animate({
						'top': '196px',
						'left': '77px'
					}, stars.speed, function() {
						star_first.css({
							'left': '1243px'
						});
					});
					$(this).find('img').animate({
						'width': '42px',
						'height': '62px'
					}, stars.speed);
				}
				else if (index == 0) {
					$(this).animate({
						'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
						'left': 685 - stars.size1.w / 2 - stars.size2.w - stars.size3.w - 20 + 'px'
					}, stars.speed);
					$(this).find('img').animate({
						'width': stars.size3.w + 'px',
						'height': stars.size3.h + 'px'
					}, stars.speed);
				}
				else if (index == 1) {
					$(this).animate({
						'top': 430 - stars.size1.h / 2 - stars.size2.h / 2 + 5 + 'px',
						'left': 685 - stars.size1.w / 2 - stars.size2.w - 10 + 'px'
					}, stars.speed);
					$(this).find('img').animate({
						'width': stars.size2.w + 'px',
						'height': stars.size2.h + 'px'
					}, stars.speed);
				}
				else if (index == 2) {
					$(this).animate({
						'top': 430 - stars.size1.h + 'px',
						'left': 685 - stars.size1.w / 2 + 'px'
					}, stars.speed, function() { stars.is_anim = false; });
					$(this).find('img').animate({
						'width': stars.size1.w + 'px',
						'height': stars.size1.h + 'px'
					}, stars.speed);
				}
				else if (index == 3) {
					$(this).animate({
						'top': 430 - stars.size1.h / 2 - stars.size2.h / 2 + 5 + 'px',
						'left': 685 + stars.size1.w / 2 + 10 + 'px'
					}, stars.speed);
					$(this).find('img').animate({
						'width': stars.size2.w + 'px',
						'height': stars.size2.h + 'px'
					}, stars.speed);
				}
				else if (index == 4) {
					$(this).animate({
						'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
						'left': 685 + stars.size1.w / 2 + stars.size2.w + 20 + 'px'
					}, stars.speed);
					$(this).find('img').animate({
						'width': stars.size3.w + 'px',
						'height': stars.size3.h + 'px'
					}, stars.speed);
				}
			});
			
			stars.move_other();
		}
	},
	auto_move: function() {
		if (detectIE() && !detectIE6())
			stars.timer = setInterval(function() { stars.move_ie(); }, stars.pause);
		else
			stars.timer = setInterval(function() { stars.move(); }, stars.pause);
	},
	no_move: function() {
		clearTimeout(stars.timer);
	},
	hover_over: function(star) {
		if (!stars.is_anim) {
			$('.star_title').hide();
			var index = $('.star').index(star);
			stars.is_anim = true;
			if (index == 0) {
				star.css({'z-index': 10});
				star.animate({
					'top': 430 - stars.size1.h + 'px',
					'left': 685 - stars.size1.w - stars.size2.w - stars.size3.w / 2 - 20 + 'px',
					'opacity': 1
				}, stars.speed/2, function() {stars.is_anim = false;});
			}
			else if (index == 1 ) {
				star.css({'z-index': 10});
				star.animate({
					'top': 430 - stars.size1.h + 'px',
					'left': 685 - stars.size1.w - stars.size2.w / 2 - 10 + 'px',
					'opacity': 1
				}, stars.speed/2, function() {stars.is_anim = false;});
			}
			else if (index == 3) {
				star.css({'z-index': 10});
				star.animate({
					'top': 430 - stars.size1.h + 'px',
					'left': 685 + stars.size2.w / 2 + 10 + 'px',
					'opacity': 1
				}, stars.speed/2, function() {stars.is_anim = false;});
			}
			else if (index == 4) {
				star.css({'z-index': 10});
				star.animate({
					'top': 430 - stars.size1.h + 'px',
					'left': 685 + stars.size2.w + stars.size3.w / 2 + 20 + 'px',
					'opacity': 1
				}, stars.speed/2, function() {stars.is_anim = false;});
			}
			star.find('img').animate({
				'width': stars.size1.w + 'px',
				'height': stars.size1.h + 'px'
			}, stars.speed/2, function() { star.find('.star_title').show();stars.is_anim = false;});
		}
	},
	hover_out: function(star) {
		var index = $('.star').index(star);
		$('.star_title').hide();
		if (index == 0) {
			star.animate({
				'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
				'left': 685 - stars.size1.w / 2 - stars.size2.w - stars.size3.w - 20 + 'px',
				'opacity': 0.6
			}, stars.speed/2, function() {stars.is_anim = false;});
			star.find('img').animate({
				'width': stars.size3.w + 'px',
				'height': stars.size3.h + 'px'
			}, stars.speed/2, function() { star.css({'z-index': 1}); $('.star_title').hide(); });
		}
		else if (index == 1) {
			star.animate({
				'top': 430 - stars.size1.h / 2 - stars.size2.h / 2 + 5 + 'px',
				'left': 685 - stars.size1.w / 2 - stars.size2.w - 10 + 'px',
				'opacity': 0.8
			}, stars.speed/2, function() {stars.is_anim = false;});
			star.find('img').animate({
				'width': stars.size2.w + 'px',
				'height': stars.size2.h + 'px'
			}, stars.speed/2, function() { star.css({'z-index': 1}); $('.star_title').hide(); });
		}
		else if (index == 3) {
			star.animate({
				'top': 430 - stars.size1.h / 2 - stars.size2.h / 2 + 5 + 'px',
				'left': 685 + stars.size1.w / 2 + 10 + 'px',
				'opacity': 0.8
			}, stars.speed/2, function() {stars.is_anim = false;});
			star.find('img').animate({
				'width': stars.size2.w + 'px',
				'height': stars.size2.h + 'px'
			}, stars.speed/2, function() { star.css({'z-index': 1}); $('.star_title').hide(); });
		}
		else if (index == 4) {
			star.animate({
				'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
				'left': 685 + stars.size1.w / 2 + stars.size2.w + 20 + 'px',
				'opacity': 0.6
			}, stars.speed/2, function() {stars.is_anim = false;});
			star.find('img').animate({
				'width': stars.size3.w + 'px',
				'height': stars.size3.h + 'px'
			}, stars.speed/2, function() { star.css({'z-index': 1}); $('.star_title').hide(); });
		}
	},
	hover_over_ie: function(star) {
		if (!stars.is_anim) {
			$('.star_title').hide();
			var index = $('.star').index(star);
			if (index == 0) {
				star.css({'z-index': 10});
				star.animate({
					'top': 430 - stars.size1.h + 'px',
					'left': 685 - stars.size1.w - stars.size2.w - stars.size3.w / 2 - 20 + 'px'
				}, stars.speed/2);
			}
			else if (index == 1 ) {
				star.css({'z-index': 10});
				star.animate({
					'top': 430 - stars.size1.h + 'px',
					'left': 685 - stars.size1.w - stars.size2.w / 2 - 10 + 'px'
				}, stars.speed/2);
			}
			else if (index == 3) {
				star.css({'z-index': 10});
				star.animate({
					'top': 430 - stars.size1.h + 'px',
					'left': 685 + stars.size2.w / 2 + 10 + 'px'
				}, stars.speed/2);
			}
			else if (index == 4) {
				star.css({'z-index': 10});
				star.animate({
					'top': 430 - stars.size1.h + 'px',
					'left': 685 + stars.size2.w + stars.size3.w / 2 + 20 + 'px'
				}, stars.speed/2);
			}
			star.find('img').animate({
				'width': stars.size1.w + 'px',
				'height': stars.size1.h + 'px'
			}, stars.speed/2, function() { star.find('.star_title').show(); });
		}
	},
	hover_out_ie: function(star) {
		var index = $('.star').index(star);
		$('.star_title').hide();
		if (index == 0) {
			star.animate({
				'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
				'left': 685 - stars.size1.w / 2 - stars.size2.w - stars.size3.w - 20 + 'px'
			}, stars.speed/2);
			star.find('img').animate({
				'width': stars.size3.w + 'px',
				'height': stars.size3.h + 'px'
			}, stars.speed/2, function() { star.css({'z-index': 1}); $('.star_title').hide(); });
		}
		else if (index == 1) {
			star.animate({
				'top': 430 - stars.size1.h / 2 - stars.size2.h / 2 + 5 + 'px',
				'left': 685 - stars.size1.w / 2 - stars.size2.w - 10 + 'px'
			}, stars.speed/2);
			star.find('img').animate({
				'width': stars.size2.w + 'px',
				'height': stars.size2.h + 'px'
			}, stars.speed/2, function() { star.css({'z-index': 1}); $('.star_title').hide(); });
		}
		else if (index == 3) {
			star.animate({
				'top': 430 - stars.size1.h / 2 - stars.size2.h / 2 + 5 + 'px',
				'left': 685 + stars.size1.w / 2 + 10 + 'px'
			}, stars.speed/2);
			star.find('img').animate({
				'width': stars.size2.w + 'px',
				'height': stars.size2.h + 'px'
			}, stars.speed/2, function() { star.css({'z-index': 1}); $('.star_title').hide(); });
		}
		else if (index == 4) {
			star.animate({
				'top': 430 - stars.size1.h / 2 - stars.size3.h / 2 - 10 + 'px',
				'left': 685 + stars.size1.w / 2 + stars.size2.w + 20 + 'px'
			}, stars.speed/2);
			star.find('img').animate({
				'width': stars.size3.w + 'px',
				'height': stars.size3.h + 'px'
			}, stars.speed/2, function() { star.css({'z-index': 1}); $('.star_title').hide(); });
		}
	}
}
