				
		function insertImage(source, width, height, sourceType, quality, scale) {
			/* returns a HTML image tag to the PHP file that draws in a PNG image of the resulting re-scaled image
			
			Parameters:
			source: the file location of the source images
			width: the width of the outputted image
			height: the height of the images
			sourceType: the type of image that that source is (options are "jpeg","gif", and "png")
			quality: the quality of the jpeg to be returned
			scale: flag to determine if the image will scale to match resolution (0 by default)
			
			*/
			
			// default quality setting if not provided
			quality = (quality == null || quality == "") ? 0.75 : quality;
			
			// default scale setting if not provided
			scale = (scale == null || scale == "") ? 0 : scale;
			
			// first make the scalable image units (based on the current resolution, compared to a default of 1024x768)
			var xu = (scale == 1) ? screen.width/1024 : 1;
			var yu = (scale == 1) ? screen.height/768 : 1;

			// now we determine the size of that the image will be scaled to
			var new_width = parseInt(width*xu);
			var new_height = parseInt(height*xu);document.write('<img src="http://www.design-ireland.net//alpha/view/widgets/image.js.php?source='+source+'&width='+new_width+'&height='+new_height+'&sourceType='+sourceType+'&quality='+quality+'&scale='+scale+'" width="'+new_width+'" height="'+new_height+'" border="0"/>')}