var previousDivID = "";
var previousKitListDivID = "";  
var previousKitCompListDivID = "";  
var previousKitVehicleListDivID = "";  
var currentHighlightedDivID = ""; 
var previousVehicleDivID = ""; 
var previousVehicleDivID2 = ""; 
var previousComponentDivID = ""; 
var currentHighlightedVehicleDivID = ""; 
var currentHighlightedComponentDivID = ""; 
var currentComponentFullInfoDiv = ""; 
var previousAscorelModelDivID = ""; 

var loadingImage = false; 
var processingFormSubmitRequest = false; 

	function customizeCSSForIE6()
	{
		alert("Customizing CSS for IE6"); 
		var menuRef = document.getElementById("ascorelmenu"); 
		var menuStyle = menuRef.style; 
		// alert(menuStyle); 
		// menuStyle.backgroundColor = "#E0E0F0"; 
	}
	
	function checkIEVersion()
	{
		var ieVersion = getIEVersion(); 
		if (ieVersion > -1)
		{
			if (ieVersion < 7)
			{
				customizeCSSForIE6();  
			}
			else
			{
				// alert("IE7 or more recent"); 
			}
		}
		else
		{
			// alert("Not using IE"); 
		}
	}
	
	function getIEVersion()
	// Returns the version of Internet Explorer or a -1
	// (indicating the use of another browser).
	{
	  var rv = -1; // Return value assumes failure.
	  if (navigator.appName == 'Microsoft Internet Explorer')
	  {
	    var ua = navigator.userAgent;
	    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
	    if (re.exec(ua) != null)
	      rv = parseFloat( RegExp.$1 );
	  }
	  return rv;
	}
	

	function toggle(divID)
	{
		var divHandle = document.getElementById(divID);
		// alert(divID + ' - ' + divHandle); 
		if (divHandle.style.display == 'none')
		{
			// alert('show ' + divID); 
			divHandle.style.display = 'block';
		}
		else
		{
			// alert('hide ' + divID); 
			divHandle.style.display = 'none';
		}
	}
			
	function toggleForms(id1, id2, rName) 
	{
		collection = document.getElementById(rName);
		// alert('collection name = ' + collection.name); 
		if (collection.checked)
		{
			// alert('yes'); 
			document.getElementById(id1).style.display="none";
			document.getElementById(id2).style.display="block";
		}
		else
		{
			// alert('no'); 
			document.getElementById(id1).style.display="block";
			document.getElementById(id2).style.display="none";
		}
	
	}
	
	function toggleInstallationFields(prefix)
	{
		dayField = document.getElementById(prefix + "day"); 
		dayField.disabled = !dayField.disabled; 
		monthField = document.getElementById(prefix + "month"); 
		monthField.disabled = !monthField.disabled; 
		yearField = document.getElementById(prefix + "year"); 
		yearField.disabled = !yearField.disabled; 
		installerField = document.getElementById("installer");
		installerField.disabled = !installerField.disabled;  
	}
	
	function updateSystemHideOptions(activeForm, hideLink) 
	{
		document.getElementById(activeForm).style.display="inline-table";
		var x=document.getElementsByName(hideLink);
		for (link in x)
		{
			link.style.display="none";
		}
	}



	function showKitNotesInLanguage(divID)
	{
		var languageHandle = document.getElementById('notesLanguage'); 
		// alert('selected language = ' + languageHandle.options[languageHandle.selectedIndex].value);
		for (langIndex = 0; langIndex < languageHandle.options.length; langIndex++)
		{
			var divToHide = divID + languageHandle.options[langIndex].value; 
			hide(divToHide); 
		} 
		var divToShow = divID + languageHandle.options[languageHandle.selectedIndex].value;
		show(divToShow); 
	}

	function show(divID)
	{
		// alert("show " + divID); 
		var divHandle = document.getElementById(divID); 
		// alert('got the handle'); 
		divHandle.style.display = 'block';
		// alert('done here'); 
	}	
	
	function showAscorelModel(modelTypeID)
	{
		var ascorelSystemModelDropDown = document.ascorelSystemForm.ascorelsystemmodel; 
		// clear the existing options
		// alert('clear the existing options of ' + ascorelSystemModelDropDown); 
		ascorelSystemModelDropDown.options.length = 0;
		
		if (modelTypeID != "")
		{
			// var systemModelsToCopy = document.getElementById['ascorelsystemmodel_' + modelTypeID]; 
			var systemModelsToCopy = eval("document.ascorelSystemForm.ascorelsystemmodel_" + modelTypeID); 
			// alert('read content from ' + systemModelsToCopy); 
			for (optionIndex = 0; optionIndex < systemModelsToCopy.length; optionIndex++)
			{
				var name = systemModelsToCopy.options[optionIndex].text; 
				var value = systemModelsToCopy.options[optionIndex].value;
				ascorelSystemModelDropDown.options[optionIndex] = new Option(name, value); 
			}
		}
	}
	
	function viewInstallationPic(installationPic)
	{
		/*
		var installationPicHandle = document.getElementById('installationPicImg'); 
		installationPicHandle.src = installationPic;
		*/ 
		// alert(installationPicHandle.innerHTML); 
	}
	
	function showAndHide(divID)
	{
		if (previousDivID != "")
			hide(previousDivID);
		show(divID);
		previousDivID = divID; 
	}
	
	function showAndHideKitList(divID)
	{
		if (previousKitListDivID == divID)
		{
			hide(divID);
			previousKitListDivID = ""; 
		}
		else
		{
			if (previousKitListDivID != "")
			{
				hide(previousKitListDivID);
			}
			show(divID);
			previousKitListDivID = divID;
		} 
	}
	
	function showAndHideKitCompList(divID)
	{
		if (previousKitCompListDivID == divID)
		{
			hide(divID);
			previousKitCompListDivID = ""; 
		}
		else
		{
			if (previousKitCompListDivID != "")
			{
				hide(previousKitCompListDivID);
			}
			show(divID);
			previousKitCompListDivID = divID;
		} 
	}
	
	function showAndHideKitVehicleList(divID)
	{
		if (previousKitVehicleListDivID == divID)
		{
			hide(divID);
			previousKitVehicleListDivID = ""; 
		}
		else
		{
			if (previousKitVehicleListDivID != "")
			{
				hide(previousKitVehicleListDivID);
			}
			show(divID);
			previousKitVehicleListDivID = divID;
		} 
	}
	
	function clearDivContent(divID)
	{
		var divHandle = document.getElementById(divID); 
		divHandle.innerHTML = ""; 
	}
	
	function highlight_manufacturer(divID)
	{
		var divHandle = document.getElementById(divID);  
		divHandle.style.background = '#FFD900';
	}
	
	function backToNormal_manufacturer(divID)
	{
		if (divID != currentHighlightedDivID)
		{
			var divHandle = document.getElementById(divID);  
			divHandle.style.background = 'none';
		}
	}
	
	function keepItHighlighted_manufacturer(divID)
	{
		if (currentHighlightedDivID != "" && currentHighlightedDivID != divID)
		{
			var divToChangeBackToNormal = currentHighlightedDivID;
			currentHighlightedDivID = ""; 
			backToNormal_manufacturer(divToChangeBackToNormal); 
		}
		currentHighlightedDivID = divID; 
		// I have to clear the value of the highlighted vehicle div here
		// because all the divs do not reside on the same page, and I can't reference the previous 
		// highlighted div if it belonged to another manufacturer, which is on a different page
		currentHighlightedVehicleDivID = ""; 
		// I have to hide the current kit and component information, since we're displaying a 
		// new manufacturer
		hide('kitInformation');
		hide('componentInformation');
		
	}
	
	function showAndHide_kit(divID, divID2)
	{
		if (previousVehicleDivID != "")
		{
			hide(previousVehicleDivID);
			hide(previousVehicleDivID2); 
		}
		show(divID);
		show(divID2);
		previousVehicleDivID = divID; 
		previousVehicleDivID2 = divID2; 
	}
	
	function highlight_vehicle(divID)
	{
		var divHandle = document.getElementById(divID);  
		divHandle.style.background = '#FFD900';
	}
	
	function backToNormal_vehicle(divID)
	{
		if (divID != currentHighlightedVehicleDivID)
		{
			var divHandle = document.getElementById(divID);  
			divHandle.style.background = 'none';
		}
	}
	
	function keepItHighlighted_vehicle(divID)
	{
		if (currentHighlightedVehicleDivID != "" && currentHighlightedVehicleDivID != divID)
		{
			var divToChangeBackToNormal = currentHighlightedVehicleDivID;
			currentHighlightedVehicleDivID = ""; 
			backToNormal_vehicle(divToChangeBackToNormal); 
		}
		// I have to clear the value of the highlighted component div here
		// because all the divs do not reside on the same page, and I can't reference the previous 
		// highlighted div if it belonged to another vehicle, which is on a different page
		currentHighlightedComponentDivID = ""; 
		currentHighlightedVehicleDivID = divID; 
	}

	function highlight_kit(divID)
	{
		var divHandle = document.getElementById(divID);  
		divHandle.style.background = '#FFD900';
	}
	
	function backToNormal_kit(divID)
	{
		// if (divID != currentHighlightedComponentDivID)
		// {
			var divHandle = document.getElementById(divID);  
			divHandle.style.background = 'none';
		// }
	}
	
	function highlight_component(divID)
	{
		var divHandle = document.getElementById(divID);  
		divHandle.style.background = '#FFD900';
	}
	
	function backToNormal_component(divID)
	{
		// alert(divID); 
		if (divID != null && divID != "" && divID != currentHighlightedComponentDivID)
		{
			var divHandle = document.getElementById(divID);
			if (divHandle != null)
			{  
				divHandle.style.background = 'none';
			}
		}
	}
	
	function keepItHighlighted_component(divID)
	{
		if (currentHighlightedComponentDivID != "")
		{
			var divToChangeBackToNormal = currentHighlightedComponentDivID;
			currentHighlightedComponentDivID = ""; 
			backToNormal_component(divToChangeBackToNormal); 
		}
		currentHighlightedComponentDivID = divID; 
	}
	
	function showAndHide_kitInstallationPictures(divID)
	{
		// alert('showing ' + divID); 
				
		hideMainDisplay(); 
		
		try
		{
			show(divID);
		}
		catch (divDisplayError)
		{
			alert('Ran into an issue displaying the component information DIV - ' + divDisplayError.name + ' - ' + divDisplayError.message);
			showMainDisplay();  
			currentComponentFullInfoDiv = ""; 
		}
	}
	
	/*
		Hides all the divs associated with the main display
	*/
	function hideMainDisplay()
	{
		hide('manufacturer_list'); 
		hide('allVehicles'); 
		hide('kitInformation');
		hide('componentInformation');
		hide('maintainControlPanel'); 
		hide('createManufacturerDiv'); 
		hide('createKitDiv'); 
		hide('createComponentDiv'); 
		hide('createVehicleDiv'); 
	}
	
	/*
		Shows all the divs associated with the main display
	*/
	function showMainDisplay()
	{
		show('manufacturer_list'); 
		show('allVehicles'); 
		show('kitInformation');
		show('componentInformation'); 
		show('maintainControlPanel'); 
	}
	
	function showAndHide_kitNotes(divID)
	{
		hideMainDisplay(); 
	
		try
		{
			show(divID);
		}
		catch (divDisplayError)
		{
			alert('Ran into an issue displaying the component information DIV - ' + divDisplayError.name + ' - ' + divDisplayError.message); 
			showMainDisplay(); 
			currentComponentFullInfoDiv = ""; 
		}
	}
	
	function showAndHide_component(divID)
	{
		// alert('showing ' + divID); 
		currentComponentFullInfoDiv = divID; 
		
		hideMainDisplay(); 
		
		// alert('hid all the other divs');  
		
		// alert('showing ' + divID); 
		try
		{
			show(divID);
		}
		catch (divDisplayError)
		{
			alert('Ran into an issue displaying the component information DIV - ' + divDisplayError.name + ' - ' + divDisplayError.message);
			showMainDisplay();  
			currentComponentFullInfoDiv = ""; 
		}
		// alert('showed the div'); 
	}
	
	function hide_component(divID, fullDisplayIndicator)
	{
		var divHandle = document.getElementById(divID);  
		divHandle.style.display = 'none';
		currentComponentFullInfoDiv = ""; 

		if (fullDisplayIndicator == "")
		{
			// only show the other divs if we're not already showing the kit search results display
			var kitSearchResultHandle = document.getElementById('kitSearchResults');
			// alert(kitSearchResults.display
			if (kitSearchResultHandle.style.display != 'block')
			{  
				showMainDisplay(); 
			}
		} 
	}
	
	function hide_kitNotes(divID, fullDisplayIndicator)
	{
		var divHandle = document.getElementById(divID);  
		divHandle.style.display = 'none';

		if (fullDisplayIndicator == "")
		{
			// only show the other divs if we're not already showing the kit search results display
			var kitSearchResultHandle = document.getElementById('kitSearchResults');
			// alert(kitSearchResults.display
			if (kitSearchResultHandle.style.display != 'block')
			{  
				showMainDisplay(); 
			}
		} 
	}

	function hide_kitInstallationPictures(divID, fullDisplayIndicator)
	{
		var divHandle = document.getElementById(divID);  
		divHandle.style.display = 'none';

		if (fullDisplayIndicator == "")
		{
			// only show the other divs if we're not already showing the kit search results display
			var kitSearchResultHandle = document.getElementById('kitSearchResults');
			// alert(kitSearchResults.display
			if (kitSearchResultHandle.style.display != 'block')
			{  
				showMainDisplay(); 
			}
		} 
	}

	function hide(divID)
	{
		// alert('hide ' + divID); 
		var divHandle = document.getElementById(divID);  
		divHandle.style.display = 'none';
	}
	
	function showIntro()
	{
		hide('mc382');
		show('products_intro');
		hide('previousButton_intro'); 
		hide('nextButton_402');
		show('nextButton_382');
	}
	
	function show382()
	{
		hide('products_intro');
		hide('mc402');
		show('mc382');
		hide('nextButton_382');
		hide('previousButton_382');
		show('nextButton_402');
		show('previousButton_intro');
	}
	
	function show402()
	{
		hide('mc382');
		show('mc402');
		hide('nextButton_402');
		hide('previousButton_intro'); 
		show('previousButton_382');
	}


	function test()
	{
		alert('testing**'); 
	}
	
	function elementTest()
	{
		// if (document.getElementById)
		// 	alert("You are using a modern browser that supports the DOM")

		var menuFrameHandle = window.xmenu; 
		alert(menuFrameHandle); 
	}
	
	// display the "back to USA" option every time we go "out" of the USA site
	function goto_out(location)
	{
		var navDivHandle = document.getElementById("backToUSA");
		// alert(navDivHandle.style.display);
		navDivHandle.style.display = "block"; 
		// alert(navDivHandle.style.display);
		goto_simple(location);
		hide('annoucementDiv');
	}
	
	function loadPage(location)
	{
		document.URL = location;
	}
	
	// simply display the location in the appropriate sub frames
	function goto_simple(location)
	{
		var separatorIndex = location.indexOf('@'); 
		if (separatorIndex == -1)
		{
			alert("Invalid target URL " + location); 
		}
		else
		{
			var location1 = location.substring(0,separatorIndex); 
			var location2 = location.substring(separatorIndex+1,location.length); 
			if (document.getElementById("xmenu")) // for IE
			{
				var menuFrameHandle = document.getElementById("xmenu"); 
				var mainFrameHandle = document.getElementById("xframe"); 
				// location 1 is for the menu iframe
				menuFrameHandle.src = location1; 
				// location 2 is for the body iframe
				mainFrameHandle.src = location2; 
			}
			else // for firefox
			{
				var menuFrameHandle = window.xmenu; 
				var mainFrameHandle = window.xframe; 
				// location 1 is for the menu iframe
				menuFrameHandle.location = location1; 
				// location 2 is for the body iframe
				mainFrameHandle.location = location2; 
			}
		}
	}
	
	// first hide the "back to USA" option and then go to the appropriate location within the USA site
	function goto(location)
	{
		var navDivHandle = document.getElementById("backToUSA");
		navDivHandle.style.display = "none"; 

		goto_simple(location);

		show('annoucementDiv');
	}
	
	function queryComponent(processingDivName)
	{
		// We are querying for a new component, so we need to reset the previously active 
		// kit list window. Otherwise, we get an error when trying to hide it when it's not part 
		// of the current display
		previousKitListDivID = ""; 	
		previousKitCompListDivID = ""; 	
		var requestParameters = ""; 
		var formRef = document.getElementById('SearchForm'); 
		if (formRef == null)
		{
			// Firefox does not refer to forms in the same way as IE does
			formRef = document.forms['SearchForm']; 
		}
		
		var formElements = formRef.elements;
		var formElementName; 
		
		for (index = 0; index < formElements.length; index++)
		{
			formElementName = formElements[index].name; 
			if (formElementName == 'CompReference')
			{
				// alert('Comp Reference = ' + formElements[index].value);
				var compReference = formElements[index].value; 
				compReference = trim(compReference); 
				if (compReference == "")
				{
					var confirmFlag = confirm("Do you want to search for all components in the system?");
					if (confirmFlag)
					{ 
						// replace with the SQL wildcard character
						compReference = "%";
					}
					else 
					{
						return; 
					} 
				}
				requestParameters = formElementName + "=" + compReference;  
			}
		}

		requestParameters += "&kit_id=no_kit&vehicle_id=no_vehicle"; 
		requestParameters += "&fullDisplay=true"; 
		
		hideMainDisplay(); 
		hide('kitSearchResults'); 
		hide('kitAndCompSingleInformation'); 
		
		if (currentComponentFullInfoDiv != "")
		{
			hide(currentComponentFullInfoDiv);
		}  
		// hide('componentFullInformation');
		// hide('componentSearchFullInformation'); 
		
		show(processingDivName); 
		
		setTimeout("queryComponent_now('" + requestParameters + "');",500); 
	}
	
	function queryComponent_now(requestParameters)
	{
		sendSyncRequest('componentInformation.php', 'componentSearchResults',requestParameters,'progressIndicatorDiv');
		sendSyncRequest('componentFullInformation.php', 'componentSearchFullInformation',requestParameters,'progressIndicatorDiv');
		
		// hide(processingDivName); 
	}
	
	function queryKit(processingDivName)
	{
		var requestParameters = ""; 
		var formRef = document.getElementById('SearchForm'); 
		if (formRef == null)
		{
			// Firefox does not refer to forms in the same way as IE does
			formRef = document.forms['SearchForm']; 
		}
		
		var formElements = formRef.elements;
		var formElementName; 
		
		for (index = 0; index < formElements.length; index++)
		{
			formElementName = formElements[index].name; 
			if (formElementName == 'KitReference')
			{
				var kitReference = formElements[index].value;
				kitReference = trim(kitReference); 
				if (kitReference == "")
				{
					var confirmFlag = confirm("Do you want to search for all kits in the system?");
					if (confirmFlag)
					{ 
						// replace with the SQL wildcard character
						kitReference = "%";
					}
					else 
					{
						return; 
					} 
				}
				// alert('Kit Reference = ' + formElements[index].value);
				requestParameters = formElementName + "=" + kitReference;   
			}
		}
		requestParameters += "&kit_id=no_kit&vehicle_id=no_vehicle"; 
		requestParameters += "&fullDisplay=true"; 
		
		hideMainDisplay(); 
		hide('componentSearchResults'); 
		hide('kitAndCompSingleInformation'); 
		
		// hide('componentFullInformation');
		// hide('componentSearchFullInformation'); 
		if (currentComponentFullInfoDiv != "")
		{
			hide(currentComponentFullInfoDiv);
		}  

		show(processingDivName); 
		
		setTimeout("queryKit_now('" + requestParameters + "')", 500); 
	}
	
	function queryKit_now(requestParameters)
	{
		sendSyncRequest('kitInformation.php', 'kitSearchResults',requestParameters,'progressIndicatorDiv');
		// hide(processingDivName); 
	}
	
	function closeComponentResults()
	{
		hide('componentSearchResults'); 
		showMainDisplay();
	}
	
	function closeKitAndCompDetails()
	{
		hide('kitAndCompSingleInformation'); 
	}
	
	function closeKitResults()
	{
		hide('kitSearchResults'); 
		show('manufacturer_list'); 
		show('allVehicles'); 
		show('maintainControlPanel'); 
		// show('kitInformation'); 
		// show('componentInformation');
	}
	
	function saveDBChanges_now(processingDivName, componentInformationFormName, vehicleID, kitID, targetKitDiv, targetCompDiv, targetFullCompDiv, targetKitNotes, targetKitInstallationPictures, fullDetailFlag)
	{
		// alert("here " + processingDivName + "-" + componentInformationFormName + "-" + vehicleID + "-" + kitID + "-" + targetKitDiv+ "-" +targetCompDiv+ "-" +targetFullCompDiv + "****" + fullDetailFlag); 

		// alert('Saving your changes to the database ...');
		/*
		var kitInformationDivHandle = document.getElementById(kitInformationDivName); 
		// alert(kitInformationDivHandle.innerHTML); 
		kitInformationNodes = kitInformationDivHandle.childNodes;
		var nodeInfo = 'Kit Information Child Nodes = ';  
		for (kitInfoNodeIndex = 0; kitInfoNodeIndex < kitInformationNodes.length; kitInfoNodeIndex++)
		{
			nodeInfo = nodeInfo + kitInformationNodes[kitInfoNodeIndex].name + '------'; 
		}
		alert(nodeInfo);
		*/  
		
		var kitNameInput = document.getElementById('kitNameInput'); 
		var kitRefInput = document.getElementById('kitReferenceInput'); 
		var kitRefInput_Orig = document.getElementById('kitReferenceInput_Original'); 
		// var kitNotesInput = document.getElementById('kitNotesInput');
		
		var requestParameters = "kitNameInput=" + kitNameInput.value;
		requestParameters += "&kitRefInput=" + trim(kitRefInput.value);
		requestParameters += "&kitRefInput_Orig=" + trim(kitRefInput_Orig.value);
		
		// alert(requestParameters); 

		// Use the language selection box to go through all the language
		// input text areas (one for each language) and set the appropriate
		// values to submit ... 
		// Submitting information of form 'kitNotesInput_[LanguageID]=[NotesText]'
		var kitNotesInputFieldName = 'kitNotesInput_'; 
		var kitNotesLanguageSelectHandle = document.getElementById('notesLanguage'); 
		for (langIndex = 0; langIndex < kitNotesLanguageSelectHandle.options.length; langIndex++)
		{
			var currentKitNotesInputFieldName = kitNotesInputFieldName + kitNotesLanguageSelectHandle.options[langIndex].value; 
			var kitNotesInput = document.getElementById(currentKitNotesInputFieldName);
			requestParameters += "&" + currentKitNotesInputFieldName + "=" + kitNotesInput.value;
		} 
		
		// requestParameters += "&kitNotesInput=" + kitNotesInput.value;

		var compInfoForm = document.getElementById(componentInformationFormName); 
		if (compInfoForm == null)
		{
			// Firefox does not refer to forms in the same way as IE does
			compInfoForm = document.forms[componentInformationFormName]; 
		}
		
		var compInfoElements = compInfoForm.elements;
		var compRefNameIndex =-1;   
		var compPicHandle;
		var compRefName;  
		for (index = 0; index < compInfoElements.length; index++)
		{
				if (requestParameters.length == 0)
				{
					requestParameters += compInfoElements[index].name + "=" + trim(compInfoElements[index].value);
				}
				else
				{
					requestParameters += "&" + compInfoElements[index].name + "=" + trim(compInfoElements[index].value);
				}
				
				/*
				// Check if this a component reference. If so, use it to find the image tag and its value	
				compRefNameIndex = compInfoElements[index].name.indexOf("CompRef_"); 
				if (compRefNameIndex != -1)
				{
					compRefName = compInfoElements[index].name.substring(compRefNameIndex+8,compInfoElements[index].name.length); 
					compPicHandle = document.getElementById("compPic_" + compRefName); 

					if (requestParameters.length == 0)
						requestParameters += "compPic_" + compRefName + "=" + compPicHandle.src;  
					else
						requestParameters += "&" + "compPic_" + compRefName + "=" + compPicHandle.src;
				}
				*/
		}
		// alert(requestParameters);
		
		sendSyncRequest('updateDatabase.php', targetKitDiv ,requestParameters,'progressIndicatorDiv');
		
		clearDivContent(targetKitDiv); 
		clearDivContent(targetCompDiv);
		
		var queryString = 'kitID=' + kitID + '&vehicleID=' + vehicleID + '&editFlag=false';
		if (fullDetailFlag == "true")
		{
			queryString = queryString + '&fullDetail=true'; 
		}
		// alert(queryString); 
		
		
		sendRequest('kitInformation.php?' + queryString, targetKitDiv,'','progressIndicatorDiv');
		sendRequest('kitNotes.php?' + queryString, targetKitNotes,'','progressIndicatorDiv'); 
		sendRequest('kitInstallationPictures.php?' + queryString, targetKitInstallationPictures,'','progressIndicatorDiv'); 
		sendRequest('componentInformation.php?' + queryString, targetCompDiv,'','progressIndicatorDiv'); 
		sendRequest('componentFullInformation.php?' + queryString, targetFullCompDiv,'','progressIndicatorDiv'); 
	
		// hide(processingDivName);  
	}
	
	function saveDBChanges(processingDivName, componentInformationFormName, vehicleID, kitID, targetKitDiv, targetCompDiv, targetFullCompDiv, targetKitNotes, targetKitInstallationPictures, fullDetailFlag)
	{
		show(processingDivName);
		setTimeout("saveDBChanges_now('" + processingDivName+ "', '" + componentInformationFormName+ "', '" + 
					vehicleID+ "', '" + kitID+ "', '" + targetKitDiv+ "', '" + 
					targetCompDiv + "', '" + targetFullCompDiv+ "', '" + targetKitNotes + "', '" + targetKitInstallationPictures + "', '" + 
					fullDetailFlag + "');",100);  
	}
	
	function addComponent(kitID)
	{
		// alert('Add Component - Coming Soon ...');
		
		var requestParameters = "kitID=" + kitID;
		// we set the list of components into a temporary location
		// so that we can use that temporary list to populate the actual list
		// (this is required because populating a select list with innerHTML does not work
		// in Internet Explorer) 
		sendSyncRequest('kitCompList.php', 'temp_kitCompListDiv',requestParameters,'progressIndicatorDiv');
		// alert("waiting here ..."); 
		hide('temp_kitCompListDiv');
		var handle = document.getElementById('temp_kitCompListDiv');
		// alert(handle.innerHTML); 
		
		var kitInputFieldHandle = document.getElementById('kitIDInputField');
		kitInputFieldHandle.value = kitID; 
		
		// Populate the actual list of components used in the form
		// from the list that was written by the PHP we called earlier
		var tempCompListHandle = document.getElementById('temp_kitCompListSelect');
		var compListHandle = document.getElementById('kitCompList');
		compListHandle.length = 0; 
		for (compIndex = 0; compIndex < tempCompListHandle.length; compIndex++)
		{
			compListHandle.options[compIndex] = new Option(tempCompListHandle[compIndex].text,tempCompListHandle[compIndex].value);  
		}  
		
		show('componentDiv'); 
	}
	
	function removeComponent()
	{
		alert('Remove Component - Coming Soon ...'); 
	}
	
	function closeCompWindow()
	{
		// Clear the status div to make sure the previous transaction status does not stay
		var statusDivHandle = document.getElementById('saveKitCompChangesDiv'); 
		statusDivHandle.innerHTML = ""; 
		
		hide('componentDiv'); 	
	}
	
	function addComponentToList()
	{
		var kitCompList = document.getElementById('kitCompList');
		var allCompList = document.getElementById('allCompList'); 
		var numberOfKitComps = kitCompList.options.length; 
		
		for (allCompIndex = 0; allCompIndex < allCompList.options.length; allCompIndex++)
		{
			if (allCompList.options[allCompIndex].selected)
			{
				// alert(allCompList.options[allCompIndex].value);
				if (!isValueInList(allCompList.options[allCompIndex].value,kitCompList))
				{
					kitCompList.options[numberOfKitComps] = new Option(allCompList.options[allCompIndex].text,allCompList.options[allCompIndex].value); 
					numberOfKitComps++; 
				}
				else
				{
					alert("\"" + allCompList.options[allCompIndex].text + "\" is already part of this kit"); 
				}
			} 
		}
		// alert(kitCompList);  
	}
	
	function isValueInList(value, list)
	{
		for (listIndex = 0; listIndex < list.options.length; listIndex++)
		{
			if (list.options[listIndex].value == value)
				return true; 
		}
	}
	
	function removeComponentFromList()
	{
		var kitCompList = document.getElementById('kitCompList');
		for (kitCompIndex = 0; kitCompIndex < kitCompList.options.length; kitCompIndex++)
		{
			// alert("List length = " + kitCompList.options.length); 
			if (kitCompList.options[kitCompIndex].selected)
			{
				// alert("Removing " + kitCompList.options[kitCompIndex].value); 
				kitCompList.options[kitCompIndex] = null; 
				kitCompIndex--; 
			}
		}
	}
	
	function saveComponentChanges()
	{
		var confirmFlag = confirm("Are you sure you want to proceed with this update?\r\n(Changes are final and cannot be rolled back)");
		if (!confirmFlag)
		{ 
			return; 
		}

		var kitCompList = document.getElementById('kitCompList');
		var requestParameters = ""; 
		for (kitCompIndex = 0; kitCompIndex < kitCompList.options.length; kitCompIndex++)
		{
			requestParameters = requestParameters + "-" + kitCompList.options[kitCompIndex].value; 
		}
		// if there are no components in the kit comp list, set to special code to indicate all components should be removed
		if (requestParameters == "")
		{
			confirmFlag = confirm("Are you sure  you want to remove all components in this kit?"); 
			if (!confirmFlag)
			{
				return; 
			}
			requestParameters = "kitCompList=RemoveAll";
		}
		else
		{
			requestParameters = "kitCompList=" + requestParameters; 
		}
		
		var kitInputFieldHandle = document.getElementById('kitIDInputField'); 
		requestParameters = requestParameters + "&kitID=" + kitInputFieldHandle.value; 		

		sendSyncRequest('saveKitComps.php', 'saveKitCompChangesDiv',requestParameters,'progressIndicatorDiv');
	}
	
	/**
	 * Modify the picture that a component is associated with
	 * 
	 * @param componentRef
	 * @return
	 */
	function modifyPic(componentRef)
	{
		// alert("Component Reference in modifyPic() = " + componentRef); 
		var compRefField = document.getElementById('pic_compRef_Component'); 
		compRefField.value = componentRef; 
		// alert(compRefField.value); 
		
		var compPreviewImage = document.getElementById('previewImage'); 
		compPreviewImage.src = "./images/components/" + componentRef + ".JPG?uniqueIdentifier=" + getUniqueIdentifier(); 
		
		/*
		var fileName = document.getElementById('file'); 
		fileName.value = " "; 
		*/
		
		showPictureLoadDiv();
	}
	
	function showPictureLoadDiv()
	{
		var formRef = document.getElementById('pictureLoadForm'); 
		if (formRef == null)
		{
			// Firefox does not refer to forms in the same way as IE does
			formRef = document.forms['pictureLoadForm']; 
		}
		
		formRef.target = 'pictureLoadFrame';
		formRef.action = 'compDescriptionLoad.php'; 

		formRef.submit();  

		formRef.action = 'javascript:uploadPic();'; 
		formRef.target = '';

		show('pictureLoadDiv'); 
	}
	
	function showInstallationPictureLoadDiv(installationPicLabel, vehicleModel, kitID)
	{
		var formRef = document.getElementById('installationPictureLoadForm'); 
		if (formRef == null)
		{
			// Firefox does not refer to forms in the same way as IE does
			formRef = document.forms['installationPictureLoadForm']; 
		}
		
		formRef.action = 'javascript:uploadInstallationPic("' + installationPicLabel + '", "' + vehicleModel + '", "' + kitID + '");'; 
		formRef.pic_header.value = installationPicLabel; 
		formRef.pic_vehicle.value = vehicleModel; 
		formRef.pic_kitID.value = kitID;
		formRef.target = '';

		show('installationPictureLoadDiv'); 
	}
	
	function closePicWindow()
	{
		hide('pictureLoadDiv'); 
	}
	
	function closeInstallationPicWindow()
	{
		hide('installationPictureLoadDiv'); 
	}
	
	function createComponent()
	{
		var formRef = document.getElementById('createComponentForm'); 
		if (formRef == null)
		{
			// Firefox does not refer to forms in the same way as IE does
			formRef = document.forms['createComponentForm']; 
		}
		
		var componentNameValue = document.getElementById('componentName').value;
		if (componentNameValue == null || trim(componentNameValue) == "")
		{
			alert("Please enter a component name"); 
			return; 
		} 

		var componentReferenceValue = document.getElementById('componentReferenceCode').value;
		if (componentReferenceValue == null || trim(componentReferenceValue) == "")
		{
			alert("Please enter a component reference"); 
			return; 
		} 

		formRef.target = 'createComponentFrame';
		formRef.action = 'createComponent.php'; 

		processingFormSubmitRequest = true;  
		formRef.submit(); 

		formRef.action = 'javascript:createComponent();'; 
		formRef.target = '';
	}
	
	function componentCreated()
	{
		if (processingFormSubmitRequest)
		{
			var messageHandle = createComponentFrame.document.getElementById('message'); 
			alert(messageHandle.value);  
			processingFormSubmitRequest = false; 
			refreshPage(); 
		}
	}
	
	function createVehicle()
	{
		var formRef = document.getElementById('createVehicleForm'); 
		if (formRef == null)
		{
			// Firefox does not refer to forms in the same way as IE does
			formRef = document.forms['createVehicleForm']; 
		}
		
		var vehicleNameValue = document.getElementById('vehicleName').value;
		if (vehicleNameValue == null || trim(vehicleNameValue) == "")
		{
			alert("Please enter a vehicle name"); 
			return; 
		} 

		formRef.target = 'createVehicleFrame';
		formRef.action = 'createVehicle.php'; 

		processingFormSubmitRequest = true;  
		formRef.submit(); 

		formRef.action = 'javascript:createVehicle();'; 
		formRef.target = '';
	}
	
	function vehicleCreated()
	{
		if (processingFormSubmitRequest)
		{
			var messageHandle = createVehicleFrame.document.getElementById('message'); 
			alert(messageHandle.value);  
			processingFormSubmitRequest = false; 
			refreshPage(); 
		}
	}
	
	function createManufacturer()
	{
		var formRef = document.getElementById('createManufacturerForm'); 
		if (formRef == null)
		{
			// Firefox does not refer to forms in the same way as IE does
			formRef = document.forms['createManufacturerForm']; 
		}
		
		var manufacturerCodeValue = document.getElementById('manufacturerCode').value;
		if (manufacturerCodeValue == null || trim(manufacturerCodeValue) == "")
		{
			alert("Please enter a manufacturer code"); 
			return; 
		} 

		formRef.target = 'createManufacturerFrame';
		formRef.action = 'createManufacturer.php'; 

		processingFormSubmitRequest = true;  
		formRef.submit(); 

		formRef.action = 'javascript:createManufacturer();'; 
		formRef.target = '';
	}
	
	function manufacturerCreated()
	{
		if (processingFormSubmitRequest)
		{
			var messageHandle = createManufacturerFrame.document.getElementById('message'); 
			alert(messageHandle.value);  
			processingFormSubmitRequest = false; 
			refreshPage(); 
		}
	}
	
	function createKit()
	{
		var formRef = document.getElementById('createKitForm'); 
		if (formRef == null)
		{
			// Firefox does not refer to forms in the same way as IE does
			formRef = document.forms['createKitForm']; 
		}
		
		var kitReferenceCodeValue = document.getElementById('kitReferenceCode').value;
		if (kitReferenceCodeValue == null || trim(kitReferenceCodeValue) == "")
		{
			alert("Please enter a kit reference code"); 
			return; 
		} 
		
		var kitNameValue = document.getElementById('kitName').value;
		if (kitNameValue == null || trim(kitNameValue) == "")
		{
			alert("Please enter a kit name"); 
			return; 
		} 

		formRef.target = 'createKitFrame';
		formRef.action = 'createKit.php'; 

		processingFormSubmitRequest = true;  
		formRef.submit(); 

		formRef.action = 'javascript:createKit();'; 
		formRef.target = '';
	}
	
	function kitCreated()
	{
		if (processingFormSubmitRequest)
		{
			var messageHandle = createKitFrame.document.getElementById('message'); 
			alert(messageHandle.value);  
			processingFormSubmitRequest = false; 
			refreshPage(); 
		}
	}
	
	function refreshPage()
	{
		window.location.reload(); 
	}
	
	function uploadPic()
	{
		var fileName = document.getElementById('file'); 
		if (fileName == null || trim(fileName.value) == "")
		{
			// alert("Please specify a file name or click \"Browse\" to select a picture"); 
			var continueFlag = confirm("Please confirm that you want to save your textual description changes\r\nwihout uploading a new image.\r\nOtherwise, click on \"Cancel\" and browse for a new image\r\nbefore saving your changes.");
			if (!continueFlag)
				return; 
		}
		
		var formRef = document.getElementById('pictureLoadForm'); 
		if (formRef == null)
		{
			// Firefox does not refer to forms in the same way as IE does
			formRef = document.forms['pictureLoadForm']; 
		}
		
		formRef.target = 'pictureLoadFrame';
		formRef.action = 'pictureLoad.php'; 
		// alert('about to submit form to ' + formRef.action + ' and display the results in ' + formRef.target);
		loadingImage = true;  
		formRef.submit();  

		formRef.action = 'javascript:uploadPic();'; 
		formRef.target = '';
	}
	
	/**
	*/
	function deleteInstallationPic(fileToDelete, vehicleID, kitID)
	{
		confirmFlag = confirm("Deleted files cannot be recovered. Are you sure you want to continue?");
		if (confirmFlag)
		{
			// alert('uploadInstallationPic::' + installationPicLabel); 
			// var fileName = document.getElementById('installationPicFileToDelete'); 
			if (fileToDelete == null || trim(fileToDelete.value) == "")
			{
				alert("You must specify a picture to delete"); 
				return; 
			}
			
			var formRef = document.getElementById('installationPictureDeleteForm'); 
			if (formRef == null)
			{
				// Firefox does not refer to forms in the same way as IE does
				formRef = document.forms['installationPictureDeleteForm']; 
			}
			
			formRef.target = 'installationPictureDeleteFrame';
			formRef.action = 'installationPictureDelete.php';
			formRef.pic_header.value = fileToDelete;  
			formRef.pic_vehicle.value = vehicleID; 
			formRef.pic_kitID.value = kitID;
			
			var informationForm = document.getElementById('installationPictureSaveForm'); 
			if (formRef == null)
			{
				// Firefox does not refer to forms in the same way as IE does
				formRef = document.forms['installationPictureSaveForm']; 
			}
			
			informationForm.currentVehicleID.value = vehicleID; 
			informationForm.currentKitID.value = kitID;
			
			// alert('about to submit form to ' + formRef.action + ' and display the results in ' + formRef.target + ' and pic header = ' + formRef.pic_header.value);
			loadingImage = true;  
			formRef.submit();  
		
			formRef.action = 'javascript:deleteInstallationPic(\"' + fileToDelete + '\", \"' + vehicleID + '\", \"' + kitID + '\");'; 
			formRef.target = '';
		}
		else
		{
			return; 
		}
	}

	/**
		Triggered when an installation picture is loaded successfully
		Sends a request to refresh the display of installation pictures in order 
		to reflect the latest picture that was just added 
	*/
	function installationPictureDeleted()
	{
		if (loadingImage)
		{
			// alert('loading installation picture()'); 
			var messageHandle = installationPictureDeleteFrame.document.getElementById('pic_errorMsg'); 
			if (messageHandle != null && messageHandle.value != "")
			{
				alert(messageHandle.value);
			}
			else
			{
				var formRef = document.getElementById('installationPictureDeleteFrame'); 
				if (formRef == null)
				{
					// Firefox does not refer to forms in the same way as IE does
					formRef = document.forms['installationPictureDeleteFrame']; 
				}
				
				var informationForm = document.getElementById('installationPictureSaveForm'); 
				if (formRef == null)
				{
					// Firefox does not refer to forms in the same way as IE does
					formRef = document.forms['installationPictureSaveForm']; 
				}
				
				var currentVehicleID = informationForm.currentVehicleID.value; 
				var currentKitID = informationForm.currentKitID.value; 
	
				sendInstallationPicRefreshRequest('kitInstallationPictures.php?kitID=' + currentKitID + '&vehicleID=' + currentVehicleID, 'kitInstallationPictures', '', 'progressIndicatorDiv');
				// show('kitInstallationPictures');
				// show('kitInstallationPicturesDisplayDiv');
				// var kitInstPicturesDiv = document.getElementById('kitInstallationPictures'); 
				// alert("kit installation pictures display prop = <" + kitInstPicturesDiv.display + ">");   
			}
	
			loadingImage = false; 
		}			
	}

	/**
		Takes the name of a picture file and uses installationPictureLoad.php in order 
		to save it to the server
		The PHP script's target is set to a hidden frame, so that the frame's onLoad event
		can get triggered whenever the script is done, and the proper actions can be taken
		upon completion of the file loading
	*/
	function uploadInstallationPic(installationPicLabel, vehicleID, kitID)
	{
		// alert('uploadInstallationPic::' + installationPicLabel); 
		var fileName = document.getElementById('installationPicFile'); 
		if (fileName == null || trim(fileName.value) == "")
		{
			alert("Please specify a file name or click \"Browse\" to select a picture"); 
			return; 
		}
		
		var formRef = document.getElementById('installationPictureLoadForm'); 
		if (formRef == null)
		{
			// Firefox does not refer to forms in the same way as IE does
			formRef = document.forms['installationPictureLoadForm']; 
		}
		
		formRef.target = 'installationPictureLoadFrame';
		formRef.action = 'installationPictureLoad.php';
		formRef.pic_header.value = installationPicLabel;  
		formRef.pic_vehicle.value = vehicleID; 
		formRef.pic_kitID.value = kitID;
		
		var informationForm = document.getElementById('installationPictureSaveForm'); 
		if (formRef == null)
		{
			// Firefox does not refer to forms in the same way as IE does
			formRef = document.forms['installationPictureSaveForm']; 
		}
		
		informationForm.currentVehicleID.value = vehicleID; 
		informationForm.currentKitID.value = kitID; 
		
		// alert('about to submit form to ' + formRef.action + ' and display the results in ' + formRef.target + ' and pic header = ' + formRef.pic_header.value);
		loadingImage = true;  
		formRef.submit();  

		formRef.action = 'javascript:uploadInstallationPic(\"' + installationPicLabel + '\", \"' + vehicleID + '\", \"' + kitID + '\");'; 
		formRef.target = '';
	}
	
	/**
		Triggered when an installation picture is loaded successfully
		Sends a request to refresh the display of installation pictures in order 
		to reflect the latest picture that was just added 
	*/
	function installationPictureLoaded()
	{
		if (loadingImage)
		{
			// alert('loading installation picture()'); 
			var messageHandle = pictureLoadFrame.document.getElementById('pic_errorMsg'); 
			if (messageHandle != null && messageHandle.value != "")
			{
				alert(messageHandle.value);
			}
			else
			{
				var formRef = document.getElementById('installationPictureLoadFrame'); 
				if (formRef == null)
				{
					// Firefox does not refer to forms in the same way as IE does
					formRef = document.forms['installationPictureLoadFrame']; 
				}
				
				var informationForm = document.getElementById('installationPictureSaveForm'); 
				if (formRef == null)
				{
					// Firefox does not refer to forms in the same way as IE does
					formRef = document.forms['installationPictureSaveForm']; 
				}
				
				var currentVehicleID = informationForm.currentVehicleID.value; 
				var currentKitID = informationForm.currentKitID.value; 

				sendInstallationPicRefreshRequest('kitInstallationPictures.php?kitID=' + currentKitID + '&vehicleID=' + currentVehicleID, 'kitInstallationPictures', '', 'progressIndicatorDiv');
				// show('kitInstallationPictures');
				// show('kitInstallationPicturesDisplayDiv');
				// var kitInstPicturesDiv = document.getElementById('kitInstallationPictures'); 
				// alert("kit installation pictures display prop = <" + kitInstPicturesDiv.display + ">");   
			}

			loadingImage = false; 
		}			
	}
	
	function pictureLoaded()
	{
		if (loadingImage)
		{
			var messageHandle = pictureLoadFrame.document.getElementById('pic_errorMsg'); 
			if (messageHandle != null && messageHandle.value != "")
			{
				alert(messageHandle.value);
			}
			
			messageHandle = pictureLoadFrame.document.getElementById('pic_fileName');
			var previewImageHandle = document.getElementById('previewImage'); 
			previewImageHandle.src = "./images/components/" + messageHandle.value + "?unique=" + getUniqueIdentifier();
			
			// var compRefField = document.getElementById('pic_compRef_Component');
			// alert(compRefField.value);  

			var leftJoinHandle = document.getElementById('leftJoin'); 
			messageHandle = pictureLoadFrame.document.getElementById('leftJoin_value');
			leftJoinHandle.value = messageHandle.value;
			var rightJoinHandle = document.getElementById('rightJoin'); 
			messageHandle = pictureLoadFrame.document.getElementById('rightJoin_value');
			rightJoinHandle.value = messageHandle.value;
			var centerJoinHandle = document.getElementById('centerJoin'); 
			messageHandle = pictureLoadFrame.document.getElementById('centerJoin_value');
			centerJoinHandle.value = messageHandle.value;			  
		}
		else
		{
			var leftJoinHandle = document.getElementById('leftJoin'); 
			// alert(pictureLoadFrame.name); 
			messageHandle = pictureLoadFrame.document.getElementById('leftJoin_value');
			// the fields might not be set up if the page is just loading ... 
			if (messageHandle != null)
			{
				// alert(messageHandle.value); 
				leftJoinHandle.value = messageHandle.value;
				var rightJoinHandle = document.getElementById('rightJoin'); 
				messageHandle = pictureLoadFrame.document.getElementById('rightJoin_value');
				rightJoinHandle.value = messageHandle.value;
				// alert(messageHandle.value); 
				var centerJoinHandle = document.getElementById('centerJoin'); 
				messageHandle = pictureLoadFrame.document.getElementById('centerJoin_value');
				centerJoinHandle.value = messageHandle.value;			  
				// alert(messageHandle.value);
			} 
		}  
	}
	
	function handleNoPreviewPic(previewImageID)
	{
		var compPreviewImage = document.getElementById(previewImageID); 
		compPreviewImage.src = "./images/components/NoPreviewPicture.JPG"; 
	}
	
	function handleNoPic(previewImageID)
	{
		var compPreviewImage = document.getElementById(previewImageID); 
		compPreviewImage.src = "./images/components/NoPicture.JPG"; 
	}
	
	function getUniqueIdentifier()
	{
		var currentTime = new Date(); 
		return currentTime.getTime(); 
	}
	
	function loadPage()
	{
		setTimeout("hide('progressIndicatorDiv');", 500);
		setTimeout("show('queryWindow');", 200);
		// alert("page loaded"); 
	}
	
	function trim(stringToTrim)
	{
		// alert(stringToTrim); 
		if (stringToTrim == null)
			return stringToTrim; 
	 	
	 	return stringToTrim.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
	}
	
	
	/**
		Goes through the elements of the form passed in as a parameter
		and adds them to the query string of the target URL
		Then calls the sendRequest method
		
		Note: handles input fields and radio buttons. 
		!! Checkboxes and other input types not tested !!  
	*/
	function submitAjaxForm(inputFormName, targetURL, targetElementName, processingDivName)
	{
		var requestParameters = ""; 
		var inputForm = document.getElementById(inputFormName); 
		if (inputForm == null)
		{
			// Firefox does not refer to forms in the same way as IE does
			inputForm = document.forms[inputFormName]; 
		}
		
		// alert('Got a reference to the form ' + inputForm.name); 
		
		var inputFormElements = inputForm.elements;
		// Flag used to indicate whether or not to add a specific form element to the query string
		// (used for radio button processing)
		var addElement = true; 
		for (index = 0; index < inputFormElements.length; index++)
		{
				// default behavior is to add every element
				addElement = true; 
				
				// Different processing for radio buttons
				if (inputFormElements[index].type == "radio")
				{
					// only add the value of the radio button to the query string if it is selected (i.e. "checked")
					if (inputFormElements[index].checked)
					{
						addElement = true; 
						// alert("add " + inputFormElements[index].name + " = " + inputFormElements[index].value); 
					}
					else 
					{
						addElement = false; 
					}
				}

				// Different processing for checkboxes
				if (inputFormElements[index].type == "checkbox")
				{
					// only add the value of the checkbox to the query string if it is selected (i.e. "checked")
					if (inputFormElements[index].checked)
					{
						addElement = true; 
						// alert("add " + inputFormElements[index].name + " = " + inputFormElements[index].value); 
					}
					else 
					{
						addElement = false; 
					}
				}

				// End of processing for radio buttons
				if (addElement)
				{
					if (requestParameters.length == 0)
					{
						requestParameters += inputFormElements[index].name + "=" + trim(inputFormElements[index].value);
					}
					else
					{
						requestParameters += "&" + inputFormElements[index].name + "=" + trim(inputFormElements[index].value);
					}
				}
		}
		
		// alert('Read: ' + requestParameters); 

		sendRequest(targetURL, targetElementName ,requestParameters,processingDivName);
	}
	

