var elInterval = null;

function attachProjectEvent(categoryId, proyectId) {
	//getProjectListing(categoryId,"",1);
	$("div#wrap div#content div#content_left div.nav_menu ul li").click(function() {
		var id = $(this).attr("id").split("_");
		getProjectListing(id[1], "");
	});
}

function attachProjectContentEvent() {
	$("div#wrap div#content div#content_left div.nav_sub_menu ul li").click(function() {
		var id = $(this).attr("id").split("_");
		window.location = URL + "project/" + id[1];
	});
}

function attachProjectSlideEvent() {
	function fader() {
		var next = (current + 1) % length;
		photos.eq(current).fadeOut(effectTime, function() {
			photos.eq(next).fadeIn(effectTime, function() {
				current = next;
				elInterval = setTimeout(fader, loopTime);
			});
		});
	}

	var photos = $("div#wrap div#content div#content_right div img"),
		length = photos.size(),
		current, effectTime, loopTime;

	if (length > 1) {
		effectTime = 2000;
		loopTime = 2000;
		current = 0;
		photos.removeClass("active")
			.eq(current).show();
		elInterval = setTimeout(fader, loopTime);
	}
}

function removeFilter(element) {
	try {
		element.style.removeAttribute("filter");
	}
	catch (e) {
	}
}

function attachMemberEvent(memberId) {
	$("div#wrap div#content div#content_left div.nav_menu ul li").click(function() {
		var id = $(this).attr("id").split("_");
		getMember(id[1]);
	});
}
