			function previewImage(fileInfo) {
			var filename =  fileInfo;
			 
			//create the popup
			popup = window.open('', 'imagePreview' ,'width=620,height=530,left=100,top=75,screenX=100,screenY=75,status = 1,resizable=0');
			//start writing in the html code
			popup.document.writeln("<html><body bgcolor='#FFFFFF'>");
			//get the extension of the file to see if it has one of the image extensions
			var fileExtension = filename.substring(filename.lastIndexOf(".")+1);
			if (fileExtension == "jpg" || fileExtension == "jpeg" || fileExtension == "gif"
			|| fileExtension == "png")
			popup.document.writeln("<center><img src='" + filename + "'>");
			else
			//if not extension fron list above write URL to file
			popup.document.writeln("<a href='" + filename + "'>" + filename + "</a>");
			popup.document.writeln("</center></body></html>");
			popup.document.close();
			popup.focus();
			}
