﻿// JavaScript Document
var isList1 = true;
var isList2 = false;
var isList3 = false;
canSubmit = 60;

function getFriendList2()
{
	$.ajax({
		   type : "POST",
		   url : "/Lcommon/getAjaxDate.asp",
		   async: false,
		   dataType : "html",
		   data : {"Action":"getFriendOrderByNewRegist"
		  },
		  success : function(msg){
			  $("#FriendIndexList2").html(msg);
			  },
		  error : function(){
			  showTips("false","操作失败，请刷新后测试");
		  }
		  });
}

function getFriendList3()
{
	$.ajax({
		   type : "POST",
		   url : "/Lcommon/getAjaxDate.asp",
		   async: false,
		   dataType : "html",
		   data : {"Action":"getFriendOrderByHaveNotHeadUrl"
		  },
		  success : function(msg){
			  $("#FriendIndexList3").html(msg);
			  },
		  error : function(){
			  showTips("false","操作失败，请刷新后测试");
		  }
		  });
}

function getFriendList(obj,actionNum)
{
	$("#navlist li a").removeAttr("class");
	$(obj).addClass("lcurrent");
	$("#FriendIndexList1").hide();
	$("#FriendIndexList2").hide();
	$("#FriendIndexList3").hide();
	if(actionNum == 1)
	{
		$("#FriendIndexList1").show();
		$("div.pagination").show();
	}
	else
	{
		$("div.pagination").hide();
		if(actionNum == 2)
		{
			$("#FriendIndexList2").show();
			if($("#FriendIndexList2").html().length > 0)
			{
				$("#FriendIndexList2").show();
				
			}
			else
			{
				getFriendList2();
			}
		}
		if(actionNum == 3)
		{
			$("#FriendIndexList3").show();
			if($("#FriendIndexList3").html().length > 0)
			{
				$("#FriendIndexList3").show();
			}
			else
			{
				getFriendList3();
			}
		}
		
	}
}

function searchIndustry()
{
	if($("#Industry").val() == "")	
	{
		showTips("false","搜索内容不能为空");
		return false;
	}
	else
	{
		return true;	
	}
}

function searchSchool()
{
	if($("#School").val() == "")	
	{
		showTips("false","搜索内容不能为空");
		return false;
	}
	else
	{
		return true;	
	}
}

function searchEnjoy()
{
	if($("#Enjoy").val() == "")	
	{
		showTips("false","搜索内容不能为空");
		return false;
	}
	else
	{
		return true;	
	}
}

function canSubmitCheck()
{
	canSubmit = canSubmit - 1;
	$("#canSearchSpan").text("距下次搜索还有" + canSubmit + "秒");
	if(canSubmit < 1)
	{
		$(":submit").attr("disabled",false);
		$("#canSearchSpan").hide();
	}
}

function selectUniversity(_value)
{
	$("select").css("display","none");
	$("#SelectUniversityProvince").css("display","");
	$("#UniversityList").css("top",GetScrollTop() + 140);
	$("#UniversityList").show("slow");
	$("#selectInforSchoolType").val(_value);
	showCommonBg();
	$("#UniversityList").css("left",GetScrollLeft() + (screen.width - 800)/2);
}

function showIndustryList()
{
	$("select").css("display","none");
	$("#IndustryList").css("top",GetScrollTop() + 140);
	$("#IndustryList").show("slow");
	showCommonBg();
	$("#IndustryList li").click(function(){
			$("#Industry").attr("value",$(this).html());
			closeIndustryList();
		});
	$("#IndustryList li").css("cursor","hand");
	$("#IndustryList").css("left",GetScrollLeft() + (screen.width - 600)/2);	
}