$(function () {
//checks for IE browser prior to v7, and asks to upgrade with redirect
	if ($.browser.name == "msie" && ($.browser.versionNumber == "5.5" || $.browser.versionNumber == "6")) {
		alert("Your current browser is Microsoft Internet Explorer Version " + $.browser.versionNumber + ". This website requires a minimum of IE 7 to view.  Please upgrade.");
		window.location="http://www.microsoft.com/windows/internet-explorer/default.aspx";
	}
	//linkscroll
	$('a[href*=#]').click(function() {
		if(location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname)
		{
		var target = $(this.hash);
		if(target.length)
			{
				var targetOffset = target.offset().top - 165;
				$('html, body').animate({scrollTop: targetOffset}, 800);
				return false;
			}
		}
	});
	//colorbox
	$("a[rel='ill'], a[rel='web']").colorbox({transition:"elastic"});
	/*$("a[rel='web']").colorbox({transition:"elastic", width:"80%", height:"80%", iframe:true});*/
	$('.up, .uppost').click(function() {
		var target = $("#body");
		if(target.length)
			{
				var targetOffset = target.offset().top - 165;
				$('html, body').animate({scrollTop: targetOffset}, 800);
				return false;
			}
	});
	//contact email
	$('#myForm').ajaxForm(function(data) {
		$('#contactmsg p').text('').removeClass();
		data = data.replace(/^\s+|\s+$/g, '');
		if (data=="Thank you! Your message has been sent."){
			$('#contactmsg p').append(data).addClass('success').fadeIn("slow");
			$('#myForm').resetForm();
		}
		else {
			$('#contactmsg p').append(data).addClass('error').fadeIn("slow");
		}
		
	});
});
