﻿/// <reference path="..\jquery-1.4.1-vsdoc.js" />
/// <reference path="..\jquery.corner.js" />

$(document).ready(function () {
	var tags = $(".tag");

	tags.click(function () {
		var anchor = $(this);
		$.ajax({
			type: "GET",
			cache: false,
			dataType: "html",
			url: $(this).attr("href"),
			success: function (data, textStatus) {
				return function (el) {
					$(".tag").removeClass("tagselected");

					if (!el.hasClass("cleartag"))
						el.addClass("tagselected");

					$(".portfoliolist").html(data);
				} (anchor);
			},
			error: function (XMLHttpRequest, textStatus, errorThrown) {
				window.location = $(this).attr("href");
			}
		});

		return false;
	});
});
