
	var uploader = null;
	function onImageUploaded( id, width, height ) {
		getFlashMovieObject("innerworld").SetVariable("/jsfunc:img_id", id );
		getFlashMovieObject("innerworld").SetVariable("/jsfunc:img_width", width );
		getFlashMovieObject("innerworld").SetVariable("/jsfunc:img_height", height );
		getFlashMovieObject("innerworld").TCallLabel("/jsfunc","img_uploaded");
		uploader.close();
	}
	function doUpload( sessionId ) {
		if ( uploader != null && !uploader.closed )
			uploader.focus();
		else {
			var w = 340;
			var h = 300;
			var left = (screen.width - w) / 2;
			var top = (screen.height - h) / 3;
			var windstatus = 'width=' + w + ',height=' + h + ',top=' + top + ',left=' + left + ',status=no,resizable=yes,scrollbars=no';
			var filename = "/servlet/ContentImage?SessionID=" + sessionId;
			uploader = window.open( filename, 'img_uploader', windstatus );
		}
	}
	function getFlashMovieObject(movieName) {
		// Safari: Mac OS X
		if ( navigator.userAgent.indexOf("Safari") != -1 )
			return document[movieName];
		else {
			// Firefox, Netscape: mac, win
			if ( document.embeds[movieName] )
				return document.embeds[movieName];
			
			// MSIE: Win
			else		
				return document[movieName];
		}
	}
	
	
	

function getCookieValue( cookieName ) {
	var theCookie = "" + document.cookie;
	var ind = theCookie.indexOf( cookieName );
	if ( ind == -1 || cookieName == "" )
		return "";
	var ind1 = theCookie.indexOf( ';', ind );
	if ( ind1 == -1 )
		ind1 = theCookie.length;
	return unescape( theCookie.substring(ind + cookieName.length + 1, ind1) );
}