function popUp(URL) { 
	return window.open(URL, new Date().getTime(), 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=914,height=572,left = 503,top = 314');
} 

$(function() {
	$('li.fold-up > a').mouseover(function() {
		if(this.clicked) return;
		$(this).parents('li:first').removeClass('fold-up').addClass('fold-down');
	})
	.mouseout(function() {
		if(this.clicked) return;
		$(this).parents('li:first').removeClass('fold-down').addClass('fold-up');
	})
	.click(function() {
		$(this).parents('li:first').find('ul').toggle();
		this.clicked = !this.clicked;
		return false;
	})
	.css('cursor', 'pointer');
});

$(document).click(function(event) {
    if (event.target.tagName.toLowerCase() == "a") {
        eventCheck(event.target.getAttribute("href"));
    }
});

function eventCheck(href){
	if (href.match(/^https?\:/i) && !href.match(document.domain)) {
		_gaq.push(['_trackEvent', 'External', 'click', href]);
	} else if (href.match(/^mailto\:/i)) {
		_gaq.push(['_trackEvent', 'Email', 'click', href.substr(7)]);
	} else if (href.match(/^.*\.(pdf|jpg|png|gif|zip|mp3|txt|doc|rar)$/i)) {
		_gaq.push(['_trackEvent', 'Download', 'click', href]);
	}
}
