// JavaScript Document

//   <p id="text-size"><a id="text-smaller" href="#">Smaller</a> <a id="text-larger" href="#">Larger</a> </p> 



$(function(){ 

// hide secondary tier of breadcrumbs if Special Offers is selected
if($.trim($('ul.breadcrumbs > li.selected ').text()) == "> Special offers" ){
  $('div.sub_breadcrumbs').hide();}

if($(".attribute-frontpage-header")&&window.location.pathname=="/"){
	$(".overflow-fix > #kenya:first").addClass("kenya2");
	$(".overflow-fix > #kenya:first").html('<p id="text-size"><a id="text-smaller" href="#">Smaller</a> <a id="text-larger" href="#">Larger</a> </p>');

}else{
	$("#kenya:first").addClass("kenya1");
	$("#kenya:first").html('<p id="text-size"><a id="text-smaller" href="#">Smaller</a> <a id="text-larger" href="#">Larger</a> </p>');
}
  // Begin text resize, integer values used as percentages
	$("p#text-size").data("size", 100);
	smallest = 80;
	largest = 120;
	$("a#text-smaller").click(function()
	{
		size = parseInt($("p#text-size").data("size")) - 10;
		if (size <= smallest) // if we've reached the second decrease form normal
			$(this).css("visibility", "hidden");
		if (size <= largest) // if we're decreasing from the maximun
			$("a#text-larger").css("visibility", "visible");
		$("p#text-size").data("size", (size));
		$("p").css("font-size", (size + "%"));
		return false;
	});
	$("a#text-larger").click(function()
	{
		size = parseInt($("p#text-size").data("size")) + 10;
		if (size >= largest) // if we've reached the second increase from normal
			$(this).css("visibility", "hidden");
		if (size >= smallest) // if we're increasing from the minimum
			$("a#text-smaller").css("visibility", "visible");
		$("p#text-size").data("size", (size));
		$("p").css("font-size", (size + "%"));
		return false;
	});
  });
