function enlargemap(map) {

	var map1div = document.getElementById('map1');
	var map2div = document.getElementById('map2');
	var map3div = document.getElementById('map3');
	var map1obj = document.getElementById('nottmmap');
	var map2obj = document.getElementById('derbymap');

	if (document.getElementById('systonmap')) {
		var map3obj = document.getElementById('systonmap');
	} else {
		var map3obj = document.getElementById('derbymap');
	}
	
	var expandlink1 = document.getElementById('expandlink1');
	var expandlink2 = document.getElementById('expandlink2');
	var expandlink3 = document.getElementById('expandlink3');

	if (document.getElementById('systonmap')) {

	//check which map we are expanding/contracting
	if(map=='1') {
		//is the map in "normal" view? - if yes, expand it and hide map2
		if(map2div.style.display=='inline'||map3div.style.display=='inline') {
			map2div.style.display='none';
			map3div.style.display='none';
			map1div.style.width='100%';
			map1obj.width='560px';
			map1obj.height='560px';
			expandlink1.innerHTML='Shrink Map &#187;';
		} else {
		//the map is already expanded? - unhide map2, shrink map1
			map2div.style.display='inline';
			map3div.style.display='inline';
			map1div.style.width='50%';
			map1obj.width='270px';
			map1obj.height='270px';
			expandlink1.innerHTML='Enlarge Map &#187;';
		}
	//same again for map 2
	} else if (map=='2') {
		//is the map in "normal" view? - if yes, expand it and hide map1
		if(map1div.style.display=='inline'||map3div.style.display=='inline') {
			map1div.style.display='none';
			map3div.style.display='none';
			map2div.style.width='100%';
			map2obj.width='560px';
			map2obj.height='560px';
			expandlink2.innerHTML='Shrink Map &#187;';
		} else {
		//the map is already expanded? - unhide map1, shrink map2
			map1div.style.display='inline';
			map3div.style.display='inline';
			map2div.style.width='50%';
			map2obj.width='270px';
			map2obj.height='270px';
			expandlink2.innerHTML='Enlarge Map &#187;';
		}
	} else {
		//is the map in "normal" view? - if yes, expand it and hide map1
		if(map1div.style.display=='inline'||map2div.style.display=='inline') {
			map1div.style.display='none';
			map2div.style.display='none';
			map3div.style.width='100%';
			map3obj.width='560px';
			map3obj.height='560px';
			expandlink3.innerHTML='Shrink Map &#187;';
		} else {
		//the map is already expanded? - unhide map1, shrink map2
			map1div.style.display='inline';
			map2div.style.display='inline';
			map3div.style.width='50%';
			map3obj.width='270px';
			map3obj.height='270px';
			expandlink3.innerHTML='Enlarge Map &#187;';
		}
	}

	} else {


	//check which map we are expanding/contracting
	if(map=='1') {
		//is the map in "normal" view? - if yes, expand it and hide map2
		if(map2div.style.display=='inline') {
			map2div.style.display='none';
			map1div.style.width='100%';
			map1obj.width='560px';
			map1obj.height='560px';
			expandlink1.innerHTML='Shrink Map &#187;';
		} else {
		//the map is already expanded? - unhide map2, shrink map1
			map2div.style.display='inline';
			map1div.style.width='50%';
			map1obj.width='270px';
			map1obj.height='270px';
			expandlink1.innerHTML='Enlarge Map &#187;';
		}
	//same again for map 2
	} else {
		//is the map in "normal" view? - if yes, expand it and hide map1
		if(map1div.style.display=='inline') {
			map1div.style.display='none';
			map2div.style.width='100%';
			map2obj.width='560px';
			map2obj.height='560px';
			expandlink2.innerHTML='Shrink Map &#187;';
		} else {
		//the map is already expanded? - unhide map1, shrink map2
			map1div.style.display='inline';
			map2div.style.width='50%';
			map2obj.width='270px';
			map2obj.height='270px';
			expandlink2.innerHTML='Enlarge Map &#187;';
		}


	}
	}
}

