/**************************************************************
	The next 2 function:
		GetImages()
		DisplayImages(result)
		
	These function are used to get the larger image from the 
	database for the thumbnails selected and to display them
	withing the main body container section.  Using Ajax.
**************************************************************/
function ChangeImage(ImageID){
	/*
	This executes the CF function GetMenu(parentId)
	and executes the JS function showNewOptions(result) when it returns.
	It'a Asynchronous, so getOptions() doesn't wait for anything.
	*/	
	//alert(ImageID);
	//alert(ID);
	
	//alert(NewsID);
	DWREngine._execute(_cfscriptLocation, null, 'ChangeImage', ImageID, DisplayImage);
}

function DisplayImage(result){		
	/*
	result is the CFAJAX return from the query.
	In this case we get a CF query that's been
	turned into a JS Array of Objects.
	*/
	//first, clear out the existing options
	//alert("hi there");
	var ImageID = document.getElementById("MainImage");
	var EnglishTaglineID = document.getElementById("MainImageEnglish");
	var ChineseTaglineID = document.getElementById("MainImageChinese");
	
	//alert(result[0].HEADLINE);
	var temp = "";
	
	//var Iwidth = getImage("userfiles/images/art.shuttle.file.afp.gi.jpg");
	//alert(Iwidth.width);
	//var Iheight = getImage("userfiles/images/art.shuttle.file.afp.gi.jpg");
	//alert(Iheight.height);
	//alert(temp1);
	ImageID.src = "Userfiles/image/Gallery/" + result[0].FILENAME;			
	EnglishTaglineID.innerHTML = result[0].ENGLISHTAGLINE;
	ChineseTaglineID.innerHTML = result[0].CHINESETAGLINE;
}

/**************************************************************
	The next 2 function:
		GetImages()
		DisplayImages(result)
		
	These function are used to get the larger image from the 
	database for the thumbnails selected and to display them
	withing the main body container section.  Using Ajax.
**************************************************************/
function ChangeImage2(ImageID){
	/*
	This executes the CF function GetMenu(parentId)
	and executes the JS function showNewOptions(result) when it returns.
	It'a Asynchronous, so getOptions() doesn't wait for anything.
	*/	
	//alert(ImageID);
	//alert(ID);
	
	//alert(NewsID);
	DWREngine._execute(_cfscriptLocation, null, 'ChangeImage', ImageID, DisplayImage2);
}

function DisplayImage2(result){		
	/*
	result is the CFAJAX return from the query.
	In this case we get a CF query that's been
	turned into a JS Array of Objects.
	*/
	//first, clear out the existing options
	//alert("hi there");
	var SecondImageID = document.getElementById("SecondMainImage");
	var SecondEnglishTaglineID = document.getElementById("SecondMainImageEnglish");
	var SecondChineseTaglineID = document.getElementById("SecondMainImageChinese");
	
	//alert(result[0].HEADLINE);
	var temp = "";
	
	//var Iwidth = getImage("userfiles/images/art.shuttle.file.afp.gi.jpg");
	//alert(Iwidth.width);
	//var Iheight = getImage("userfiles/images/art.shuttle.file.afp.gi.jpg");
	//alert(Iheight.height);
	//alert(temp1);
	SecondImageID.src = "Userfiles/image/Gallery/" + result[0].FILENAME;			
	SecondEnglishTaglineID.innerHTML = result[0].ENGLISHTAGLINE;
	SecondChineseTaglineID.innerHTML = result[0].CHINESETAGLINE;
}
