function items()
{
	
	var template = $("#template").html();
	var useritems = $("#useritems").text();
	var user = $("#user").text();
	
	if (useritems == 'blank' && user != '')
	{
		useritems = user;
		$("#useritems").text(user);
		parent.location.href = user;
	}

	//var usern = $("#user").val();
	var qstring = "functions/get_items.php?username=" + useritems;
	var lstring = "functions/get_feed.php?username=" + useritems;
	
	$("#loading").ajaxStart(function(){
		$(this).attr('src', 'pres/img/loading.gif')
	});
	
	$("#loading").ajaxStop(function(){
		$(this).attr('src', 'pres/img/loading_off.gif')
	});
	
	$.ajax({
		type: "GET",
		url: lstring,
		dataType: "xml",
		success: function(xml) {
			var error = $(xml).find('error').text();
			var title = $(xml).find('title').text();
			var note = $(xml).find('note').text();
			var icon = $(xml).find('icon').text();
			var link = $(xml).find('link').text();
			
			if (error == '')
			{
				$("#feedtitle").html(title);
			}
		
		}
	});
	
	$.ajax({
	type: "GET",
	url: qstring,
	dataType: "xml",
	success: function(xml) {

		var error = $(xml).find('error').text();
		if (error != '')
		{
			if (useritems != 'blank')
			{
				showmessage(error);
			}
			$("#loadtext,#register").hide();
			$("#welcome,#wrap").show();
		}
		if (error == '')
		{
			$("#welcome").hide();
			$('#items').html("");
			$("#loadtext").hide();
			$("#wrap").show();
		}
		
		$(xml).find('item')
			.each(function(){
				
				var defaultview = $("#defaultview").text();
				var itemid = $(this).attr("id");
				var title = $(this).find('title').text();
				var date = $(this).find('date').text();
				var uri = $(this).find('uri').text();
				var type = $(this).find('type').text();
				var icon = $(this).find('icon').text();
				var media = $(this).find('media').text();
				if (type == "web")
				{
					var nomediaflag = 1;
				}
				var note = $(this).find('note').text();
				//var tags = $(this).find('tags').text();
				var rating = $(this).find('rating').text();
				var price = $(this).find('price').text();
				var thumb = $(this).find('thumb').text();
				var full = $(this).find('full').text();

				$(".item:first")
					.clone()
					.appendTo("#items")
					.attr({title: itemid})
					.addClass('item')
					.addClass(defaultview);
				
				if (type == "image" || type == "flickr")
				{
					$("div[title=" + itemid + "]").addClass("image");
				}
				if (type == "youtube" || type == "vimeo" || type == "video")
				{
					$("div[title=" + itemid + "]").addClass("video");
				}
				if (type == "amazon" || type == "vimeo" || type == "product")
				{
					$("div[title=" + itemid + "]").addClass("product");
				}
				
				$("div[title=" + itemid + "]").find(".title").text(title).attr({href: uri});
				$("div[title=" + itemid + "]").find(".icon").attr({src: icon});
				if (nomediaflag != 1)
				{
					$("div[title=" + itemid + "]").find(".media").html(media);
					$("object").attr({width: "222"});
					$("embed").attr({width: "222"});
					$("div[title=" + itemid + "] .media img").attr({width: "222"});
					$("div[title=" + itemid + "]").find(".note").hide();
				}
				if (nomediaflag == 1)
				{
					$("div[title=" + itemid + "]").find(".media").css({border:"0"});
					/* $("div[title=" + itemid + "]").find(".note").hide(); */
				}
				
				$("div[title=" + itemid + "]").find(".note").html(note);
				//$("div[title=" + itemid + "]").find(".tags").text(tags);
				
				var ratingstars ='';
				var ind;
				if (rating > 0)
				{
					for (ind=1;ind<=rating;ind=ind+1) 
					{
						ratingstars = ratingstars + '<img src="pres/img/feedstar.png" class="star"/>';
					}
				}
				
				$("div[title=" + itemid + "]").find(".rating").html(ratingstars);
				$("div[title=" + itemid + "]").find(".thumb").text(thumb);
				$("div[title=" + itemid + "]").find(".full").text(full);
				$("div[title=" + itemid + "]").find(".date").text(date);
				
			}); //close each(
			
					
		}//close success
	}); //close $.ajax(			
}; //close func

/*

					
					
					
					
					
					
*/