/**
 * @author interblock
 */
$(document).ready(function(){
	$(".catLink").click(function(){
		id=$(this).attr("id");
		$("#portfolioArea").html("<p><br/></p>").addClass("portfolioLoading");
		LoadPage(id);
	});
	AssignElements();
});

function AssignElements()
{
	$(".project").hover(function(){
		$(this).addClass("projectActive");
	},function(){
		$(this).removeClass("projectActive");
	});
	$(".logo").hover(function(){
		$(this).addClass("logoActive");
	},function(){
		$(this).removeClass("logoActive");
	});
	setupZoom();
}

function LoadPage(id)
{	
	if($("#ZoomBox"))
	{
		$("#ZoomBox").remove();
		$("#ZoomSpin").remove();
		$("#ZoomCapDiv").remove();
		$("#ShadowBox").remove();
	}
	switch(id)
	{
		case "0": {
			$(".portfolio-left").load("portfolio/projects/all.html", function(){
				AssignElements();
			})
		}break;
		case "1": {
			$(".portfolio-left").load("portfolio/projects/automotive.html", function(){
				AssignElements();
			});
		}break;
		case "2": {
			$(".portfolio-left").load("portfolio/projects/business.html", function(){
				AssignElements();
			});
		}break;
		case "3": {
			$(".portfolio-left").load("portfolio/projects/education.html", function(){
				AssignElements();
			});
		}break;
		case "4": {
			$(".portfolio-left").load("portfolio/projects/sport_ent.html", function(){
				AssignElements();
			});
		}break;
		case "5": {
			$(".portfolio-left").load("portfolio/projects/hotel_rest.html", function(){
				AssignElements();
			});
		}break;
		case "6": {
			$(".portfolio-left").load("portfolio/projects/goverment.html", function(){
				AssignElements();
			});
		}break;
		case "7": {
			$(".portfolio-left").load("portfolio/projects/nonprofit.html", function(){
				AssignElements();
			});
		}break;
		case "8": {
			$(".portfolio-left").load("portfolio/projects/realestate.html", function(){
				AssignElements();
			});
		}break;
		case "9": {
			$(".portfolio-left").load("portfolio/projects/onlinetv.html", function(){
				AssignElements();
			});
		}break;
		case "50": {
			$(".portfolio-left").load("portfolio/projects/logo.html", function(){
				AssignElements();
			});
		}break;
	};
}

