	var fontClassFilters = [];
	var Font = function(){this.init.apply(this, arguments)};
	Font.prototype = {
		fontPath: '/fonts/',
		init: function(swf, options){
			this.swf = this.fontPath + swf;
			this.setOptions(options || {});
			String.prototype.rgbToHex = this.rgbToHex;
			String.prototype.toHex = this.toHex;
			Array.prototype.indexOf = this.indexOf;
		},
		setOptions: function(o){
			this.options = {
				sizeAdjust: o.sizeAdjust || 0,
				color: o.color || o.sColor,
				bgcolor: o.bgcolor,
				width: o.width,
				height: o.height,
				align: o.align || 'left',
				sWmode: o.sWmode || 'transparent',
				tags: o.tags || '',
				classFilter: o.classFilter || ''
			}
			if(o.classFilter) fontClassFilters[fontClassFilters.length] = o.classFilter;
		},
		replace: function(tags){
			var tags = (tags || this.options.tags).split(',');
			for(var i=0; tag=tags[i]; i++)
				this.replaceTag(tag);
		},
		replaceTag: function(tag){
			this.replaceElements(document.getElementsByTagName(tag));
		},
		replaceElements: function(els){
			for(var i=0; el=els[i]; i++)
				this.replaceElement(el);
		},
		replaceElement: function(el){
			var o = this.options;
			//if(!this.hasFlash || el.oldHTML || (!o.classFilter && this.hasClassName(el, fontClassFilters)) || (o.classFilter && el.className.indexOf(o.classFilter)==-1) ) return;
	
			var c = this.options.color || el.style.color || document.defaultView ? document.defaultView.getComputedStyle(el, null).color : el.currentStyle ? el.currentStyle.color : '#000001';
					
			if(c.indexOf('rgb') > -1) c = '#'+c.rgbToHex();
			else if(c.length == 4) c = '#'+c.charAt(1)+c.charAt(1)+c.charAt(2)+c.charAt(2)+c.charAt(3)+c.charAt(3);
			var width = o.width || (el.offsetWidth + o.sizeAdjust) * .9;//fix for ie floats
			var height = o.height || el.offsetHeight;
			var lines = el.innerHTML.split(/\r?\n|\r/).length;
			height = height*lines;
			var sVars = 'txt=' + escape(el.innerHTML) + '&amp;textcolor=' + c + '&amp;textalign=' + o.align + '&amp;w=' + width + '&amp;h=' + (height+o.sizeAdjust) + '';
			el.oldHTML = el.innerHTML;
			el.innerHTML = '<span><embed type="application/x-shockwave-flash" src="' + this.swf + '" quality="best" wmode="' + o.sWmode + '" bgcolor="' + o.bgcolor + '" flashvars="' + sVars + '" width="' + width + '" height="' + height + '" sifr="true"></embed></span>';
		},
		hasClassName: function(el, classNames) {
			var classNames = el.className.split(' ');
			for(var i=0; cn=classNames[i]; i++)
				if(classNames.indexOf(cn)) return true;
			return false;
		},
		indexOf: function(needle){
			for(var i=0; val=this[i]; i++)
				if(val == needle) return i;
			return -1;
		},
		toHex: function(){//borrowed from mootools.net
			var N = parseInt(this);
			if (N==0 || isNaN(N)) return "00";
			N = Math.round(Math.min(Math.max(0,N),255));
			return "0123456789abcdef".charAt((N-N%16)/16) + "0123456789abcdef".charAt(N%16);
		},
		rgbToHex: function(){//borrowed from mootools.net
			var rgb = this.match(/[rgba]{3,4}\(([\d]{0,3}),[\s]([\d]{0,3}),[\s]([\d]{0,3})\)/);
			return rgb[1].toHex()+rgb[2].toHex()+rgb[3].toHex();
		},
		hasFlash: function(){//borrowed from the original sIFR
			var nRequiredVersion = 6;
			if(navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.indexOf("Windows") > -1){
				document.write('<script language="VBScript"\> \non error resume next \nhasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & ' + nRequiredVersion + '))) \n</script\> \n');
				if(window.hasFlash != null)
					return window.hasFlash;
			};
			if(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
				var flashDescription = (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description;
				return parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1)) >= nRequiredVersion;
			};
			return false;
		}()
	};
	
	
	var akzidenz = new Font("akzidenz.swf");
	akzidenz.setOptions({ height: 33,width:300 });
	akzidenz.replaceElements($(".primary h1").get());
	
	akzidenz.setOptions({ height: 25 });
	akzidenz.replaceElements($(".secondary h2").get());
	
	akzidenz.setOptions({ height: 23 });
	akzidenz.replaceElements($(".summary h2").get());
	
	akzidenz.setOptions({ height: 35 });
	akzidenz.replaceElements($(".banner h2").get());

	akzidenz.setOptions({ height:23, align:'center' });
	akzidenz.replaceElements($(".quote-box").get());
	
	akzidenz.setOptions({ height:35 });
	akzidenz.replaceElements($(".sector h4").get());

	akzidenz.setOptions({ height:35 });
	akzidenz.replaceElements($(".section h2").get());

	akzidenz.setOptions({ height:40 });
	akzidenz.replaceElements($(".section h3").get());


