pagecount = 0;page = 2;username = "";separator = "\r\n";function getFirstPage(){	if($("#commas").attr("checked"))	{		separator = ",";	}	else	{		separator = "\r\n";	}	username = $("#username").val();	$("#ajax").show();	$("#status").text("Processing page 1...");	$.ajax({        type: "GET",        url: "proxy.php?method=library.getartists&user="+username,        dataType: "xml",        success: function(xml) {			$("#results").text("");			pagecount = $(xml).find('artists').attr("totalPages");			var s="";			var wordle="";			$(xml).find('artist').each(function(){			var playcount = $(this).find('playcount').text();			var name_text = $(this).find('name').text();			s += name_text+separator;			wordle +=name_text+":"+playcount+"\r\n";            }); //close each(			$("#results").text(s);			$("#wordle").text(wordle);			$("#wordle_submit").show();			$("#ajax").hide();			if(page < pagecount)			{				setTimeout("getPage()", 500); 			}			else			{				$("#status").text("Done.");				page = 2;			}        }	});	return false;}function getPage(){	$("#status").text("Processing page "+page+" of "+pagecount+"...");	$("#ajax").show();	$.ajax({        type: "GET",        url: "proxy.php?method=library.getartists&user="+username+"&page="+page,        dataType: "xml",        success: function(xml) {			var s=$("#results").text();			$(xml).find('artist').each(function(){			var name_text = $(this).find('name').text();			s += name_text+separator;            }); //close each(			$("#ajax").hide();			$("#results").text(s);			page++;			if(page < pagecount)			{				setTimeout("getPage()", 500); 			}			else			{				$("#status").text("Done.");				page = 2;			}        }	});}function textFocus(){	if($(this).val() == "%username%")	{		$(this).val("").removeClass("empty");	}}function textBlur(){	if($(this).val() == "")	{		$(this).val("%username%").addClass("empty");	}}$(document).ready(function(){	$("#username").bind("focus", textFocus).bind("blur", textBlur);});