	jQuery("document").ready(function(){
		var menu = {
			"step":0,
			"init":true,
			"todo":function() {
				for (var i = 1; i <= 8; i++) {
					jQuery ("#menu_"+i+" > a").attr("alt", i);
					jQuery ("#menu_"+i+" > a").click(function(){
						var num = jQuery (this).attr("alt");
						if(menu.step != num) {
							if (menu.init == false) {
								jQuery ("#menu_"+menu.step+" > dl").hide("blind", {direction: "vertical"}, 300);
								jQuery ("#menu_"+menu.step+" > a.menu").attr("class", "hiddenTxt menu");
							}
							jQuery ("#menu_"+num+" > dl").show("blind", {direction: "vertical"}, 300);
							jQuery ("#menu_"+num+" > a.menu").attr("class", "hiddenTxt menu step");
							menu.step = num;
							menu.init = false;
						}
					});
				}
			}
		};
		menu.todo();
		
		var top = {
			"arr":new Array(),
			"step":1,
			"init":true,
			"todo":function() {
				for (var i = 1; i <= 5; i++) {
					jQuery ("#top_"+i).attr("alt", i);
					jQuery ("#top_"+i).mouseover(function(){
						var num = jQuery (this).attr("alt");
						if(top.step != num) {
							jQuery (this).css("background-position", "left bottom");
						}
					});
					jQuery ("#top_"+i).mouseout(function(){
						var num = jQuery (this).attr("alt");
						if(top.step != num) {
							jQuery (this).css("background-position", "left top");
						}
					});
					jQuery ("#top_"+i).click(function(){
						var num = jQuery (this).attr("alt");
						if(top.step != num) {
							if (top.init == false) {
								jQuery ("#top_"+top.step).css("background-position", "left top");
							}
							jQuery ("#top_"+num).css("background-position", "left bottom");
							top.step = num;
							top.init = false;
						}
						top.insert(top.step-1);
					});
				}
				jQuery ("#top_"+top.step).css("background-position", "left bottom");
				top.init = false;
				top.xml();
			},
			"insert":function(num) {
				jQuery ("#topDisplay > .txt > h3").text(top.arr["title"][num]);
				jQuery ("#topDisplay > .txt > p").text(top.arr["txt"][num]);
				jQuery ("#topDisplay > .txt > .btn > a").attr("href",top.arr["url"][num]);
				jQuery ("#topDisplay > .pic > a").attr("href",top.arr["url"][num]);
				jQuery ("#topDisplay > .pic > .img > img").attr("src",top.arr["pic"][num]);
				star.range = top.arr["rate"][num];
				star.todo();
			},
			"xml":function() {
				top.arr["title"] = new Array();
				top.arr["txt"] = new Array();
				top.arr["url"] = new Array();
				top.arr["pic"] = new Array();
				top.arr["rate"] = new Array();
				jQuery.ajax({
					type: "GET",
					url: "top.xml",
					dataType: "xml",
					success: function(xml) {
						var i = 0;
						jQuery (xml).find("top").each(function(){
							top.arr["title"][i] = jQuery (this).find("title").text();
							top.arr["txt"][i] = jQuery (this).find("txt").text();
							top.arr["url"][i] = jQuery (this).find("url").text();
							top.arr["pic"][i] = jQuery (this).find("pic").text();
							top.arr["rate"][i] = jQuery (this).find("rate").text();
							i++;
						});
						top.insert(0);
					}
				});
			}
		};
		top.todo();
		
		var star = {
			"init":true,
			"step":1,
			"range":0,
			"todo":function() {
				if (star.init == true) {
					for (var i = 1; i <= 5; i++) {
						jQuery ("#star_"+i+" > a").attr("alt", i);
						jQuery ("#star_"+i+" > a").hover(function(){
							var num = jQuery (this).attr("alt");
							if (star.step > num && num != 1) {
								jQuery ("#star_"+star.step+" > a").css("background-position", "left top");
							} else {
								for (var s = 5; s >= num; s--) {
									jQuery ("#star_"+s+" > a").css("background-position", "left top");
								}
							}
							if (star.step < num && num != 5) {
								jQuery ("#star_"+num+" > a").css("background-position", "left bottom");
							} else {
								for (var s = 1; s <= num; s++) {
									jQuery ("#star_"+s+" > a").css("background-position", "left bottom");
								}
							}
							star.step = num;
						});
						jQuery ("#star_"+i+" > a").click(function(){
							var num = jQuery (this).attr("alt");
							for (var s = 5; s >= num; s--) {
								jQuery ("#star_"+s+" > a").css("background-position", "left top");
							}
							for (var s = 1; s <= num; s++) {
								jQuery ("#star_"+s+" > a").css("background-position", "left bottom");
							}
							star.range = num;
						});
						jQuery ("#rate_1").mouseleave(function(){
							if (star.step > star.range) {
								for (var s = 5; s > star.range; s--) {
									jQuery ("#star_"+s+" > a").css("background-position", "left top");
								}
							} else {
								for (var s = 1; s <= star.range; s++) {
									jQuery ("#star_"+s+" > a").css("background-position", "left bottom");
								}
							}
						});
					}
					star.init = false;
				} else {
					for (var s = 5; s >= 1; s--) {
						jQuery ("#star_"+s+" > a").css("background-position", "left top");
					}
					for (var s = 1; s <= star.range; s++) {
						jQuery ("#star_"+s+" > a").css("background-position", "left bottom");
					}
				}
			}
		};
		star.todo();
		
		var hot = {
			"todo":function() {
				var elm = jQuery ("#hotMenu > li").length-1;
				var pos = jQuery ("#hotMenu > li").width()+10;
				var end = pos*elm-jQuery ("#hot > .con > .mask").width();
				var move = 0;
				jQuery ("#hot > .con > .prev").click(function(){
					if (move > 0) {
						move -= pos;
						jQuery ("#hotMenu").animate({
							left:-move
						}, 600, "easeInSine");
					}
				});
				jQuery ("#hot > .con > .next").click(function(){
					if (move < end) {
						move += pos;
						jQuery ("#hotMenu").animate({
							left:-move
						}, 600, "easeOutSine");
					}
				});
			}
		};
		hot.todo();
	});