// make default values for text boxes disappear
$(":text,textarea")
	.each(function() { if (this.value != "") this.defaultText = this.value; })
	.focus(function() { if (this.value == this.defaultText) this.value = ""; })
	.blur(function() { if (this.value == "" && this.defaultText) this.value = this.defaultText; });


// handle FAQ questions clicking
$("dl.faq>dd").hide();
$("dl.faq>dt").wrapInner("<a href=\"#\"></a>");
$("dl.faq>dt>a").click(function() { $(this).parent().toggleClass("opened").next("dd").toggleClass("opened").animate({ opacity: "toggle", height: "toggle", paddingTop: "toggle", paddingBottom: "toggle" }, 500, "swing", function() { if ($.browser.msie && $.browser.version == 7) this.style.removeAttribute("filter"); }); return false; });


/*// Google map on the "contact information" page
var $contactMap = $(".contact-map:first").empty();
var contactMap;
if ($contactMap.length)
{
	contactMap = new GMap2($contactMap[0]);
	contactMap.setMapType(G_SATELLITE_MAP);
	var center = new GLatLng(37.4419, -122.1419);
	contactMap.setCenter(center, 15);
	contactMap.addOverlay(new GMarker(center));
	contactMap.addControl(new GSmallMapControl());
	contactMap.addControl(new GMapTypeControl());
	$(window).unload(GUnload);
}
*/

