$(function(){
	$.ajaxSetup( { 
		 global: true,
		 type: "POST",
		 ifModified:true
	} ); 
	
});

function getGang(cateid){
	$.get("/index.php/gang/listGangNameByCate/index/"+cateid, { name: "John", time: "2pm" },
	   function(data){
		data = "<option>选择该分类群组</option>"+data;
		$("#gangname").empty();
		$("#gangname").append(data);
		$("#gangForm").attr("action", "/index.php/gang/loadMain/");

	   } 
	); 

}

function setGangformUrl(gangid){
	$("#gangForm").attr("action", "/index.php/gang/viewGang/show/"+gangid);
}

function choosegroup(frid, gid){
		$.blockUI({ message: $('#box_container'), 
					focusInput: false,
					css:{width: '3px', height: '0px', cursor: 'auto', border: '0px solid #E0ECFF', background: 'transparent'},  
					overlayCSS:{ opacity: '0.1', cursor: 'auto' }
				});

		$('#box_button').hide();
}

function lightuser(item){
	uid = $(item).attr("rel");
	invite = $(item).attr("href");
	$("#link_blog").attr("href", "http://www.longhaier.com/index.php/blog/blog/index/"+uid);
	$("#link_photo").attr("href", "http://www.longhaier.com/index.php/document/upload/showList/"+uid+"/image");
	$("#link_vote").attr("href", "http://www.longhaier.com/index.php/component_vote/votelist/voteperson/"+uid);
	$("#link_dog").attr("href", "http://www.longhaier.com/index.php/component_dog/dogshow/index/"+uid);


	$(".light_img").attr("src", $(item).find("img").attr("src"));
	$(".light_a").attr("href", invite);
	$(".light_name").text($(item).attr("title"));
	$(".light_info").text($(item).attr("alt"));

	$(".lightuser").find("img").css("border","1px solid #D8D3D0"); 
	$(item).find("img").css("border","1px solid #FFFF33"); 
}

function nologin(href){
	showMsg(message, "请注意");
	if (href!=undefined) {	
		$("#forward").val(href);	
	}
}

circulateid = 1;
circulatetotal = 7;
function circulate(){
	showid = circulateid+1;
	if (showid > circulatetotal) showid = 1;
	$("#circulate"+circulateid).fadeIn("slow"); 
	$("#circulate"+circulateid).hide();	
	$("#circulate"+showid).show();	
	circulateid = showid;

	bigitem = $("#circulate"+showid).find(".lightuser");
	$(".lightuser").find("img").css("border","1px solid #D8D3D0"); 
	$(bigitem.find("img").get()[0]).css("border","1px solid #FFFF33")
	uid = bigitem.attr("rel");
	invite = bigitem.attr("href");

	$("#link_blog").attr("href", "http://www.longhaier.com/index.php/blog/blog/index/"+uid);
	$("#link_photo").attr("href", "http://www.longhaier.com/index.php/document/upload/showList/"+uid+"/image");
	$("#link_vote").attr("href", "http://www.longhaier.com/index.php/component_vote/votelist/voteperson/"+uid);
	$("#link_dog").attr("href", "http://www.longhaier.com/index.php/component_dog/dogshow/index/"+uid);
	//$("#link_invite").attr("href", invite);

	$(".light_img").attr("src", bigitem.find("img").attr("src"));
	$(".light_a").attr("href", invite);
	$(".light_name").text(bigitem.attr("title"));
	$(".light_info").text(bigitem.attr("alt"));

}