// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function togglePageLoader() {
	$('page_loading').toggle('appear', {duration: 0.3});
}

function showScreenLoader() {
	$('screen_loading').appear({duration: 0.3});
}

function toggleMainColumnLoader() {
	$('main_loading').toggle('appear', {duration: 0.3});
}

function setActiveScreen(el) {
	$$("ul#screen_thumbs li").each(function(item) {
		$(item).removeClassName("current");
	});
	$(el).addClassName("current");
	$('screen_loading').fade({duration: 0.3});
}

function setActiveNavItem (elId) {
	$$("ul#left_navigation li").each(function(li) {
		if($(li).identify() == elId) {
			li.addClassName("current");
		} else {
			li.removeClassName("current");
		}
	});
}

function setAnchor (id) {
	base_uri = this.location.href.split("#")[0];
	this.location.href = base_uri+"#"+id;
}

function setProjectURL(id) {
	if( window.location.href.indexOf("/portfolio") > -1 ) {
		this.location.href = "/portfolio"+"#"+id;
		window.location.reload();
	} else {
		this.location.href = "/portfolio"+"#"+id;
	}
}