/*// Google map on the "where wo work" page
var $workMap = $(".where-we-work-map:first").empty();
var workMap;
if ($workMap.length)
{
	workMap = new GMap2($workMap[0]);
	workMap.setMapType(G_NORMAL_MAP);
	workMap.setCenter(new GLatLng(0, 0), 1);

	var icon = new GIcon(G_DEFAULT_ICON);
	icon.image = "http://localhost/world_relief_canada/images/map_flag.png";
	icon.shadow = "http://localhost/world_relief_canada/images/map_flag_shadow.png";
	icon.iconSize = new GSize(21, 38);
	icon.shadowSize = new GSize(43, 38);
	icon.iconAnchor = new GPoint(10, 37);
	icon.infoWindowAnchor = new GPoint(10, 0);

	// example and random marker positions, please replace of course!
	workMap.addOverlay(new GMarker(new GLatLng(37, 15), { icon: icon }));
	workMap.addOverlay(new GMarker(new GLatLng(16, -40), { icon: icon }));
	workMap.addOverlay(new GMarker(new GLatLng(-27, 23), { icon: icon }));
	workMap.addOverlay(new GMarker(new GLatLng(11, -5), { icon: icon }));
	workMap.addOverlay(new GMarker(new GLatLng(-4, 80), { icon: icon }));
	workMap.addOverlay(new GMarker(new GLatLng(20, -23), { icon: icon }));

	workMap.addControl(new GSmallMapControl());
	workMap.addControl(new GMapTypeControl());
	//$(window).unload(GUnload);
}

*/
/*// gallery slider
var $gallery = $(".photo-gallery");
if ($gallery.length)
{
	$gallery.each(function()
	{
		$(this).children("ul").before("<p class=\"previous\"><a href=\"#\">&lt;</a></p>").after("<p class=\"next\"><a href=\"#\">&gt;</a></p>").wrap("<div class=\"clip\"></div>");
		$(this).children(".clip").width(Math.floor(($(this).width() - 35) / 84) * 84);
		var w = 84;
		$(this).find(">.clip>ul>li").each(function() { w += $(this).outerWidth(); });
		$(this).find(">.clip>ul").width(w);
	});

	$gallery.find(">.next>a").click(function()
	{
		var $list = $(this).parents(".gallery").find(">.clip>ul");
		if ($list.is(":animated"))
			return false;
		$list.stop().animate({ left: "-=84px" }, 300, "swing", function() { $(this).animate({ left: "+=84px" }, 0).children("li:first").remove(); }).children("li:first").clone(true).appendTo($list);
		return false;
	});

	$gallery.find(">.previous>a").click(function()
	{
		var $list = $(this).parents(".gallery").find(">.clip>ul");
		if ($list.is(":animated"))
			return false;
		$list.stop().animate({ left: "-84px" }, 0).animate({ left: "+=84px" }, 300, "swing", function() { $(this).children("li:last").remove(); }).children("li:last").clone(true).prependTo($list);
		return false;
	});

	$gallery.find(">.clip>ul>li>a").click(function()
	{
		var $current = $(this).parents(".gallery").find(".current");
		$current.find(".contents img:first").attr("src", $(this).attr("href"));
		var str = $(this).children("img").attr("alt");
		var i = str.indexOf(":");
		$current.find(">.description>h4").text(str.substring(0, i));
		$current.find(">.description>p:first").text(str.substring(i + 1));
		return false;
	});
}

//video gallery
var $gallery = $(".video-gallery");
if ($gallery.length)
{
	$gallery.each(function()
	{
		$(this).children("ul").before("<p class=\"previous\"><a href=\"#\">&lt;</a></p>").after("<p class=\"next\"><a href=\"#\">&gt;</a></p>").wrap("<div class=\"clip\"></div>");
		$(this).children(".clip").width(Math.floor(($(this).width() - 35) / 84) * 84);
		var w = 84;
		$(this).find(">.clip>ul>li").each(function() { w += $(this).outerWidth(); });
		$(this).find(">.clip>ul").width(w);
	});

	$gallery.find(">.next>a").click(function()
	{
		var $list = $(this).parents(".gallery").find(">.clip>ul");
		if ($list.is(":animated"))
			return false;
		$list.stop().animate({ left: "-=84px" }, 300, "swing", function() { $(this).animate({ left: "+=84px" }, 0).children("li:first").remove(); }).children("li:first").clone(true).appendTo($list);
		return false;
	});

	$gallery.find(">.previous>a").click(function()
	{
		var $list = $(this).parents(".gallery").find(">.clip>ul");
		if ($list.is(":animated"))
			return false;
		$list.stop().animate({ left: "-84px" }, 0).animate({ left: "+=84px" }, 300, "swing", function() { $(this).children("li:last").remove(); }).children("li:last").clone(true).prependTo($list);
		return false;
	});

	$gallery.find(">.clip>ul>li>a").click(function()
	{
		var $current = $(this).parents(".gallery").find(".current");
		$current.find(".contents img:first").attr("src", $(this).attr("href"));
		var str = $(this).children("img").attr("alt");
		var i = str.indexOf(":");
		$current.find(">.description>h4").text(str.substring(0, i));
		$current.find(">.description>p:first").text(str.substring(i + 1));
		return false;
	});
}*/


$("form.materials a.more").click(function() { var html = $.post($(this).attr("href"), function(data) { Shadowbox.open({ player: "html", content: data, height: 120, width: 410 }); }); return false; });

var objects = $('A[rel="shadowbox[photos]"]');
var items = [];
$.each(	objects, function(i,val){ items[i] = { player:"img", content: this.href, title: this.name }; $(this).click(function(){ Shadowbox.open(items);Shadowbox.change(i);return false; })   });
//$(function() { Shadowbox.open(items); }); </script>



// fixes for IE6
if ($.browser.msie && $.browser.version == 6)
{
	$(".footer input.button,button,ul.menu li,.banner ul.tabs a").bind("mouseenter mouseleave", function() { $(this).toggleClass("hover"); });
	$(".header .buttons a").hover(function() { $(this).find(">img").css("margin-top", "-54px"); }, function() { $(this).find(">img").css("margin-top", "0"); });
}

$(function()
{
	$('.banner .tabs').tabs({fx: { opacity: 'toggle' }}).tabs('rotate', 20000,true);
});