	var	xlviewers	= 0;
	var	popUpErrorNum	= 0;

	function createViewer(path, imgf, w, h)
	{
		var viewerID      = "viewer" + xlviewers++;	// id of the div-container which will host the flash-application
		var swfName       = "/flash/viewer.swf";	// name of the swf file, absolute.

		document.write('<div id="' + viewerID + '">');
		document.write('<a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a>');
		document.write('</div>');

		var swfObj = document.getElementById(viewerID);
		//alert(swfObj.id);

		swfObj.fullscreenUrl = "fullscreen.html";		// fullscreenUrl with JS-popUp if Flash-Fullscreen doesn't work clientside
		swfObj.flashvars = new Array();
		/*
			closer_image_path: IMGF file path, XLimage path excluded. Example:
				if XLimage image path is "/opt/xlimage/images", this variable will be the image name ("Landscape.imgi").
				if XLimage image path is "/opt/xlimage/images/mydir", this variable will be the image name ("mydir/Landscape.imgi").
				Notice that for internal use only of the PHP code "imgf" file extension is changed to "imgi". The file, however, will
				be "Landscape.imgf".
		*/
		swfObj.flashvars.keepInFrame		= false;
		swfObj.flashvars.closer_image_path	= imgf;
		/*
			closer_app_path: complete URL to xml.php file.
				Notice that the parameter must end with a trailing slash.
		*/
		swfObj.flashvars.closer_app_path	= path;
		var params = {};
		params.allowfullscreen = true;
		var ret = swfobject.embedSWF(swfName, viewerID, w, h, "8.0.0", null, swfObj.flashvars, params);
	}

