function fetchChaseData(tripDayID){
	object = document.getElementById("dataRow_"+tripDayID);
	
	if( object.style.display == 'none' ){
		if( document.getElementById("dataFrame_"+tripDayID).src == '')
			document.getElementById("dataFrame_"+tripDayID).src='chaseDetails.php?id='+tripDayID;
		object.style.display = '';
	}else{
		object.style.display="none";
	}
}

function CreateXmlHttpRequestObject(){
	var xmlHttp;
	if(window.ActiveXObject)
	{
		try
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=false;
		}
	}
	else{
		try
		{
			xmlHttp = new XMLHttpRequest();
		}
		catch(e)
		{
			xmlHttp = false;
		}
	}
	if(!xmlHttp)
	{
		alert("error creating XMLHttpRequest object!");
	}
	else
	{
		return xmlHttp;
	}
}

function implantChaseMap(tripDayID){
	document.getElementById("chaseMap"+tripDayID).src= "maps/smallChaseMap.php?tripDayID="+tripDayID;
}
function implantBigChaseMap(tripDayID){
	document.getElementById("chaseMap"+tripDayID).src= "maps/chaseMap.php?tripDayID="+tripDayID;
}

function toggleMapDisplaySwitch()
{
	var xmlHttp = CreateXmlHttpRequestObject();
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.responseText==1)
			document.getElementById("mapSwitch").style.backgroundImage="url(images/mapSwitchOn.png)";
		else
			document.getElementById("mapSwitch").style.backgroundImage="url(images/mapSwitchOff.png)";
	}
	xmlHttp.open('GET','toggleMapDisplay.php',true);
	xmlHttp.send(null);
}

function loadSeasonMap(){
	document.getElementById("mapHolder").innerHTML='<iframe width="200" height="250" src="maps/smallSeasonOverview.php?year=2007" scrolling="no" frameborder="1" marginheight="0" marginwidth="0"></iframe>';
}


function loadSmallChaseMap(tripDayID){
	document.getElementById("mapHolder").innerHTML='<iframe class="map" id="chaseMap'+tripDayID+'"  src="maps/smallChaseMap.php?tripDayID='+tripDayID+'" width="300" height="200" marginwidth="2" marginheight="2" scrolling="no" frameborder="1">';
}
function loadBigChaseMap(tripDayID){
	document.getElementById("mapHolder").innerHTML='<iframe id="chaseMap'+tripDayID+'"  src="maps/chaseMap.php?tripDayID='+tripDayID+'" width="99%" height="395" marginwidth="0" marginheight="0" scrolling="no" frameborder="0">';
}

	

