﻿$(document).ready(function() {
	$('.tabHome').click(function() { loadPage('index.html'); });
	$('.tabAboutUcan').click(function() { loadPage('about-ucan.html'); });
	$('.tabWhatWeDo').click(function() { loadPage('what-we-do.html'); });
	$('.tabGetInvolved').click(function() { loadPage('get-involved.html'); });
	$('.tabContactUs').click(function() { loadPage('contact-us.html'); });
	$('.tabRelatedLinks').click(function() { loadPage('related-links.html'); });

	if ($('#ucanWordMorph')) $('#ucanWordMorph').cycle({ delay: 500, speed: 1000, timeout: 5000 });

});

function loadPage(page) {
	document.location.href = page;
}

/* IE PNG fix multiple filters */
(function ($) {
	if (!$) return;
	$.fn.extend({
		fixPNG: function (sizingMethod, forceBG) {
			if (!($.browser.msie)) return this;
			var emptyimg = "images/blank.gif"; //Path to empty 1x1px GIF goes here
			sizingMethod = sizingMethod || "scale"; //sizingMethod, defaults to scale (matches image dimensions)
			this.each(function () {
				var isImg = (forceBG) ? false : jQuery.nodeName(this, "img"),
                                imgname = (isImg) ? this.src : this.currentStyle.backgroundImage,
                                src = (isImg) ? imgname : imgname.substring(5, imgname.length - 2);
				this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + sizingMethod + "')";
				if (isImg) this.src = emptyimg;
				else this.style.backgroundImage = "url(" + emptyimg + ")";
			});
			return this;
		}
	});
})(jQuery);
