if(top.location != self.location){
	alert("您现在访问的不是玫瑰大众官方网站！\n\n点击“确定”前往玫瑰大众官方网站。");
	top.location=self.location;
}

var focus_pic_count=1;
var focus_pic_autochange;
var newtask_list_scroll;

function newtask_list_up(){
	$("#newtask_list").animate({top:"-25px"},1000,function(){
		$(this).find("li:first").appendTo(this)
		$(this).css({top:0});
	});
}

$(document).ready(function(){

$(".tablist .task_tab li").hover(function(){
	$(".task_list ul").hide().eq($(".task_tab li").removeClass("task_tab_on").index($(this).addClass("task_tab_on"))).show();
},function(){});
$(".employer .tab li").hover(function(){
	$(".employer .tab_list .tl").hide().eq($(".employer .tab li").removeClass("curr").index($(this).addClass("curr"))).show();
},function(){});
$(".worker .title a").hover(function(){
	$(".worker .worker_list").hide().eq($(".worker .title a").index(this)).show();
},function(){});

var costlist = $(".employer .cost_list").length-1;
var costlist_i = 0;
$(".employer .cost_list:first").show();
$(".employer .larr").click(function(){
	if (costlist_i > 0){
		$(".employer .cost_list").hide();
		$(".employer .cost_list").eq(costlist_i-1).show();
		costlist_i--;
	}
});
$(".employer .rarr").click(function(){
	if (costlist_i < costlist){
		$(".employer .cost_list").hide();
		$(".employer .cost_list").eq(costlist_i+1).show();
		costlist_i++;
	}	
});

$("#focus_pic_list").append("<a href=\"work01.html\" target=\"_blank\"><img src=\"http://www.51vpc.com/fashion/images/01focus_pic_02.jpg\" /></a>").prepend("<a href=\"work02.html\" target=\"_blank\"><img src=\"http://www.51vpc.com/fashion/images/01focus_pic_03.jpg\" /></a>");

$("#focus_pic_change_box").show();
$("#focus_pic_change_count").html("<strong>"+focus_pic_count+"</strong> / "+$("#focus_pic_list img").length);

$("#focus_pic_change_prev,#focus_pic_change_next").hover(function(){
	$(this).addClass("active");
},function(){
	$(this).removeClass("active");
}).click(function(){
	$("#focus_pic_list").stop(true,true);
	if(this.id=="focus_pic_change_prev"){
		$("#focus_pic_list").animate({marginLeft:0},500,function(){
			$(this).css("margin-left","-637px").find("a:last").prependTo(this);
			$("#focus_pic_change_count").html("<strong>"+(focus_pic_count==1?focus_pic_count=3:--focus_pic_count)+"</strong> / "+$("#focus_pic_list img").length);
		});
	}else{
		$("#focus_pic_list").animate({marginLeft:"-1274px"},500,function(){
			$(this).css("margin-left","-637px").find("a:first").appendTo(this);
			$("#focus_pic_change_count").html("<strong>"+(focus_pic_count==3?focus_pic_count=1:++focus_pic_count)+"</strong> / "+$("#focus_pic_list img").length);
		});
	}
});

$("#focus_pic_box").hover(function(){
	clearInterval(focus_pic_autochange);
},function(e){
	var focus_space=$(this);
	if((e.pageX<focus_space.offset().left||e.pageX>=(focus_space.offset().left+focus_space.outerWidth())||e.pageY<focus_space.offset().top||e.pageY>=(focus_space.offset().top+focus_space.outerHeight()))){
		focus_pic_autochange=window.setInterval('$("#focus_pic_change_next").click()',10000);	
	}
});

focus_pic_autochange=window.setInterval('$("#focus_pic_change_next").click()',10000);
newtask_list_scroll=window.setInterval('newtask_list_up()',2000);

$("#newtask_list").hover(function(){
	clearInterval(newtask_list_scroll);
},function(){
	newtask_list_scroll=window.setInterval('newtask_list_up()',2000);
});

$(".open_class_list").click(function(){
	$(".open_class_list").show();
	$(".task_class_list").hide();
	$(".class_name").removeClass("open_list");
	$(this).hide().parents(".class_name:first").addClass("open_list").next(".task_class_list").show();
	if($(this).parents(".class_name:first").attr("id")=="class_name_rencai"){
		$("#task_class_foot").addClass("active");
	}else{
		$("#task_class_foot").removeClass("active");
	}
	document.documentElement.scrollTop=$("#task_class_anchor").offset().top;
});

})
