///////////// PRELOAD IMAGES ////////////////

preloadArray = new Array();
function addPreload(imgSrc) { preloadArray[preloadArray.length] = imgSrc; }
var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		for (i=0; i<preloadArray.length; i++) eval("preloadImage"+i+" = newImage('"+preloadArray[i]+"');");
		preloadFlag = true;
	}
}
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

///////// END PRELOAD IMAGES /////////

////// FACTS SWAP //////

i=1;/*resets the facts to number one when loading the script*/
fact = new Array ();/*defines the facts' text*/
/* ADD OR REMOVE FACTS HERE (don't forget the backslash before ') */
fact[1] = 'Researchers have found that vegetarians are between 25 and 50 percent less likely to suffer from cancer than meat-eaters are.';
fact[2] = 'Twenty-five percent of all breast cancers are found by women while they\'re doing their own breast examinations.';
fact[3] = 'Women who eat red meat have an 88 to 330 percent higher risk of contracting breast cancer than women who don\'t eat red meat.';
fact[4] = 'Did you know that men can get breast cancer too? It\'s true!';
fact[5] = 'Every year, millions of animals suffer and die in labs in the name of "research."';
fact[6] = 'Monkeys, rats, mice, cats, dogs, and other animals are capable of feeling the same pain that humans feel. ';
/* END ADD OR REMOVE FACTS HERE */
fact_image = new Array ();/*defines the facts' text*/
/* ASSOCIATE AN IMAGE TO EACH FACT HERE (don't forget the backslash before ') */
fact_image[1] = 'Animal_Mouse.gif';
fact_image[2] = 'Animal_Monkey.gif';
fact_image[3] = 'Animal_Rat.gif';
fact_image[4] = 'Animal_Dog.gif';
fact_image[5] = 'Animal_Pig.gif';
fact_image[6] = 'Animal_Dog_2.gif';
/* END ASSOCIATE AN IMAGE HERE */
number_of_facts = fact.length-1;/*the number of facts, calculated from the array above*/

function previous() {
	var text_target = document.getElementById('facts_text'); /* sets the div where the fact will be displayed */
	var image_target = document.getElementById('animal'); /* sets the div where the image will be displayed */
	if (i==1)
		{
		i=number_of_facts;	
		}
	else 
		{
		i=i-1;
		}
	/*alert(fact[i]);*/
	text_target.innerHTML = '<p>'+fact[i]+'</p>';
	image_target.src = 'http://www.mediapeta.com/standalones/bnt/Images/'+fact_image[i]
}
function next() { 
	var text_target = document.getElementById('facts_text'); /* sets the div where the fact will be displayed */
	var image_target = document.getElementById('animal'); /* sets the div where the image will be displayed */
	if (i<number_of_facts)
		{
		i=i+1;	
		}
	else 
		{
		i=1;
		}
	text_target.innerHTML = '<p>'+fact[i]+'</p>';
	image_target.src = 'http://www.mediapeta.com/standalones/bnt/Images/'+fact_image[i]
}

////// END FACTS SWAP //////