function getXMLHTTP()
{
var xmlHttp=null;
try
 {
	 // Firefox, Opera 8.0+, Safari
	 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
	 //Internet Explorer
	 try
	  {
	  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	 catch (e)
	  {
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	if(navigator.userAgent.indexOf("MSIE 6.0"))
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
 }
	return xmlHttp;
}



function getPopulated(strURL,base)
{  	 

	var req = getXMLHTTP();
	
	if(req)
	{

	req.onreadystatechange = function()
	{	
		if(req.readyState == 4)
		{ 
			
			res = document.getElementById("edit-Screen-Position").value;			
			if(res == 'select')
			{
				document.getElementById('edit-Sweep-Stakes-Image-link').value = '';
				return;
			}
			
			else
			{
				if (req.status == 200)
				{	
					
					var ajaxStr = req.responseText;									
					ajaxStr_arr = ajaxStr.split(':subtype-seperator:');					
					nid_str = res.split('_');

					 var img1 = base+ajaxStr_arr[2];						
						document.getElementById('edit-Sweep-Stakes-Image-link').value = ajaxStr_arr[1];
						document.getElementById('files_list').innerHTML='<img width='+nid_str[1]+' height='+nid_str[2]+' src="'+img1+'">'; 
						
						
				}
				else
				{ 
					alert("There was a problem while using XMLHTTP:\n");
				}
			}
		}            
	}    
	     
	req.open("GET", strURL, true); //open url using get method
	req.send(null);
	}
}


