banner_ads = new Array('<a href="#"><img src="/download/gallery/img/banner_pakistan_floodsjpg" alt="Pakistan: Facing the worst floods in its history due to the heaviest monsoon rains Pakistan has seen in over 80 years. An estimated 3.2 million people have been affected." /></a>','<a href="#"><img src="/download/gallery/img/banner_china_landslidesjpg" alt="China: China\'s worst flooding for a decade has already killed more than 1,400 people, left hundreds missing and caused tens of billions of pounds in damage." /></a>','<a href="/howyoucanh/haitidonationdetails"><img src="/download/gallery/img/banner_haiti_jpg" alt="Haiti: Earthquake - Supplies are getting low. Drinking water is needed. Time is of the essence.WE NEED YOUR HELP" /></a>','<a href="#"><img src="/download/gallery/img/banner02jp" alt="USA: Hurricane Ike US authorities raced to help millions of people stranded without water and power in the wake of devastating Hurricane Ike, which left more than 17 dead across nine states. Massive search and recovery operations were underway in storm-battered Texas, where officials said 10 people were killed and thousands rescued." /></a>','<a href="#"><img src="/download/gallery/img/banner03pn" alt="FIGI Floods: Continuous torrential rains fell for over 2 weeks, leaving the low lying areas in the country with flood levels of up to 3-5 meters. " /></a>','<a href="#"><img src="/download/gallery/img/banner04pn" alt="India Floods: 250,000 houses destroyed in what officials say were the worst floods in 50 years." /></a>');

//'<a href="#"><img src="/download/gallery/img/banner01jp" alt="Pakistan: Balochistan Earthquake At least 80 people have been killed and hundreds of homes destroyed after a powerful earthquake rocked southwest Pakistan. More than 500 homes have been reduced to rubble." /></a>',

banner_ad_count = banner_ads.length;
//current_ad = Math.floor(Math.random()*banner_ad_count);
current_ad = 0;

window.addEvent('domready',function(){
	banner_ad_set();
	
	$$('.home_banner').each(function(banner){
		banner.addEvent('click', function(){
			var index = this.id.substring(7);			
			banner_ad_choose(index);
		});
	});
});

function banner_ad_choose(n){
		current_ad = n;
		banner_ad_set();
		return false;
}
function banner_ad_set() {
	//current_ad = (current_ad + banner_ad_count) % banner_ad_count;
	
	// put code here that manipulates the DOM
	$('home-banner-details').innerHTML = banner_ads[current_ad];		
}
