// JavaScript Document
function setIframe(x){	

	var myDate = new Date;
	
	myDate.setDate(25);	
	myDate.setMonth(11); // January = 0
	myDate.setFullYear(2009);
	var today = new Date;
	if (today <= myDate) {
		var today = new Date().getDay();
	var image = today + x;
	//Assigns image and link to variables
	var Feedback = "<a href='../exodus.htm?radio_2gb/feedback' target='_parent'><img src='../../images/front_feedback.jpg' alt='Feedback' width='173' height='100' border='0'></a>";
	var Volunteer = "<a href='../exodus.htm?volunteer/about_volunteering' target='_parent'><img src='../../images/front_volunteer.jpg' alt='Volunteer' width='173' height='100' border='0'></a>";
	var SuccessStories = "<a href='../exodus.htm?about_us/success_stories' target='_parent'><img src='../../images/front_success_stories.jpg' alt='Success Stories' width='173' height='100' border='0'></a>";
	var Bequests = "<a href='../exodus.htm?bequests/the_exodus_society' target='_parent'><img src='../../images/front_bequests.jpg' alt='Bequests' width='173' height='100' border='0'></a>";
	var FreeRestaurant = "<a href='../exodus.htm?our_services/our_services' target='_parent'><img src='../../images/front_free_restaurant.jpg' alt='Free Restaurant' width='173' height='100' border='0'></a>";
	var Tutorial = "<a href='../exodus.htm?our_services/education' target='_parent'><img src='../../images/front_tutorial.jpg' alt='Tutorial centre' width='173' height='100' border='0'></a>";
	var Webpoll = "<a href='../exodus.htm?misc/webpoll' target='_parent'><img src='../../images/front_webpoll.jpg' alt='Webpoll' width='173' height='100' border='0'></a>";	
	var Toydrive = "<a href='../exodus.htm?latest_news&toydrive' target='_parent'><img src='../../images/Toydrive.jpg' alt='Toydrive' width='173' height='100' border='0'></a>";
	var Youth = "<a href='../exodus.htm?our_services/education' target='_parent'><img src='../../images/front_youth.jpg' alt='Exodus Youth' width='173' height='100' border='0'></a>";
	

	//Assigns variables to days of the week
	switch (image) {
		//Sunday
		case "0top": document.write(Feedback); break;
		case "0bottom": document.write(FreeRestaurant); break;
		
		//Monday
		case "1top": document.write(Volunteer); break;
		case "1bottom": document.write(Feedback); break;
		
		//Tuesday
		case "2top": document.write(Bequests); break;
		case "2bottom": document.write(Tutorial); break;

		//Wednesday
		case "3top": document.write(SuccessStories); break;
		case "3bottom": document.write(Volunteer); break;
		
		//Thusday
		case "4top": document.write(Youth); break;
		case "4bottom": document.write(Bequests); break;
		
		//Friday
		case "5top": document.write(FreeRestaurant); break;
		case "5bottom": document.write(Tutorial); break;
		
		//Saturday
		case "6top": document.write(Tutorial); break;
		case "6bottom": document.write(Feedback); break;	
		
		default: null;
		
		}
	}
	var today = new Date;
	if (today > myDate) {
		var today = new Date().getDay();
		
	var image = today + x;
	//Assigns image and link to variables
	var Feedback = "<a href='../exodus.htm?radio_2gb/feedback' target='_parent'><img src='../../images/front_feedback.jpg' alt='Feedback' width='173' height='100' border='0'></a>";
	var Volunteer = "<a href='../exodus.htm?volunteer/about_volunteering' target='_parent'><img src='../../images/front_volunteer.jpg' alt='Volunteer' width='173' height='100' border='0'></a>";
	var SuccessStories = "<a href='../exodus.htm?about_us/success_stories' target='_parent'><img src='../../images/front_success_stories.jpg' alt='Success Stories' width='173' height='100' border='0'></a>";
	var Bequests = "<a href='../exodus.htm?bequests/the_exodus_society' target='_parent'><img src='../../images/front_bequests.jpg' alt='Bequests' width='173' height='100' border='0'></a>";
	var FreeRestaurant = "<a href='../exodus.htm?our_services/our_services' target='_parent'><img src='../../images/front_free_restaurant.jpg' alt='Free Restaurant' width='173' height='100' border='0'></a>";
	var Tutorial = "<a href='../exodus.htm?our_services/education' target='_parent'><img src='../../images/front_tutorial.jpg' alt='Tutorial centre' width='173' height='100' border='0'></a>";
	var Webpoll = "<a href='../exodus.htm?misc/webpoll' target='_parent'><img src='../../images/front_webpoll.jpg' alt='Webpoll' width='173' height='100' border='0'></a>";	
	var Toydrive = "<a href='../exodus.htm?latest_news&toydrive' target='_parent'><img src='../../images/Toydrive.jpg' alt='Toydrive' width='173' height='100' border='0'></a>";	
	var Haiti = "<a href='../exodus.htm?donate/open_cash_donation_haiti&donation to the Haiti earthquake appeal&haiti' target='_parent'><img src='../../images/haiti_appeal.jpg' alt='Haiti appeal' width='173' height='100' border='0'></a>";
	var Youth = "<a href='../exodus.htm?our_services/education' target='_parent'><img src='../../images/front_youth.jpg' alt='Exodus Youth' width='173' height='100' border='0'></a>";
	

	//Assigns variables to days of the week
	switch (image) {
		//Sunday
		case "0top": document.write(Feedback); break;
		case "0bottom": document.write(FreeRestaurant); break;
		
		//Monday
		case "1top": document.write(Volunteer); break;
		case "1bottom": document.write(Feedback); break;
		
		//Tuesday
		case "2top": document.write(Bequests); break;
		case "2bottom": document.write(Tutorial); break;

		//Wednesday
		case "3top": document.write(SuccessStories); break;
		case "3bottom": document.write(Volunteer); break;
		
		//Thusday
		case "4top": document.write(Youth); break;
		case "4bottom": document.write(Bequests); break;
		
		//Friday
		case "5top": document.write(FreeRestaurant); break;
		case "5bottom": document.write(Tutorial); break;
		
		//Saturday
		case "6top": document.write(Tutorial); break;
		case "6bottom": document.write(Feedback); break;		
		
		default: null;
		
		}
	}




}