function displayroutes(map) {

	var directions1div = document.getElementById('directions1');
	var directions2div = document.getElementById('directions2');
	var directions3div = document.getElementById('directions3');
	var directions1link = document.getElementById('directionslink1');
	var directions2link = document.getElementById('directionslink2');
	var directions3link = document.getElementById('directionslink3');

	if(map=='1') {
		if(directions1div.style.display=='block') {
			directions1div.style.display='none';
			directions1link.innerHTML='Display Bus Routes &#187;';
		} else {
			directions1div.style.display='block';
			directions1link.innerHTML='Hide Bus Routes &#187;';
		}
	} else if (map=='2') {
		if(directions2div.style.display=='block') {
			directions2div.style.display='none';
			directions2link.innerHTML='Display Bus Routes &#187;';
		} else {
			directions2div.style.display='block';
			directions2link.innerHTML='Hide Bus Routes &#187;';
		}
	} else {
		if(directions3div.style.display=='block') {
			directions3div.style.display='none';
			directions3link.innerHTML='Display Bus Routes &#187;';
		} else {
			directions3div.style.display='block';
			directions3link.innerHTML='Hide Bus Routes &#187;';
		}	
	}
}

var map1;
var map2;
var map3;
var map4;

/*************** define all of the stuff for the maps here **************/
function initClasses(daynumber,dayname) {

var arrDays=new Object();
arrDays['MONDAY'] = new Object();
arrDays['TUESDAY'] = new Object();
arrDays['WEDNESDAY'] = new Object();
arrDays['THURSDAY'] = new Object();
arrDays['FRIDAY'] = new Object();
arrDays['SATURDAY'] = new Object();
arrDays['SUNDAY'] = new Object();

/*
map1=document.getElementById('map1');
map2=document.getElementById('map2');
map3=document.getElementById('map3');
map4=document.getElementById('map4');
*/

arrDays['MONDAY'].map1display='inline'; //leesbroke
arrDays['MONDAY'].map2display='inline'; //gw
arrDays['MONDAY'].map3display='none';	//springwood
arrDays['MONDAY'].map4display='none';	//giffe

arrDays['TUESDAY'].map1display='inline';
arrDays['TUESDAY'].map2display='none';
arrDays['TUESDAY'].map3display='none';
arrDays['TUESDAY'].map4display='none';

arrDays['WEDNESDAY'].map1display='inline';
arrDays['WEDNESDAY'].map2display='none';
arrDays['WEDNESDAY'].map3display='none';
arrDays['WEDNESDAY'].map4display='inline';

arrDays['THURSDAY'].map1display='inline';
arrDays['THURSDAY'].map2display='inline';
arrDays['THURSDAY'].map3display='none';
arrDays['THURSDAY'].map4display='none';

arrDays['FRIDAY'].map1display='none';
arrDays['FRIDAY'].map2display='none';
arrDays['FRIDAY'].map3display='inline';
arrDays['FRIDAY'].map4display='none';

arrDays['SATURDAY'].map1display='none';
arrDays['SATURDAY'].map2display='inline';
arrDays['SATURDAY'].map3display='none';
arrDays['SATURDAY'].map4display='none';

arrDays['SUNDAY'].map1display='none';
arrDays['SUNDAY'].map2display='none';
arrDays['SUNDAY'].map3display='none';
arrDays['SUNDAY'].map4display='none';

/*
map1.style.display=arrDays[dayname].map1display;
map2.style.display=arrDays[dayname].map2display;
map3.style.display=arrDays[dayname].map3display;
map4.style.display=arrDays[dayname].map4display;
*/

/***********************************************************/
jQuery(document).ready(function(){

	// simple accordion
	jQuery('#calender1').accordion({

		active: daynumber,
		header: 'div.day',
		autoHeight: true,
		animated: 'easeslide'

	}).bind('change.ui-accordion', function(event, ui) {
	/*
		map1.style.display=arrDays[jQuery(ui.newHeader).text()].map1display;
		map2.style.display=arrDays[jQuery(ui.newHeader).text()].map2display;
		map3.style.display=arrDays[jQuery(ui.newHeader).text()].map3display;
		map4.style.display=arrDays[jQuery(ui.newHeader).text()].map4display;
	*/
	});
	
	// simple accordion
	jQuery('#calender2').accordion({

		active: daynumber,
		header: 'div.day',
		autoHeight: true,
		animated: 'easeslide'

	}).bind('change.ui-accordion', function(event, ui) {
	/*
		map1.style.display=arrDays[jQuery(ui.newHeader).text()].map1display;
		map2.style.display=arrDays[jQuery(ui.newHeader).text()].map2display;
		map3.style.display=arrDays[jQuery(ui.newHeader).text()].map3display;
		map4.style.display=arrDays[jQuery(ui.newHeader).text()].map4display;
	*/
	});
	


});


}
