Commits

gb2013 gb committed 21a320e

Imported from SVN by Bitbucket

Comments (0)

Files changed (346)

+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>Example</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>

Example/AC_OETags.js

+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+	var version;
+	var axo;
+	var e;
+
+	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+	try {
+		// version will be set for 7.X or greater players
+		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+		version = axo.GetVariable("$version");
+	} catch (e) {
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 6.X players only
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+			
+			// installed player is some revision of 6.0
+			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+			// so we have to be careful. 
+			
+			// default to the first public version
+			version = "WIN 6,0,21,0";
+
+			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
+			axo.AllowScriptAccess = "always";
+
+			// safe to call for 6.0r47 or greater
+			version = axo.GetVariable("$version");
+
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 4.X or 5.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+			version = axo.GetVariable("$version");
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 3.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+			version = "WIN 3,0,18,0";
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 2.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+			version = "WIN 2,0,0,11";
+		} catch (e) {
+			version = -1;
+		}
+	}
+	
+	return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+	// NS/Opera version >= 3 check for Flash plugin in plugin array
+	var flashVer = -1;
+	
+	if (navigator.plugins != null && navigator.plugins.length > 0) {
+		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+			var descArray = flashDescription.split(" ");
+			var tempArrayMajor = descArray[2].split(".");			
+			var versionMajor = tempArrayMajor[0];
+			var versionMinor = tempArrayMajor[1];
+			var versionRevision = descArray[3];
+			if (versionRevision == "") {
+				versionRevision = descArray[4];
+			}
+			if (versionRevision[0] == "d") {
+				versionRevision = versionRevision.substring(1);
+			} else if (versionRevision[0] == "r") {
+				versionRevision = versionRevision.substring(1);
+				if (versionRevision.indexOf("d") > 0) {
+					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+				}
+			} else if (versionRevision[0] == "b") {
+				versionRevision = versionRevision.substring(1);
+			}
+			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+		}
+	}
+	// MSN/WebTV 2.6 supports Flash 4
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+	// WebTV 2.5 supports Flash 3
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+	// older WebTV supports Flash 2
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+	else if ( isIE && isWin && !isOpera ) {
+		flashVer = ControlVersion();
+	}
+	return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+	versionStr = GetSwfVer();
+	if (versionStr == -1 ) {
+		return false;
+	} else if (versionStr != 0) {
+		if(isIE && isWin && !isOpera) {
+			// Given "WIN 2,0,0,11"
+			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
+			tempString        = tempArray[1];			// "2,0,0,11"
+			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
+		} else {
+			versionArray      = versionStr.split(".");
+		}
+		var versionMajor      = versionArray[0];
+		var versionMinor      = versionArray[1];
+		var versionRevision   = versionArray[2];
+
+        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
+		if (versionMajor > parseFloat(reqMajorVer)) {
+			return true;
+		} else if (versionMajor == parseFloat(reqMajorVer)) {
+			if (versionMinor > parseFloat(reqMinorVer))
+				return true;
+			else if (versionMinor == parseFloat(reqMinorVer)) {
+				if (versionRevision >= parseFloat(reqRevision))
+					return true;
+			}
+		}
+		return false;
+	}
+}
+
+function AC_AddExtension(src, ext)
+{
+  var qIndex = src.indexOf('?');
+  if ( qIndex != -1)
+  {
+    // Add the extention (if needed) before the query params
+    var path = src.substring(0, qIndex);
+    if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+      return src;
+    else
+      return src.replace(/\?/, ext+'?'); 
+  }
+  else
+  {
+    // Add the extension (if needed) to the end of the URL
+    if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+      return src;  // Already have extension
+    else
+      return src + ext;
+  }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs) 
+{ 
+    var str = '';
+    if (isIE && isWin && !isOpera)
+    {
+  		str += '<object ';
+  		for (var i in objAttrs)
+  			str += i + '="' + objAttrs[i] + '" ';
+  		str += '>';
+  		for (var i in params)
+  			str += '<param name="' + i + '" value="' + params[i] + '" /> ';
+  		str += '</object>';
+    } else {
+  		str += '<embed ';
+  		for (var i in embedAttrs)
+  			str += i + '="' + embedAttrs[i] + '" ';
+  		str += '> </embed>';
+    }
+
+    document.write(str);
+}
+
+function AC_FL_RunContent(){
+  var ret = 
+    AC_GetArgs
+    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+     , "application/x-shockwave-flash"
+    );
+  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+  var ret = new Object();
+  ret.embedAttrs = new Object();
+  ret.params = new Object();
+  ret.objAttrs = new Object();
+  for (var i=0; i < args.length; i=i+2){
+    var currArg = args[i].toLowerCase();    
+
+    switch (currArg){	
+      case "classid":
+        break;
+      case "pluginspage":
+        ret.embedAttrs[args[i]] = args[i+1];
+        break;
+      case "src":
+      case "movie":	
+        args[i+1] = AC_AddExtension(args[i+1], ext);
+        ret.embedAttrs["src"] = args[i+1];
+        ret.params[srcParamName] = args[i+1];
+        break;
+      case "onafterupdate":
+      case "onbeforeupdate":
+      case "onblur":
+      case "oncellchange":
+      case "onclick":
+      case "ondblClick":
+      case "ondrag":
+      case "ondragend":
+      case "ondragenter":
+      case "ondragleave":
+      case "ondragover":
+      case "ondrop":
+      case "onfinish":
+      case "onfocus":
+      case "onhelp":
+      case "onmousedown":
+      case "onmouseup":
+      case "onmouseover":
+      case "onmousemove":
+      case "onmouseout":
+      case "onkeypress":
+      case "onkeydown":
+      case "onkeyup":
+      case "onload":
+      case "onlosecapture":
+      case "onpropertychange":
+      case "onreadystatechange":
+      case "onrowsdelete":
+      case "onrowenter":
+      case "onrowexit":
+      case "onrowsinserted":
+      case "onstart":
+      case "onscroll":
+      case "onbeforeeditfocus":
+      case "onactivate":
+      case "onbeforedeactivate":
+      case "ondeactivate":
+      case "type":
+      case "codebase":
+        ret.objAttrs[args[i]] = args[i+1];
+        break;
+      case "id":
+      case "width":
+      case "height":
+      case "align":
+      case "vspace": 
+      case "hspace":
+      case "class":
+      case "title":
+      case "accesskey":
+      case "name":
+      case "tabindex":
+        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+        break;
+      default:
+        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+    }
+  }
+  ret.objAttrs["classid"] = classid;
+  if (mimeType) ret.embedAttrs["type"] = mimeType;
+  return ret;
+}
+
+

