var galleryNum=0;
if(typeof Cufon=="function"){
	Cufon.replace('h1').replace('h2');
}
if(typeof(Shadowbox)!="undefined"){
	Shadowbox.init({
		skipSetup: true,
		players:    ["iframe"]
	});
}
$(document).ready(function(){
	$('a[rel=blank]').attr("target","_blank");
	$('#cookie-mail').click(function(){ popCookieMail() });
	$('.narrow-section-div a.pop').each(function(){
		var t=$(this);
		t.click(function(){ popCookieFinder(t.attr("id")); });	
	});
	$('#letters-div a').each(function(){
		var g=++galleryNum;
		$(this).click(function(){ popGallery(g) });
	});
});
function popGallery(galleryId){
	Shadowbox.open({
		content:    '/inc/pop-gallery.inc.php?id='+galleryId,
		player:		["iframe"],
		title:      'Letters of Appreciation',
		width:      400,
		height:     600
	});
}
function popCookieMail(){
	Shadowbox.open({
		content:    '/inc/pop-send-cookie-mail.inc.php',
		player:		["iframe"],
		title:      'Send a Hero CookiEmail',
		width:      400,
		height:     400
	});
}
function popCookieFinder(type){
	title=type=="troops"?"Send Cookies to the troops":"Find cookies near you";
	Shadowbox.open({
		content:    '/inc/pop-find-cookies.inc.php?type='+type,
		player:		["iframe"],
		title:      title,
		width:      500,
		height:     550
	});
}
