<?xml version="1.0" encoding="UTF-8" ?>
<!--
   Copyright 2009 Marcin Szczepanski, webqem (marcins@gmail.com)

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<Module>
  <ModulePrefs title="Napkin Gadget" height="500">
    <Require feature="wave" /> 
    <Require feature="flash" />
  </ModulePrefs>
  <Content type="html">
    <![CDATA[     
    <script type="text/javascript"
       src="http://wave-api.appspot.com/public/wave.js"></script>
    <script type="text/javascript"
       src="http://my-wave-gadgets.appspot.com/wave/js/waveFlashBridge.js"></script>
    <script type="text/javascript"
       src="http://my-wave-gadgets.appspot.com/wave/js/napkinCanvasViewer.js"></script>

    <script type="text/javascript">
		function main()
		{
		  if(gadgets.flash.getMajorVersion() == 0) {
              // no Flash, use canvas..
              setupCanvasViewer();
          } else {
			var url = "http://my-wave-gadgets.appspot.com/wave/NapkinGadget.2.2.swf";
                        
			var result = gadgets.flash.embedCachedFlash(
			     url, 
				"NapkinGadget-container", 
				9,
				{	
				    id: "NapkinGadget", 
					width:"100%", 
					height:"100%", 
					allowscriptaccess:"always",
					wmode:"transparent",
					flashvars:"gadgetName=NapkinGadget&debugMode=false"
				}
			);
		  }
		}

		gadgets.util.registerOnLoadHandler(main);    
    </script>
    <div id="NapkinGadget-container">
       <canvas id="napkinViewerCanvas">You must either have Flash or
       support the Canvas tag to use this Gadget!</canvas>
    </div>
    ]]>
  </Content>
</Module>