$(document).ready(function() {
	$('#myGallery').spacegallery({loadingClass:"loading",perspective:80,minScale:0.3,after:function(){
		load_description();	
	}});
	$('#next_button').bind("click",function(){
		$("a",$('#myGallery')).trigger("click");
	});
	$("#thumb_er img").each(function(i){
		$(this).css({cursor:"pointer"}).click(function(){
			swap_banks(i);
		});
	});

	if (typeof $.fn.ifixpng=="function"){
		$(".fixpng").ifixpng();
	}
	

	
});
function load_description(){
	var j=imageIndex+1;
	if(j==7){j=1;}
	imageIndex=j;
	var data=[];
	data.push({1:"<b>STAGE 1</b><br />The process of recycling begins with the public who place their clean unwanted clothes, shoes, sheets and towels in carrier bags at BCR clothing banks throughout the country.",
	2:"<b>STAGE 2</b><br />A vehicle is deployed to collect the textiles from the bank on-site. BCR have a fleet of vehicles of all sizes to suit a wide range of locations.<br /><br />BCR operates with a <b>Waste Carriers Licence</b>. All drivers are fully qualified and carry ID cards at all times.",
	3:"<b>STAGE 3</b><br />The collected bags are returned to BCR headquarters. They are then weighed on-site using our own weighbridge and transferred to our warehouse for sorting and grading.<br /><br /> Then monies are paid monthly to the Local Authority, Waste Management Company, School or Charity",
	4:"<b>STAGE 4</b><br />Items are then hand sorted into different grades of clothing and textiles in BCR's extensive warehouse sorting facility. <br /><br />BCR uses predetermined categories to ensure that the best use is made of all textile & shoes when distributed worldwide.",
	5:"<b>STAGE 5</b><br />Once separated into categories, re-useable and recyclable items are then tightly packed and wrapped in protective transport bags.<br /><br />The Bags are then labelled and weighed before being despatched for shipping.",
	6:"<b>STAGE 6</b><br />They are then shipped to developing countries.<br /><br />Jobs are also created in these countries as businesses buy the clothing to sell in their local markets, shops etc.<br /> They use unskilled staff who rely heavily on the employment to feed their families."});

	$("#stage_text").html("<p>"+data[0][j]+"</p>");
}
var imageIndex=1;

function swap_banks(id){
	var data={0:{text:"<h2 class='yellow_text'>Bra Banks</h2><p>1) Interior bra banks are suitable for all secure indoor locations: Offices, banks, doctors, dentists, schools, haridressers.<br /><br />2) Ideal for Exterior locations</p>",
	img:"<img src='images/res_brabanks.jpg'  alt='Bra banks' border='0'  />"},
	1:{text:"<h2 class=\"yellow_text\">Large Banks</h2><p>Suitable for Exterior locations</p>",
	img:"<img src=\"images/res_largebanks.jpg\"  alt='Large banks' border='0'  />"},
	2:{text:"<h2 class=\"yellow_text\">Toy Banks</h2><p>Recommended for use at household waste recycling sites and busy civic amenity sites.</p>",
	img:"<img src=\"images/res_toybanks.jpg\"  alt='Toy banks' border=\"0\"  />"}
	};
	$("#thumber_text").fadeOut("fast",function(){
		$(this).html(data[id]["text"]).fadeIn("fast");
	});
	$("#thumber_img").fadeOut("fast",function(){
		$(this).html(data[id]["img"]).fadeIn("fast");
	});
}