/**************************************************************
	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 GetImages(ImageID,ID){
	/*
	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);
	
	DWREngine._execute(_cfscriptLocation, null, 'Images', ImageID, ID, DisplayImages);
}
function GetImagesSearch(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);
	
	DWREngine._execute(_cfscriptLocation, null, 'SearchImages', ImageID, DisplaySearchImages);
}

function DisplayImages(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
	var temp = document.getElementById("BodyPadding");
	temp.innerHTML = result;	
}

function clearDefaultandCSS(el) {
	if (el.defaultValue==el.value) el.value = ""
	// If Dynamic Style is supported, clear the style
	if (el.style) el.style.cssText = ""
}

function DisplaySearchImages(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
	var temp = document.getElementById("SearchImageLoadHere");
	temp.innerHTML = result;	
}


function test(){
	var temp = document.getElementById("BodyContainer");
	var temp2 = temp.innerHTML;
	temp.innerHTML = "";	
	temp2 = temp2 + "hi there";
	temp.innerHTML = temp2;
	alert(temp2);
}


function GetFlash(FlashID){
	/*
	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("hi there");
	DWREngine._execute(_cfscriptLocation, null, 'FlashDisplay', FlashID, DisplayFlash);
}
function DisplayFlash(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
	//var temp = document.getElementById("BodyPadding");
	//temp.innerHTML = result;	
	var so = new SWFObject(result[0].FILENAME, "movie", result[0].WIDTH,  result[0].HEIGHT, "7", "#FFFFFF");
	so.addParam("scale", "noscale");
	so.write("flashcontent");
}