  	function doImageCompletion(ind, id) {
  	
        var url = "/portal/innovateimageservlet?industry=" + ind+"&id="+id + "&rand=" + (new Date()).getTime();
        var req = initRequest(url);

		if(isIE){
	        req.onreadystatechange = function() {
	            if (req.readyState == 4) {
	                if (req.status == 200) {
		                    parseImageMessages(req,req.responseXML);
	                } else if (req.status == 204){
	                }
	            }
	        };
  		   try {
  		     	req.open("GET", url, false);
	        	req.send(null);
  		   }catch(e) {
  		   }

        }else{
	        // Because Firefox doesn't work with responseXML, create a div
			// and put responseText in the innerHTML. This does not work with
			// IE 7.
			req.open("GET", url, false);
        	req.send(null);
			
			var doc = document.createElement("div");
			doc.innerHTML = req.responseText;
			var xmlDocument = req.responseXML;
            if(!xmlDocument || xmlDocument.childNodes.length==0){ 
               xmlDocument = (new DOMParser()).parseFromString(req.responseText, "text/xml");
				if(xmlDocument.getElementsByTagName("image")[0]!=undefined)                      
		            parseImageMessages(req,xmlDocument);
            }else{
		            parseImageMessages(req,xmlDocument);
            }
        }
	}

	function parseImageMessages(req,responseXML) {
		var images = responseXML.getElementsByTagName("images")[0];
				var ni = document.getElementById("form");
				for (loop = 0; loop < images.childNodes.length; loop++) {
					
				  var image = images.childNodes[loop].firstChild.nodeValue;
				  var textNode = document.createElement('input');
				  textNode.type = 'hidden';
				  textNode.name = 'backimage' + loop;
				  textNode.id = 'backimage' + loop;
				   ni.appendChild(textNode);
				  textNode.value = image;
				}
				  var textNode = document.createElement('input');
				  textNode.type = 'hidden';
				  textNode.name = 'numImages';
				  textNode.id = 'numImages';
				  textNode.value = images.childNodes.length;
				
				   ni.appendChild(textNode);
	}
	
