//mrPix is the Left side images
//myPixu is the url that clicking the left img leads to(a href='whatever')

//mrPixr is the right side images
//myPixru is the url that clicking the img leads to(a href='whatever')

//From The Royal Fair Ads
//var myPixr = new Array ("http://www.helpinghomelesspets.com/images/rawf.jpg","http://www.helpinghomelesspets.com/images/rawf.jpg","http://www.helpinghomelesspets.com/images/rawf.jpg")
//var myPixru = new Array("http://www.royalfair.org","http://www.royalfair.org","http://www.royalfair.org")

//auction
var myPixr = new Array ("http://www.helpinghomelesspets.com/images/hhp_auction.jpg","http://www.helpinghomelesspets.com/images/hhp_auction.jpg","http://www.helpinghomelesspets.com/images/hhp_auction.jpg")
var myPixru = new Array("http://www.mycausemyauction.com/Items.aspx?a=hhp103","http://www.mycausemyauction.com/Items.aspx?a=hhp103","http://www.mycausemyauction.com/Items.aspx?a=hhp103")

//Barkham
//var myPixr = new Array ("http://www.helpinghomelesspets.com/hr_barkham.jpg","http://www.helpinghomelesspets.com/hr_barkham.jpg","http://www.helpinghomelesspets.com/hr_barkham.jpg")
//var myPixru = new Array("http://www.helpinghomelesspets.com/news/events/markham_village_music_festival.htm","http://www.helpinghomelesspets.com/news/events/markham_village_music_festival.htm","http://www.helpinghomelesspets.com/news/events/markham_village_music_festival.htm")

//BrewSomeGood
//var myPixr = new Array ("http://www.helpinghomelesspets.com/images/brewsomegood_helprescue.jpg","http://www.helpinghomelesspets.com/hr_bridget.jpg","http://www.helpinghomelesspets.com/header_right3.jpg")
//var myPixru = new Array("http://www.helpinghomelesspets.com/support","http://www.helpinghomelesspets.com/rescuestories","http://www.helpinghomelesspets.com/maillist/maillist.htm")

//Pet Fun Fest
//var myPixr = new Array ("http://www.helpinghomelesspets.com/hr_pff.jpg","http://www.helpinghomelesspets.com/hr_pff.jpg","http://www.helpinghomelesspets.com/hr_pff.jpg")
//var myPixru = new Array("http://www.petfunfest.ca","http://www.petfunfest.ca","http://www.petfunfest.ca")

//Survey
//var myPixr = new Array ("http://www.helpinghomelesspets.com/hr_survey.jpg","http://www.helpinghomelesspets.com/hr_survey.jpg","http://www.helpinghomelesspets.com/hr_survey.jpg")
//var myPixru = new Array("http://www.helpinghomelesspets.com/survey/petsurvey/index.htm","http://www.helpinghomelesspets.com/survey/petsurvey/index.htm","http://www.helpinghomelesspets.com/survey/petsurvey/index.htm")

//color me mine
//var myPixr = new Array ("http://www.helpinghomelesspets.com/images/colormemine_banner.jpg","http://www.helpinghomelesspets.com/hr_bridget.jpg","http://www.helpinghomelesspets.com/header_right3.jpg")
//var myPixru = new Array("http://www.markham.colormemine.com","http://www.helpinghomelesspets.com/rescuestories","http://www.helpinghomelesspets.com/maillist/maillist.htm")


//Usual One
//var myPixr = new Array ("http://www.helpinghomelesspets.com/images/hhpradio_banner.jpg","http://www.helpinghomelesspets.com/hr_bridget.jpg","http://www.helpinghomelesspets.com/header_right3.jpg")
//var myPixru = new Array("http://www.helpinghomelesspets.com/radio","http://www.helpinghomelesspets.com/rescuestories","http://www.helpinghomelesspets.com/maillist/maillist.htm")



var myPix = new Array("http://www.helpinghomelesspets.com/header_left_sc.jpg", "http://www.helpinghomelesspets.com/header_left_sc.jpg","http://www.helpinghomelesspets.com/header_left_sc.jpg","http://www.helpinghomelesspets.com/header_left_sc.jpg")	
var myPixu = new Array("http://www.helpinghomelesspets.com/sc","http://www.helpinghomelesspets.com/sc","http://www.helpinghomelesspets.com/sc","http://www.helpinghomelesspets.com/sc")


var seconds = 2;
	
function imgOne(){
	//Uses .length to obtain max array size + 1
	//Requires + 1 because arrays are generally base 0, and using base 1 is required to be able to use all images
	//due to the logic of randomization
	maxPix = myPix.length;
	maxPixr = myPixr.length;
	var randomNum;
	var randomNum2;
	if (document.images){
		randomNum=
		Math.floor((Math.random()*10))%maxPix;
		document.getElementById("mypics").innerHTML = '<a href="'+myPixu[randomNum]+'"><img src="'+myPix[randomNum]+'" name="myimg" border=0></a>';
		randomNum2=	 
		Math.floor((Math.random()*10))%maxPixr;   
		
		document.getElementById("mypicsr").innerHTML = '<a href="'+myPixru[randomNum2]+'"><img src="'+myPixr[randomNum2]+'" name="myimgr" border=0></a>';

	}
	//checking if it needs to reset to 1
	if (randomNum = maxPix)
	{
		randomNum=1;
	}
	//increases RandomNum by 1 in order to call the proper function
	else
	{
		randomNum=randomNum+1;
	}
	if (randomNum2 = maxPixr)
	{
		randomNum2=1;
	}
	else
	{
		randomNum2=randomNum2+1;
	}
	//calls the next image in line
	setTimeout("img"+randomNum+"()", seconds * 3000);
	setTimeout("img"+randomNum2+"r()", seconds * 3000);
 
}

//I removed some of the functions from before that are no longer needed
function img1() 
{ 
document.getElementById("mypics").innerHTML = '<a href="'+myPixu[0]+'"><img src="'+myPix[0]+'" name="myimg" border=0></a>';
setTimeout("img2()", seconds * 1000); 

}
function img2() 
{ 
document.getElementById("mypics").innerHTML = '<a href="'+myPixu[1]+'"><img src="'+myPix[1]+'" name="myimg" border=0></a>'; 
setTimeout("img3()", seconds * 3000); 
} 
function img3() 
{ 
document.getElementById("mypics").innerHTML = '<a href="'+myPixu[2]+'"><img src="'+myPix[2]+'" name="myimg" border=0></a>'; 
setTimeout("img4()", seconds * 6000); 
}

function img4() 
{ 
document.getElementById("mypics").innerHTML = '<a href="'+myPixu[3]+'"><img src="'+myPix[3]+'" name="myimg" border=0></a>'; 
setTimeout("img1()", seconds * 6000); 
}


function img1r() 
{ 
document.getElementById("mypicsr").innerHTML = '<a href="'+myPixru[0]+'"><img src="'+myPixr[0]+'" name="myimgr" border=0></a>';
setTimeout("img2r()", seconds * 5000); 
} 
function img2r() 
{ 
document.getElementById("mypicsr").innerHTML = '<a href="'+myPixru[1]+'"><img src="'+myPixr[1]+'" name="myimgr" border=0></a>'; 
setTimeout("img3r()", seconds * 6000); 
} 
function img3r() 
{ 
document.getElementById("mypicsr").innerHTML = '<a href="'+myPixru[2]+'"><img src="'+myPixr[2]+'" name="myimgr" border=0></a>'; 
setTimeout("img1r()", seconds * 5000); 
} 
