$(document).ready(function() {
	$("#nav > ul > li > a").mouseover(function() {
		var list = $(this).parent().children("ul")
		var el = $(this).parent();
		if(navigator.appVersion.indexOf("MSIE 6.0")>0) {
			$("#nav ul ul").not(list).hide();
			list.show();
		}
		list.css({
			top: el.position()['top']+el.height()-4,
			left: el.position()['left']
		});
	})
	if(navigator.appVersion.indexOf("MSIE 6.0")>0) {
		$(document.body).click(function(){
			setTimeout(function(){
				$("#nav ul ul").hide();
			},50)
		});
	}
	
	// START TOP OF PAGE LINK
	// hide #back-top first
	$("#back-top").hide();
	
	// fade in #back-top
	$(function () {
		$(window).scroll(function () {
			if ($(this).scrollTop() > 100) {
				$('#back-top').fadeIn();
			} else {
				$('#back-top').fadeOut();
			}
		});

		// scroll body to 0px on click
		$('#back-top a').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});
	});

  	// END TOP OF PAGE LINK
});
/* by Daniel Lever at CRE8IVE, 2010 */
var showreel = {
	"selected":null,
	"timer":null,
	"init":function() {
		showreel.arrow = $("#showreel .items .arrow");
		// setup arrow events
		$("#showreel .items > a").click(function() {
			showreel.fadeTo(this,true);
			return false;
		})
		showreel.fadeTo($("#showreel .items > a:first"),true);
	},
	"fadeTo":function(el,keepGoing) {
		showreel.selected = $(el);
		$("#showreel .display .stub").remove();
		$("#showreel a").removeClass("selected");
		$(el).addClass("selected");
		$("#showreel .arrow").hide().css({
			left: $(el).position()["left"]+$(el).width()/2+5,
			visibility: "visible"
		}).fadeIn();
		var stub = $("#showreel .display").append("<div class=\"stub\" style=\"display: none;\"><img src=\""+$(el).attr("rel")+"\" /></div>").children(".stub")
		stub.fadeIn(function() { $("#showreel .display").html("<a href=\""+$(el).attr("href")+"\" title=\""+$(el).attr("title")+"\"><img src=\""+$(el).attr("rel")+"\" title=\""+$(el).attr("title")+"\" alt=\""+$(el).attr("title")+"\"</a>"); });
		/* fade in object etc */
		clearTimeout(showreel.timer);
		if(keepGoing) {
			showreel.timer = setTimeout(function() {
				var next = $(el).next("a").size()? $(el).next("a") : $("#showreel .items > a:first");
				showreel.fadeTo(next,true);
			},4000);
		}
	}
};


