function swtab(itype){
	document.getElementById("hashfld").value=document.location.hash;
	//$("#sharelist").html("<div style=\"padding:25px;padding-bottom:200px;text-align:center;font-size:15px;color:#444\"><img src=\"/i/loading.gif\" /> &nbsp; Updating &amp; Loading List... Please wait...</div>");
	$("#sharelist").css("opacity","0.35").css("filter","alpha(opacity=35)");
	clClass();
	if(itype=="popular"){$('#sel_pop').addClass('sel');}
	else if(itype=="recent"){$('#sel_rec').addClass('sel');}
	else if(itype=="justseen"){$('#sel_jus').addClass('sel');}
	else if(itype=="random"){$('#sel_rnd').addClass('sel');}
	else if(itype=="top"){$('#sel_top').addClass('sel');}
	
	var fetch_type = "type1";
	if(itype=="top" || itype=="popular"){
		fetch_type = "type2";
	}
	
	$.get("/cgi-bin/lssapi.cgi/list-fetch-inline?tabid="+itype+"&vtype="+fetch_type, function($data){
		$("#sharelist").html($data);
		$("#sharelist").css("opacity","1").css("filter","alpha(opacity=100)");
	});
}

function hashReload(){
try{
	hsh = document.location.hash;
	hashfield = document.getElementById('hashfld');
	if(hsh!=hashfield.value&&hsh!=""&&(hsh=="#recent" || hsh=="#popular" || hsh=="#justseen" || hsh=="#top" || hsh=="#random")){
		swtab(hsh.split("#")[1]);
		hashfield.value = hsh;
	}
} catch(e) {}
}

function reload_by_page(ntype,qo){
	$("#sharelist").css("opacity","0.35").css("filter","alpha(opacity=35)");
	var fetch_type_w = "type1";
	if(ntype=="top" || ntype=="popular"){
		fetch_type_w = "type2";
	}
	$.get("/cgi-bin/lssapi.cgi/list-fetch-inline?tabid="+ntype+"&vtype="+fetch_type_w+"&h="+qo, function($data){
		$("#sharelist").html($data);
		$("#sharelist").css("opacity","1").css("filter","alpha(opacity=100)");
	});
}


function reload_by_cat(cat,co){
	$("#sharelist").css("opacity","0.35").css("filter","alpha(opacity=35)");
	$.get("/" + cat + "/" +co+"?feed=1", function($data){
		$("#sharelist").html($data);
		$("#sharelist").css("opacity","1").css("filter","alpha(opacity=100)");
	});
}

//setInterval('hashReload()',1000);