Example/PDFViewer.html

+<!-- saved from url=(0014)about:internet -->
+<html lang="en">
+
+<!-- 
+Smart developers always View Source. 
+
+This application was built using Adobe Flex, an open source framework
+for building rich Internet applications that get delivered via the
+Flash Player or to desktops via Adobe AIR. 
+
+Learn more about Flex at http://flex.org 
+// -->
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!--  BEGIN Browser History required section -->
+<link rel="stylesheet" type="text/css" href="history/history.css" />
+<!--  END Browser History required section -->
+
+<title></title>
+<script src="AC_OETags.js" language="javascript"></script>
+
+<!--  BEGIN Browser History required section -->
+<script src="history/history.js" language="javascript"></script>
+<!--  END Browser History required section -->
+
+<style>
+body { margin: 0px; overflow:hidden }
+</style>
+<script language="JavaScript" type="text/javascript">
+<!--
+// -----------------------------------------------------------------------------
+// Globals
+// Major version of Flash required
+var requiredMajorVersion = 9;
+// Minor version of Flash required
+var requiredMinorVersion = 0;
+// Minor version of Flash required
+var requiredRevision = 124;
+// -----------------------------------------------------------------------------
+// -->
+</script>
+</head>
+
+<body scroll="no">
+<script language="JavaScript" type="text/javascript">
+<!--
+// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
+var hasProductInstall = DetectFlashVer(6, 0, 65);
+
+// Version check based upon the values defined in globals
+var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
+
+if ( hasProductInstall && !hasRequestedVersion ) {
+	// DO NOT MODIFY THE FOLLOWING FOUR LINES
+	// Location visited after installation is complete if installation is required
+	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
+	var MMredirectURL = window.location;
+    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+    var MMdoctitle = document.title;
+
+	AC_FL_RunContent(
+		"src", "playerProductInstall",
+		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
+		"width", "100%",
+		"height", "100%",
+		"align", "middle",
+		"id", "PDFViewer",
+		"quality", "high",
+		"bgcolor", "#ffffff",
+		"name", "PDFViewer",
+		"allowScriptAccess","sameDomain",
+		"type", "application/x-shockwave-flash",
+		"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+} else if (hasRequestedVersion) {
+	// if we've detected an acceptable version
+	// embed the Flash Content SWF when all tests are passed
+	AC_FL_RunContent(
+			"src", "PDFViewer",
+			"width", "100%",
+			"height", "100%",
+			"align", "middle",
+			"id", "PDFViewer",
+			"quality", "high",
+			"bgcolor", "#ffffff",
+			"name", "PDFViewer",
+			"allowScriptAccess","sameDomain",
+			"type", "application/x-shockwave-flash",
+			"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+  } else {  // flash is too old or we can't detect the plugin
+    var alternateContent = 'Alternate HTML content should be placed here. '
+  	+ 'This content requires the Adobe Flash Player. '
+   	+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
+    document.write(alternateContent);  // insert non-flash content
+  }
+// -->
+</script>
+<noscript>
+  	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+			id="PDFViewer" width="100%" height="100%"
+			codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
+			<param name="movie" value="PDFViewer.swf" />
+			<param name="quality" value="high" />
+			<param name="bgcolor" value="#ffffff" />
+			<param name="allowScriptAccess" value="sameDomain" />
+			<embed src="PDFViewer.swf" quality="high" bgcolor="#ffffff"
+				width="100%" height="100%" name="PDFViewer" align="middle"
+				play="true"
+				loop="false"
+				quality="high"
+				allowScriptAccess="sameDomain"
+				type="application/x-shockwave-flash"
+				pluginspage="http://www.adobe.com/go/getflashplayer">
+			</embed>
+	</object>
+</noscript>
+</body>
+</html>

Example/PDFViewer.swf

Binary file added.

Example/PDFViewerFS.html

+<!-- saved from url=(0014)about:internet -->
+<html lang="en">
+
+<!-- 
+Smart developers always View Source. 
+
+This application was built using Adobe Flex, an open source framework
+for building rich Internet applications that get delivered via the
+Flash Player or to desktops via Adobe AIR. 
+
+Learn more about Flex at http://flex.org 
+// -->
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!--  BEGIN Browser History required section -->
+<link rel="stylesheet" type="text/css" href="history/history.css" />
+<!--  END Browser History required section -->
+
+<title></title>
+<script src="AC_OETags.js" language="javascript"></script>
+
+<!--  BEGIN Browser History required section -->
+<script src="history/history.js" language="javascript"></script>
+<!--  END Browser History required section -->
+
+<style>
+body { margin: 0px; overflow:hidden }
+</style>
+<script language="JavaScript" type="text/javascript">
+<!--
+// -----------------------------------------------------------------------------
+// Globals
+// Major version of Flash required
+var requiredMajorVersion = 9;
+// Minor version of Flash required
+var requiredMinorVersion = 0;
+// Minor version of Flash required
+var requiredRevision = 124;
+// -----------------------------------------------------------------------------
+// -->
+</script>
+</head>
+
+<body scroll="no">
+<script language="JavaScript" type="text/javascript">
+<!--
+// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
+var hasProductInstall = DetectFlashVer(6, 0, 65);
+
+// Version check based upon the values defined in globals
+var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
+
+if ( hasProductInstall && !hasRequestedVersion ) {
+	// DO NOT MODIFY THE FOLLOWING FOUR LINES
+	// Location visited after installation is complete if installation is required
+	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
+	var MMredirectURL = window.location;
+    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+    var MMdoctitle = document.title;
+
+	AC_FL_RunContent(
+		"src", "playerProductInstall",
+		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
+		"width", "100%",
+		"height", "100%",
+		"align", "middle",
+		"id", "PDFViewerFS",
+		"quality", "high",
+		"bgcolor", "#ffffff",
+		"name", "PDFViewerFS",
+		"allowScriptAccess","sameDomain",
+		"type", "application/x-shockwave-flash",
+		"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+} else if (hasRequestedVersion) {
+	// if we've detected an acceptable version
+	// embed the Flash Content SWF when all tests are passed
+	AC_FL_RunContent(
+			"src", "PDFViewerFS",
+			"width", "100%",
+			"height", "100%",
+			"align", "middle",
+			"id", "PDFViewerFS",
+			"quality", "high",
+			"bgcolor", "#ffffff",
+			"name", "PDFViewerFS",
+			"allowScriptAccess","sameDomain",
+			"type", "application/x-shockwave-flash",
+			"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+  } else {  // flash is too old or we can't detect the plugin
+    var alternateContent = 'Alternate HTML content should be placed here. '
+  	+ 'This content requires the Adobe Flash Player. '
+   	+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
+    document.write(alternateContent);  // insert non-flash content
+  }
+// -->
+</script>
+<noscript>
+  	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+			id="PDFViewerFS" width="100%" height="100%"
+			codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
+			<param name="movie" value="PDFViewerFS.swf" />
+			<param name="quality" value="high" />
+			<param name="bgcolor" value="#ffffff" />
+			<param name="allowScriptAccess" value="sameDomain" />
+			<embed src="PDFViewerFS.swf" quality="high" bgcolor="#ffffff"
+				width="100%" height="100%" name="PDFViewerFS" align="middle"
+				play="true"
+				loop="false"
+				quality="high"
+				allowScriptAccess="sameDomain"
+				type="application/x-shockwave-flash"
+				pluginspage="http://www.adobe.com/go/getflashplayer">
+			</embed>
+	</object>
+</noscript>
+</body>
+</html>

Example/PDFViewerFS.swf

Binary file added.

Example/Paper3.swf

Binary file added.

Example/file53157.swf

Binary file added.

Example/flash/.project

+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>flash</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>

Example/flash/FlexPaperViewer.html

+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
+<!-- saved from url=(0014)about:internet --> 
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <head> 
+        <title></title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; }   
+			#flashContent { display:none; }
+        </style> 
+		
+		<script type="text/javascript" src="js/swfobject/swfobject.js"></script>
+		<script type="text/javascript" src="js/flexpaper_flash.js"></script>
+		
+        <script type="text/javascript"> 
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "9.0.124";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = { 
+                  SwfFile : escape("Paper.swf?v1.4.0final"),
+				  Scale : 0.8, 
+				  ZoomTransition : "easeOut",
+				  ZoomTime : 0.5,
+  				  ZoomInterval : 0.1,
+  				  FitPageOnLoad : false,
+  				  FitWidthOnLoad : false,
+  				  PrintEnabled : true,
+  				  FullScreenAsMaxWindow : false,
+				  ProgressiveLoading : false,
+				  
+				  PrintToolsVisible : true,
+  				  ViewModeToolsVisible : true,
+  				  ZoomToolsVisible : true,
+  				  FullScreenVisible : true,
+  				  NavToolsVisible : true,
+  				  CursorToolsVisible : true,
+  				  SearchToolsVisible : true,
+  				  
+  				  localeChain: "en_US"
+				  };
+			 var params = {
+				
+			    }
+            params.quality = "high";
+            params.bgcolor = "#ffffff";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "FlexPaperViewer";
+            attributes.name = "FlexPaperViewer";
+            swfobject.embedSWF(
+                "FlexPaperViewer.swf", "flashContent", 
+                "800", "550", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script> 
+        
+    </head> 
+    <body> 
+    	<div style="position:absolute;left:10px;top:10px;">
+	        <div id="flashContent"> 
+	        	<p> 
+		        	To view this page ensure that Adobe Flash Player version 
+					9.0.124 or greater is installed. 
+				</p> 
+				<script type="text/javascript"> 
+					var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+					document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+									+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+				</script> 
+	        </div>
+        </div>
+   </body> 
+</html> 

Example/flash/FlexPaperViewer.swf

Binary file added.

Example/flash/FlexPaperViewerDevBuild.html

+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <title>Example of FlexPaper</title>
+</head>
+<body>
+  <div id="cb">
+  </div>
+  
+  <script type="text/javascript" src="js/swfobject/swfobject.js"></script>
+  <script type="text/javascript">
+  window.onload = function()
+  {
+    var params = {
+      SwfFile : "Paper.swf?v=1.1d6",
+	  Scale : 0.6
+    }
+    swfobject.embedSWF("FlexPaperViewerDevBuild.swf?v=1.1d6","cb","500","500","9.0.0","js/swfobject/expressInstall.swf", params);
+  }
+  </script>
+</body>
+</html>

Example/flash/FlexPaperViewerDevBuild.swf

Binary file added.

Example/flash/FlexPaperViewerLatest.swf

Binary file added.

Example/flash/FlexPaperViewer_sm.html

+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
+<!-- saved from url=(0014)about:internet --> 
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <head> 
+        <title></title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; }   
+			#flashContent { display:none; }
+        </style> 
+		
+		<script type="text/javascript" src="js/swfobject/swfobject.js"></script>
+		<script type="text/javascript" src="js/flexpaper_flash.js"></script>
+		
+        <script type="text/javascript"> 
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "9.0.124";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = { 
+                  SwfFile : escape("comm.swf?v1.4.0final"),
+				  Scale : 0.7, 
+				  ZoomTransition : "easeOut",
+				  ZoomTime : 0.5,
+  				  ZoomInterval : 0.1,
+  				  FitPageOnLoad : false,
+  				  FitWidthOnLoad : false,
+  				  PrintEnabled : true,
+  				  FullScreenAsMaxWindow : false,
+				  ProgressiveLoading : true,
+				  
+				  PrintToolsVisible : true,
+  				  ViewModeToolsVisible : true,
+  				  ZoomToolsVisible : true,
+  				  FullScreenVisible : true,
+  				  NavToolsVisible : true,
+  				  CursorToolsVisible : true,
+  				  SearchToolsVisible : true,
+  				  
+  				  localeChain: "en_US"
+				  };
+			 var params = {
+				
+			    }
+            params.quality = "high";
+            params.bgcolor = "#ffffff";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "FlexPaperViewer";
+            attributes.name = "FlexPaperViewer";
+            swfobject.embedSWF(
+                "FlexPaperViewer.swf", "flashContent", 
+                "655", "340", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script> 
+        
+    </head> 
+    <body> 
+    	<div style="position:absolute;left:10px;top:10px;">
+	        <div id="flashContent"> 
+	        	<p> 
+		        	To view this page ensure that Adobe Flash Player version 
+					9.0.124 or greater is installed. 
+				</p> 
+				<script type="text/javascript"> 
+					var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+					document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+									+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+				</script> 
+	        </div>
+        </div>
+   </body> 
+</html> 

Example/flash/GoogleGadget.xml

+<?xml version="1.0" encoding="UTF-8" ?> 
+<Module>
+  <ModulePrefs title="hello world example" /> 
+  <Content type="html">
+     <iframe src="http://flexpaper.googlecode.com/svn/trunk/Example/flash/FlexPaperViewer.html" width="520" height="540" frameborder="0"></iframe>
+  </Content> 
+</Module>

Example/flash/Paper.swf

Binary file added.

Example/flash/Paper3_v9.swf

Binary file added.

Example/flash/comm.swf

Binary file added.

Example/flash/crossdomain.xml

+<?xml version="1.0" ?>
+<cross-domain-policy>
+<allow-access-from domain="*" />
+</cross-domain-policy>

Example/flash/debug/FlexPaperViewer.html

+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
+<!-- FlexPaperViewer flash version debug template --> 
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <head> 
+        <title>FlexPaper</title>                
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; }   
+			#flashContent { display:none; }
+        </style> 
+		
+		<script type="text/javascript" src="js/flexpaper_flash_debug.js"></script>
+		<script type="text/javascript" src="js/jquery.js"></script>
+		
+    </head> 
+    <body> 
+    	<div style="position:absolute;left:10px;top:10px;">
+	        <a id="viewerPlaceHolder" style="width:730px;height:480px;display:block"></a>
+	        
+	        <script type="text/javascript"> 
+				var fp = new FlexPaperViewer(	
+						 'FlexPaperViewer',
+						 'viewerPlaceHolder', { config : {
+						 SwfFile : 'Paper.swf',
+						 Scale : 0.6, 
+						 ZoomTransition : 'easeOut',
+						 ZoomTime : 0.5,
+						 ZoomInterval : 0.2,
+						 FitPageOnLoad : true,
+						 FitWidthOnLoad : false,
+						 PrintEnabled : true,
+						 FullScreenAsMaxWindow : false,
+						 ProgressiveLoading : false,
+						 MinZoomSize : 0.2,
+						 MaxZoomSize : 5,
+						 SearchMatchAll : false,
+						 InitViewMode : 'Portrait',
+						 
+						 ViewModeToolsVisible : true,
+						 ZoomToolsVisible : true,
+						 NavToolsVisible : true,
+						 CursorToolsVisible : true,
+						 SearchToolsVisible : true,
+  						
+  						 localeChain: 'en_US'
+						 }});
+	        </script>  
+        </div>
+        <div style="position:absolute;left:750px;top:10px;font-family:Verdana;font-size:9pt;">
+        <table border="0" width="230">
+	        <tr><th colspan=3>Operations</th></tr>
+	        <tr><td>loadSwf</td><td><input type=text style="width:70px;" id="txt_swffile" value="Paper.swf"></td><td><input type=submit value="Invoke" onclick="getDocViewer().loadSwf($('#txt_swffile').val())"></td></tr>
+	        <tr><td>fitWidth</td><td></td><td><input type=submit value="Invoke" onclick="getDocViewer().fitWidth()"></td></tr>
+	        <tr><td>fitHeight</td><td></td><td><input type=submit value="Invoke" onclick="getDocViewer().fitHeight()"></td></tr>
+	        <tr><td>gotoPage</td><td><input type=text style="width:70px;" id="txt_pagenum" value="3"></td><td><input type=submit value="Invoke" onclick="getDocViewer().gotoPage($('#txt_pagenum').val())"></td></tr>
+	        <tr><td>getCurrPage</td><td></td><td><input type=submit value="Invoke" onclick="alert('Current page:' + getDocViewer().getCurrPage())"></td></tr>
+	        <tr><td>nextPage</td><td></td><td><input type=submit value="Invoke" onclick="getDocViewer().nextPage()"></td></tr>
+	        <tr><td>prevPage</td><td></td><td><input type=submit value="Invoke" onclick="getDocViewer().prevPage()"></td></tr>
+	        <tr><td>setZoom</td><td><input type=text style="width:70px;" id="txt_zoomfactor" value="1.30"></td><td><input type=submit value="Invoke" onclick="getDocViewer().setZoom($('#txt_zoomfactor').val())"></td></tr>
+	        <tr><td>searchText</td><td><input type=text style="width:70px;" id="txt_searchtext" value="text"></td><td><input type=submit value="Invoke" onclick="getDocViewer().searchText($('#txt_searchtext').val())"></td></tr>
+	        <tr><td>switchMode</td><td><input type=text style="width:70px;" id="txt_viewmode" value="Tile"></td><td><input type=submit value="Invoke" onclick="getDocViewer().switchMode($('#txt_viewmode').val())"></td></tr>
+	        <tr><td>printPaper</td><td></td><td><input type=submit value="Invoke" onclick="getDocViewer().printPaper()"></td></tr>
+	        <tr><td>highlight</td><td><input type=text style="width:80px;" id="txt_highlighturl" value="highlight.xml"></td><td><input type=submit value="Invoke" onclick="getDocViewer().highlight($('#txt_highlighturl').val())"></td></tr>
+	        <tr><td>postSnapshot</td><td><input type=text style="width:80px;" id="txt_postsnapshot" value=""></td><td><input type=submit value="Invoke" onclick="getDocViewer().postSnapshot($('#txt_postsnapshot').val())"></td></tr>
+        </table>
+        <br/><br/>
+        <table border="0" width="230">
+        	<tr><th>Event Log</th></tr>
+        	<tr><td><textarea rows=6 cols=28 id="txt_eventlog" style="width:350px;font-size:9px;" wrap="off"></textarea></td></tr>
+        	<tr><td><input type=text style="width:350px;" id="txt_progress" value=""></td></tr>
+	    </table>
+        </div>
+   </body> 
+</html> 

Example/flash/debug/FlexPaperViewer.swf

Binary file added.

Example/flash/debug/Paper.swf

Binary file added.

Example/flash/debug/highlight.xml

+<XML>
+<Body units='characters' color='#ff00ff' mode='active' version='2'>
+<Highlight>
+	<loc pg='0' pos='0' len='6' />
+	<loc pg='2' pos='1' len='10' />
+</Highlight>
+</Body>
+</XML>

Example/flash/debug/js/flexpaper_flash.js

+var docViewer;
+
+function getDocViewer(){
+    if(docViewer)
+    	return docViewer;
+    else
+    	docViewer = window.FlexPaperViewer_Instance.getApi();
+    	
+    return docViewer;
+}
+
+/**
+*
+* FlexPaper constructor (name of swf, name of placeholder, config)
+*
+*/
+window.FlexPaperViewer = window.$f = function() {
+	var config = arguments[2].config;
+	
+	window.FlexPaperViewer_Instance = flashembed(arguments[1], {
+	
+			src: arguments[0]+".swf",
+			version: [10, 0],
+			expressInstall: "js/expressinstall.swf"
+		},{
+			SwfFile : escape(config.SwfFile),
+			Scale : config.Scale, 
+			ZoomTransition : config.ZoomTransition,
+			ZoomTime : config.ZoomTime,
+			ZoomInterval : config.ZoomInterval,
+			FitPageOnLoad : config.FitPageOnLoad,
+			FitWidthOnLoad : config.FitWidthOnLoad,
+			PrintEnabled : config.PrintEnabled,
+			FullScreenAsMaxWindow : config.FullScreenAsMaxWindow,
+			ProgressiveLoading : config.ProgressiveLoading,
+			MinZoomSize : config.MinZoomSize,
+			MaxZoomSize : config.MaxZoomSize,
+			SearchMatchAll : config.SearchMatchAll,
+			InitViewMode : config.InitViewMode,
+			
+			ViewModeToolsVisible : config.ViewModeToolsVisible,
+			ZoomToolsVisible : config.ZoomToolsVisible,
+			NavToolsVisible : config.NavToolsVisible,
+			CursorToolsVisible : config.CursorToolsVisible,
+			SearchToolsVisible : config.SearchToolsVisible,
+			  
+			localeChain : config.localeChain
+	});
+};
+
+
+
+/**
+ * Handles the event of external links getting clicked in the document. 
+ *
+ * @example onExternalLinkClicked("http://www.google.com")
+ *
+ * @param String link
+ */
+function onExternalLinkClicked(link){
+   // alert("link " + link + " clicked" );
+   window.location.href = link;
+}
+
+/**
+ * Recieves progress information about the document being loaded
+ *
+ * @example onProgress( 100,10000 );
+ *
+ * @param int loaded
+ * @param int total
+ */
+function onProgress(loadedBytes,totalBytes){
+}
+
+/**
+ * Handles the event of a document is in progress of loading
+ *
+ */
+function onDocumentLoading(){
+}
+
+/**
+ * Receives messages about the current page being changed
+ *
+ * @example onCurrentPageChanged( 10 );
+ *
+ * @param int pagenum
+ */
+function onCurrentPageChanged(pagenum){
+}
+
+/**
+ * Receives messages about the document being loaded
+ *
+ * @example onDocumentLoaded( 20 );
+ *
+ * @param int totalPages
+ */
+function onDocumentLoaded(totalPages){
+}
+
+/**
+ * Receives error messages when a document is not loading properly
+ *
+ * @example onDocumentLoadedError( "Network error" );
+ *
+ * @param String errorMessage
+ */
+function onDocumentLoadedError(errMessage){
+}
+
+/**
+ * Receives error messages when a document has finished printed
+ *
+ * @example onDocumentPrinted();
+ *
+ */
+function onDocumentPrinted(){
+}
+
+
+
+/** 
+ * 
+ * FlexPaper embedding functionality. Based on FlashEmbed
+ *
+ */
+
+(function() {
+		
+	var IE = document.all,
+		 URL = 'http://www.adobe.com/go/getflashplayer',
+		 JQUERY = typeof jQuery == 'function', 
+		 RE = /(\d+)[^\d]+(\d+)[^\d]*(\d*)/,
+		 GLOBAL_OPTS = { 
+			// very common opts
+			width: '100%',
+			height: '100%',		
+			id: "_" + ("" + Math.random()).slice(9),
+			
+			// flashembed defaults
+			allowfullscreen: true,
+			allowscriptaccess: 'always',
+			quality: 'high',	
+			
+			// flashembed specific options
+			version: [3, 0],
+			onFail: null,
+			expressInstall: null, 
+			w3c: false,
+			cachebusting: false  		 		 
+	};
+	
+	// version 9 bugfix: (http://blog.deconcept.com/2006/07/28/swfobject-143-released/)
+	if (window.attachEvent) {
+		window.attachEvent("onbeforeunload", function() {
+			__flash_unloadHandler = function() {};
+			__flash_savedUnloadHandler = function() {};
+		});
+	}
+	
+	// simple extend
+	function extend(to, from) {
+		if (from) {
+			for (var key in from) {
+				if (from.hasOwnProperty(key)) {
+					to[key] = from[key];
+				}
+			}
+		} 
+		return to;
+	}	
+
+	// used by asString method	
+	function map(arr, func) {
+		var newArr = []; 
+		for (var i in arr) {
+			if (arr.hasOwnProperty(i)) {
+				newArr[i] = func(arr[i]);
+			}
+		}
+		return newArr;
+	}
+
+	window.flashembed = function(root, opts, conf) {
+	
+		// root must be found / loaded	
+		if (typeof root == 'string') {
+			root = document.getElementById(root.replace("#", ""));
+		}
+		
+		// not found
+		if (!root) { return; }
+		
+		root.onclick = function(){return false;}
+		
+		if (typeof opts == 'string') {
+			opts = {src: opts};	
+		}
+
+		return new Flash(root, extend(extend({}, GLOBAL_OPTS), opts), conf); 
+	};	
+	
+	// flashembed "static" API
+	var f = extend(window.flashembed, {
+		
+		conf: GLOBAL_OPTS,
+	
+		getVersion: function()  {
+			var fo, ver;
+			
+			try {
+				ver = navigator.plugins["Shockwave Flash"].description.slice(16); 
+			} catch(e) {
+				
+				try  {
+					fo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+					ver = fo && fo.GetVariable("$version");
+					
+				} catch(err) {
+                try  {
+                    fo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+                    ver = fo && fo.GetVariable("$version");  
+                } catch(err2) { } 						
+				} 
+			}
+			
+			ver = RE.exec(ver);
+			return ver ? [ver[1], ver[3]] : [0, 0];
+		},
+		
+		asString: function(obj) { 
+
+			if (obj === null || obj === undefined) { return null; }
+			var type = typeof obj;
+			if (type == 'object' && obj.push) { type = 'array'; }
+			
+			switch (type){  
+				
+				case 'string':
+					obj = obj.replace(new RegExp('(["\\\\])', 'g'), '\\$1');
+					
+					// flash does not handle %- characters well. transforms "50%" to "50pct" (a dirty hack, I admit)
+					obj = obj.replace(/^\s?(\d+\.?\d+)%/, "$1pct");
+					return '"' +obj+ '"';
+					
+				case 'array':
+					return '['+ map(obj, function(el) {
+						return f.asString(el);
+					}).join(',') +']'; 
+					
+				case 'function':
+					return '"function()"';
+					
+				case 'object':
+					var str = [];
+					for (var prop in obj) {
+						if (obj.hasOwnProperty(prop)) {
+							str.push('"'+prop+'":'+ f.asString(obj[prop]));
+						}
+					}
+					return '{'+str.join(',')+'}';
+			}
+			
+			// replace ' --> "  and remove spaces
+			return String(obj).replace(/\s/g, " ").replace(/\'/g, "\"");
+		},
+		
+		getHTML: function(opts, conf) {
+
+			opts = extend({}, opts);
+			
+			/******* OBJECT tag and it's attributes *******/
+			var html = '<object width="' + opts.width + 
+				'" height="' + opts.height + 
+				'" id="' + opts.id + 
+				'" name="' + opts.id + '"';
+			
+			if (opts.cachebusting) {
+				opts.src += ((opts.src.indexOf("?") != -1 ? "&" : "?") + Math.random());		
+			}			
+			
+			if (opts.w3c || !IE) {
+				html += ' data="' +opts.src+ '" type="application/x-shockwave-flash"';		
+			} else {
+				html += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';	
+			}
+			
+			html += '>'; 
+			
+			/******* nested PARAM tags *******/
+			if (opts.w3c || IE) {
+				html += '<param name="movie" value="' +opts.src+ '" />'; 	
+			} 
+			
+			// not allowed params
+			opts.width = opts.height = opts.id = opts.w3c = opts.src = null;
+			opts.onFail = opts.version = opts.expressInstall = null;
+			
+			for (var key in opts) {
+				if (opts[key]) {
+					html += '<param name="'+ key +'" value="'+ opts[key] +'" />';
+				}
+			}	
+		
+			/******* FLASHVARS *******/
+			var vars = "";
+			
+			if (conf) {
+				for (var k in conf) { 
+					if (conf[k]) {
+						var val = conf[k]; 
+						vars += k +'='+ (/function|object/.test(typeof val) ? f.asString(val) : val) + '&';
+					}
+				}
+				vars = vars.slice(0, -1);
+				html += '<param name="flashvars" value=\'' + vars + '\' />';
+			}
+			
+			html += "</object>";	
+			
+			return html;				
+		},
+		
+		isSupported: function(ver) {
+			return VERSION[0] > ver[0] || VERSION[0] == ver[0] && VERSION[1] >= ver[1];			
+		}		
+		
+	});
+	
+	var VERSION = f.getVersion(); 
+	
+	function Flash(root, opts, conf) {  
+	                                                
+		// version is ok
+		if (f.isSupported(opts.version)) {
+			root.innerHTML = f.getHTML(opts, conf);
+			
+		// express install
+		} else if (opts.expressInstall && f.isSupported([6, 65])) {
+			root.innerHTML = f.getHTML(extend(opts, {src: opts.expressInstall}), {
+				MMredirectURL: location.href,
+				MMplayerType: 'PlugIn',
+				MMdoctitle: document.title
+			});	
+			
+		} else {
+			
+			// fail #2.1 custom content inside container
+			if (!root.innerHTML.replace(/\s/g, '')) {
+				/* root.innerHTML = 
+					"<h2>Flash version " + opts.version + " or greater is required</h2>" + 
+					"<h3>" + 
+						(VERSION[0] > 0 ? "Your version is " + VERSION : "You have no flash plugin installed") +
+					"</h3>" + 
+					
+					(root.tagName == 'A' ? "<p>Click here to download latest version</p>" : 
+						"<p>Download latest version from <a href='" + URL + "'>here</a></p>");
+				*/
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://");
+				
+				root.innerHTML = "<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+										+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>";
+											
+				if (root.tagName == 'A') {	
+					root.onclick = function() {
+						location.href = URL;
+					};
+				}				
+			}
+			
+			// onFail
+			if (opts.onFail) {
+				var ret = opts.onFail.call(this);
+				if (typeof ret == 'string') { root.innerHTML = ret; }	
+			}			
+		}
+		
+		// http://flowplayer.org/forum/8/18186#post-18593
+		if (IE) {
+			window[opts.id] = document.getElementById(opts.id);
+		} 
+		
+		// API methods for callback
+		extend(this, {
+				
+			getRoot: function() {
+				return root;	
+			},
+			
+			getOptions: function() {
+				return opts;	
+			},
+
+			
+			getConf: function() {
+				return conf;	
+			}, 
+			
+			getApi: function() {
+				return root.firstChild;	
+			}
+			
+		}); 
+	}
+	
+	// setup jquery support
+	if (JQUERY) {
+		
+		// tools version number
+		jQuery.tools = jQuery.tools || {version: '1.2.5'};
+		
+		jQuery.tools.flashembed = {  
+			conf: GLOBAL_OPTS
+		};	
+		
+		jQuery.fn.flashembed = function(opts, conf) {		
+			return this.each(function() { 
+				$(this).data("flashembed", flashembed(this, opts, conf));
+			});
+		}; 
+	} 
+	
+})();

Example/flash/debug/js/flexpaper_flash_debug.js

+var docViewer;
+
+function getDocViewer(){
+    if(docViewer)
+    	return docViewer;
+    else
+    	docViewer = window.FlexPaperViewer_Instance.getApi();
+    	
+    return docViewer;
+}
+
+/**
+*
+* FlexPaper constructor (name of swf, name of placeholder, config)
+*
+*/
+window.FlexPaperViewer = window.$f = function() {
+	var config = arguments[2].config;
+	
+	window.FlexPaperViewer_Instance = flashembed(arguments[1], {
+	
+			src: arguments[0]+".swf",
+			version: [10, 0],
+			expressInstall: "js/expressinstall.swf"
+			}, {
+			SwfFile : escape(config.SwfFile),
+			Scale : config.Scale, 
+			ZoomTransition : config.ZoomTransition,
+			ZoomTime : config.ZoomTime,
+			ZoomInterval : config.ZoomInterval,
+			FitPageOnLoad : config.FitPageOnLoad,
+			FitWidthOnLoad : config.FitWidthOnLoad,
+			PrintEnabled : config.PrintEnabled,
+			FullScreenAsMaxWindow : config.FullScreenAsMaxWindow,
+			ProgressiveLoading : config.ProgressiveLoading,
+			MinZoomSize : config.MinZoomSize,
+			MaxZoomSize : config.MaxZoomSize,
+			SearchMatchAll : config.SearchMatchAll,
+			InitViewMode : config.InitViewMode,
+			  
+			ViewModeToolsVisible : config.ViewModeToolsVisible,
+			ZoomToolsVisible : config.ZoomToolsVisible,
+			NavToolsVisible : config.NavToolsVisible,
+			CursorToolsVisible : config.CursorToolsVisible,
+			SearchToolsVisible : config.SearchToolsVisible,
+			  
+			localeChain : config.localeChain
+	});
+};
+
+
+
+/**
+ * Handles the event of external links getting clicked in the document. 
+ *
+ * @example onExternalLinkClicked("http://www.google.com")
+ *
+ * @param String link
+ */
+function onExternalLinkClicked(link){
+	$("#txt_eventlog").val('onExternalLinkClicked:' + link + '\n' + $("#txt_eventlog").val());	
+}
+
+/**
+ * Recieves progress information about the document being loaded
+ *
+ * @example onProgress( 100,10000 );
+ *
+ * @param int loaded
+ * @param int total
+ */
+function onProgress(loadedBytes,totalBytes){
+	$("#txt_progress").val('onProgress:' + loadedBytes + '/' + totalBytes + '\n');	
+}
+
+/**
+ * Handles the event of a document is in progress of loading
+ *
+ */
+function onDocumentLoading(){
+	$("#txt_eventlog").val('onDocumentLoading' + '\n' + $("#txt_eventlog").val());	
+}
+
+/**
+ * Receives messages about the current page being changed
+ *
+ * @example onCurrentPageChanged( 10 );
+ *
+ * @param int pagenum
+ */
+function onCurrentPageChanged(pagenum){
+	$("#txt_eventlog").val('onCurrentPageChanged:' + pagenum + '\n' + $("#txt_eventlog").val());
+}
+
+/**
+ * Receives messages about the document being loaded
+ *
+ * @example onDocumentLoaded( 20 );
+ *
+ * @param int totalPages
+ */
+function onDocumentLoaded(totalPages){
+	$("#txt_eventlog").val('onDocumentLoaded:' + totalPages + '\n' + $("#txt_eventlog").val());
+}
+
+/**
+ * Receives error messages when a document is not loading properly
+ *
+ * @example onDocumentLoadedError( "Network error" );
+ *
+ * @param String errorMessage
+ */
+function onDocumentLoadedError(errMessage){
+	$("#txt_eventlog").val('onDocumentLoadedError:' + errMessage + '\n' + $("#txt_eventlog").val());
+}
+
+/**
+ * Receives error messages when a document has finished printed
+ *
+ * @example onDocumentPrinted();
+ *
+ */
+function onDocumentPrinted(){
+	$("#txt_eventlog").val('onDocumentPrinted\n' + $("#txt_eventlog").val());
+}
+
+
+/** 
+ * 
+ * FlexPaper embedding functionality. Based on FlashEmbed
+ *
+ */
+
+(function() {
+		
+	var IE = document.all,
+		 URL = 'http://www.adobe.com/go/getflashplayer',
+		 JQUERY = typeof jQuery == 'function', 
+		 RE = /(\d+)[^\d]+(\d+)[^\d]*(\d*)/,
+		 GLOBAL_OPTS = { 
+			// very common opts
+			width: '100%',
+			height: '100%',		
+			id: "_" + ("" + Math.random()).slice(9),
+			
+			// flashembed defaults
+			allowfullscreen: true,
+			allowscriptaccess: 'always',
+			quality: 'high',	
+			
+			// flashembed specific options
+			version: [3, 0],
+			onFail: null,
+			expressInstall: null, 
+			w3c: false,
+			cachebusting: false  		 		 
+	};
+	
+	// version 9 bugfix: (http://blog.deconcept.com/2006/07/28/swfobject-143-released/)
+	if (window.attachEvent) {
+		window.attachEvent("onbeforeunload", function() {
+			__flash_unloadHandler = function() {};
+			__flash_savedUnloadHandler = function() {};
+		});
+	}
+	
+	// simple extend
+	function extend(to, from) {
+		if (from) {
+			for (var key in from) {
+				if (from.hasOwnProperty(key)) {
+					to[key] = from[key];
+				}
+			}
+		} 
+		return to;
+	}	
+
+	// used by asString method	
+	function map(arr, func) {
+		var newArr = []; 
+		for (var i in arr) {
+			if (arr.hasOwnProperty(i)) {
+				newArr[i] = func(arr[i]);
+			}
+		}
+		return newArr;
+	}
+
+	window.flashembed = function(root, opts, conf) {
+	
+		// root must be found / loaded	
+		if (typeof root == 'string') {
+			root = document.getElementById(root.replace("#", ""));
+		}
+		
+		// not found
+		if (!root) { return; }
+		
+		root.onclick = function(){return false;}
+		
+		if (typeof opts == 'string') {
+			opts = {src: opts};	
+		}
+
+		return new Flash(root, extend(extend({}, GLOBAL_OPTS), opts), conf); 
+	};	
+	
+	// flashembed "static" API
+	var f = extend(window.flashembed, {
+		
+		conf: GLOBAL_OPTS,
+	
+		getVersion: function()  {
+			var fo, ver;
+			
+			try {
+				ver = navigator.plugins["Shockwave Flash"].description.slice(16); 
+			} catch(e) {
+				
+				try  {
+					fo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+					ver = fo && fo.GetVariable("$version");
+					
+				} catch(err) {
+                try  {
+                    fo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+                    ver = fo && fo.GetVariable("$version");  
+                } catch(err2) { } 						
+				} 
+			}
+			
+			ver = RE.exec(ver);
+			return ver ? [ver[1], ver[3]] : [0, 0];
+		},
+		
+		asString: function(obj) { 
+
+			if (obj === null || obj === undefined) { return null; }
+			var type = typeof obj;
+			if (type == 'object' && obj.push) { type = 'array'; }
+			
+			switch (type){  
+				
+				case 'string':
+					obj = obj.replace(new RegExp('(["\\\\])', 'g'), '\\$1');
+					
+					// flash does not handle %- characters well. transforms "50%" to "50pct" (a dirty hack, I admit)
+					obj = obj.replace(/^\s?(\d+\.?\d+)%/, "$1pct");
+					return '"' +obj+ '"';
+					
+				case 'array':
+					return '['+ map(obj, function(el) {
+						return f.asString(el);
+					}).join(',') +']'; 
+					
+				case 'function':
+					return '"function()"';
+					
+				case 'object':
+					var str = [];
+					for (var prop in obj) {
+						if (obj.hasOwnProperty(prop)) {
+							str.push('"'+prop+'":'+ f.asString(obj[prop]));
+						}
+					}
+					return '{'+str.join(',')+'}';