initial commit
Arthur Axel 'fREW' Schmidt [Sat, 1 May 2010 08:11:10 +0000 (03:11 -0500)]
18 files changed:
slideshow.html [new file with mode: 0644]
ui/graphic_support/blank.gif [new file with mode: 0644]
ui/graphic_support/finish.gif [new file with mode: 0644]
ui/graphic_support/fixed.js [new file with mode: 0644]
ui/graphic_support/help.jpg [new file with mode: 0644]
ui/graphic_support/iepngfix.htc [new file with mode: 0644]
ui/graphic_support/numeric.png [new file with mode: 0644]
ui/graphic_support/progress.gif [new file with mode: 0644]
ui/s5-notes.html [new file with mode: 0644]
ui/scala_utf/framing.css [new file with mode: 0644]
ui/scala_utf/opera.css [new file with mode: 0644]
ui/scala_utf/outline.css [new file with mode: 0644]
ui/scala_utf/pattern.png [new file with mode: 0644]
ui/scala_utf/pretty.css [new file with mode: 0644]
ui/scala_utf/print.css [new file with mode: 0644]
ui/scala_utf/s5-core.css [new file with mode: 0644]
ui/scala_utf/slides.css [new file with mode: 0644]
ui/scala_utf/slides.js [new file with mode: 0644]

diff --git a/slideshow.html b/slideshow.html
new file mode 100644 (file)
index 0000000..980fe90
--- /dev/null
@@ -0,0 +1,920 @@
+<!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>
+<title>DBIx::Class (aka DBIC)</title>
+<!-- metadata -->
+<meta name="contributor" content="youcan[64]netzgesta[46]de" />
+<meta name="publisher" content="s5.netzgesta.de" />
+<meta name="description" content="S5 1.3 is a very flexible and lightweight slide show system available for anyone to use (including transitions and scalable fonts and images)" />
+<meta name="keywords" content="S5, version 1.3, slide show, presentation-mode, projection-mode, powerpoint-like, scala-like, keynote-like, incremental display, scalable fonts, scalable images, transitions, notes, osf, xoxo, css, javascript, xhtml, public domain" />
+
+<meta name="generator" content="S5" />
+<meta name="version" content="1" />
+<meta name="subject" content="DBIx::Class" />
+<meta name="author" content="See first slide" />
+<meta name="company" content="N/A" />
+<meta name="robots" content="index, follow" />
+<meta name="revisit-after" content="7 days" />
+<!-- meta additionally -->
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<meta http-equiv="Content-Script-Type" content="text/javascript" />
+<meta http-equiv="Content-Style-Type" content="text/css" /><!-- configuration parameters -->
+<meta name="defaultView" content="slideshow" />
+<meta name="controlVis" content="hidden" />
+<!-- configuration transition extension -->
+<meta name="tranSitions" content="true" />
+<meta name="fadeDuration" content="500" />
+<meta name="incrDuration" content="250" />
+<!-- configuration autoplay extension -->
+<meta name="autoMatic" content="false" />
+<meta name="playLoop" content="true" />
+<meta name="playDelay" content="10" />
+<!-- configuration audio extension -->
+<meta name="audioSupport" content="false" />
+<meta name="audioVolume" content="0" />
+<meta name="audioError" content="false" />
+<!-- configuration audio debug -->
+<meta name="audioDebug" content="false" />
+<!-- style sheet links -->
+<link rel="stylesheet" href="ui/scala_utf/slides.css" type="text/css" media="projection" id="slideProj" />
+<link rel="stylesheet" href="ui/scala_utf/outline.css" type="text/css" media="screen" id="outlineStyle" />
+<link rel="stylesheet" href="ui/scala_utf/print.css" type="text/css" media="print" id="slidePrint" />
+<link rel="stylesheet" href="ui/scala_utf/opera.css" type="text/css" media="projection" id="operaFix" />
+<!-- embedded styles -->
+<style type="text/css" media="all">
+.imgcon {width: 100%; margin: 0 auto; padding: 0; text-align: center;}
+#anim {width: 33%; height: 320px; position: relative;}
+#anim img {position: absolute; top: 0px; left: 0px;}
+.red {color: red;}
+.grey {color: gray;}
+</style>
+<!-- S5 JS -->
+<script src="ui/scala_utf/slides.js" type="text/javascript"></script>
+</head>
+<body>
+
+<div class="layout">
+   <div id="controls"><!-- DO NOT EDIT --></div>
+   <div id="currentSlide"><!-- DO NOT EDIT --></div>
+   <div id="header"></div>
+   <div id="footer">
+      <h1>DBIx::Class Introduction</h1>
+      <h2>YAPC::NA 2010</h2>
+   </div>
+</div>
+
+<div class="presentation">
+
+   <div class="slide">
+      <h1>DBIX::Class (aka DBIC)</h1>
+      <h3>for (advanced) beginners</h3>
+      <h4>Leo Lapworth @ LPW 2009</h4>
+      <h4><a href="http://leo.cuckoo.org/projects">http://leo.cuckoo.org/projects</a></h4>
+      <div class="handout"></div>
+   </div>
+
+   <div class="slide">
+      <h1>assumptions</h1>
+      <p>You know a little about Perl and using objects</p>
+      <p>You know a little bit about databases and using foreign keys</p>
+   </div>
+
+   <div class="slide">
+      <h1>DBIx::Class?</h1>
+      <ul>
+         <li>ORM (object relational mapper)</li>
+         <li>SQL &lt;-&gt; OO (using objects instead of SQL)</li>
+         <li>Simple, powerful, complex, fab and confusing</li>
+         <li>There are many ORMs, DBIx::Class just happens to be the best in Perl (personal opinion)</li>
+      </ul>
+   </div>
+
+   <div class="slide">
+      <h1>why this talk?</h1>
+      <ul>
+         <li>Help avoid mistakes I made!</li>
+         <li>Help learn DBIx::Class faster</li>
+         <li>Make your coding easier</li>
+      </ul>
+   </div>
+
+   <div class="slide">
+      <h1>point of note</h1>
+      <p><em>"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan</em></p>
+      <p>This talk is about making it easy so we are less likely to get confused</p>
+   </div>
+
+   <div class="slide">
+      <h1>table setup</h1>
+   </div>
+
+   <div class="slide">
+      <h1>example...</h1>
+      <ul>
+         <li>Authors</li>
+         <li>Books</li>
+      </ul>
+   </div>
+
+   <div class="slide">
+      <h1>authors table</h1>
+<pre>CREATE TABLE authors(
+   id   int(8) primary key auto_increment,
+   name varchar(255)
+) engine = InnoDB DEFAULT CHARSET=utf8;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>tips</h1>
+      <p>Name tables as simple plurals (<strong>add an S</strong>) - makes relationships easier to understand</p>
+      <p>(issue: Matt Trout "Tables should not be plural as gives you plurals for Result:: package names which represent a single row" - talk may be rewritten in future to reflect this as this is better once you understand the relationship setup - either way, consistency is important)</p>
+      <p>Use a character set (<strong>UTF8</strong>) from the start (for international characters)</p>
+   </div>
+
+   <div class="slide">
+      <h1>authors table</h1>
+<pre>CREATE TABLE author<strong>s</strong>(
+   id   int(8) primary key auto_increment,
+   name varchar(255)
+) engine = <strong>InnoDB</strong> DEFAULT CHARSET=<strong>utf8</strong>;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>books table</h1>
+<pre>CREATE TABLE books(
+   id     int(8) primary key auto_increment,
+   title  varchar(255),
+   author int(8),foreign key (author)
+      references authors(id)
+) engine = InnoDB DEFAULT CHARSET=utf8;</pre>
+   </div>
+
+
+   <div class="slide">
+      <h1>tips</h1>
+      <p>Name link fields as singular</p>
+      <p>Check foreign key is the same field and type and size in both tables</p>
+   </div>
+
+   <div class="slide">
+      <h1>books table</h1>
+<pre>CREATE TABLE books(
+   id     int(8) primary key auto_increment,
+   title  varchar(255),
+   author <strong>int(8)</strong>,<strong>foreign key (<em>author</em>)</strong>
+      <strong>references <em>authors(id)</em></strong>
+) engine = InnoDB DEFAULT CHARSET=utf8;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>CRUD compared</h1>
+      <ul>
+         <li><strong>C</strong> - Create</li>
+         <li><strong>R</strong> - Read</li>
+         <li><strong>U</strong> - Update</li>
+         <li><strong>D</strong> - Delete</li>
+      </ul>
+   </div>
+
+   <div class="slide">
+      <h1>Manual (SQL)</h1>
+   </div>
+
+   <div class="slide">
+      <h1>manual: create</h1>
+<pre>my $sth = $dbh-&gt;prepare('
+   INSERT INTO books
+   (title, author)
+   values (?,?)
+');
+
+$sth-&gt;execute(
+  'A book title', $author_id
+);</pre>
+   </div>
+
+   <div class="slide">
+      <h1>manual: create</h1>
+<pre>my $sth = $dbh-&gt;prepare('
+   <strong>INSERT INTO books
+   (title, author)
+   values (?,?)</strong>
+');
+
+$sth-&gt;execute(
+  'A book title', <strong><em>$author_id</em></strong>
+);</pre>
+   </div>
+
+   <div class="slide">
+      <h1>manual: retrieve</h1>
+<pre>my $sth = $dbh-&gt;prepare('
+   SELECT title,
+   authors.name as author_name
+   FROM books, authors
+   WHERE books.author = authors.id
+');</pre>
+   </div>
+
+   <div class="slide">
+      <h1>manual: retrieve</h1>
+<pre>while( my $book = $sth-&gt;fetchrow_hashref() ) {
+  print 'Author of '
+     . $book-&gt;{title}
+     . ' is '
+     . $book-&gt;{author_name}
+     . "\n";
+}</pre>
+   </div>
+
+   <div class="slide">
+      <h1>manual: update</h1>
+<pre>my $update = $dbh-&gt;prepare('
+   UPDATE books
+   SET title = ?
+   WHERE id = ?
+');
+
+$update-&gt;execute(
+  'New title',<strong>$book_id</strong>
+);</pre>
+   </div>
+
+   <div class="slide">
+      <h1>manual: delete</h1>
+<pre>my $delete = $dbh-&gt;prepare('
+   DELETE FROM books
+   WHERE id = ?
+');
+
+$delete-&gt;execute(<strong>$book_id</strong>);</pre>
+   </div>
+
+   <div class="slide">
+      <h1>DBIx::Class</h1>
+   </div>
+
+   <div class="slide">
+      <h1>DBIC: create</h1>
+<pre>my $book = $book_model-&gt;create({
+   title  =&gt; 'A book title',
+   author =&gt; $author_id,
+});</pre>
+      <p>Look ma, no SQL!</p>
+      <p><strong>Tip:</strong> do not pass in primary_key field, even if it's empty/undef as the object returned will have an empty id, even if your field is auto increment.</p>
+   </div>
+
+   <div class="slide">
+      <h1>DBIC: create</h1>
+<pre>my $book = $book_model-&gt;create({
+   title  =&gt; 'A book title',
+   author =&gt; <strong>$author_id</strong>,
+});</pre>
+   </div>
+
+   <div class="slide">
+      <h1>DBIC: create</h1>
+<pre>my $pratchett = $author_model-&gt;create({
+   name =&gt; 'Terry Pratchett',
+});</pre>
+   </div>
+
+   <div class="slide">
+      <h1>DBIC: create</h1>
+<pre>my $book = $pratchett-&gt;create_related(
+  books =&gt; {
+   title =&gt; 'Another Discworld book',
+});</pre>
+<strong>or</strong>
+<pre>my $book = $pratchett-&gt;add_to_books({
+   title =&gt; 'Another Discworld book',
+});</pre>
+   </div>
+
+   <div class="slide">
+      <h1>DBIC: create</h1>
+<pre>my $book = $pratchett-&gt;create_related(
+  <strong>books</strong> =&gt; {
+   title =&gt; 'Another Discworld book',
+});</pre>
+<strong>or</strong>
+<pre>my $book = $pratchett-&gt;add_to_<strong>books</strong>({
+   title =&gt; 'Another Discworld book',
+});</pre>
+   </div>
+
+   <div class="slide">
+      <h1>DBIC: retrieve</h1>
+      <p>DBIx::Class - Lots of ways to do the same thing...</p>
+      <p><em>"There is more than one way to do it (TIMTOWTDI, usually pronounced "Tim Toady") is a Perl motto"</em></p>
+   </div>
+
+   <div class="slide">
+      <h1>DBIC: retrieve</h1>
+<pre>my $book = $book_model-&gt;find($book_id);
+
+my $book = $book_model-&gt;search({
+   title =&gt; 'A book title',
+})-&gt;single;
+
+my @books = $book_model-&gt;search({
+   author =&gt; $author_id,
+})-&gt;all;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>DBIC: retrieve</h1>
+<pre>while( my $book = $books_rs-&gt;next() ) {
+ print 'Author of '
+    . $book-&gt;title
+    . ' is '
+    . $book-&gt;author-&gt;name
+    . "\n";
+}</pre>
+   </div>
+
+   <div class="slide">
+      <h1>DBIC: retrieve</h1>
+<pre>my $books_rs = $book_model-&gt;search({
+   author =&gt; $author_id,
+});</pre>
+      <p>Search takes SQL::Abstract formatted queries</p>
+      <pre>&gt; perldoc SQL::Abstract</p>
+   </div>
+
+   <div class="slide">
+      <h1>DBIC: update</h1>
+<pre>$book-&gt;update({
+  title =&gt; 'New title',
+});</pre>
+   </div>
+
+   <div class="slide">
+      <h1>DBIC: delete</h1>
+<pre>$book-&gt;delete;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>Creating models</h1>
+   </div>
+
+   <div class="slide">
+      <pre>Example of a DBIC Result</pre>
+   </div>
+
+   <div class="slide">
+      <pre>Example of a DBIC Result</pre>
+   </div>
+
+   <div class="slide">
+      <p>too much typing!  too much maintenance!</p>
+      <p>too much maintenance!</p>
+   </div>
+
+   <div class="slide">
+      <h1>Schema::Loader</h1>
+      <pre>code for S::L here</pre>
+   </div>
+
+   <div class="slide">
+      <h1>splitting logic cleanly</h1>
+      <p>LPW::DBIC::Result::Foo = an individual row</p>
+      <p>LPW::DBIC::ResultSet::Foo = searches / results</p>
+   </div>
+
+   <div class="slide">
+      <h1>using your Schema</h1>
+      <pre>example usage code goes here</pre>
+   </div>
+
+   <div class="slide">
+      <h1>DEBUGGING</h1>
+      <pre>DBIC_TRACE=1 ./your_script.pl</pre>
+   </div>
+
+   <div class="slide">
+      <h1>Schema::Loader</h1>
+<pre>LPW::DBIC::Result::Authors-&gt;table("authors");
+LPW::DBIC::Result::Authors-&gt;add_columns(
+   id =&gt; {
+      data_type     =&gt; "INT",
+      default_value =&gt; undef,
+      is_nullable   =&gt; 0,
+      size          =&gt; 8
+   },
+   title =&gt; {
+      data_type     =&gt; "VARCHAR",
+      default_value =&gt; undef,
+      is_nullable   =&gt; 1,
+      size          =&gt; 255,
+   },
+);
+LPW::DBIC::Result::Authors-&gt;set_primary_key("id");</pre>
+   </div>
+
+   <div class="slide">
+      <h1>Schema::Loader</h1>
+<pre>LPW::DBIC::Result::Books->table("books");
+LPW::DBIC::Result::Books->add_columns(
+   id =&gt; {
+      data_type     =&gt; "INT",
+      default_value =&gt; undef,
+      is_nullable   =&gt; 0,
+      size          =&gt; 8
+   },
+   name =&gt; {
+      data_type     =&gt; "VARCHAR",
+      default_value =&gt; undef,
+      is_nullable   =&gt; 1,
+      size          =&gt; 255,
+   },
+   author =&gt; {
+      data_type     =&gt; "INT",
+      default_value =&gt; undef,
+      is_nullable   =&gt; 1,
+      size          =&gt; 8
+   },
+);
+LPW::DBIC::Result::Books-&gt;set_primary_key("id");</pre>
+   </div>
+
+   <div class="slide">
+      <h1>Schema::Loader</h1>
+<pre>LPW::DBIC::Result::Authors-&gt;has_many(books =&gt; "LPW::DBIC::Books",
+   { "foreign.author" =&gt; "self.id" });
+
+LPW::DBIC::Result::Books-&gt;belongs_to(author =&gt; "LPW::DBIC::Authors",
+   { id =&gt; "author" });</pre>
+   </div>
+
+   <div class="slide">
+      <h1>SQL - debugging</h1>
+<pre>INSERT INTO authors (name)
+   VALUES (?): 'Douglas Adams'
+
+INSERT INTO books (author, title)
+   VALUES (?, ?): '5', '42'</pre>
+   </div>
+
+   <div class="slide">
+      <h1>overloading</h1>
+<pre>LPW::DBIC::Result::Books
+LPW::DBIC::ResultSet::Books
+LPW::DBIC::Result::Authors
+LPW::DBIC::ResultSet::Books</pre>
+   </div>
+
+   <div class="slide">
+      <h1>Result::</h1>
+<pre>package LPW::DBIC::Result::Books;
+use base 'DBIx::Class';
+use strict;
+use warnings;
+
+sub isbn {
+   my $self = shift;
+
+   # search amazon or something
+   my $api = Amazon::API-&gt;book({
+      title =&gt; $self-&gt;title
+   });
+
+   return $api-&gt;isbn;
+}
+
+1;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>Result::</h1>
+<pre>print $book-&gt;isbn;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>Result:: (inflating)</h1>
+<pre>package LPW::DBIC::Result::Books;
+use base 'DBIx::Class';
+use strict;
+use warnings;
+
+use DateTime::Format::MySQL;
+
+__PACKAGE__-&gt;<strong>inflate_column</strong>(
+   <strong>date_published</strong> =&gt; {
+      inflate =&gt; sub { DateTime::Format::MySQL-&gt;parse_date(shift) },
+      deflate =&gt; sub { shift-&gt;ymd},
+   }
+);
+# Automatic see: DBIx::Class::InflateColumn::DateTime</pre>
+   </div>
+
+   <div class="slide">
+      <h1>Result:: (inflating)</h1>
+<pre>package LPW::DBIC::Result::Books;
+use base 'DBIx::Class';
+use strict;
+use warnings;
+
+use DateTime::Format::MySQL;
+
+__PACKAGE__-&gt;inflate_column(
+   date_published =&gt; {
+      <strong>inflate =&gt; sub { DateTime::Format::MySQL-&gt;parse_date(shift) },
+      deflate =&gt; sub { shift-&gt;ymd},</strong>
+   }
+);
+# Automatic see: DBIx::Class::InflateColumn::DateTime
+# Automatic see: DBIx::Class::InflateColumn::DateTime
+# Automatic see: DBIx::Class::InflateColumn::DateTime</pre>
+   </div>
+
+   <div class="slide">
+      <h1>Result:: (deflating)</h1>
+<pre>$book-&gt;date_published(DateTime-&gt;now);
+$book-&gt;update;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>Result:: (inflating)</h1>
+<pre>my $date_published = $book-&gt;date_published;
+print $date_published-&gt;month_abbr;</pre>
+
+<strong><em>Nov</em></strong>
+   </div>
+
+   <div class="slide">
+      <h1>ResultSets::</h1>
+<pre>package LPW::DBIC::ResultSet::Books;
+use base 'DBIx::Class::ResultSet';
+sub the_ultimate_books {
+   my $self = shift;
+   return $self-&gt;search({ title =&gt; { -like =&gt; '%42%' } });
+}
+sub by_author {
+   my ( $self, $author ) = @_;
+   return $self-&gt;search({ author =&gt; $author-&gt;id })
+}
+
+1;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>ResultSets::</h1>
+<pre>package LPW::DBIC::<strong>ResultSet::Books</strong>;
+use base '<strong>DBIx::Class::ResultSet</strong>';
+sub the_ultimate_books {
+   my $self = shift;
+   <strong>return $self-&gt;search({ title =&gt; { -like =&gt; '%42%' } })</strong>
+}
+sub by_author {
+   my ( $self, $author ) = @_;
+   return $self-&gt;search({ author =&gt; $author-&gt;id })
+}
+
+1;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>ResultSets::</h1>
+<pre>package LPW::DBIC::ResultSet::Books;
+use base 'DBIx::Class::ResultSet';
+sub the_ultimate_books {
+   my $self = shift;
+   return $self-&gt;search({ title =&gt; { -like =&gt; '%42%' } });
+}
+sub by_author {
+   my ( $self, $author ) = @_;
+   <strong>return $self-&gt;search({ author =&gt; $author-&gt;id })</strong>
+}
+
+1;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>ResultSets::</h1>
+<pre>use LPW::DBIC;
+my $book_model = LPW::DBIC-&gt;resultset('Books');
+my $book_rs    = $book_model-&gt;the_ultimate_books;
+my @books      = $book_rs-&gt;all;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>ResultSets::chaining</h1>
+<pre>use LPW::DBIC;
+my $book_model   = LPW::DBIC-&gt;resultset('Books');
+my $author_model = LPW::DBIC-&gt;resultset('Authors');
+my $author       = $author_model-&gt;search({ name =&gt; 'Douglas Adams' })-&gt;single;
+my $book_rs      = $book_model-&gt;the_ultimate_books-&gt;by_author($author);
+my @books        = $book_rs-&gt;all;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>ResultSets::chaining</h1>
+<pre>my $book_rs = $book_model
+  -&gt;the_ultimate_books
+  -&gt;by_author($author);</pre>
+or
+
+<pre>my $book_rs = $book_model
+  -&gt;the_ultimate_books();
+$book_rs = $book_rs-&gt;by_author($author);</pre>
+<pre># Debug (SQL):
+
+# SELECT me.id, me.title, me.date_published, me.author
+#   FROM books me
+#   WHERE ( ( ( author = ? ) AND ( title LIKE ? ) ) ): '5', '%42%'
+#   WHERE ( ( ( author = ? ) AND ( title LIKE ? ) ) ): '5', '%42%'</pre>
+   </div>
+
+   <div class="slide">
+      <h1>ResultSets::chaining</h1>
+<pre>my $rs = $book_model
+  -&gt;category('childrens')
+  -&gt;by_author($author)
+  -&gt;published_after('1812')
+  -&gt;first_page_contains('once upon')
+  -&gt;rating_greater_than(4);
+
+my @books = $rs-&gt;all;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>overloading before new record</h1>
+   </div>
+
+   <div class="slide">
+      <h1>overloading before new record</h1>
+      <pre>package LPW::DBIC::Result::Authors;
+use base 'DBIx::Class';
+
+sub new {
+   my ( $class, $attrs ) = @_;
+   # Mess with $attrs
+   my $new = $class-&gt;next::method($attrs);
+   return $new
+}
+
+1;</pre>
+
+   <div class="slide">
+      <h1>relationships</h1>
+   </div>
+
+   <div class="slide">
+      <h1>multiple authors</h1>
+   </div>
+
+   <div class="slide">
+      <h1>a few relationships</h1>
+      (authors -- author_link_to_book -- books)
+   </div>
+
+   <div class="slide">
+      <h1>a few relationships</h1>
+      !
+   </div>
+
+   <div class="slide">
+      <h1>new join table</h1>
+<pre>CREATE TABLE author_and_books(
+  id      int(8)    primary key auto_increment,
+  book    int(8),
+  author  int(8),
+  foreign key (book)     references books(id),
+  foreign key (author)   references authors(id)
+) engine = InnoDB DEFAULT CHARSET=utf8;
+
+ALTER TABLE `books` DROP `author`</pre>
+   </div>
+
+   <div class="slide">
+      <h1>new join table</h1>
+<pre>CREATE TABLE author_and_books(
+  id      int(8)    primary key auto_increment,
+  book    int(8),
+  author  int(8),
+  <strong>foreign key (book)     references books(id),
+  foreign key (author)   references authors(id)</strong>
+) engine = InnoDB DEFAULT CHARSET=utf8;
+
+ALTER TABLE `books` DROP `author`</pre>
+   </div>
+
+   <div class="slide">
+      <h1>has_many</h1>
+   </div>
+
+   <div class="slide">
+      <h1>has_many</h1>
+<pre>package LPW::DBIC::<strong>Result::Books</strong>;
+
+__PACKAGE__-&gt;has_many( author_and_books =&gt; "LPW::DBIC::Result::AuthorAndBooks",
+    { "foreign.book" =&gt; "self.id" },
+);
+
+<strong># This is auto generated by Schema::Loader</strong></pre>
+   </div>
+
+   <div class="slide">
+      <h1>has_many</h1>
+<pre>package LPW::DBIC::<strong>Result::Books</strong>;
+
+__PACKAGE__-&gt;has_many(
+author_and_books =&gt; <strong># name of accessor</strong>
+"LPW::DBIC::Result::AuthorAndBooks", <strong># related class</strong>
+    { "foreign.book" =&gt; "self.id" } <strong># Relationship (magic often works if not
+                                        # specified, but avoid!)</strong>
+);
+</pre>
+   </div>
+
+   <div class="slide">
+      <h1>belongs_to</h1>
+   </div>
+
+   <div class="slide">
+      <h1>belongs_to</h1>
+<pre>package LPW::DBIC::<strong>Result::AuthorAndBooks</strong>;
+
+__PACKAGE__-&gt;belongs_to(
+   book =&gt; <strong># Accessor name</strong>
+   "LPW::DBIC::Result::Books", <strong># Related class</strong>
+   { id =&gt; "book" } <strong># relationship</strong>
+);
+</pre>
+   </div>
+
+   <div class="slide">
+      <h1>same for Authors</h1>
+   </div>
+
+   <div class="slide">
+      <h1>with no coding...</h1>
+   </div>
+
+   <div class="slide">
+      <h1>many_to_many</h1>
+   </div>
+
+   <div class="slide">
+      <h1>many_to_many</h1>
+      <pre>package LPW::DBIC::<strong>Result::Books</strong>;
+use base 'DBIx::Class';
+
+__PACKAGE__-&gt;many_to_many(
+   authors =&gt; "author_and_books", 'author'
+);
+
+1;
+
+<strong> # This is <em>NOT</em> auto generated by Schema::Loader </strong></pre>
+   </div>
+
+   <div class="slide">
+      <h1>many_to_many</h1>
+      <pre>package LPW::DBIC::<strong>Result::Books</strong>;
+use base 'DBIx::Class';
+
+__PACKAGE__-&gt;many_to_many(
+   authors <strong># Accessor name</strong>
+   =&gt; "author_and_books", <strong># has_many</strong>
+   'author' <strong># foreign relationship name</strong>
+);
+
+1;</pre>
+   </div>
+
+   <div class="slide">
+      <h1>many_to_many</h1>
+      <pre>package LPW::DBIC::Result::Authors;
+use base 'DBIx::Class';
+
+__PACKAGE__-&gt;many_to_many(
+   "books" <strong># Accessor Name</strong>
+   =&gt; "author_and_books", <strong># has_many accessor_name</strong>
+   'book' <strong># foreign relationship name</strong>
+);
+
+1;
+
+<strong># This is <em>NOT</em> auto generated by Schema::Loader</strong></pre>
+   </div>
+
+   <div class="slide">
+      <h1>using many_to_many</h1>
+      <pre>#!/usr/bin/perl
+
+use LPW::DBIC;
+
+my $author_model = LPW::DBIC-&gt;resultset('Authors');
+my $author       = $author_model-&gt;search({
+   name =&gt; 'Douglas Adams',
+})-&gt;single;
+$author-&gt;add_to_books({
+   title =&gt; 'A new book',
+});</pre>
+   </div>
+
+   <div class="slide">
+      <h1>using many_to_many</h1>
+      <pre>my $author = $author_model-&gt;search({
+   name =&gt; 'Douglas Adams',
+})-&gt;single;
+<strong>$author-&gt;add_to_books({
+   title =&gt; 'A new book',
+});</strong>
+
+# SELECT me.id, me.name FROM authors me
+#     WHERE ( name = ? ): 'Douglas Adams';
+# INSERT INTO books (title) VALUES (?): 'A new book';
+# INSERT INTO author_and_books (author, book)
+#     VALUES (?, ?): '5', '2';</pre>
+   </div>
+
+   <div class="slide">
+      <h1>using many_to_many</h1>
+      <pre>$author-&gt;add_to_books($book);
+
+$book-&gt;add_to_authors($author_1);
+$book-&gt;add_to_authors($author_2);</pre>
+   </div>
+
+   <div class="slide">
+      <h1>in 16 lines of code</h1>
+   </div>
+
+   <div class="slide">
+      <h1>errors</h1>
+      <p>Read them closely!</p>
+   </div>
+
+   <div class="slide">
+      <h1>error messages</h1>
+      <pre>DBIx::Class::Schema::Loader::connection(): Failed to load external class definition for 'LPW::DBIC::Result::Authors': Can't locate object method "many_to_many" via package "LPW::DBIC::Result::Author" at lib/LPW/DBIC/Result/Authors.pm line 9.Compilation failed in require at /Library/Perl/5.8.8/DBIx/Class/Schema/Loader/Base.pm line 292.</pre>
+   </div>
+
+   <div class="slide">
+      <h1>error messages</h1>
+   <pre>DBIx::Class::Schema::Loader::connection(): Failed to load external class definition for 'LPW::DBIC::Result::Authors': Can't locate object method "many_to_many" via package "LPW::DBIC::<strong>Result::Author</strong>" at lib/LPW/DBIC/<strong>Result/Authors.pm</strong> line 9.Compilation failed in require at /Library/Perl/5.8.8/DBIx/Class/Schema/Loader/Base.pm line 292.</pre>
+   </div>
+
+   <div class="slide">
+      <h1>errors</h1>
+      <ul>
+         <li>Turn on debugging</li>
+         <li>Read error messages (sometimes useful!)</li>
+         <li>Check field names</li>
+         <li>Check package names</li>
+         <li>Check which database you are connected to (dev/test/live?) - repeat above</li>
+      </ul>
+   </div>
+
+   <div class="slide">
+      <h1>bonus slides!</h1>
+   </div>
+
+   <div class="slide">
+      <h1>Template Toolkit</h1>
+      <ul>
+         <li><pre>[% author.books.count %]</pre> not working?</li>
+         <li>TT all methods are called in list context</li>
+         <li><pre>[% author.books<strong>_rs</strong>.count %]</pre> scalar context</li>
+         <li><em>Available for all relationships</em></li>
+      </ul>
+   </div>
+
+   <div class="slide">
+      <h1>Catalyst</h1>
+      <pre>package Your::App::Model::<strong>LPW</strong>;
+use base qw(<strong>Catalyst::Model::DBIC::Schema</strong>);
+
+use strict;
+use warnings;
+
+__PACKAGE__-&gt;config(
+  schema_class =&gt; '<strong>LPW::DBIC</strong>',
+);
+
+1;</pre>
+   <p>Keep your Schema in a <em>separate</em> package to your Catalyst application</p>
+   </div>
+
+   <div class="slide">
+      <h1>Catalyst</h1>
+<pre>sub action_name : Local {
+  my ($self, $c) = @_;
+
+  my $model = $c-&gt;model('DBIC::LPW');
+  my $author_model = $model-&gt;resultset('Authors');
+
+}
+
+1;</pre>
+   </div>
+
+</div>
+</body>
+</html>
diff --git a/ui/graphic_support/blank.gif b/ui/graphic_support/blank.gif
new file mode 100644 (file)
index 0000000..75b945d
Binary files /dev/null and b/ui/graphic_support/blank.gif differ
diff --git a/ui/graphic_support/finish.gif b/ui/graphic_support/finish.gif
new file mode 100644 (file)
index 0000000..55e1ff9
Binary files /dev/null and b/ui/graphic_support/finish.gif differ
diff --git a/ui/graphic_support/fixed.js b/ui/graphic_support/fixed.js
new file mode 100644 (file)
index 0000000..118ae70
--- /dev/null
@@ -0,0 +1 @@
+// fixed.js: fix fixed positioning and fixed backgrounds in IE/Win\r// version 1.8, 08-Aug-2003\r// written by Andrew Clover <and@doxdesk.com>, use freely\r\r/*@cc_on\r@if (@_win32 && @_jscript_version>4)\r\rvar fixed_positions= new Array();\rvar fixed_backgrounds= new Array();\rvar fixed_viewport;\r\r// Initialisation. Called when the <body> tag arrives. Set up viewport so the\r// rest of the script knows we're going, and add a measurer div, used to detect\r// font size changes and measure image sizes for backgrounds later   \r\rfunction fixed_init() {\r  fixed_viewport= (document.compatMode=='CSS1Compat') ?\r    document.documentElement : document.body;\r  var el= document.createElement('div');\r  el.setAttribute('id', 'fixed-measure');\r  el.style.position= 'absolute';\r  el.style.top= '0'; el.style.left= '0';\r  el.style.overflow= 'hidden'; el.style.visibility= 'hidden';\r  el.style.fontSize= 'xx-large'; el.style.height= '5em';\r  el.style.setExpression('width', 'fixed_measureFont()');\r  document.body.insertBefore(el, document.body.firstChild);\r}\r\r// Binding. Called every time an element is added to the document, check it\r// for fixed features, if found add to our lists and set initial props   \r\rfunction fixed_bind(el) {\r  var needLayout= false;\r  var tag= el.tagName.toLowerCase();\r  var st= el.style;\r  var cst= el.currentStyle;\r  var anc;\r\r  // find fixed-position elements\r  if (cst.position=='fixed') {\r    needLayout= true;\r    fixed_positions[fixed_positions.length]= el;\r    // store original positioning as we'll overwrite it\r    st.position= 'absolute';\r    st.fixedPLeft=   cst.left;\r    st.fixedPTop=    cst.top;\r    st.fixedPRight=  cst.right;\r    st.fixedPBottom= cst.bottom;\r    st.fixedPWidth=  fixed_parseLength(cst.width);\r    st.fixedPHeight= fixed_parseLength(cst.height);\r    // find element that will act as containing box, for convenience later\r    st.fixedCB= null;\r    for (anc= el; (anc= anc.parentElement).parentElement;) {\r      if (anc.currentStyle.position!='static') {\r        st.fixedCB= anc;\r        break;\r    } }\r    // detect nested fixed positioning (only ancestor need move)\r    st.fixedNest= false;\r    for (anc= el; anc= anc.parentElement;) {\r      if (anc.style.fixedNest!=null)\r        st.fixedNest= true;\r        break;\r    }\r  }\r\r  // find fixed-background elements (not body/html which IE already gets right)\r  if (cst.backgroundAttachment=='fixed' && tag!='body' && tag!='html') {\r    needLayout= true;\r    fixed_backgrounds[fixed_backgrounds.length]= el;\r    // get background offset, converting from keyword if necessary\r    st.fixedBLeft= fixed_parseLength(cst.backgroundPositionX);\r    st.fixedBTop=  fixed_parseLength(cst.backgroundPositionY);\r    // if it's a non-zero %age, need to know size of image for layout\r    if (st.fixedBLeft[1]=='%' || st.fixedBTop[1]=='%') {\r      st.fixedBWidth= 0; st.fixedBHeight= 0;\r      fixed_measureBack(el);\r    }\r  }\r  if (needLayout) fixed_layout();\r}\r\r// Layout. On every window or font size change, recalculate positioning   \r\r// Request re-layout at next free moment\rvar fixed_delaying= false;\rfunction fixed_delayout() {\r  if (fixed_delaying) return;\r  fixed_delaying= true;\r  window.setTimeout(fixed_layout, 0);\r}\r\rvar fixed_ARBITRARY= 200;\r\rfunction fixed_layout() {\r  fixed_delaying= false;\r  if (!fixed_viewport) return;\r  var i, el, st, j, pr, tmp, A= 'auto';\r  var cb, cbLeft, cbTop, cbRight, cbBottom, oLeft, oTop, oRight, oBottom;\r  var vpWidth=fixed_viewport.clientWidth, vpHeight=fixed_viewport.clientHeight;\r\r  // calculate initial position for fixed-position elements [black magic]\r  for (i= fixed_positions.length; i-->0;) {\r    el= fixed_positions[i]; st= el.style;\r    // find positioning of containing block\r    cb= st.fixedCB; if (!cb) cb= fixed_viewport;\r    cbLeft= fixed_pageLeft(cb); cbTop= fixed_pageTop(cb);\r    if (cb!=fixed_viewport) { cbLeft+= cb.clientLeft; cbTop+= cb.clientTop; }\r    cbRight= fixed_viewport.clientWidth-cbLeft-cb.clientWidth;\r    cbBottom= fixed_viewport.clientHeight-cbTop-cb.clientHeight;\r    // if size is in %, must recalculate relative to viewport\r    if (st.fixedPWidth[1]=='%')\r      st.width= Math.round(vpWidth*st.fixedPWidth[0]/100)+'px';\r    if (st.fixedPHeight[1]=='%')\r      st.height= Math.round(vpHeight*st.fixedPHeight[0]/100)+'px';\r    // find out offset values at max size, to account for margins\r    st.left= A; st.right= '0'; st.top= A; st.bottom= '0';\r    oRight= el.offsetLeft+el.offsetWidth; oBottom= el.offsetTop+el.offsetHeight;\r    st.left= '0'; st.right= A; st.top= '0'; st.bottom= A;\r    oLeft= el.offsetLeft; oTop= el.offsetTop;\r    // use this to convert all edges to pixels\r    st.left= A; st.right= st.fixedPRight;\r    st.top= A; st.bottom= st.fixedPBottom;\r    oRight-= el.offsetLeft+el.offsetWidth;\r    oBottom-= el.offsetTop+el.offsetHeight;\r    st.left= st.fixedPLeft; st.top= st.fixedPTop;\r    oLeft= el.offsetLeft-oLeft; oTop= el.offsetTop-oTop;\r    // edge positioning fix\r    if (st.fixedPWidth[1]==A && st.fixedPLeft!=A && st.fixedPRight!=A) {\r      tmp= el.offsetLeft; st.left= A; st.width= fixed_ARBITRARY+'px';\r      tmp= fixed_ARBITRARY+el.offsetLeft-tmp+cbLeft+cbRight;\r      st.left= st.fixedPLeft; st.width= ((tmp<1)?1:tmp)+'px';\r    }\r    if (st.fixedPHeight[1]==A && st.fixedPTop!=A && st.fixedPBottom!=A) {\r      tmp= el.offsetTop; st.top= A; st.height= fixed_ARBITRARY+'px';\r      tmp= fixed_ARBITRARY+el.offsetTop-tmp+cbTop+cbBottom;\r      st.top= st.fixedPTop; st.height= ((tmp<1)?1:tmp)+'px';\r    }\r    // move all non-auto edges relative to the viewport\r    st.fixedCLeft= (st.fixedPLeft=='auto') ? oLeft : oLeft-cbLeft;\r    st.fixedCTop= (st.fixedPTop=='auto') ? oTop : oTop-cbTop;\r    st.fixedCRight= (st.fixedPRight=='auto') ? oRight : oRight-cbRight;\r    st.fixedCBottom= (st.fixedPBottom=='auto') ? oBottom : oBottom-cbBottom;\r    // remove left-positioning of right-positioned elements\r    if (st.fixedPLeft=='auto' && st.fixedPRight!='auto') st.fixedCLeft= 'auto';\r    if (st.fixedPTop=='auto' && st.fixedPBottom!='auto') st.fixedCTop= 'auto';\r  }\r\r\r  // calculate initial positioning of fixed backgrounds\r  for (i= fixed_backgrounds.length; i-->0;) {\r    el= fixed_backgrounds[i]; st= el.style;\r    tmp= st.fixedBImage;\r    if (tmp) {\r      if (tmp.readyState!='uninitialized') {\r        st.fixedBWidth= tmp.offsetWidth;\r        st.fixedBHeight= tmp.offsetHeight;\r        st.fixedBImage= window.undefined;\r      }\r    }\r    st.fixedBX= fixed_length(el, st.fixedBLeft, vpWidth-st.fixedBWidth);\r    st.fixedBY= fixed_length(el, st.fixedBTop, vpHeight-st.fixedBHeight);\r  }\r\r  // now call scroll() to set the positions from the values just calculated\r  fixed_scroll();\r}\r\r// Scrolling. Offset fixed elements relative to viewport scrollness\r\rvar fixed_lastX, fixed_lastY;\rvar fixed_PATCHDELAY= 300;\rvar fixed_patching= false;\r\r// callback function after a scroll, because incorrect scroll position is\r// often reported first go!\rfunction fixed_patch() {\r  fixed_patching= false;\r  var scrollX= fixed_viewport.scrollLeft, scrollY= fixed_viewport.scrollTop;\r  if (scrollX!=fixed_lastX && scrollY!=fixed_lastY) fixed_scroll();\r}\r\rfunction fixed_scroll() {\r  if (!fixed_viewport) return;\r  var i, el, st, viewportX, viewportY;\r  var scrollX= fixed_viewport.scrollLeft, scrollY= fixed_viewport.scrollTop;\r  fixed_lastX= scrollX; fixed_lastY= scrollY;\r\r  // move non-nested fixed-position elements\r  for (i= fixed_positions.length; i-->0;) {\r    st= fixed_positions[i].style;\r    viewportX= (st.fixedNest) ? 0 : scrollX;\r    viewportY= (st.fixedNest) ? 0 : scrollY;\r    if (st.fixedCLeft!='auto') st.left= (st.fixedCLeft+viewportX)+'px';\r    if (st.fixedCTop!='auto') st.top= (st.fixedCTop+viewportY)+'px';\r    viewportX= (st.fixedCB==null || st.fixedCB==fixed_viewport) ? 0 : viewportX;\r    viewportY= (st.fixedCB==null || st.fixedCB==fixed_viewport) ? 0 : viewportY;\r    st.right= (st.fixedCRight-viewportX+1)+'px'; st.right= (st.fixedCRight-viewportX)+'px';\r    st.bottom= (st.fixedCBottom-viewportY+1)+'px'; st.bottom= (st.fixedCBottom-viewportY)+'px';\r  }\r\r  // align fixed backgrounds to viewport\r  for (i= fixed_backgrounds.length; i-->0;) {\r    el= fixed_backgrounds[i]; st= el.style;\r    viewportX= scrollX;\r    viewportY= scrollY;\r    while (el.offsetParent) {\r      viewportX-= el.offsetLeft+el.clientLeft;\r      viewportY-= el.offsetTop +el.clientTop;\r      el= el.offsetParent;\r    }\r    st.backgroundPositionX= (st.fixedBX+viewportX)+'px';\r    st.backgroundPositionY= (st.fixedBY+viewportY)+'px';\r  }\r\r  // call back again in a tic\r  if (!fixed_patching) {\r    fixed_patching= true;\r    window.setTimeout(fixed_patch, fixed_PATCHDELAY);\r  }\r}\r\r// Measurement. Load bg-image into an invisible element on the page, when\r// loaded write the width/height to an element's style for layout use; detect\r// when font size changes\r\rfunction fixed_measureBack(el) {\r  var measure= document.getElementById('fixed-measure');\r  var img= document.createElement('img');\r  img.setAttribute('src', fixed_parseURL(el.currentStyle.backgroundImage));\r  measure.appendChild(img);\r  el.style.fixedBImage= img;\r  if (img.readyState=='uninitialized')\r    img.attachEvent('onreadystatechange', fixed_measureBackImage_ready);\r}\r\rfunction fixed_measureBackImage_ready() {\r  var img= event.srcElement;\r  if (img && img.readyState!='uninitialized') {\r    img.detachEvent('onreadystatechange', fixed_measureBackImage_ready);\r    fixed_layout();\r  }\r}\r\rvar fixed_fontsize= 0;\rfunction fixed_measureFont() {\r  var fs= document.getElementById('fixed-measure').offsetHeight;\r  if (fixed_fontsize!=fs && fixed_fontsize!=0)\r    fixed_delayout();\r  fixed_fontsize= fs;\r  return '5em';\r}\r\r// Utility. General-purpose functions\r\r// parse url() to get value inside\r\rfunction fixed_parseURL(v) {\r  v= v.substring(4, v.length-1);\r  if (v.charAt(0)=='"' && v.charAt(v.length-1)=='"' ||\r      v.charAt(0)=="'" && v.charAt(v.length-1)=="'")\r    return v.substring(1, v.length-1);\r  else return v;\r}\r\r// parse length or auto or background-position keyword into number and unit\r\rvar fixed_numberChars= '+-0123456789.';\rvar fixed_ZERO= new Array(0, 'px');\rvar fixed_50PC= new Array(50, '%');\rvar fixed_100PC= new Array(100, '%');\rvar fixed_AUTO= new Array(0, 'auto');\r\rfunction fixed_parseLength(v) {\r  var num, i;\r  if (v=='left'  || v=='top')    return fixed_ZERO;\r  if (v=='right' || v=='bottom') return fixed_100PC;\r  if (v=='center') return fixed_50PC;\r  if (v=='auto')   return fixed_AUTO;\r  i= 0;\r  while (i<v.length && fixed_numberChars.indexOf(v.charAt(i))!=-1)\r    i++;\r  num= parseFloat(v.substring(0, i));\r  if (num==0) return fixed_ZERO;\r  else return new Array(num, v.substring(i));\r}\r\r// convert parsed (number, unit) into a number of pixels\r\rfunction fixed_length(el, l, full) {\r  var tmp, x;\r  if (l[1]=='px') return l[0];\r  if (l[1]=='%')  return Math.round(full*l[0]/100);\r  // other units - measure by setting position; this is rather inefficient\r  // but then these units are used for background-position so seldom...\r  tmp= el.currentStyle.left;\r  el.style.left= '0';\r  x= el.offsetLeft;\r  el.style.left= l[0]+l[1];\r  x= el.offsetLeft-x;\r  el.style.left= tmp;\r  return x;\r}\r\r// convert stupid IE offsetLeft/Top to page-relative values\r\rfunction fixed_pageLeft(el) {\r  var v= 0;\r  while (el.offsetParent) {\r    v+= el.offsetLeft;\r    el= el.offsetParent;\r  }\r  return v;\r}\rfunction fixed_pageTop(el) {\r  var v= 0;\r  while (el.offsetParent) {\r    v+= el.offsetTop;\r    el= el.offsetParent;\r  }\r  return v;\r}\r\r// Scanning. Check document every so often until it has finished loading. Do\r// nothing until <body> arrives, then call main init. Pass any new elements\r// found on each scan to be bound   \r\rvar fixed_SCANDELAY= 500;\r\rfunction fixed_scan() {\r  if (!document.body) return;\r  if (!fixed_viewport) fixed_init();\r  var el;\r  for (var i= 0; i<document.all.length; i++) {\r    el= document.all[i];\r    if (!el.fixed_bound) {\r      el.fixed_bound= true;\r      fixed_bind(el);\r  } }\r}\r\rvar fixed_scanner;\rfunction fixed_stop() {\r  window.clearInterval(fixed_scanner);\r  fixed_scan();\r}\r\rfixed_scan();\rfixed_scanner= window.setInterval(fixed_scan, fixed_SCANDELAY);\rwindow.attachEvent('onload', fixed_stop);\rwindow.attachEvent('onresize', fixed_delayout);\rwindow.attachEvent('onscroll', fixed_scroll);\r\r@end @*/\r
\ No newline at end of file
diff --git a/ui/graphic_support/help.jpg b/ui/graphic_support/help.jpg
new file mode 100644 (file)
index 0000000..9be4d33
Binary files /dev/null and b/ui/graphic_support/help.jpg differ
diff --git a/ui/graphic_support/iepngfix.htc b/ui/graphic_support/iepngfix.htc
new file mode 100644 (file)
index 0000000..12a8b89
--- /dev/null
@@ -0,0 +1,42 @@
+<public:component>\r
+<public:attach event="onpropertychange" onevent="doFix()" />\r
+\r
+<script>\r
+\r
+// IE5.5+ PNG Alpha Fix v1.0 by Angus Turnbull http://www.twinhelix.com\r
+// Free usage permitted as long as this notice remains intact.\r
+\r
+// This must be a path to a blank image. That's all the configuration you need here.\r
+var blankImg = 'ui/graphic_support/blank.gif';\r
+\r
+var f = 'DXImageTransform.Microsoft.AlphaImageLoader';\r
+\r
+function filt(s, m) {\r
+ if (filters[f]) {\r
+  filters[f].enabled = s ? true : false;\r
+  if (s) with (filters[f]) { src = s; sizingMethod = m }\r
+ } else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")';\r
+}\r
+\r
+function doFix() {\r
+ if ((parseFloat(navigator.userAgent.match(/MSIE (\S+)/)[1]) < 5.5) ||\r
+  (event && !/(background|src)/.test(event.propertyName))) return;\r
+\r
+ if (tagName == 'IMG') {\r
+  if ((/\.png$/i).test(src)) {\r
+   filt(src, 'image');  // was 'scale'\r
+   src = blankImg;\r
+  } else if (src.indexOf(blankImg) < 0) filt();\r
+ } else if (style.backgroundImage) {\r
+  if (style.backgroundImage.match(/^url[("']+(.*\.png)[)"']+$/i)) {\r
+   var s = RegExp.$1;\r
+   style.backgroundImage = '';\r
+   filt(s, 'crop');\r
+  } else filt();\r
+ }\r
+}\r
+\r
+doFix();\r
+\r
+</script>\r
+</public:component>
\ No newline at end of file
diff --git a/ui/graphic_support/numeric.png b/ui/graphic_support/numeric.png
new file mode 100644 (file)
index 0000000..8f911e7
Binary files /dev/null and b/ui/graphic_support/numeric.png differ
diff --git a/ui/graphic_support/progress.gif b/ui/graphic_support/progress.gif
new file mode 100644 (file)
index 0000000..1323684
Binary files /dev/null and b/ui/graphic_support/progress.gif differ
diff --git a/ui/s5-notes.html b/ui/s5-notes.html
new file mode 100644 (file)
index 0000000..d4da758
--- /dev/null
@@ -0,0 +1,157 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!--  Do not edit this document! The system will likely break if you do. -->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Notes</title>
+<style type="text/css" media="all">
+body {
+   margin: 0;
+   padding: 1.0em;
+   background: #333;
+   color: #FFF;
+   font: 2em/1.4em 'Lucida Grande', Verdana, sans-serif;
+}
+div.timers {
+   background: #FFF;
+   color: #333;
+   border: 0.08em solid #222;
+   border-top-width: 1px;
+   border-left-width: 1px;
+   float: left;
+   padding: 0.2em;
+   margin: 0 0 0.5em;
+   position: relative;
+}
+div.timers h1 {
+   text-align: left;
+   font-size: 0.6em;
+   line-height: 1.4em;
+   background-color: #FF9;
+   padding: 0 0.75em;
+   margin: 0.25em 0 0;
+   border: 1px solid #EE8;
+}
+div.timers div.controls {
+   position: absolute;
+   right: 0.25em;
+   top: 0.1em;
+   line-height: 1em;
+}
+div.timers h1 a {
+   text-decoration: none;
+   color: #000;
+}
+div.timers div.controls a {
+   font-size: 0.5em;
+   padding: 0;
+   color: #330;
+}
+div.timers a.control {
+   position: absolute;
+   text-decoration: none;
+   padding: 0 0.25em;
+   color: #AAA;
+   outline: 0;
+}
+a.headctrl {
+   outline: none;
+   text-decoration: none;
+   font-weight: bold;
+}
+#minus {left: 0.25em;}
+#plus {right: 0.25em;}
+.overtime {
+   background: yellow;
+   color: red;
+   border: 3px solid;
+   padding: 0.1em 0.25em;
+   font-weight: bold;
+}
+div.timers h2 {
+   font-size: 0.6em;
+   line-height: 1.0em;
+   font-weight: normal;
+   margin: 0 0 -0.25em;
+   padding-top: 0.5em;
+   color: #666;
+}
+div.timers p {margin: 0; padding: 0 0.5em;}
+div.timers form {margin: 0;}
+div.timers span.clock {font-family: monospace;}
+div.timers ul {margin: 0; padding: 0; list-style: none;}
+div.timers li {float: left; width: 5em; margin: 0; padding: 0 0.5em; text-align: center;}
+div#elapsed {width: 12.1em;}
+div#remaining {clear: left; width: 12.1em;}
+div#remaining p {text-align: center;}
+#slide, #next, #notes, #nextnotes {
+   font-size: 0.75em;
+   line-height: 1.4em;
+   clear: left;
+/* max-width: 30.0em; */
+   text-shadow: 0.1em 0.1em 0.1em #111;
+}
+#next {margin-top: 2.5em;}
+#next, #nextnotes {color: #999; font-size: 0.66em;}
+em.disclaimer {color: #666;}
+div.collapsed h1 {display: block; font-size: 0.33em;}
+div.collapsed h1 a {display: inline;}
+div.collapsed * {display: none;}
+</style>
+<script type="text/javascript">
+// <![CDATA[
+   document.onkeyup = opener.keys;
+   document.onkeypress = opener.trap;
+   document.onclick = opener.clicker;
+// ]]>
+</script>
+</head>
+
+<body onload="opener.s5NotesWindowLoaded=true;" onunload="opener.s5NotesWindowLoaded=false;">
+
+
+<div class="timers" id="elapsed">
+<h1>
+<a href="#" onclick="opener.minimizeTimer('elapsed'); return false;">Elapsed Time</a>
+</h1>
+<ul>
+<li>
+<h2>Presentation</h2>
+<span class="clock" id="elapsed-presentation">00:00:00</span>
+</li>
+<li>
+<h2>Current Slide</h2>
+<span class="clock" id="elapsed-slide">00:00:00</span>
+</li>
+</ul>
+<div class="controls">
+<a href="#reset-elapsed" class="headctrl" onclick="opener.resetElapsedTime(); return false;" title="Reset Elapsed Time">|&lt;</a>
+</div>
+</div>
+
+<div class="timers" id="remaining">
+<h1>
+<a href="#" onclick="opener.minimizeTimer('remaining'); return false;">Remaining Time</a>
+</h1>
+<p>
+<a href="#subtract-remaining" class="control" id="minus" onclick="opener.alterRemainingTime('-5'); return false;" title="Subtract 5 Minutes">-</a>
+<span class="clock" id="timeLeft">00:00:00</span>
+<a href="#add-remaining" class="control" id="plus" onclick="opener.alterRemainingTime('5'); return false;" title="Add 5 Minutes">+</a>
+</p>
+<div class="controls">
+<form action="#" onsubmit="opener.resetRemainingTime(); return false;">
+<input type="text" class="text" id="startFrom" value="0" size="4" maxlength="4" />
+<a href="#toggle-remaining" class="headctrl" onclick="opener.toggleRemainingTime(); return false;" title="Pause/Run Remaining Time">||</a>
+<a href="#reset-remaining" class="headctrl" onclick="opener.resetRemainingTime(); return false;" title="Reset Remaining Time">|&lt;</a>
+</form>
+</div>
+</div>
+
+<h2 id="slide">...</h2>
+<div id="notes"></div>
+
+<h2 id="next">...</h2>
+<div id="nextnotes"></div>
+
+</body>
+</html>
diff --git a/ui/scala_utf/framing.css b/ui/scala_utf/framing.css
new file mode 100644 (file)
index 0000000..bfd20bb
--- /dev/null
@@ -0,0 +1,22 @@
+/* The following styles size, place, and layer the slide components.
+   Edit these if you want to change the overall slide layout.
+   The commented lines can be uncommented (and modified, if necessary) 
+   to help you with the rearrangement process. */
+
+/* target = 1024x768 */
+
+div#header, div#footer, .slide {width: 100%; top: 0; left: 0;}
+div#header {top: 0; height: 3em; z-index: 1;}
+div#footer {top: auto; bottom: 0; height: 0.5em; z-index: 5;}
+.slide {top: 0; width: 92%; padding: 3.5em 4% 4%; z-index: 2;  list-style: none;}
+div#controls {left: 50%; bottom: 0; width: 50%; z-index: 100;}
+div#controls form {text-align: right; width: 100%; margin: 0;}
+#currentSlide {position: absolute; width: 12%; left: 44%; bottom: 1em; z-index: 10;}
+html>body #currentSlide {position: fixed;}
+
+/*
+div#header {background: #FCC;}
+div#footer {background: #CCF;}
+div#controls {background: #BBD;}
+div#currentSlide {background: #FFC;}
+*/
diff --git a/ui/scala_utf/opera.css b/ui/scala_utf/opera.css
new file mode 100644 (file)
index 0000000..9e9d2a3
--- /dev/null
@@ -0,0 +1,7 @@
+/* DO NOT CHANGE THESE unless you really want to break Opera Show */
+.slide {
+       visibility: visible !important;
+       position: static !important;
+       page-break-before: always;
+}
+#slide0 {page-break-before: avoid;}
diff --git a/ui/scala_utf/outline.css b/ui/scala_utf/outline.css
new file mode 100644 (file)
index 0000000..962acab
--- /dev/null
@@ -0,0 +1,13 @@
+/* don't change this unless you want the layout stuff to show up in the outline view! */
+
+.hide, .layout div, #footer *, #controlForm * {display: none;}
+#footer, #controls, #controlForm, #navLinks, #sheet {display: block; visibility: visible; margin: 0; padding: 0;}
+#sheet {float: right; padding: 0.5em;}
+html>body #sheet {position: fixed; top: 0; right: 0;}
+
+/* making the outline look pretty-ish */
+
+#slide0 h1, #slide0 h2, #slide0 h3, #slide0 h4 {border: none; margin: 0;}
+#slide0 h1 {padding-top: 1.5em;}
+.slide h1 {margin: 1.5em 0 0; padding-top: 0.25em; border-top: 1px solid #888; border-bottom: 1px solid #AAA;}
+#sheet {border: 1px solid; border-width: 0 0 1px 1px; background: #FFF;}
diff --git a/ui/scala_utf/pattern.png b/ui/scala_utf/pattern.png
new file mode 100644 (file)
index 0000000..6258f02
Binary files /dev/null and b/ui/scala_utf/pattern.png differ
diff --git a/ui/scala_utf/pretty.css b/ui/scala_utf/pretty.css
new file mode 100644 (file)
index 0000000..dbc70cc
--- /dev/null
@@ -0,0 +1,96 @@
+/* Following are the presentation styles -- edit away! */
+
+body {background: #000; color: #fff; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 2.25em;}
+a:link, a:visited {text-decoration: none; color: #F93;}
+/* a:focus, a:hover {color: #f33 !important;} */
+
+h1, h2, h3, h4 {font-size: 100%; margin: 0; padding: 0; font-weight: inherit;}
+h1 {background-color: transparent;}
+
+ul, pre {margin: 0; line-height: 1em;}
+html, body {margin: 0; padding: 0;}
+
+blockquote, q {font-style: italic;}
+blockquote {padding: 0 2em 0.5em; margin: 0 1.5em 0.5em; text-align: center; font-size: 1em;}
+blockquote p {margin: 0;}
+blockquote i {font-style: normal;}
+blockquote b {display: block; margin-top: 0.5em; font-weight: normal; font-size: smaller; font-style: normal;}
+blockquote b i {font-style: italic;}
+
+img {border: 0; }
+kbd {font-weight: bold; font-size: 1em;}
+sup {font-size: smaller; line-height: 1px;}
+
+.slide code {padding: 2px 0.25em; font-weight: bold; color: #f30;}
+.slide code.bad, code del {color: red;}
+.slide code.old {color: silver;}
+.slide pre {padding: 0; margin: 0.25em 0 0.5em 0.5em; color: #f30; font-size: 90%;}
+.slide pre code {display: block;}
+.slide ul {margin-left: 5%; margin-right: 7%; list-style: disc;}
+.slide li {margin-top: 0.75em; margin-right: 0;}
+.slide ul ul {line-height: 1;}
+.slide ul ul li {margin: .2em; font-size: 85%; list-style: square;}
+.slide img.leader {display: block; margin: 0 auto;}
+
+div#header, div#footer {color: #666; font-family: Verdana, Arial, Helvetica, sans-serif;}
+div#header {background-color: transparent; line-height: 1px;}
+div#footer {background-color: transparent; font-size: 0.5em; font-weight: bold; padding: 1em 0;}
+#footer h1, #footer h2 {border: none; display: block; padding: 0; position:absolute; bottom:0.5em;}
+#footer h1 {left:1em; color: #666;}
+#footer h2 {right:1em; color: #666; font-style: italic;}
+
+div.long {font-size: 0.75em;}
+.slide h1 {position: absolute; top: 0.9em; left: 1.25em; z-index: 1; margin: 0.35em 0 0 50px; padding: 0; white-space: nowrap; font: bold 150%/1em Tahoma, Verdana, Arial, Helvetica, sans-serif; text-transform: capitalize; color: #fff; border-bottom: solid 0.1em red; background-color: transparent;}
+.slide h3 {font-size: 130%;}
+h1 abbr {font-variant: small-caps;}
+
+div#controls {position: absolute; left: 25%; bottom: 0; width: 50%; text-align: center; font: bold 1em Verdana, Arial, Helvetica, sans-serif;}
+html>body div#controls {background: transparent; position: fixed; padding: 0; top: auto; text-align: center;}
+#controls #sheet {display: none;}
+#controls #controlForm {height: 3.0em; text-align: center; vertical-align: middle;}
+#controls #navLinks {padding: 0 0 0.2em 0; margin: 0; background: url(pattern.png) gray bottom repeat-x; border: 2px outset gray; border-top-color: silver; border-left-color: silver; text-align: center; vertical-align: middle; white-space: nowrap;}
+#controls #navLinks a {text-shadow: #444 0.1em 0.1em 0.1em; padding: 0; margin: 0em 0.36em; background: transparent; border: none; color: white; cursor: pointer;}
+#controls #navLinks a:focus, #controls #navLinks a:hover {text-decoration: none; color: black !important;}
+#controls #navLinks a:link, #controls #navLinks a:visited {text-decoration: none; color: white;}
+#controls #navLinks .subLinks {display: inline; border: 1px inset gray; border-bottom-color: silver; border-right-color: silver; font-size: 75%; padding: 0 0.25em; margin: -0.2em 0 0 0; background-color: #666; text-align: center; vertical-align: middle; white-space: nowrap;}
+#controls #navLinks .subLinks a {text-shadow: none; font-weight: normal; padding: 0; margin: 0; border: none; color: white; cursor: pointer;}
+
+#jumplist, #volumelist {padding: 0; margin: 0; width: 1.5em; height: 2.25em; cursor: pointer;}
+
+#currentSlide {white-space: nowrap; text-align: center; margin-bottom: -0.5em; font-size: 0.5em; background-color: transparent; color: #666;}
+
+#guru {position: absolute; visibility: visible; left: 0px; top: 0px; padding: 4px; width: 99%; height: auto; text-align: center; background-color: black; z-index: 10;}
+#guru div {border: solid 3px red; padding: 4px; font-family: monospace; font-size: 60%; width: auto; height: auto; color: red; text-align: center;}
+
+#slide0 {padding-top: 3.5em; font-size: 90%;}
+#slide0 h1 {position: static; margin: 1em 0 0; padding: 0; border: none; font: bold 3em Verdana, Arial, Helvetica, sans-serif; font-variant: small-caps; white-space: normal; color: #fff; background-color: transparent;}
+#slide0 h2 {font: bold italic 1em Arial, Helvetica, sans-serif; margin: 0.25em;}
+#slide0 h3 {margin-top: 1.5em; font-size: 1.5em;}
+#slide0 h4 {margin-top: 0; font-size: 1em;}
+
+ul.urls {list-style: none; display: inline; margin: 0;}
+.urls li {display: inline; margin: 0;}
+.note {display: none;}
+.external {border-bottom: 1px dotted gray;}
+html>body .external {border-bottom: none;}
+.external:after {content: " \274F"; font-size: smaller; color: #F93;}
+
+.incremental, .incremental *, .incremental *:after {color: #999; visibility: visible;}
+img.incremental, canvas.incremental {visibility: hidden;}
+.slide .current {color: #ff0;}
+
+/* diagnostics
+li:after {content: " [" attr(class) "]"; color: #F88;}
+*/
+
+table.piechart, table.barchart, table.linechart { border-spacing: 0.3em 0.15em;  }
+table.piechart tr th, table.barchart tr th, table.linechart tr th { white-space: nowrap; }
+table.piechart tr td, table.barchart tr td, table.linechart tr td { vertical-align: top; white-space: nowrap; }
+table.piechart tr td.col, table.barchart tr td.col, table.linechart tr td.col { border-bottom: 1px solid #555; border-right: 1px solid #555; }
+table.fs90 tr td, table.fs90 tr th, div.fs90, pre.fs90, p.fs90 ,ul.fs90 {font-size: 0.9em; }
+table.fs75 tr td, table.fs75 tr th, div.fs75, pre.fs75, p.fs75 ,ul.fs75 {font-size: 0.75em; }
+table.fs66 tr td, table.fs66 tr th, div.fs66, pre.fs66, p.fs66 ,ul.fs66 {font-size: 0.66em; }
+table.fs50 tr td, table.fs50 tr th, div.fs50, pre.fs50, p.fs50 ,ul.fs50 {font-size: 0.5em; }
+
+#soundmanager-debug {position:fixed; top:0px; right:0px; width:30em; height:20em; overflow:auto; border:1px solid red; padding:1em; margin:2em; font-family:"sans serif"; font-size: 12px;color: black; background-color:#f6f6f6; z-index: 100;}\r
+#soundmanager-debug code {font-size: 11px;}
\ No newline at end of file
diff --git a/ui/scala_utf/print.css b/ui/scala_utf/print.css
new file mode 100644 (file)
index 0000000..5affe5d
--- /dev/null
@@ -0,0 +1,3 @@
+/* The following rule is necessary to have all slides appear in print! DO NOT REMOVE IT! */\r.slide, ul, p {page-break-inside: avoid; visibility: visible !important;}\rh1 {page-break-after: avoid;}
+img {page-break-inside: avoid; page-break-after: avoid;}
+/*.slide {page-break-after: always;}*/\r\rbody {font-size: 12pt; background: white;}\r* {color: black;}\r\r#slide0 h1 {font-size: 200%; border: none; margin: 0.5em 0 0.25em;}\r#slide0 h3 {margin: 0; padding: 0;}\r#slide0 h4 {margin: 0 0 0.5em; padding: 0;}\r#slide0 {margin-bottom: 3em;}\r\rh1 {border-top: 2pt solid gray; border-bottom: 1px dotted silver;}\r.extra {background: transparent !important;}\rdiv.extra, pre.extra, .example {font-size: 10pt; color: #333;}\rul.extra a {font-weight: bold;}\rp.example {display: none;}\r\r#header {display: none;}\r#footer h1 {margin: 0; border-bottom: 1px solid; color: gray; font-style: italic;}\r#footer h2, #controls {display: none;}\r\r/* The following rule keeps the layout stuff out of print.  Remove at your own risk! */\r.hide, .layout, .layout * {display: none !important;}\r
\ No newline at end of file
diff --git a/ui/scala_utf/s5-core.css b/ui/scala_utf/s5-core.css
new file mode 100644 (file)
index 0000000..8ed9c1e
--- /dev/null
@@ -0,0 +1,8 @@
+/* Do not edit or override these styles! The system will likely break if you do. */
+
+div#header, div#footer, div#controls, .slide {position: absolute;}
+html>body div#header, html>body div#footer, html>body div#controls, html>body .slide {position: fixed;}
+.handout, .notes, .hide {display: none;}
+.layout {display: block;}
+.slide, .hideme, .incremental {visibility: hidden;}
+#slide0 {visibility: visible;}
diff --git a/ui/scala_utf/slides.css b/ui/scala_utf/slides.css
new file mode 100644 (file)
index 0000000..0786d7d
--- /dev/null
@@ -0,0 +1,3 @@
+@import url(s5-core.css); /* required to make the slide show run at all */
+@import url(framing.css); /* sets basic placement and size of slide components */
+@import url(pretty.css);  /* stuff that makes the slides look better than blah */
\ No newline at end of file
diff --git a/ui/scala_utf/slides.js b/ui/scala_utf/slides.js
new file mode 100644 (file)
index 0000000..ef9f4c5
--- /dev/null
@@ -0,0 +1,2665 @@
+// S5 1.3beta7 (18-Apr-2007) advanced version by C. Effenberger 
+// Please see http://s5.netzgesta.de/ for more information
+// based on S5 v1.2a1 slides.js -- released into the Public Domain
+// Please see http://www.meyerweb.com/eric/tools/s5/credits.html for information 
+// about all the wonderful and talented contributors to this code!
+// audio extension: soundmanager2 is NOT Public Domain
+// Please see http://www.schillmania.com/projects/soundmanager2/ for information
+
+var undef;
+var slideCSS = '';
+var snum = 0;
+var smax = 1;
+var incpos = 0;
+var number = undef;
+var firstTime = 1;
+var s5mode = true;
+var helpmode = false;
+var defaultView = 'slideshow'; //outline
+var controlVis = 'visible';
+
+// scalable images extension
+var empx = 0;
+var images = new Array();
+var canvas = new Array();
+var medias = new Array();
+var piecharts = new Array(); 
+var barcharts = new Array();
+var linecharts = new Array();  
+// scalable images extension
+
+// transition extension
+var tranSitions = false;
+var fadeModus = false;
+var fadeDuration = 500;
+var incrDuration = 250;
+var opac = 1;
+var cid = '';
+var nid = '';
+var tid = '';
+var jl = '';
+// transition extension
+
+// autoplay extension
+var autoMatic = false;
+var playLoop = false;
+var playPause = false;\r
+var autoRun = false;
+var playDelay = 5000;
+var remainDer = 0;
+var incrDelay = 0;
+// autoplay extension
+
+// audio extension
+var sound = new Array();
+var audioSupport = false;
+var audioVolume = 100;
+var audioError = false;
+var swfUnloaded = true;
+var bgSoundItem = 9999;
+var curSoundID = -1;
+// audio extension
+
+// panel extension
+var highLight = "rgb(255, 204, 0)";
+// panel extension
+
+// canvas chart extension
+var canvasSupport = false;
+var ChartData = new Array();
+var colorSlice = new Array();
+var font = document.createElement("img");
+font.setAttribute("src", "ui/graphic_support/numeric.png");
+signs = {
+       '0': {sx: 0, sy: 0, sw: 48, sh: 64},
+       '1': {sx: 48, sy: 0, sw: 48, sh: 64},
+       '2': {sx: 96, sy: 0, sw: 48, sh: 64},
+       '3': {sx: 144, sy: 0, sw: 48, sh: 64},
+       '4': {sx: 192, sy: 0, sw: 48, sh: 64},
+       '5': {sx: 240, sy: 0, sw: 48, sh: 64},
+       '6': {sx: 288, sy: 0, sw: 48, sh: 64},
+       '7': {sx: 336, sy: 0, sw: 48, sh: 64},
+       '8': {sx: 384, sy: 0, sw: 48, sh: 64},
+       '9': {sx: 432, sy: 0, sw: 48, sh: 64},
+       '%': {sx: 480, sy: 0, sw: 48, sh: 64},
+       '.': {sx: 528, sy: 0, sw: 24, sh: 64}
+};
+var colorNames= new Array(); 
+colorNames["black"]="#000000"; colorNames["maroon"]="#800000";\rcolorNames["green"]="#008000"; colorNames["olive"]="#808000";\rcolorNames["navy"]="#000080"; colorNames["purple"]="#800080";\rcolorNames["teal"]="#008080"; colorNames["gray"]="#808080";\rcolorNames["silver"]="#C0C0C0"; colorNames["red"]="#FF0000";\rcolorNames["lime"]="#00FF00"; colorNames["yellow"]="#FFFF00";\rcolorNames["blue"]="#0000FF"; colorNames["fuchsia"]="#FF00FF";\rcolorNames["aqua"]="#00FFFF"; colorNames["white"]="#FFFFFF";\rcolorNames["aliceblue"]="#F0F8FF"; colorNames["antiquewhite"]="#FAEBD7";\rcolorNames["aquamarine"]="#7FFFD4"; colorNames["azure"]="#F0FFFF";\rcolorNames["beige"]="#F5F5DC"; colorNames["blueviolet"]="#8A2BE2";\rcolorNames["brown"]="#A52A2A"; colorNames["burlywood"]="#DEB887";\rcolorNames["cadetblue"]="#5F9EA0"; colorNames["chartreuse"]="#7FFF00";\rcolorNames["chocolate"]="#D2691E"; colorNames["coral"]="#FF7F50";\rcolorNames["cornflowerblue"]="#6495ED"; colorNames["cornsilk"]="#FFF8DC";\rcolorNames["crimson"]="#DC143C"; colorNames["darkblue"]="#00008B";\rcolorNames["darkcyan"]="#008B8B"; colorNames["darkgoldenrod"]="#B8860B";\rcolorNames["darkgray"]="#A9A9A9"; colorNames["darkgreen"]="#006400";\rcolorNames["darkkhaki"]="#BDB76B"; colorNames["darkmagenta"]="#8B008B";\rcolorNames["darkolivegreen"]="#556B2F"; colorNames["darkorange"]="#FF8C00";\rcolorNames["darkorchid"]="#9932CC"; colorNames["darkred"]="#8B0000";\rcolorNames["darksalmon"]="#E9967A"; colorNames["darkseagreen"]="#8FBC8F";\rcolorNames["darkslateblue"]="#483D8B"; colorNames["darkslategray"]="#2F4F4F";\rcolorNames["darkturquoise"]="#00CED1"; colorNames["darkviolet"]="#9400D3";\rcolorNames["deeppink"]="#FF1493"; colorNames["deepskyblue"]="#00BFFF";\rcolorNames["dimgray"]="#696969"; colorNames["dodgerblue"]="#1E90FF";\rcolorNames["firebrick"]="#B22222"; colorNames["floralwhite"]="#FFFAF0";\rcolorNames["forestgreen"]="#228B22"; colorNames["gainsboro"]="#DCDCDC";\rcolorNames["ghostwhite"]="#F8F8FF"; colorNames["gold"]="#FFD700";\rcolorNames["goldenrod"]="#DAA520"; colorNames["greenyellow"]="#ADFF2F";\rcolorNames["honeydew"]="#F0FFF0"; colorNames["hotpink"]="#FF69B4";\rcolorNames["indianred"]="#CD5C5C"; colorNames["indigo"]="#4B0082";\rcolorNames["ivory"]="#FFFFF0"; colorNames["khaki"]="#F0E68C";\rcolorNames["lavender"]="#E6E6FA"; colorNames["lavenderblush"]="#FFF0F5";\rcolorNames["lawngreen"]="#7CFC00"; colorNames["lemonchiffon"]="#FFFACD";\rcolorNames["lightblue"]="#ADD8E6"; colorNames["lightcoral"]="#F08080";\rcolorNames["lightcyan"]="#E0FFFF"; colorNames["lightgoldenrodyellow"]="#FAFAD2";\rcolorNames["lightgreen"]="#90EE90"; colorNames["lightgrey"]="#D3D3D3";\rcolorNames["lightpink"]="#FFB6C1"; colorNames["lightsalmon"]="#FFA07A";\rcolorNames["lightseagreen"]="#20B2AA"; colorNames["lightskyblue"]="#87CEFA";\rcolorNames["lightslategray"]="#778899"; colorNames["lightsteelblue"]="#B0C4DE";\rcolorNames["lightyellow"]="#FFFFE0"; colorNames["limegreen"]="#32CD32";\rcolorNames["linen"]="#FAF0E6"; colorNames["mediumaquamarine"]="#66CDAA";\rcolorNames["mediumblue"]="#0000CD"; colorNames["mediumorchid"]="#BA55D3";\rcolorNames["ediumpurple"]="#9370D"; colorNames["mediumseagreen"]="#3CB371";\rcolorNames["mediumslateblue"]="#7B68EE"; colorNames["mediumspringgreen"]="#00FA9A";\rcolorNames["mediumturquoise"]="#48D1CC"; colorNames["mediumvioletred"]="#C71585";\rcolorNames["midnightblue"]="#191970"; colorNames["mintcream"]="#F5FFFA";\rcolorNames["mistyrose"]="#FFE4E1"; colorNames["moccasin"]="#FFE4B5";\rcolorNames["navajowhite"]="#FFDEAD"; colorNames["oldlace"]="#FDF5E6";\rcolorNames["olivedrab"]="#6B8E23"; colorNames["orange"]="#FFA500";\rcolorNames["orangered"]="#FF4500"; colorNames["orchid"]="#DA70D6";\rcolorNames["palegoldenrod"]="#EEE8AA"; colorNames["palegreen"]="#98FB98";\rcolorNames["paleturquoise"]="#AFEEEE"; colorNames["palevioletred"]="#DB7093";\rcolorNames["papayawhip"]="#FFEFD5"; colorNames["peachpuff"]="#FFDAB9";\rcolorNames["peru"]="#CD853F"; colorNames["pink"]="#FFC0CB";\rcolorNames["plum"]="#DDA0DD"; colorNames["powderblue"]="#B0E0E6";\rcolorNames["rosybrown"]="#BC8F8F"; colorNames["royalblue"]="#4169E1";\rcolorNames["saddlebrown"]="#8B4513"; colorNames["salmon"]="#FA8072";\rcolorNames["sandybrown"]="#F4A460"; colorNames["seagreen"]="#2E8B57";\rcolorNames["seashell"]="#FFF5EE"; colorNames["sienna"]="#A0522D";\rcolorNames["skyblue"]="#87CEEB"; colorNames["slateblue"]="#6A5ACD";\rcolorNames["slategray"]="#708090"; colorNames["snow"]="#FFFAFA";\rcolorNames["springgreen"]="#00FF7F"; colorNames["steelblue"]="#4682B4";\rcolorNames["tan"]="#D2B48C"; colorNames["thistle"]="#D8BFD8";\rcolorNames["tomato"]="#FF6347"; colorNames["turquoise"]="#40E0D0";\rcolorNames["violet"]="#EE82EE"; colorNames["wheat"]="#F5DEB3";\rcolorNames["whitesmoke"]="#F5F5F5"; colorNames["yellowgreen"]="#9ACD32";
+var canvas_bgcolor = "";
+var canvas_width = 200;
+var canvas_height = 200;
+var canvas_noshade = 0;
+var canvas_nofill = 0;
+var canvas_noshadow = 0;
+var canvas_htmltext = 0;
+var canvas_imgtext = 0;
+var canvas_notext = 0;
+// canvas chart extension
+
+var s5NotesWindow;
+var s5NotesWindowLoaded = false;
+var previousSlide = 0;
+var presentationStart = new Date();
+var slideStart = new Date();
+
+var countdown = {
+       timer: 0,
+       state: 'pause',
+       start: new Date(),
+       end: 0,
+       remaining: 0
+};
+
+var isIE = navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('Opera') < 1 ? 1 : 0;
+if(isIE) var notIE7 = parseInt(navigator.appVersion) < 7 ? 1 : 0;
+var isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0;
+var isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0;
+var isS2 = navigator.userAgent.indexOf('Safari') >= 2 ? 1 : 0;
+
+function hasClass(object, className) {
+       if (!object.className) return false;
+       return (object.className.search('(^|\\s)' + className + '(\\s|$)') != -1);
+}
+
+function hasValue(object, value) {
+       if (!object) return false;
+       return (object.search('(^|\\s)' + value + '(\\s|$)') != -1);
+}
+
+function removeClass(object,className) {
+       if (!object || !hasClass(object,className)) return;
+       object.className = object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'), RegExp.$1+RegExp.$2);
+}
+
+function addClass(object,className) {
+       if (!object || hasClass(object, className)) return;
+       if (object.className) {
+               object.className += ' '+className;
+       } else {
+               object.className = className;
+       }
+}
+
+function changeClass(object,className) {
+       if (!object) return;
+       object.firstChild.className = className;
+}
+
+function GetElementsWithClassName(elementName,className) {
+       var allElements = document.getElementsByTagName(elementName);
+       var elemColl = new Array();
+       for (var i = 0; i< allElements.length; i++) {
+               if (hasClass(allElements[i], className)) {
+                       elemColl[elemColl.length] = allElements[i];
+               }
+       }
+       return elemColl;
+}
+
+function isParentOrSelf(element, id) {
+       if (element == null || element.nodeName=='BODY') return false;
+       else if (element.id == id) return true;
+       else return isParentOrSelf(element.parentNode, id);
+}
+
+function nodeValue(node) {
+       var result = "";
+       if (node.nodeType == 1) {
+               var children = node.childNodes;
+               for (var i = 0; i < children.length; ++i) {
+                       result += nodeValue(children[i]);
+               }               
+       }
+       else if (node.nodeType == 3) {
+               result = node.nodeValue;
+       }
+       return(result);
+}
+
+function slideLabel() {
+       var slideColl = GetElementsWithClassName('*','slide');
+       var list = document.getElementById('jumplist');
+       smax = slideColl.length;
+       for (var n = 0; n < smax; n++) {
+               var obj = slideColl[n];
+               var did = 'slide' + n.toString();
+               obj.setAttribute('id',did);
+               var otext = '';
+               var menu = obj.firstChild;
+               if (!menu) continue; // to cope with empty slides
+               while (menu && menu.nodeType == 3) {
+                       menu = menu.nextSibling;
+               }
+               if (!menu) continue; // to cope with slides with only text nodes
+               var menunodes = menu.childNodes;
+               for (var o = 0; o < menunodes.length; o++) {
+                       otext += nodeValue(menunodes[o]);
+               }
+               list.options[list.length] = new Option(n + ' : '  + otext, n);
+       }
+}
+
+function currentSlide() {
+       var cs, at, fd, ss;
+       if (document.getElementById) {
+               cs = document.getElementById('currentSlide');
+       } else {
+               cs = document.currentSlide;
+       }
+       fd = fadeModus?"F":"&ndash;";
+       ss = audioSupport?"S":"&ndash;";  
+       at = (autoMatic?(playPause?"||":(playLoop?"&gt;0":"&gt;|")):"&ndash;&ndash;");
+       cs.innerHTML = '<div id="plink" nowrap="nowrap">' + 
+       '<span id="csFade">[' + fd + ss + ']<\/span>&nbsp;' +
+       '<span id="csHere"><strong>' + snum + '<\/strong><\/span>' + 
+       '<span id="csSep">\/<\/span>' + 
+       '<span id="csTotal">' + (smax-1) + '<\/span>&nbsp;' +
+       '<span id="csAuto">[' + at + ']<\/span>' +
+       '<\/div>';
+               
+       if (snum == 0) {
+               cs.style.visibility = 'hidden';
+       } else {
+               cs.style.visibility = 'visible';
+       }
+}
+
+function go(step) {
+       if (document.getElementById('slideProj').disabled || step == 0) return;
+       jl = document.getElementById('jumplist');
+       cid = 'slide' + snum;
+       var ce = document.getElementById(cid);
+       if (incrementals[snum].length > 0) {
+               for (var i = 0; i < incrementals[snum].length; i++) {
+                       removeClass(incrementals[snum][i], 'current');
+                       removeClass(incrementals[snum][i], 'incremental');
+               }
+       }
+       if (step != 'j') {
+               snum += step;
+               lmax = smax - 1;
+               if (snum > lmax) snum = lmax;
+               if (snum < 0) snum = 0;
+       }else {
+               snum = parseInt(jl.value);
+       }       
+       nid = 'slide' + snum;
+       var ne = document.getElementById(nid);
+       if (!ne) {
+               ne = document.getElementById('slide0');
+               nid = 'slide0';
+               snum = 0;
+       }
+       if (step < 0) {
+               incpos = incrementals[snum].length
+       }else {
+               incpos = 0;
+       }
+       if (incrementals[snum].length > 0 && incpos == 0) {
+               for (var i = 0; i < incrementals[snum].length; i++) {
+                       if (hasClass(incrementals[snum][i], 'current')) {
+                               incpos = i + 1;
+                       }else {
+                               addClass(incrementals[snum][i], 'incremental');
+                       }
+               }
+       }
+       if (incrementals[snum].length > 0 && incpos > 0) {
+               addClass(incrementals[snum][incpos - 1], 'current');
+       }
+       var guru = document.getElementById('guru');
+       if(guru && snum==0) {
+               guru.style.visibility = 'visible';
+       }else if(guru && snum>0) {
+               guru.style.visibility = 'hidden';
+       }       
+       if(tranSitions && s5mode && fadeModus) {
+               if(curSoundID != getSoundID(nid)) {
+                       if(curSoundID == bgSoundItem && !sound[getSoundID(nid)]) {
+                       }else {fadeoutSound(curSoundID,true); } // audio support
+               }               
+               changeOpac(0,nid);
+               changeOpac(100,cid);
+               ce.style.visibility = 'visible';
+               shiftOpacity(cid,fadeDuration);
+               window.setTimeout("changeSlides()",fadeDuration);
+       }else {
+               if(curSoundID != getSoundID(nid)) {
+                       if(curSoundID == bgSoundItem && !sound[getSoundID(nid)]) {
+                       }else {stopSound(curSoundID); } // audio support 
+               }
+               ce.style.visibility = 'hidden';
+               if (isOp) location.hash = nid;
+               ne.style.visibility = 'visible';
+               finishSlides();         
+       }
+}
+
+function changeSlides() {
+       if(nid != cid) changeOpac(100,cid);
+       document.getElementById(cid).style.visibility = 'hidden';
+       document.getElementById(nid).style.visibility = 'visible';
+       if (isOp) location.hash = nid;
+       shiftOpacity(nid,fadeDuration);
+       window.setTimeout("finishSlides()",fadeDuration);
+}
+
+function finishSlides() {
+       jl.selectedIndex = snum;
+       currentSlide();
+       loadNote();
+       permaLink();
+       number = undef;
+       if(sound[getSoundID(nid)]) {
+               playSound(nid); // audio support
+       }else if(sound[bgSoundItem] && curSoundID != bgSoundItem) {
+               playSound(bgSoundItem); // audio support
+       }
+}
+
+function goTo(target) {
+       if (target >= smax || target == snum) return;
+       go(target - snum);
+}
+
+function subgo(step) {
+       if (step > 0) {
+               removeClass(incrementals[snum][incpos - 1],'current');
+               removeClass(incrementals[snum][incpos], 'incremental');
+               if(tranSitions && s5mode && fadeModus) {                        
+                       if(!incrementals[snum][incpos].id) {
+                               var tmp = new Date(); tid = "inc" + String(tmp.getTime());
+                               incrementals[snum][incpos].id = tid;
+                       }else {
+                               tid = incrementals[snum][incpos].id;
+                       }       
+                       if(typeof(incrementals[snum][incpos].src) != "undefined" || incrementals[snum][incpos].getContext) {
+                               changeOpac(0,tid);              
+                               addClass(incrementals[snum][incpos],'current');
+                               shiftOpacity(tid,incrDuration);
+                               setTimeout("nextInc()",incrDuration);
+                       }else {
+                               addClass(incrementals[snum][incpos],'current');
+                               nextInc();
+                       }       
+               }else {
+                       addClass(incrementals[snum][incpos],'current');
+                       nextInc();
+               }
+       } else {
+               incpos--;
+               removeClass(incrementals[snum][incpos],'current');
+               addClass(incrementals[snum][incpos], 'incremental');
+               addClass(incrementals[snum][incpos - 1],'current');
+               loadNote();
+       }
+}
+
+function nextInc() {
+       incpos++;
+       loadNote();
+}
+
+function toggle() {
+       var slideColl = GetElementsWithClassName('*','slide');
+       var slides = document.getElementById('slideProj');
+       var outline = document.getElementById('outlineStyle');
+       var guru = document.getElementById('guru');
+       if (!slides.disabled) {
+               stopPlay();
+               if(audioSupport && !swfUnloaded) stopAllSounds();
+               slides.disabled = true;
+               outline.disabled = false;
+               s5mode = false;
+               fontSize(1,'em');
+               for (var n = 0; n < smax; n++) {
+                       var slide = slideColl[n];
+                       slide.style.visibility = 'visible';
+               }
+               if(guru) guru.style.visibility = 'hidden';
+       } else {
+               slides.disabled = false;
+               outline.disabled = true;
+               s5mode = true;
+               fontScale();
+               for (var n = 0; n < smax; n++) {
+                       var slide = slideColl[n];
+                       slide.style.visibility = 'hidden';
+               }
+               slideColl[snum].style.visibility = 'visible';
+               if(guru && snum==0) guru.style.visibility = 'visible';
+       }
+}
+
+function showHide(action) {
+       var obj = GetElementsWithClassName('*','hideme')[0];
+       switch (action) {
+       case 's': 
+               obj.style.visibility = 'visible'; 
+               break;
+       case 'h':
+               obj.style.visibility = 'hidden'; 
+               break;
+       case 'k':
+               if (obj.style.visibility != 'visible') {
+                       obj.style.visibility = 'visible';
+               } else {
+                       obj.style.visibility = 'hidden';
+               }
+       break;
+       }
+}
+
+function keys(key) {
+       if (!key) {
+               key = event;
+               key.which = key.keyCode;
+       }
+       if (helpmode) {
+               dumpHelpReq();
+               return;
+       }
+       if (key.which == 84 && !isOp) {
+               toggle();
+               return;
+       }
+       if (s5mode) {
+               if (autoMatic) {
+                       switch (key.which) {
+                       case 70: // f/ading on/off
+                               switchFade();
+                               break;
+                       case 83: // s/ound on/off
+                               toggleSounds();
+                               break;  
+                       case 67: // c
+                               showHide('k');
+                               break;
+                       case 65: // a/utoplay on/off
+                               stopPlay();
+                               break;
+                       case 76: // l/ooping on/off
+                               switchLoop();
+                               break;
+                       case 80: // p/ause
+                       case 32: // spacebar
+                               pausePlay();
+                               break;
+                       }
+               }else {
+                       switch (key.which) {
+                       case 8: // backspace = HELP
+                               createHelpReq();
+                               break;                                                          
+                       case 10: // return
+                       case 13: // enter
+                               if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;
+                               if (key.target && isParentOrSelf(key.target, 'controls')) return;
+                               if(number != undef) {
+                                       goTo(number);
+                                       break;
+                               }
+                       case 32: // spacebar
+                       case 34: // page down
+                       case 39: // rightkey
+                       case 40: // downkey
+                               if(number != undef) {
+                                       go(number);
+                               } else if (!incrementals[snum] || incpos >= incrementals[snum].length) {
+                                       go(1);
+                               } else {
+                                       subgo(1);
+                               }
+                               break;
+                       case 33: // page up
+                       case 37: // leftkey
+                       case 38: // upkey
+                               if(number != undef) {
+                                       go(-1 * number);
+                               } else if (!incrementals[snum] || incpos <= 0) {
+                                       go(-1);
+                               } else {
+                                       subgo(-1);
+                               }
+                               break;
+                       case 65: // a/utoplay
+                               startPlay();
+                               break;                          
+                       case 72: // h
+                       case 36: // home
+                               goTo(0);
+                               break;
+                       case 69: // e
+                       case 35: // end
+                               goTo(smax-1);
+                               break;
+                       case 70: // f/ade transitions on/off
+                               switchFade();
+                               break;
+                       case 76: // l/ooping on/off
+                               switchLoop();
+                               break;
+                       case 83: // s/ound support on/off
+                               toggleSounds();
+                               break;                                  
+                       case 27: // escape
+                       case 81: // q
+                               if(!isOp) byby();
+                               break;
+                       case 67: // c
+                               showHide('k');
+                               break;
+                       case 78: // n
+                               createNotesWindow();
+                               break;
+                       }
+                       if (key.which < 48 || key.which > 57) {
+                               number = undef;
+                       } else {
+                               if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;
+                               if (key.target && isParentOrSelf(key.target, 'controls')) return;
+                               number = (((number != undef) ? number : 0) * 10) + (key.which - 48);
+                       }
+               }
+       }
+       return false;
+}
+
+function clicker(e) {
+       number = undef;
+       var target;
+       if (window.event) {
+               target = window.event.srcElement;
+               e = window.event;
+       } else {
+               target = e.target;
+       }
+       if (target.href != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target,'object')) return true;
+       if (!helpmode) {
+               if (!e.which || e.which == 1) {
+                       if (!incrementals[snum] || incpos >= incrementals[snum].length) {
+                               go(1);
+                       } else {
+                               subgo(1);
+                       }
+               }
+       } else {
+               dumpHelpReq();  
+       }
+}
+
+function findSlide(hash) {
+       var target = null;
+       var slides = GetElementsWithClassName('*','slide');
+       for (var i = 0; i < slides.length; i++) {
+               var targetSlide = slides[i];
+               if ( (targetSlide.name && targetSlide.name == hash)
+                || (targetSlide.id && targetSlide.id == hash) ) {
+                       target = targetSlide;
+                       break;
+               }
+       }
+       while(target != null && target.nodeName != 'BODY') {
+               if (hasClass(target, 'slide')) {
+                       return parseInt(target.id.slice(5));
+               }
+               target = target.parentNode;
+       }
+       return null;
+}
+
+function slideJump() {
+       if (window.location.hash == null) return;
+       var sregex = /^#slide(\d+)$/;
+       var matches = sregex.exec(window.location.hash);
+       var dest = null;
+       if (matches != null) {
+               dest = parseInt(matches[1]);
+       } else {
+               dest = findSlide(window.location.hash.slice(1));
+       }
+       if (dest != null)
+               go(dest - snum);
+}
+
+function fixLinks() {
+       var thisUri = window.location.href;
+       thisUri = thisUri.slice(0, thisUri.length - window.location.hash.length);
+       var aelements = document.getElementsByTagName('A');
+       for (var i = 0; i < aelements.length; i++) {
+               var a = aelements[i].href;
+               var slideID = a.match('\#slide[0-9]{1,2}');
+               if ((slideID) && (slideID[0].slice(0,1) == '#')) {
+                       var dest = findSlide(slideID[0].slice(1));
+                       if (dest != null) {
+                               if (aelements[i].addEventListener) {
+                                       aelements[i].addEventListener("click", new Function("e",
+                                               "if (document.getElementById('slideProj').disabled) return;" +
+                                               "go("+dest+" - snum); " +
+                                               "if (e.preventDefault) e.preventDefault();"), true);
+                               } else if (aelements[i].attachEvent) {
+                                       aelements[i].attachEvent("onclick", new Function("",
+                                               "if (document.getElementById('slideProj').disabled) return;" +
+                                               "go("+dest+" - snum); " +
+                                               "event.returnValue = false;"));
+                               }
+                       }
+               }
+       }
+}
+
+function externalLinks() {
+       if (!document.getElementsByTagName) return;
+       var anchors = document.getElementsByTagName('a');
+       for (var i=0; i<anchors.length; i++) {
+               var anchor = anchors[i];
+               if (anchor.getAttribute('href') && hasValue(anchor.rel, 'external')) {
+                       anchor.target = '_blank';
+                       addClass(anchor,'external');
+               }
+       }
+}
+
+function permaLink() {
+       document.getElementById('plink').href = window.location.pathname + '#slide' + snum;
+}
+
+function createControls() {
+       var controlsDiv = document.getElementById("controls");
+       if (!controlsDiv) return;
+       var hider = ' onmouseover="showHide(\'s\');" onmouseout="showHide(\'h\');"';
+       var hideDiv, hideList = '';
+       if (controlVis == 'hidden') {
+               hideDiv = hider;
+       } else {
+               hideList = hider;
+       }
+       if(isOp) {
+               var str = '';
+       }else {
+               var str = '<a accesskey="t" id="sheet" title="toggle CSS" href="javascript:toggle();">&plusmn;<\/a>';
+       }       
+       if(isIE) {
+               var tmp = "move around&xA0;until the color&xA0;change to red!";
+       }else if(isS2) {
+               var tmp = "move around\r\nuntil the color\r\nchange to red!";
+       }else {
+               var tmp = "move around until color change to red!";
+       }
+       if(isIE) {
+               controlsDiv.innerHTML = str + '<form action="#" id="controlForm"' + hideDiv + '>' +
+               '<div id="navLinks" title="press [backspace] for keyboard help!" style="background-image: none;">' +
+               '<a accesskey="n" id="show-notes" title="show Notes" href="javascript:createNotesWindow();">i<\/a>' +
+               '<a accesskey="t" id="toggle" title="toggle CSS" href="javascript:toggle();">&plusmn;<\/a>' +
+               '<a accesskey="h" id="zero" title="goto Start Slide" href="javascript:goTo(0);">|&lt;<\/a>' +
+               '<a accesskey="y" id="prev" title="previous Slide" href="javascript:go(-1);">&lt;<\/a>' +
+               '<a accesskey="x" id="next" title="next Slide" href="javascript:go(1);">&gt;<\/a>' +
+               '<a accesskey="e" id="last" title="goto Last Slide" href="javascript:goTo(smax-1);">&gt;|<\/a>' +
+               '<br \/><div class="subLinks" id="autoLinks" style="margin-left:0.25em;">' +
+               '<a accesskey="a" id="auto" title="Auto Play" href="javascript:togglePlay();">&gt;<\/a>&nbsp;' +
+               '<a style="font-weight: bold;" accesskey="p" id="pause" title="Pausing" href="javascript:pausePlay();">||<\/a>&nbsp;' +
+               '<a style="font-weight: bold;" accesskey="l" id="loop" title="Looping" href="javascript:switchLoop();">&infin;<\/a>&nbsp;&nbsp;' +
+               '<a title="5 Sec. Delay" href="javascript:setDelay(5);">5<\/a>&middot;' +
+               '<a title="10 Sec. Delay" href="javascript:setDelay(10);">10<\/a>&middot;' + 
+               '<a title="15 Sec. Delay" href="javascript:setDelay(15);">15<\/a>&middot;' + 
+               '<a title="30 Sec. Delay" href="javascript:setDelay(30);">30<\/a>&middot;' + 
+               '<a title="60 Sec. Delay" href="javascript:setDelay(60);">60<\/a>' +
+               '<\/div><select id="jumplist" style="position: absolute; left: -9999px;"><\/select><\/div><\/form>';
+       }else {
+               controlsDiv.innerHTML =  str +
+               '<form action="#" id="controlForm"' + hideDiv + '>' +
+               '<div id="navLinks" title="press [backspace] or double click this area for keyboard help!" ondblclick="createHelpReq();">' +
+               '<a accesskey="q" id="exit" title="exit Show" href="javascript:byby();">&times;<\/a>' +
+               '<a accesskey="n" id="show-notes" title="show Notes" href="javascript:createNotesWindow();">&#x274f;<\/a>' +
+               '<a accesskey="t" id="toggle" title="toggle CSS" href="javascript:toggle();">&plusmn;<\/a>' +
+               '<a accesskey="h" id="zero" title="goto Start Slide" href="javascript:goTo(0);">|&lt;<\/a>' +
+               '<a accesskey="y" id="prev" title="previous Slide" href="javascript:go(-1);">&lt;<\/a>' +
+               '<a accesskey="x" id="next" title="next Slide" href="javascript:go(1);">&gt;<\/a>' +
+               '<a accesskey="e" id="last" title="goto Last Slide" href="javascript:goTo(smax-1);">&gt;|<\/a>' +
+               '<a id="list" style="cursor:wait;" title="' + tmp + '">&Xi;<\/a>' +
+               '<select id="jumplist" title="select named Slide" onchange="go(\'j\');"><\/select>' +
+               '<br \/><div class="subLinks" id="fadeLinks">' +
+               '<a style="font-weight: bold;" accesskey="f" id="fade" title="Transions" href="javascript:switchFade();">&#x25a8;<\/a>&nbsp;' +
+               '<\/div><div class="subLinks" id="audioLinks" style="margin-left:0.25em;">' +
+               '<a accesskey="s" id="audio" title="Sound" href="javascript:toggleSounds();">&#x266b;<\/a>&nbsp;' +
+               '<a id="volume" style="cursor:wait;" title="' + tmp + '">&#x25e2;<\/a>' +
+               '<select id="volumelist" title="select Volume" onchange="setVolume();"><option value="100">100</option>' +
+               '<option value="90">90</option><option value="80">80</option>' +
+               '<option value="70">70</option><option value="60">60</option>' +
+               '<option value="50">50</option><option value="40">40</option>' +
+               '<option value="30">30</option><option value="20">20</option>' +
+               '<option value="10">10</option><option value="0">0</option>' +
+               '<\/select>' +
+               '<\/div><div class="subLinks" id="autoLinks" style="margin-left:0.25em;">' +
+               '<a accesskey="a" id="auto" title="Auto Play" href="javascript:togglePlay();">&#x25b6;<\/a>&nbsp;' +
+               '<a style="font-weight: bold;" accesskey="p" id="pause" title="Pausing" href="javascript:pausePlay();">||<\/a>&nbsp;' +
+               '<a style="font-weight: bold;" accesskey="l" id="loop" title="Looping" href="javascript:switchLoop();">&infin;<\/a>&nbsp;&nbsp;' +
+               '<a title="5 Sec. Delay" href="javascript:setDelay(5);">5<\/a>&middot;' +
+               '<a title="10 Sec. Delay" href="javascript:setDelay(10);">10<\/a>&middot;' + 
+               '<a title="15 Sec. Delay" href="javascript:setDelay(15);">15<\/a>&middot;' + 
+               '<a title="30 Sec. Delay" href="javascript:setDelay(30);">30<\/a>&middot;' + 
+               '<a title="60 Sec. Delay" href="javascript:setDelay(60);">60<\/a>' +
+               '<\/div><\/div><\/form>';
+       }
+       if (controlVis == 'hidden') {
+               var hidden = document.getElementById('navLinks');
+       } else {
+               var hidden = document.getElementById('jumplist');
+       }
+       addClass(hidden,'hideme');
+}
+
+function fontScale() {  // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers
+       if (!s5mode && !isOp) return false;
+       var hScreen = screen.width; var vScreen = screen.height;
+       var vWindow = window.outerHeight; var hWindow = window.outerWidth;
+       if (isOp && s5mode && defaultView=='slideshow' && ((hScreen != hWindow) || (vScreen != vWindow))) {
+               toggle();
+               return false;
+       }
+       if (isOp && !s5mode && ((hScreen != hWindow) || (vScreen != vWindow))) return false;
+       if (isOp && !s5mode && (hScreen == hWindow) && (vScreen == vWindow)) toggle();
+       var vScale = 48;  // both yield 16 (the usual browser default) at 1024x768
+       var hScale = 64;  // perhaps should auto-calculate based on theme's declared value?
+       if (window.innerHeight) {
+               var vSize = window.innerHeight;
+               var hSize = window.innerWidth;
+       } else if (document.documentElement.clientHeight) {
+               var vSize = document.documentElement.clientHeight;
+               var hSize = document.documentElement.clientWidth;
+       } else if (document.body.clientHeight) {
+               var vSize = document.body.clientHeight;
+               var hSize = document.body.clientWidth;
+       } else {
+               var vSize = 700;  // assuming 1024x768, minus chrome and such equals 8:5
+               var hSize = 1024; // these do not account for kiosk mode or Opera Show
+       }
+       var newSize = Math.min(Math.round(vSize/vScale),Math.round(hSize/hScale));
+       extendImgSizes(newSize); // scalable images extension
+       extendCanSizes(newSize); // scalable canvas extension
+       extendObjSizes(newSize); // scalable object extension
+       fontSize(newSize,"px");
+       if(!isS2 || firstTime==0) {
+               generateCanvas(); // dynamic canvas extension
+       }
+       if (isGe) {  // hack to counter incremental reflow bugs
+               var obj = document.getElementsByTagName('body')[0];
+               obj.style.visibility = 'hidden';
+               obj.style.display = 'none';
+               obj.style.display = 'block';
+               obj.style.visibility = 'visible';
+               changeOpac(100,'slide' + snum);
+               shiftOpacity('slide' + snum,10);
+               window.setTimeout("fixReflow()",10);
+       }else {
+               setListPos(); // invisible select extension
+       }
+}
+
+function fixReflow() {
+       shiftOpacity('slide' + snum,10);
+       window.setTimeout("finishReflow()",10);
+}
+function finishReflow() {
+       setListPos(); // invisible select extension
+}
+
+function fontSize(val,fmt) {
+       var value = val + fmt;
+       if (!(s5ss = document.getElementById('s5ss'))) {
+               if (!document.createStyleSheet) {
+                       document.getElementsByTagName('head')[0].appendChild(s5ss = document.createElement('style'));
+                       s5ss.setAttribute('media','screen, projection');
+                       s5ss.setAttribute('id','s5ss');
+               } else {
+                       document.createStyleSheet();
+                       document.s5ss = document.styleSheets[document.styleSheets.length - 1];
+               }
+       }
+       if (!(document.s5ss && document.s5ss.addRule)) {
+               while (s5ss.lastChild) s5ss.removeChild(s5ss.lastChild);
+               s5ss.appendChild(document.createTextNode('html {font-size: ' + value + ' !important;}'));
+       } else {
+               document.s5ss.addRule('html','font-size: ' + value + ' !important;');
+       }
+}
+
+function windowChange() {
+       fontScale();
+}
+
+function notOperaFix() {
+       slideCSS = document.getElementById('slideProj').href;
+       var slides = document.getElementById('slideProj');
+       var outline = document.getElementById('outlineStyle');
+       slides.setAttribute('media','screen');
+       outline.disabled = true;
+       if (isGe) {
+               slides.setAttribute('href','null');   // Gecko fix
+               slides.setAttribute('href',slideCSS); // Gecko fix
+       }
+       if ((isIE && notIE7) && document.styleSheets && document.styleSheets[0]) {
+               document.styleSheets[0].addRule('img', 'behavior: url(ui/graphic_support/iepngfix.htc)');
+               document.styleSheets[0].addRule('div', 'behavior: url(ui/graphic_support/iepngfix.htc)');
+               document.styleSheets[0].addRule('.slide', 'behavior: url(ui/graphic_support/iepngfix.htc)');
+       }
+}
+
+function getIncrementals(obj) {
+       var incrementals = new Array();
+       if (!obj) 
+               return incrementals;
+       var children = obj.childNodes;
+       for (var i = 0; i < children.length; i++) {
+               var child = children[i];
+               if (hasClass(child, 'incremental')) {
+                       if (child.nodeName == 'OL' || child.nodeName == 'UL') {
+                               removeClass(child, 'incremental');
+                               for (var j = 0; j < child.childNodes.length; j++) {
+                                       if (child.childNodes[j].nodeType == 1) {
+                                               addClass(child.childNodes[j], 'incremental');
+                                       }
+                               }
+                       } else {
+                               incrementals[incrementals.length] = child;
+                               removeClass(child,'incremental');
+                       }
+               }
+               if (hasClass(child, 'show-first')) {
+                       if (child.nodeName == 'OL' || child.nodeName == 'UL') {
+                               removeClass(child, 'show-first');
+                               if (child.childNodes[isGe].nodeType == 1) {
+                                       removeClass(child.childNodes[isGe], 'incremental');
+                               }
+                       } else {
+                               incrementals[incrementals.length] = child;
+                       }
+               }
+               incrementals = incrementals.concat(getIncrementals(child));
+       }
+       return incrementals;
+}
+
+function createIncrementals() {
+       var incrementals = new Array();
+       for (var i = 0; i < smax; i++) {
+               incrementals[i] = getIncrementals(document.getElementById('slide'+i));
+       }
+       return incrementals;
+}
+
+function trap(e) {
+       if (!e) {
+               e = event;
+               e.which = e.keyCode;
+       }
+       try {
+               modifierKey = e.ctrlKey || e.altKey || e.metaKey;
+       }
+       catch(e) {
+               modifierKey = false;
+       }
+       return modifierKey || e.which == 0;
+}
+
+// notes extension
+function noteLabel() { // Gives notes id's to match parent slides
+       var notes = GetElementsWithClassName('div','notes');
+       for (var i = 0; i < notes.length; i++) {
+               var note = notes[i];
+               var id = 'note' + note.parentNode.id.substring(5);
+               note.setAttribute('id',id);
+       }
+       resetElapsedSlide();
+       resetRemainingTime();
+       window.setInterval('updateElaspedTime()', 1000);
+}
+
+function createNotesWindow() { // creates a window for our notes
+       if (!s5NotesWindow || s5NotesWindow.closed) { // Create the window if it doesn't exist
+               s5NotesWindowLoaded = false;
+               // Note: Safari has a tendency to ignore window options preferring to default to the settings of the parent window, grr.
+               s5NotesWindow = window.open('ui/s5-notes.html', 's5NotesWindow', 'top=0,left=0');
+       }
+       if (s5NotesWindowLoaded) { // Load the current note if the Note HTML has loaded
+               loadNote();
+       } else { // Keep trying...
+               window.setTimeout('createNotesWindow()', 50);
+       }
+}
+
+function loadNote() {
+// Loads a note into the note window
+       var notes = nextNotes = '<em class="disclaimer">There are no notes for this slide.</em>';
+       if (document.getElementById('note' + snum)) {
+               notes = document.getElementById('note' + snum).innerHTML;
+       }
+       if (document.getElementById('note' + (snum + 1))) {
+               nextNotes = document.getElementById('note' + (snum + 1)).innerHTML;
+       }
+       
+       var jl = document.getElementById('jumplist');
+       var slideTitle = jl.options[jl.selectedIndex].text.replace(/^\d+\s+:\s+/, '') + ((jl.selectedIndex) ? ' (' + jl.selectedIndex + '/' + (smax - 1) + ')' : '');
+       if (incrementals[snum].length > 0) {
+               slideTitle += ' <small>[' + incpos + '/' + incrementals[snum].length + ']</small>';
+       }
+       if (jl.selectedIndex < smax - 1) {
+               var nextTitle = jl.options[jl.selectedIndex + 1].text.replace(/^\d+\s+:\s+/, '') + ((jl.selectedIndex + 1) ? ' (' + (jl.selectedIndex + 1) + '/' + (smax - 1) + ')' : '');
+       } else {
+               var nextTitle = '[end of slide show]';
+       }
+       
+       if (s5NotesWindow && !s5NotesWindow.closed && s5NotesWindow.document) {
+               s5NotesWindow.document.getElementById('slide').innerHTML = slideTitle;
+               s5NotesWindow.document.getElementById('notes').innerHTML = notes;
+               s5NotesWindow.document.getElementById('next').innerHTML = nextTitle;
+               s5NotesWindow.document.getElementById('nextnotes').innerHTML = nextNotes;
+       }
+       resetElapsedSlide();
+}
+
+function minimizeTimer(id) {
+       var obj = s5NotesWindow.document.getElementById(id);
+       if (hasClass(obj,'collapsed')) {
+               removeClass(obj,'collapsed');
+       } else {
+               addClass(obj,'collapsed');
+       }
+}
+
+function resetElapsedTime() {
+       presentationStart = new Date();
+       slideStart = new Date();
+       updateElaspedTime();
+}
+
+function resetElapsedSlide() {
+       if (snum != previousSlide) {
+               slideStart = new Date();
+               previousSlide = snum;
+               updateElaspedTime();
+       }
+}
+
+function updateElaspedTime() {
+       if (!s5NotesWindowLoaded || !s5NotesWindow || s5NotesWindow.closed) return;
+       var now = new Date();
+       var ep = s5NotesWindow.document.getElementById('elapsed-presentation');
+       var es = s5NotesWindow.document.getElementById('elapsed-slide');
+       ep.innerHTML = formatTime(now.valueOf() - presentationStart.valueOf());
+       es.innerHTML = formatTime(now.valueOf() - slideStart.valueOf());
+}
+
+function resetRemainingTime() {
+       if (!s5NotesWindowLoaded || !s5NotesWindow || s5NotesWindow.closed) return;
+       var startField = s5NotesWindow.document.getElementById('startFrom');
+       startFrom = readTime(startField.value);
+       countdown.remaining = startFrom * 60000;  // convert to msecs
+       countdown.start = new Date().valueOf();
+       countdown.end = countdown.start + countdown.remaining;
+       var tl = s5NotesWindow.document.getElementById('timeLeft');
+       var timeLeft = formatTime(countdown.remaining);
+       tl.innerHTML = timeLeft;
+}
+
+function updateRemainingTime() {
+       if (!s5NotesWindowLoaded || !s5NotesWindow || s5NotesWindow.closed) return;
+       var tl = s5NotesWindow.document.getElementById('timeLeft');
+       var now = new Date();
+       if (countdown.state == 'run') {
+               countdown.remaining = countdown.end - now;
+       }
+       tl.style.color = '';
+       tl.style.backgroundColor = '';
+       if (countdown.remaining >= 0) {
+               var timeLeft = formatTime(countdown.remaining);
+               removeClass(tl,'overtime');
+               if (countdown.remaining < 300000) {
+                       tl.style.color = 'rgb(' + (255-Math.round(countdown.remaining/2000)) + ',0,0)';
+                       tl.style.backgroundColor = 'rgb(255,255,' + (Math.round(countdown.remaining/2000)) + ')';
+               }
+       } else {
+               var timeLeft = '-' + formatTime(-countdown.remaining);
+               addClass(tl,'overtime');
+       }
+       tl.innerHTML = timeLeft;
+}
+
+function toggleRemainingTime() {
+       if (countdown.state == 'pause') countdown.state = 'run'; else countdown.state = 'pause';
+       if (countdown.state == 'pause') {
+               window.clearInterval(countdown.timer);
+       }
+       if (countdown.state == 'run') {
+               countdown.start = new Date().valueOf();
+               countdown.end = countdown.start + countdown.remaining;
+               countdown.timer = window.setInterval('updateRemainingTime()', 1000);
+       }
+}
+
+function alterRemainingTime(amt) {
+       var change = amt * 60000;  // convert to msecs
+       countdown.end += change;
+       countdown.remaining += change;
+       updateRemainingTime();
+}
+
+function formatTime(msecs)  {
+       var time = new Date(msecs);
+       
+       var hrs = time.getUTCHours() + ((time.getUTCDate() -1) * 24); // I doubt anyone will spend more than 24 hours on a presentation or single slide but just in case...
+       hrs = (hrs < 10) ? '0'+hrs : hrs;
+       if (hrs == 'NaN' || isNaN(hrs)) hrs = '--';
+       
+       var min = time.getUTCMinutes();
+       min = (min < 10) ? '0'+min : min;
+       if (min == 'NaN' || isNaN(min)) min = '--';
+       
+       var sec = time.getUTCSeconds();
+       sec = (sec < 10) ? '0'+sec : sec;
+       if (sec == 'NaN' || isNaN(sec)) sec = '--';
+
+       return hrs + ':' + min + ':' + sec;
+}
+
+function readTime(val) {
+       var sregex = /:/;
+       var matches = sregex.exec(val);
+       if (matches == null) {
+               return val;
+       } else {
+               var times = val.split(':');
+               var hours = parseInt(times[0]);
+               var mins = parseInt(times[1]);
+               var total = (hours * 60) + mins;
+               return total;
+       }
+}
+// notes extension
+
+// startup process
+function createSlideShow() {
+       defaultCheck(); 
+       if(!isIE) createDetector(); // (degrade IE) scalable images extension 
+       if(opac!=0 || isIE) { // &&!isIE (degrade IE)
+               tranSitions = false;
+               fadeModus = false;
+       }
+       if(tranSitions && document.getElementById && document.createElement){
+               createProgress();
+               var nop=document.getElementById('StartupControl');
+               nop.onload = dumpProgress;
+       }else {
+               startup();
+               showAll();
+               setListPos(true); // invisible select extension
+               panelSetup();
+               audioSetup(); // audio extension
+               if(isS2 && firstTime>=1) {
+                       generateCanvas(); // dynamic canvas extension
+               } firstTime = 0;
+       }
+}
+
+function defaultCheck() {
+       var allMetas = document.getElementsByTagName('meta');
+       for (var i = 0; i< allMetas.length; i++) {
+               if (allMetas[i].name == 'defaultView') {
+                       defaultView = allMetas[i].content;
+               }
+               if (allMetas[i].name == 'controlVis') {
+                       controlVis = allMetas[i].content;
+               }
+               if (allMetas[i].name == 'tranSitions') {
+                       tranSitions = (allMetas[i].content == "true") ? true : false;
+                       fadeModus = (tranSitions == true) ? true : false;
+               }
+               if (allMetas[i].name == 'fadeDuration') {
+                       var tmp = parseInt(allMetas[i].content);
+                       fadeDuration = Math.max(200,Math.min(tmp,2000));
+               }
+               if (allMetas[i].name == 'incrDuration') {
+                       var tmp = parseInt(allMetas[i].content);
+                       incrDuration = Math.max(50,Math.min(tmp,500));
+               }
+               if (allMetas[i].name == 'autoMatic') {
+                       autoMatic = (allMetas[i].content == "true") ? true : false;
+               }
+               if (allMetas[i].name == 'playLoop') {
+                       playLoop = (allMetas[i].content == "true") ? true : false;
+               }
+               if (allMetas[i].name == 'playDelay') {
+                       var tmp = parseInt(allMetas[i].content);
+                       playDelay = Math.max(5,Math.min(tmp,90))*1000;
+                       playDelay = (fadeModus == true) ? (playDelay+(2*fadeDuration)) : playDelay;
+               }
+               if (allMetas[i].name == 'audioSupport') {
+                       audioSupport = (allMetas[i].content == "true") ? true : false;
+               }
+               if (allMetas[i].name == 'audioVolume') {
+                       var tmp = parseInt(allMetas[i].content);
+                       audioVolume = Math.max(0,Math.min(tmp,100));
+               }
+               if (allMetas[i].name == 'audioError') {
+                       audioError = (allMetas[i].content == "true") ? true : false;
+               }                                               
+       }
+}
+
+function createProgress() {
+       var obj = document.getElementsByTagName("body")[0].firstChild;
+       var pg = document.createElement('div');
+       pg.id = "StartupProgress";
+       pg.style.position = 'absolute';
+       pg.style.left = 0 + 'px';
+       pg.style.top = 0 + 'px';
+       pg.style.width = 100 + '%';\r
+       pg.style.height = 100 + '%';
+       pg.style.margin = 0 + 'px';
+       pg.style.padding = 0 + 'px';
+       if (isIE) {
+               pg.style.filter = "alpha(opacity=100)"; 
+       }else {
+               pg.style.opacity = 1.0;
+       }\r      pg.style.zIndex = 9999;
+       pg.style.backgroundColor="rgb(255, 255, 255)";
+       pg.style.textAlign = "center";\r pg.style.verticalAlign = "middle";
+       pg.style.backgroundPosition="center center";
+       pg.style.backgroundRepeat="no-repeat";
+       pg.style.backgroundImage="url(ui/graphic_support/progress.gif)";
+       document.getElementsByTagName("body")[0].insertBefore(pg,obj);
+
+       var im = document.createElement('img');
+       im.id = "StartupControl";
+       im.src = "ui/graphic_support/blank.gif?" + new Date().valueOf();
+       document.getElementsByTagName("body")[0].appendChild(im);
+}
+
+function startup() {
+       createControls(); // hallvord
+       slideLabel();
+       incrementals = createIncrementals();
+       noteLabel(); // [SI:060104] must follow slideLabel()
+       loadNote();
+       fixLinks();
+       externalLinks();
+       fontScale();
+       if (!isOp) {
+               notOperaFix();
+       }else if(isOp) {
+               document.getElementById('exit').style.visibility = 'hidden';
+               document.getElementById('toggle').style.visibility = 'hidden';
+               document.getElementById('list').style.visibility = 'hidden';
+               document.getElementById('jumplist').style.visibility = 'hidden';
+               document.getElementById('audioLinks').style.display = 'none';
+       }
+       slideJump();
+       if (defaultView == 'outline') toggle();
+       document.onkeyup = keys;
+       document.onkeypress = trap;
+       document.onclick = clicker;
+}
+
+function preloadImgages() {
+       var temp = '';
+       var objects = document.getElementsByTagName('img');
+       for (var i=0; i < objects.length; i++) {
+               if(objects[i].src != '') {\r
+                       temp = new Image(); 
+                       temp.src = objects[i].src;\r
+               }\r
+       }
+}
+
+function showAll() {
+       var obj1 = GetElementsWithClassName('div','presentation')[0];
+       if(!obj1) var obj1 = GetElementsWithClassName('ol','presentation')[0];
+       var obj2 = GetElementsWithClassName('div','layout')[0];
+       if(!obj1){}else {obj1.style.display = 'block'};
+       if(!obj2){}else {obj2.style.display = 'block'};
+}
+
+function dumpProgress() {
+       document.body.removeChild(document.getElementById('StartupControl'));
+       startup();
+       preloadImgages();
+       showAll();
+       createSoundManagerScript();
+       shiftOpacity('StartupProgress',1000);
+       window.setTimeout("removeProgress()",1000);\r}
+
+function removeProgress() {
+       document.body.removeChild(document.getElementById('StartupProgress'));
+       setListPos(true); // invisible select extension
+       panelSetup();
+       audioSetup(); // audio extension
+       if(isS2 && firstTime>=1) {
+               generateCanvas(); // dynamic canvas extension
+       } firstTime = 0;
+}
+function panelSetup() {
+       if(playPause) document.getElementById('pause').style.color=highLight;
+       if(playLoop) document.getElementById('loop').style.color=highLight;
+       if(audioSupport && !isIE && !isOp) document.getElementById('audio').style.color=highLight;
+       if(fadeModus && !isIE) document.getElementById('fade').style.color=highLight;
+       if(autoMatic) {
+               document.getElementById('auto').style.color=highLight; 
+               startPlay();
+       }
+       if(audioVolume && !isIE && !isOp) {
+               var idx = 0;
+               if(audioVolume >= 95 && audioVolume <= 100) {idx = 0;}
+               else if(audioVolume >= 85 && audioVolume < 95) {idx = 1;}
+               else if(audioVolume >= 75 && audioVolume < 85) {idx = 2;}
+               else if(audioVolume >= 65 && audioVolume < 75) {idx = 3;}
+               else if(audioVolume >= 55 && audioVolume < 65) {idx = 4;}
+               else if(audioVolume >= 45 && audioVolume < 55) {idx = 5;}
+               else if(audioVolume >= 35 && audioVolume < 45) {idx = 6;}
+               else if(audioVolume >= 25 && audioVolume < 35) {idx = 7;}
+               else if(audioVolume >= 15 && audioVolume < 25) {idx = 8;}
+               else if(audioVolume >= 5 && audioVolume < 15) {idx = 9;}
+               else {idx = 10;}
+               document.getElementById('volumelist').selectedIndex = idx;
+       }
+}
+// startup process
+
+// shutdown process
+function byby() {
+       stopPlay();
+       if(tranSitions && fadeModus && s5mode && !isOp) {
+               fadeoutSound(curSoundID,true); // audio support
+               var pg = document.createElement('div');
+               pg.id = "GoodBy";
+               pg.style.position = 'absolute';
+               pg.style.left = 0 + 'px';
+               pg.style.top = 0 + 'px';
+               pg.style.width = 100 + '%';\r
+               pg.style.height = 100 + '%';
+               pg.style.margin = 0 + 'px';
+               pg.style.padding = 0 + 'px';
+               if (isIE) {
+                       pg.style.filter = "alpha(opacity=0)";   
+               }else {
+                       pg.style.opacity = 0.0;
+               }\r              pg.style.zIndex = 9999;
+               pg.style.backgroundColor="rgb(255, 255, 255)";
+               pg.style.textAlign = "center";\r         pg.style.verticalAlign = "middle";
+               pg.style.backgroundPosition="center center";
+               pg.style.backgroundRepeat="no-repeat";
+               pg.style.backgroundImage="url(ui/graphic_support/finish.gif)";          
+               document.getElementsByTagName("body")[0].appendChild(pg);
+               shiftOpacity('GoodBy',1000);
+               window.setTimeout("history.back()",1000);\r      }else {
+               stopSound(curSoundID); 
+               history.back();
+       }
+}
+// shutdown process
+
+// scalable images extension
+function createDetector() {
+       var em = document.createElement('div');\r
+       em.id='EMSizeControl'; em.style.position="absolute"; em.style.left="-999px";
+       em.style.width="1em"; em.style.height="1em"; em.style.opacity=0.0;\r
+       document.getElementsByTagName("body")[0].appendChild(em);
+       var nop=document.getElementById('EMSizeControl');\r
+       if(!nop||findPosX(nop)!=-999) {}else {
+               opac=document.getElementById('EMSizeControl').style.opacity;
+               empx=document.getElementById('EMSizeControl').offsetHeight;
+               document.body.removeChild(document.getElementById('EMSizeControl'));
+               var objects = document.getElementsByTagName('img'); 
+               var j = 0; var i = 0; var k = 0; var d; var obj;
+               for (i=0; i < objects.length; i++) {
+                       if(objects[i].className.match(/^scale/i)) {\r
+                               images[j] = objects[i];\r
+                               ++j;\r
+                       }\r
+               }               
+               var objects = document.getElementsByTagName('canvas'); j = 0; 
+               for (i=0; i < objects.length; i++) {
+                       if(objects[i].className.match(/^scale/i)) {\r
+                               canvas[objects[i].id] = objects[i];
+                               if(j==0) {
+                                       if(objects[i].getContext) {
+                                               canvasSupport = true;
+                                       }
+                                       ++j;
+                               }\r
+                       }\r
+               }       
+               if(canvasSupport!=true) {
+                       for (d in canvas) {
+                               canvas[d].setAttribute("width",1); 
+                               canvas[d].setAttribute("height",1); 
+                       } 
+               }       
+               var objects = document.getElementsByTagName('table'); 
+               j = 0; k = 0; l = 0; var w; var h; var tmp; var cnt;
+               for (i=0; i < objects.length; i++) {
+                       if(objects[i].className.match(/^piechart/i)) {
+                               tmp = objects[i].id;
+                               cnt = tmp.split("_");
+                               obj = cnt[0] + "_canvas";
+                               if(canvas[obj]) {
+                                       w = canvas[obj].getAttribute("width");
+                                       h = canvas[obj].getAttribute("height");
+                                       if(w>0&&h>0) {
+                                               piecharts[j] = objects[i];
+                                               em = piecharts[j].getAttribute("summary");
+                                               if(em != "") em = "," + em;
+                                               piecharts[j].setAttribute("summary", w + "," + h + em);
+                                               ++j;
+                                       }
+                               }\r
+                       }
+                       if(objects[i].className.match(/^barchart/i)) {
+                               tmp = objects[i].id;
+                               cnt = tmp.split("_");
+                               obj = cnt[0] + "_canvas";
+                               if(canvas[obj]) {
+                                       w = canvas[obj].getAttribute("width");
+                                       h = canvas[obj].getAttribute("height");
+                                       if(w>0&&h>0) {
+                                               barcharts[k] = objects[i];
+                                               em = barcharts[k].getAttribute("summary");
+                                               if(em != "") em = "," + em;
+                                               barcharts[k].setAttribute("summary", w + "," + h + em);
+                                               ++k;
+                                       }
+                               }\r
+                       }
+                       if(objects[i].className.match(/^linechart/i)) {
+                               tmp = objects[i].id;
+                               cnt = tmp.split("_");
+                               obj = cnt[0] + "_canvas";
+                               if(canvas[obj]) {
+                                       w = canvas[obj].getAttribute("width");
+                                       h = canvas[obj].getAttribute("height");
+                                       if(w>0&&h>0) {
+                                               linecharts[l] = objects[i];
+                                               em = linecharts[l].getAttribute("summary");
+                                               if(em != "") em = "," + em;
+                                               linecharts[l].setAttribute("summary", w + "," + h + em);
+                                               ++l;
+                                       }
+                               }\r
+                       }\r
+               }       
+               objects = document.getElementsByTagName('object'); j = 0; i = 0;
+               for (i=0; i < objects.length; i++) {
+                       if(objects[i].className.match(/^scale/i)) {\r
+                               medias[j] = objects[i]; ++j;
+                               if(!isIE) {
+                                       if(objects[i].getAttributeNode("classid")) objects[i].removeAttributeNode(objects[i].getAttributeNode("classid"));
+                                       if(objects[i].getAttributeNode("codebase")) objects[i].removeAttributeNode(objects[i].getAttributeNode("codebase"));
+                               }\r
+                       }\r
+               }
+       }
+}
+function extendImgSizes(f) {
+       if(empx>0) {
+               var q = (f/empx); var w = 0; var h = 0;
+               for(var i=0; i < images.length; i++) {\r
+                       w=images[i].getAttribute("width",0); 
+                       h=images[i].getAttribute("height",0);
+                       if(w>0&&h>0) {
+                               images[i].style.width=Math.floor(w*q)+"px";\r                            images[i].style.height=Math.floor(h*q)+"px";
+                       }
+               }
+       }\r
+}
+
+function extendCanSizes(f) {
+       if(empx>0 && canvasSupport) {
+               var q = (f/empx); var w = 0; var h = 0; var tmp = ""; var cnt; var obj;
+               for(var i=0; i < piecharts.length; i++) {
+                       if(piecharts[i].getAttribute("summary")) {
+                               tmp = piecharts[i].getAttribute("summary");
+                               cnt = tmp.split(",");
+                               if(cnt[0].match(/^[1-9][0-9]+/)) w = parseInt(cnt[0]);
+                               if(cnt[1].match(/^[1-9][0-9]+/)) h = parseInt(cnt[1]);
+                               if(w>0&&h>0) {
+                                       tmp = piecharts[i].id;
+                                       cnt = tmp.split("_");
+                                       obj = cnt[0] + "_canvas";                                       
+                                       canvas[obj].setAttribute("width",Math.floor(w*q)); 
+                                       canvas[obj].setAttribute("height",Math.floor(h*q));
+                                       canvas[obj].style.width=Math.floor(w*q)+"px";\r                                  canvas[obj].style.height=Math.floor(h*q)+"px";
+                               }
+                       }
+               }
+               for(var i=0; i < barcharts.length; i++) {
+                       if(barcharts[i].getAttribute("summary")) {
+                               tmp = barcharts[i].getAttribute("summary");
+                               cnt = tmp.split(",");
+                               if(cnt[0].match(/^[1-9][0-9]+/)) w = parseInt(cnt[0]);
+                               if(cnt[1].match(/^[1-9][0-9]+/)) h = parseInt(cnt[1]);
+                               if(w>0&&h>0) {
+                                       tmp = barcharts[i].id;
+                                       cnt = tmp.split("_");
+                                       obj = cnt[0] + "_canvas";                                       
+                                       canvas[obj].setAttribute("width",Math.floor(w*q)); 
+                                       canvas[obj].setAttribute("height",Math.floor(h*q));
+                                       canvas[obj].style.width=Math.floor(w*q)+"px";\r                                  canvas[obj].style.height=Math.floor(h*q)+"px";
+                               }
+                       }
+               }
+               for(var i=0; i < linecharts.length; i++) {
+                       if(linecharts[i].getAttribute("summary")) {
+                               tmp = linecharts[i].getAttribute("summary");
+                               cnt = tmp.split(",");
+                               if(cnt[0].match(/^[1-9][0-9]+/)) w = parseInt(cnt[0]);
+                               if(cnt[1].match(/^[1-9][0-9]+/)) h = parseInt(cnt[1]);
+                               if(w>0&&h>0) {
+                                       tmp = linecharts[i].id;
+                                       cnt = tmp.split("_");
+                                       obj = cnt[0] + "_canvas";                                       
+                                       canvas[obj].setAttribute("width",Math.floor(w*q)); 
+                                       canvas[obj].setAttribute("height",Math.floor(h*q));
+                                       canvas[obj].style.width=Math.floor(w*q)+"px";\r                                  canvas[obj].style.height=Math.floor(h*q)+"px";
+                               }
+                       }
+               }
+       }\r
+}
+function extendObjSizes(f) {
+       if(empx>0) {
+               var q = (f/empx); var w = 0; var h = 0;
+               for(var i=0; i < medias.length; i++) {\r
+                       w=medias[i].getAttribute("width",0); 
+                       h=medias[i].getAttribute("height",0);
+                       if(w>0&&h>0) {
+                               medias[i].style.width=Math.floor(w*q)+"px";\r                            medias[i].style.height=Math.floor(h*q)+"px";
+                       }
+               }
+       }\r
+}
+function findPosX(obj) {\r
+       var posLeft = 0;\r
+       while (obj.offsetParent) {\r
+               posLeft += obj.offsetLeft;\r
+               obj = obj.offsetParent;\r
+       }\r
+       return posLeft;\r
+}
+function findPosY(obj) {\r
+       var posTop = 0;\r
+       while (obj.offsetParent) {\r
+               posTop += obj.offsetTop;\r
+               obj = obj.offsetParent;\r
+       }\r
+       return posTop;\r
+}\r
+// scalable images extension
+
+// canvas chart extension
+function deg2rad(degrees) {
+       return Math.PI *degrees/180;
+}
+function rad2deg(radians) {
+       return 180.0 *radians/Math.PI;
+}
+function circle_point_x(radians, diameter) {
+       var x = Math.cos(radians)*(diameter/2);
+       return x;
+}
+function circle_point_y(radians, diameter) {
+       var y = Math.sin(radians)*(diameter/2);
+       return y;
+}
+function roundTo(val,dig) {
+       var num = val;
+       if (val > 8191 && val < 10485) {
+               val = val-5000;
+               num = Math.round(val*Math.pow(10,dig))/Math.pow(10,dig);
+               num = num+5000;
+       } else {
+               num = Math.round(val*Math.pow(10,dig))/Math.pow(10,dig);
+       }
+       return num;
+}
+function searchColor(value) {
+       for (var dat in colorNames) {
+               if(dat==value) return colorNames[dat];
+    }
+    return false;
+}
+function scanColor(value) {
+       if(value.match(/^#[0-9a-f][0-9a-f][0-9a-f]$/i)) {
+               var val1 = value.substr(1,1).toLowerCase();
+               var val2 = value.substr(2,1).toLowerCase();
+               var val3 = value.substr(3,1).toLowerCase();
+               value = '#' + val1 + val1 + val2 + val2 + val3 + val3;
+       }
+       if(!value.match(/^#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]$/i)) {
+               var tmp = searchColor(value.toLowerCase());
+               if(!tmp) {}else{value = tmp;}
+       }
+       if(!value.match(/^#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]$/i)) {
+               value = '#000000';
+       }
+       return value.toLowerCase();
+}
+function hex2rgb(val,trans) {
+       if(val.length==7) {
+               var tp1 = Math.max(0,Math.min(parseInt(val.substr(1,2),16),255));
+               var tp2 = Math.max(0,Math.min(parseInt(val.substr(3,2),16),255));
+               var tp3 = Math.max(0,Math.min(parseInt(val.substr(5,2),16),255));
+               return 'rgba(' + tp1 + ',' + tp2 + ',' + tp3 + ',' + trans + ')';
+       }
+}
+function trim(str) {
+    return (str.replace(/\s+$/,"").replace(/^\s+/,""));
+}
+function roundedRect(ctx,x,y,width,height,radius){
+       ctx.beginPath();
+       ctx.moveTo(x,y+radius);
+       ctx.lineTo(x,y+height-radius);
+       ctx.quadraticCurveTo(x,y+height,x+radius,y+height);
+       ctx.lineTo(x+width-radius,y+height);
+       ctx.quadraticCurveTo(x+width,y+height,x+width,y+height-radius);
+       ctx.lineTo(x+width,y+radius);
+       ctx.quadraticCurveTo(x+width,y,x+width-radius,y);
+       ctx.lineTo(x+radius,y);
+       ctx.quadraticCurveTo(x,y,x,y+radius);
+       ctx.closePath();
+}
+function drawString(ctx, text, fc, tx, ty) {
+       var xp = 0; var c = "";
+       ctx.beginPath();
+       for (var i = 0; i < text.length; i++) {
+               c = text[i];
+               ctx.drawImage(font, signs[c].sx, signs[c].sy, signs[c].sw, signs[c].sh, tx+xp, ty, signs[c].sw*fc, signs[c].sh*fc);
+               xp += (signs[c].sw*fc);
+       }
+       ctx.closePath();
+}
+function strokeString(ctx, txt, col, fh, tx, ty) {
+       var fw = fh*0.666666; var lw = fh*0.125;  
+       var ls = lw/2; var cr = lw; var xp = 0; 
+       ctx.lineCap = "round"; ctx.lineJoin = "round"
+       ctx.lineWidth = lw; ctx.strokeStyle = col;
+       for (var i = 0; i < txt.length; i++) {
+               strokeSymbol(ctx, txt[i], ls, tx+xp, ty, fw, fh);
+               xp += (txt[i]!="."?fw+cr:(fw/2)+cr);
+       }
+}
+function strokeSymbol(ctx, symbol, fc, cx, cy, cw, ch) {
+       ctx.beginPath();
+       switch (symbol) {
+               case "0":
+                       ctx.moveTo(cx+fc,cy+(ch*0.333333));
+                       ctx.arc(cx+(cw/2),cy+(cw/2),(cw/2)-fc,deg2rad(180),0, false);
+                       ctx.arc(cx+(cw/2),(cy+ch)-(cw/2),(cw/2)-fc,0,deg2rad(180), false);
+                       ctx.closePath();
+               break;
+               case "1":
+                       ctx.moveTo(cx+(cw*0.1)+fc,cy+ch-fc);
+                       ctx.lineTo(cx+cw-fc,cy+ch-fc);
+                       ctx.moveTo(cx+(cw*0.666666),cy+ch-fc);
+                       ctx.lineTo(cx+(cw*0.666666),cy+fc);
+                       ctx.lineTo(cx+(cw*0.25),cy+(ch*0.25));
+               break;
+               case "2":
+                       ctx.moveTo(cx+cw-fc,cy+(ch*0.8));
+                       ctx.lineTo(cx+cw-fc,cy+ch-fc);
+                       ctx.lineTo(cx+fc,cy+ch-fc);
+                       ctx.arc(cx+(cw/2),cy+(cw*0.425),(cw*0.425)-fc,deg2rad(45),deg2rad(-180), true);
+               break;
+               case "3":
+                       ctx.moveTo(cx+(cw*0.1)+fc,cy+fc);
+                       ctx.lineTo(cx+(cw*0.9)-fc,cy+fc);
+                       ctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-90),deg2rad(180), false);
+               break;
+               case "4":
+                       ctx.moveTo(cx+(cw*0.75),cy+ch-fc);
+                       ctx.lineTo(cx+(cw*0.75),cy+fc);
+                       ctx.moveTo(cx+cw-fc,cy+(ch*0.666666));
+                       ctx.lineTo(cx+fc,cy+(ch*0.666666));
+                       ctx.lineTo(cx+(cw*0.75),cy+fc);
+                       ctx.moveTo(cx+cw-fc,cy+ch-fc);
+                       ctx.lineTo(cx+(cw*0.5),cy+ch-fc);
+               break;
+               case "5":
+                       ctx.moveTo(cx+(cw*0.9)-fc,cy+fc);
+                       ctx.lineTo(cx+(cw*0.1)+fc,cy+fc);
+                       ctx.lineTo(cx+(cw*0.1)+fc,cy+(ch*0.333333));
+                       ctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-80),deg2rad(180), false);
+               break;
+               case "6":
+                       ctx.moveTo(cx+fc,cy+ch-(cw*0.5)-fc);
+                       ctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-180),deg2rad(180), false);
+                       ctx.bezierCurveTo(cx+fc,cy+fc,cx+fc,cy+fc,cx+(cw*0.9)-fc,cy+fc);
+                       ctx.moveTo(cx+(cw*0.9)-fc,cy+fc);
+               break;
+               case "7":
+                       ctx.moveTo(cx+(cw*0.5),cy+ch-fc);
+                       ctx.lineTo(cx+cw-fc,cy+fc);
+                       ctx.lineTo(cx+(cw*0.1)+fc,cy+fc);
+                       ctx.lineTo(cx+(cw*0.1)+fc,cy+(ch*0.25)-fc);
+               break;
+               case "8":
+                       ctx.moveTo(cx+(cw*0.92)-fc,cy+(cw*0.59));
+                       ctx.arc(cx+(cw/2),cy+(cw*0.45),(cw*0.45)-fc,deg2rad(25),deg2rad(-205), true);
+                       ctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-135),deg2rad(-45), true);
+                       ctx.closePath();
+                       ctx.moveTo(cx+(cw*0.79),cy+(ch*0.47));
+                       ctx.lineTo(cx+(cw*0.21),cy+(ch*0.47));
+               break;
+               case "9":
+                       ctx.moveTo(cx+cw-fc,cy+(cw*0.5));
+                       ctx.arc(cx+(cw/2),cy+(cw*0.5),(cw*0.5)-fc,deg2rad(0),deg2rad(360), false);
+                       ctx.bezierCurveTo(cx+cw-fc,cy+ch-fc,cx+cw-fc,cy+ch-fc,cx+(cw*0.1)+fc,cy+ch-fc);
+               break;
+               case "%":
+                       ctx.moveTo(cx+fc,cy+(ch*0.75));
+                       ctx.lineTo(cx+cw-fc,cy+(ch*0.25));
+                       ctx.moveTo(cx+(cw*0.505),cy+(cw*0.3));
+                       ctx.arc(cx+(cw*0.3),cy+(cw*0.3),(cw*0.3)-fc,deg2rad(0),deg2rad(360), false);
+                       ctx.moveTo(cx+(cw*0.905),cy+ch-(cw*0.3));
+                       ctx.arc(cx+(cw*0.7),cy+ch-(cw*0.3),(cw*0.3)-fc,deg2rad(0),deg2rad(360), false);
+               break;
+               case ".":
+                       ctx.moveTo(cx+(cw*0.25),cy+ch-fc-fc);
+                       ctx.arc(cx+(cw*0.25),cy+ch-fc-fc,fc,deg2rad(0),deg2rad(360), false);
+                       ctx.closePath();
+               break;
+               default:
+               break;
+       }       
+       ctx.stroke();
+}
+function drawBar(ctx,x,y,width,height,color,value,textdiv){
+       var rw = width/2; var rh = rw/2;
+       height = Math.max(height,rw);
+       var dh = Math.max(height-(2*rh),0.1); var S2L;  
+       var xx = rw/8; var yy = rh/4; 
+       var yo = rh/2; y = y - yy;      
+       if(canvas_noshadow <= 0 && canvas_noshade <= 0) {
+               ctx.save();
+               S2L = ctx.createRadialGradient(x+rw+rh,y+height-rw+yy+rh,0,x+rw,y+height-rw+yy,rw);
+               S2L.addColorStop(0, 'rgba(0,0,0,0.5)');
+               S2L.addColorStop(0.7, 'rgba(0,0,0,0.25)');      
+               S2L.addColorStop(0.9, 'rgba(0,0,0,0.1)');       
+               S2L.addColorStop(1, 'rgba(0,0,0,0)');   
+               ctx.fillStyle = S2L;
+               ctx.scale(1,0.5);
+               ctx.translate(xx,y+height+yy);
+               if(isOp){
+                       ctx.fillRect(x,y+yy+height-width,width,width);
+               }else {
+                       ctx.arc(x+rw,y+yy+height-width,width,0,deg2rad(360), false);
+                       ctx.fill();     
+               }
+               ctx.restore();
+       }else if(canvas_noshadow <= 0 && canvas_noshade >= 1) {
+               ctx.fillStyle = 'rgba(0,0,0,0.2)';
+               ctx.fillRect(x+yo,y+rh+yo+yo,width,dh);
+       }
+
+       if(canvas_noshade <= 0) {
+               ctx.beginPath();
+               ctx.moveTo(x,y+rh);
+               ctx.lineTo(x,y+rh+dh);
+               ctx.bezierCurveTo(x,y+height,x+width,y+height,x+width,y+rh+dh)
+               ctx.lineTo(x+width,y+rh);
+               ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
+               ctx.closePath();
+               ctx.fillStyle = color;
+               ctx.fill();
+               S2L = ctx.createLinearGradient(x,y+(height/2),x+width,y+(height/2));
+               S2L.addColorStop(0, 'rgba(255,255,255,0.75)');
+               S2L.addColorStop(0.2, 'rgba(255,255,255,0)');
+               S2L.addColorStop(0.3, 'rgba(0,0,0,0)');
+               S2L.addColorStop(0.5, 'rgba(0,0,0,0.1)');
+               S2L.addColorStop(0.9, 'rgba(0,0,0,0.35)');
+               S2L.addColorStop(1, 'rgba(0,0,0,0.3)');
+               ctx.beginPath();
+               ctx.moveTo(x,y+rh);
+               ctx.lineTo(x,y+rh+dh);
+               ctx.bezierCurveTo(x,y+height,x+width,y+height,x+width,y+rh+dh)
+               ctx.lineTo(x+width,y+rh);
+               ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
+               ctx.closePath();
+               ctx.fillStyle = S2L;
+               ctx.fill();
+               ctx.beginPath();
+               ctx.moveTo(x+width,y+rh);
+               ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
+               ctx.bezierCurveTo(x,y+(rh*2),x+width,y+(rh*2),x+width,y+rh)
+               ctx.closePath();
+               ctx.fillStyle = color;
+               ctx.fill();
+               S2L = ctx.createLinearGradient(x+rw-(width*0.15),y-2,x+rw+(width*0.15),y+(2.1*rh));
+               S2L.addColorStop(0, 'rgba(255,255,255,0.9)');
+               S2L.addColorStop(0.5, 'rgba(255,255,255,0)');
+               S2L.addColorStop(0.6, 'rgba(0,0,0,0)');
+               S2L.addColorStop(1, 'rgba(0,0,0,0.3)');
+               ctx.beginPath();
+               ctx.moveTo(x+width,y+rh);
+               ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
+               ctx.bezierCurveTo(x,y+(rh*2),x+width,y+(rh*2),x+width,y+rh)
+               ctx.closePath();
+               ctx.fillStyle = S2L;
+               ctx.fill();     
+               S2L = ctx.createLinearGradient(x+rw-(width*0.15),y-2,x+rw+(width*0.15),y+(2.1*rh));
+               S2L.addColorStop(0, 'rgba(255,255,255,0.9)');
+               S2L.addColorStop(0.5, 'rgba(255,255,255,0)');
+               S2L.addColorStop(0.6, 'rgba(0,0,0,0)');
+               S2L.addColorStop(1, 'rgba(0,0,0,0.1)'); 
+               ctx.beginPath();
+               ctx.moveTo(x+width,y+rh);
+               ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
+               ctx.bezierCurveTo(x,y+(rh*2),x+width,y+(rh*2),x+width,y+rh)
+               ctx.closePath();
+               ctx.strokeStyle = S2L;
+               ctx.stroke();
+       }else {
+               ctx.fillStyle = color;
+               ctx.fillRect(x,y+rh+yo,width,dh);
+       }
+       ctx.lineCap = "butt";
+       ctx.lineWidth = 1;
+       ctx.fillStyle = 'rgba(255,255,255,0.5)';
+       var bw = width; var bh = bw/4; 
+       var th = roundTo(bh*0.75,0); var tf = bh/80; 
+       var c; var w; 
+       if(canvas_notext <= 0) {
+               if(canvas_htmltext <= 0) {
+                       w = '"' + per + '"';
+                       if(w.indexOf(".")!=-1) {
+                               c = w.length+0.5;
+                               w = parseFloat(c-2)*parseFloat(48*tf);
+                               bw = parseFloat(c-1)*parseFloat(48*tf);
+                       }else {
+                               c = w.length;
+                               w = parseFloat(c-1)*parseFloat(48*tf);
+                               bw = parseFloat(c)*parseFloat(48*tf);
+                       }
+                       roundedRect(ctx,x+(width/2)-(bw/2),y,bw,bh,bh/4);
+                       ctx.fill();
+                       if(canvas_imgtext <= 0) {
+                               strokeString(ctx, value + "%","rgba(48,48,48,1)", th, x+(width/2)-(w/2), y+((bh-th)/2));
+                       }else {
+                               drawString(ctx, value + "%", tf, x+(width/2)-(w/2), y+((bh-th)/2.2));
+                       }
+               }else {
+                       var bh = bw/3; var th = roundTo(bh*0.75,0); 
+                       roundedRect(ctx,x,y,bw,bh,bh/4);
+                       ctx.fill();
+                       var obj = document.createElement('div');
+                       obj.style.position = "absolute";
+                       obj.style.overflow = "hidden";
+            obj.style.textAlign = "center";
+                       obj.style.width = bw + "px";
+                       obj.style.left = x + "px";
+                       obj.style.top = y+((bh-th)/2.2) + "px";
+                       obj.appendChild(document.createTextNode(per + "%"));                    
+                       textdiv.appendChild(obj);
+               }
+
+       }       
+}
+function drawLine(ctx,x,y,width,height,dist,array,factor,color,fill){
+       if(fill <= 0){
+               var style = hex2rgb(color,0.5);
+               ctx.lineJoin = "miter";
+               ctx.beginPath();
+               ctx.moveTo(x,y+height);
+               for (var i = 0; i < array.length; i++) {
+                       ctx.lineTo(x+(i*dist),y+height-(array[i]*factor));
+               }
+               ctx.lineTo(x+width,y+height);
+               ctx.lineTo(x,y+height);
+               ctx.closePath();
+               ctx.fillStyle = style;
+               ctx.fill();
+       }
+       ctx.lineJoin = "round";
+       ctx.beginPath();
+       ctx.moveTo(x,y+height-(array[0]*factor));
+       for (var i = 0; i < array.length; i++) {
+               ctx.lineTo(x+(i*dist),y+height-(array[i]*factor));
+       }
+       ctx.strokeStyle = color;
+       ctx.stroke();
+}
+function setDataURL(cid) {
+       if(cid.toDataURL) {
+               var obj = document.getElementById(cid.id + "_link");
+               if(obj) {
+                       obj.setAttribute("title", "To Data URL");
+                       obj.setAttribute("target", "_blank");
+                       obj.setAttribute("href", cid.toDataURL());
+               }
+       }
+}
+function get_input(dataobj,canvasobj,linechart) {
+       var table = document.getElementById(dataobj);
+       var canvas = document.getElementById(canvasobj);
+       var row; var clm; var cnt = 0; var val = 0; var nme = ""; var col = "";  
+       if(canvas.getContext) {
+               canvas_width = parseInt(canvas.style.width);
+               canvas_height = parseInt(canvas.style.height);
+               if(canvas_width >= 16 && canvas_height >= 16) {
+                       var tmp = table.getAttribute("summary");
+                       canvas_noshade = 0; canvas_noshadow = 0; 
+                       canvas_notext = 0; canvas_imgtext = 0;
+                       canvas_htmltext = 0; canvas_nofill = 0;
+                       if(tmp.search(/noshadow/) != -1) canvas_noshadow = 1;
+                       if(tmp.search(/noshade/) != -1) canvas_noshade = 1;
+                       if(tmp.search(/nofill/) != -1) canvas_nofill = 1;
+                       if(tmp.search(/notext/) != -1) canvas_notext = 1;
+                       if(tmp.search(/htmltext/) != -1) canvas_htmltext = 1;
+                       if(tmp.search(/imgtext/) != -1) canvas_imgtext = 1;
+                       if(table.getAttribute("bgcolor")) {
+                               canvas_bgcolor = scanColor(table.getAttribute("bgcolor"));
+                       }
+                       ChartData = new Array(); colorSlice = new Array();
+                       if(table.getElementsByTagName("tr")[0].getElementsByTagName("th")[0]) cnt = 1;
+                       for(var r = cnt; r < table.getElementsByTagName("tr").length; r++) {
+                               row = table.getElementsByTagName("tr")[r];
+                               clm = row.getElementsByTagName("td").length;
+                               if(row.getElementsByTagName("td")[0].getAttribute("bgcolor")) { 
+                                       col = scanColor(row.getElementsByTagName("td")[0].getAttribute("bgcolor")); val = 0;
+                                       nme = trim(row.getElementsByTagName("td")[1].innerHTML.replace(/<[^>]+>/g,""));
+                                       if(!linechart) {
+                                               if(clm > 3) {
+                                                       for(var z = 2; z < clm; z++) {
+                                                               val += parseFloat(row.getElementsByTagName("td")[z].innerHTML.replace(/<[^>]+>/g,""));
+                                                       }
+                                               }else {
+                                                       val = parseFloat(row.getElementsByTagName("td")[2].innerHTML.replace(/<[^>]+>/g,""));
+                                               }
+                                               if(!isNaN(val) && val > 0 && nme != '') {
+                                                       colorSlice[r-cnt] = col; ChartData[nme] = Math.abs(val);
+                                               }else {
+                                                       break;
+                                               }
+                                       }else {
+                                               val = 0; i = 0;
+                                               if(clm > 3 && nme != '') {
+                                                       ChartData[r-cnt] = new Array();
+                                                       colorSlice[r-cnt] = col;
+                                                       for(var z = 2; z < clm; z++) {
+                                                               val = Math.abs(parseFloat(row.getElementsByTagName("td")[z].innerHTML.replace(/<[^>]+>/g,"")));
+                                                               if(!isNaN(val) && val >= 0) {
+                                                                       ChartData[r-cnt][i] = val; i++;
+                                                               }else {
+                                                                       ChartData[r-cnt][i] = 0; i++;
+                                                               }                                                        \r
+                                                       }       
+                                               }else {
+                                                       break;
+                                               }                       
+                                       }                       
+                               }else {
+                                       break;
+                               }
+                       }
+               }       
+       }
+}
+function setPieChart(canvasobj,textobj) {
+       var cd = (Math.min(canvas_width,canvas_height)/110)*100;
+       var cp = cd*0.1; var cr = cd/2;
+       var sr = cr*0.93; var cw = cd+cp; var ch = cw;
+       var cx = (cd/2)+(cp/2); var cy = cx; var ct = 0;
+       for (var data in ChartData) {
+               ct += ChartData[data];
+       } 
+       var poc = ct/100;
+       var canvas = document.getElementById(canvasobj);
+       if(canvas_htmltext >= 1) {
+               if(document.getElementById(textobj)) {
+                       canvas.parentNode.removeChild(canvas.parentNode.lastChild);             
+               }
+       }       
+       if(canvas.getContext) {
+               var ctx = canvas.getContext('2d');
+               if(canvas_bgcolor != "") {
+                       ctx.fillStyle = canvas_bgcolor;
+                       ctx.fillRect(0,0,cw,ch);
+               }else {
+                       ctx.clearRect(0,0,cw,ch);
+               }
+               if(canvas_noshadow <= 0) {
+                       if(!isOp) { 
+                               ctx.beginPath();
+                               var B2B = ctx.createRadialGradient(cx+(cr*0.1),cy+(cr*0.1),cr,cx+(cr*0.1),cy+(cr*0.1),sr*0.9);
+                               B2B.addColorStop(0, 'rgba(0,0,0,0)');
+                               B2B.addColorStop(1, 'rgba(0,0,0,0.5)');
+                               ctx.arc(cx+(cr*0.1),cy+(cr*0.1),cr,0,deg2rad(360), false);
+                               ctx.closePath();
+                               ctx.fillStyle = B2B;
+                               ctx.fill();
+                       }else {
+                               var B2B = ctx.createRadialGradient(cx+(cr*0.1),cy+(cr*0.1),0,cx+(cr*0.1),cy+(cr*0.1),cr);\r
+                               B2B.addColorStop(0, 'rgba(0,0,0,0.5)');\r
+                               B2B.addColorStop(0.87, 'rgba(0,0,0,0.5)');\r
+                               B2B.addColorStop(1, 'rgba(0,0,0,0)');\r
+                               ctx.fillStyle = B2B;\r
+                               ctx.fillRect(0,0,cw,ch);\r
+                       }
+               }               
+               var val = 0; var deg = 0; var idx = 0; var data;
+               for (data in ChartData) {
+                       val = ChartData[data]; sdeg = deg;
+                       deg += (val/ct)*deg2rad(360); edeg = deg;
+                       ctx.beginPath();
+                       ctx.moveTo(cx,cy);
+                       ctx.arc(cx,cy,cr,sdeg,edeg, false);
+                       ctx.lineTo(cx,cy);
+                       ctx.closePath();
+                       ctx.fillStyle = colorSlice[(idx++)];
+                       ctx.fill();
+               } 
+               if(canvas_noshade <= 0) {
+                       ctx.beginPath();
+                       var W2T = ctx.createLinearGradient(cp*2,cp*2,cx,cy);
+                       W2T.addColorStop(0, 'rgba(255,255,255,0.8)');
+                       W2T.addColorStop(1, 'rgba(255,255,255,0)');
+                       ctx.moveTo(cx,cy);
+                       ctx.arc(cx,cy,sr,deg2rad(135),deg2rad(315), false);
+                       ctx.closePath();
+                       ctx.fillStyle = W2T;
+                       ctx.fill();
+                       ctx.beginPath();
+                       var T2B = ctx.createLinearGradient(cx,cy,cw-(cp*2),ch-(cp*2));
+                       T2B.addColorStop(0, 'rgba(0,0,0,0)');
+                       T2B.addColorStop(1, 'rgba(0,0,0,0.5)');
+                       ctx.moveTo(cx,cy);
+                       ctx.arc(cx,cy,sr,deg2rad(-45),deg2rad(135), false);
+                       ctx.closePath();
+                       ctx.fillStyle = T2B;
+                       ctx.fill();
+                       ctx.beginPath();
+                       var B2T = ctx.createLinearGradient(cx,cy,cw-(cp*1.9),ch-(cp*1.9));
+                       B2T.addColorStop(0, 'rgba(0,0,0,0)');
+                       B2T.addColorStop(1, 'rgba(0,0,0,0.6)');
+                       ctx.lineWidth = cr*0.07;
+                       ctx.lineCap = "round";
+                       ctx.moveTo(cx,cy);
+                       ctx.arc(cx,cy,cr*0.965,deg2rad(-45),deg2rad(135), false);
+                       ctx.closePath();
+                       ctx.strokeStyle = B2T;
+                       ctx.stroke();
+                       ctx.beginPath();
+                       var T2W = ctx.createLinearGradient(cx,cy,(cp*1.9),(cp*1.9));
+                       T2W.addColorStop(0, 'rgba(255,255,255,0)');
+                       T2W.addColorStop(1, 'rgba(255,255,255,0.6)');
+                       ctx.lineWidth = cr*0.07;
+                       ctx.lineCap = "round";
+                       ctx.moveTo(cx,cy);
+                       ctx.arc(cx,cy,cr*0.965,deg2rad(135),deg2rad(315), false);
+                       ctx.closePath();
+                       ctx.strokeStyle = T2W;
+                       ctx.stroke();   
+               }                                                       
+               ctx.lineCap = "butt";
+               ctx.lineWidth = 1;
+               ctx.fillStyle = 'rgba(255,255,255,0.5)';
+               var mpos = 0; var per = 0; var gx = 0; 
+               var gy = 0; var tx = 0; var ty = 0; 
+               var obj = ""; var w = 0; var c = 0;
+               var bw = cr*0.45; var bh = cr*0.125; 
+               var th = roundTo(bh*0.75,0); var tf = bh/80; 
+               if(canvas_notext <= 0) {
+                       if(canvas_htmltext >= 1) {
+                               bw = (cr*0.365);
+                               canvas.parentNode.style.position = "relative";
+                               if(!document.getElementById(textobj)) {
+                                       obj = document.createElement('div');
+                                       obj.id = textobj;
+                           obj.style.color = "rgb(0,0,0)";
+                           obj.style.fontFamily = "Arial,sans-serif";
+                                       obj.style.fontSize = th + "px";
+                                       obj.style.zIndex = 11;
+                                       canvas.parentNode.appendChild(obj);
+                               }
+                               var textdiv = document.getElementById(obj.id);
+                       }
+                       for (data in ChartData) {                       
+                               val = ChartData[data];
+                               sdeg = deg; mpos = deg+(((val/2)/ct)*deg2rad(360));
+                               deg += (val/ct)*deg2rad(360); edeg = deg;
+                               per = roundTo(val/poc,2);
+                               gx = circle_point_x(mpos, cd);
+                               gy = circle_point_y(mpos, cd);
+                               tx = parseFloat((cx+(2*Math.floor(cx + gx)))/3);
+                               ty = (cy+(2*Math.floor(cy + gy)))/3;
+                               if(canvas_htmltext <= 0) {
+                                       w = '"' + per + '"';
+                                       if(w.indexOf(".")!=-1) {
+                                               c = w.length+0.5;
+                                               w = parseFloat(c-2)*parseFloat(48*tf);
+                                               bw = parseFloat(c-1)*parseFloat(48*tf);
+                                       }else {
+                                               c = w.length;
+                                               w = parseFloat(c-1)*parseFloat(48*tf);
+                                               bw = parseFloat(c)*parseFloat(48*tf);
+                                       }
+                                       roundedRect(ctx,(tx-(bw/2)),ty-(bh/2),bw,bh,bh/4);
+                                       ctx.fill();\r
+                                       if(canvas_imgtext >= 1) {
+                                               drawString(ctx, per + "%", tf, tx-(w/2), ty-(th/1.8));
+                                       }else {
+                                               strokeString(ctx, per + "%","rgba(48,48,48,1)", th, tx-(w/2), ty-(th/2));
+                                       }
+                               }else {
+                                       roundedRect(ctx,(tx-(bw/2)),ty-(bh/2),bw,bh,bh/4);
+                                       ctx.fill();
+                                       obj = document.createElement('div');
+                                       obj.style.position = "absolute";
+                                       obj.style.overflow = "hidden";
+                           obj.style.textAlign = "center";
+                                       obj.style.width = bw + "px";
+                                       obj.style.left = (tx-(bw/2)) + "px";
+                                       obj.style.top = ty-(th/1.8) + "px";
+                                       obj.appendChild(document.createTextNode(per + "%"));                    
+                                       textdiv.appendChild(obj);
+                               }
+                       }
+               }
+       }
+}
+function setBarChart(canvasobj,textobj) {
+       var iw = canvas_width*0.9; var ih = canvas_height*0.9;
+       var pw = canvas_width*0.05; var ph = canvas_height*0.05; 
+       var cm = 0; var ct = 0;
+       for (var data in ChartData) {
+               cm = Math.max(cm,ChartData[data]);
+               ct += ChartData[data];
+       } 
+       var hf = ih/cm; var bs = colorSlice.length; 
+       var bw = iw/(bs*1.1); var poc = ct/100;
+       var th = roundTo((bw/3)*0.75,0);
+       var canvas = document.getElementById(canvasobj);
+       if(canvas.getContext) {
+               var ctx = canvas.getContext('2d');
+               if(canvas_bgcolor != "") {
+                       ctx.fillStyle = canvas_bgcolor;
+                       ctx.fillRect(0,0,canvas_width,canvas_height);
+               }else {
+                       ctx.clearRect(0,0,canvas_width,canvas_height);
+               }
+               if(canvas_htmltext >= 1) {
+                       if(document.getElementById(textobj)) {
+                               canvas.parentNode.removeChild(canvas.parentNode.lastChild);             
+                       }
+                       canvas.parentNode.style.position = "relative";
+                       if(!document.getElementById(textobj)) {
+                               var obj = document.createElement('div');
+                               obj.id = textobj;
+                   obj.style.color = "rgb(0,0,0)";
+                   obj.style.fontFamily = "Arial,sans-serif";
+                               obj.style.fontSize = th + "px";
+                               obj.style.zIndex = 11;
+                               canvas.parentNode.appendChild(obj);
+                       }
+                       var textdiv = document.getElementById(obj.id);
+               }               
+               var cc = ""; var bh = 0; var idx = 0; var t = 0; per = 0;
+               for (var data in ChartData) {
+                       per = roundTo(ChartData[data]/poc,2);
+                       bh = ChartData[data]*hf; 
+                       drawBar(ctx,pw+(t*(bw*1.1)),ph+ih-bh,bw,bh,colorSlice[(idx++)],per,textdiv); 
+                       t++;
+               }               
+       }
+}
+function setLineChart(canvasobj,textobj) {
+       var iw = canvas_width*0.9;
+       var ih = canvas_height*0.9;
+       var pw = canvas_width*0.05;
+       var ph = canvas_height*0.05;
+       var cm = 0;
+       for (var i = 0; i < ChartData.length; i++) {
+               for (var j = 0; j < ChartData[i].length; j++) {
+                       cm = Math.max(cm,ChartData[i][j]);
+               }
+       } 
+       var hf = (ih*0.95)/cm; var bw = iw;
+       var dw = iw/(ChartData[0].length-1)
+       var dh = ih/(ChartData[0].length-1)
+       var ps = Math.min(pw,ph); lw = ps/4;
+       var B2T;
+       var canvas = document.getElementById(canvasobj);
+       if(canvas.getContext) {
+               var ctx = canvas.getContext('2d');
+               if(canvas_bgcolor != "") {
+                       ctx.fillStyle = canvas_bgcolor;
+                       ctx.fillRect(0,0,canvas_width,canvas_height);
+               }else {
+                       ctx.clearRect(0,0,canvas_width,canvas_height);
+               }
+               if(canvas_noshadow <= 0) {
+                       B2T = ctx.createLinearGradient(pw+ps,ph+ih+1,pw+ps+ps,ph+ih+1);
+                       B2T.addColorStop(0, 'rgba(0,0,0,0.0)');
+                       B2T.addColorStop(1, 'rgba(0,0,0,0.5)');
+                       ctx.fillStyle = B2T;
+                       ctx.beginPath();
+                       ctx.moveTo(pw+ps,ph+ih);
+                       ctx.lineTo(pw+ps,ph+ih+ps);     
+                       ctx.lineTo(pw+ps+ps,ph+ih);
+                       ctx.closePath();                        
+                       ctx.fill();
+                       B2T = ctx.createLinearGradient(pw+ps+ps,ph+ih,pw+ps+ps,ph+ih+ps);
+                       B2T.addColorStop(0, 'rgba(0,0,0,0.5)');
+                       B2T.addColorStop(1, 'rgba(0,0,0,0.0)');
+                       ctx.fillStyle = B2T;
+                       ctx.beginPath();
+                       ctx.moveTo(pw+ps+ps,ph+ih);
+                       ctx.lineTo(pw+iw,ph+ih);        
+                       ctx.lineTo(pw+ps+iw,ph+ih+ps);
+                       ctx.lineTo(pw+ps,ph+ih+ps);             
+                       ctx.closePath();                        
+                       ctx.fill();
+                       var B2T = ctx.createLinearGradient(pw+iw+1,ph+ps,pw+iw+1,ph+ps+ps);
+                       B2T.addColorStop(0, 'rgba(0,0,0,0.0)');
+                       B2T.addColorStop(1, 'rgba(0,0,0,0.35)');
+                       ctx.fillStyle = B2T;
+                       ctx.beginPath();
+                       ctx.moveTo(pw+iw,ph+ps);
+                       ctx.lineTo(pw+iw,ph+ps+ps);     
+                       ctx.lineTo(pw+iw+ps,ph+ps);
+                       ctx.closePath();                        
+                       ctx.fill();
+                       B2T = ctx.createLinearGradient(pw+iw,ph+ps+ps,pw+iw+ps,ph+ps+ps);
+                       B2T.addColorStop(0, 'rgba(0,0,0,0.35)');
+                       B2T.addColorStop(1, 'rgba(0,0,0,0.0)');
+                       ctx.fillStyle = B2T;
+                       ctx.beginPath();
+                       ctx.moveTo(pw+iw,ph+ps+ps);
+                       ctx.lineTo(pw+iw,ph+ih);        
+                       ctx.lineTo(pw+iw+ps,ph+ih+ps);
+                       ctx.lineTo(pw+iw+ps,ph+ps);             
+                       ctx.closePath();                        
+                       ctx.fill();
+               }       
+               ctx.lineCap = "butt";
+               ctx.lineWidth = lw/2;
+               ctx.strokeStyle = "rgba(255,255,255,0.25)";
+               if(canvas_nofill <= 0) {
+                       ctx.fillStyle = "rgba(240,240,240,0.8)";
+                       ctx.strokeStyle = "rgba(255,255,255,1)";
+                       ctx.fillRect(pw,ph,iw,ih);
+               }
+               for (var i = 0; i < ChartData[0].length-1; i++) {
+                       ctx.beginPath();
+                       ctx.moveTo(pw+(i*dw),ph);
+                       ctx.lineTo(pw+(i*dw),ph+ih);
+                       ctx.stroke();
+               }
+               for (var i = 1; i < ChartData[0].length; i++) {
+                       ctx.beginPath();
+                       ctx.moveTo(pw,ph+(i*dh));
+                       ctx.lineTo(pw+iw,ph+(i*dh));
+                       ctx.stroke();
+               }                       
+               ctx.lineWidth = lw;
+               var cc = ""; var bh = 0; var idx = 0; var t = 0;
+               for (var i = 0; i < ChartData.length; i++) {
+                       for (var j = 0; j < ChartData[i].length; j++) {
+                               t = Math.max(t,ChartData[i][j]);
+                       }
+                       bh = t*hf; cc = colorSlice[(idx++)];
+                       drawLine(ctx,pw,ph+ih-bh,bw,bh,dw,ChartData[i],hf,cc,canvas_nofill);
+               }
+               ctx.beginPath();
+               ctx.moveTo(pw,ph);
+               ctx.lineTo(pw,ph+ih);
+               ctx.lineTo(pw+iw+(lw/2),ph+ih);
+               ctx.strokeStyle = "rgba(48,48,48,1)";
+               ctx.stroke();
+               ctx.lineWidth = lw/2;
+               B2T = ctx.createLinearGradient(pw,ph+ih,pw,ph+ih+ps);
+               B2T.addColorStop(0, 'rgba(0,0,0,1)');
+               B2T.addColorStop(0.5, 'rgba(0,0,0,1)');
+               B2T.addColorStop(1, 'rgba(0,0,0,0)');
+               ctx.strokeStyle = B2T;
+               for (var i = 0; i < ChartData[0].length; i++) {
+                       ctx.beginPath();
+                       ctx.moveTo(pw+(i*dw),ph+ih);
+                       ctx.lineTo(pw+(i*dw),ph+ih+ps);
+                       ctx.stroke();
+               }
+               B2T = ctx.createLinearGradient(pw-ps,ph,pw,ph);
+               B2T.addColorStop(0, 'rgba(0,0,0,0)');
+               B2T.addColorStop(0.5, 'rgba(0,0,0,1)');
+               B2T.addColorStop(1, 'rgba(0,0,0,1)');
+               ctx.strokeStyle = B2T;
+               for (var i = 1; i < ChartData[0].length; i++) {
+                       ctx.beginPath();
+                       ctx.moveTo(pw-ps,ph+(i*dh));
+                       ctx.lineTo(pw,ph+(i*dh));
+                       ctx.stroke();
+               }                       
+       }
+}
+function generateCanvas() {
+       if(canvasSupport) {
+               var canvasID; var tdataID; var textID; 
+               var tmp; var dat; var i; var j;
+               for(i=0; i < piecharts.length; i++) {
+                       tmp = piecharts[i].id.split("_");
+                       tdataID = piecharts[i].id;
+                       canvasID = tmp[0] + "_canvas";
+                       textID = tmp[0] + "_text";
+                       if(document.getElementById(tdataID)) {
+                               get_input(tdataID,canvasID);
+                               if(colorSlice.length > 0) {
+                                       j = 0; dat = ""; for(dat in ChartData) {j++; }
+                                       if(j > 0 && j == colorSlice.length) {
+                                               setPieChart(canvasID,textID);
+                                       }
+                               }
+                       }
+               }
+               for(i=0; i < barcharts.length; i++) {
+                       tmp = barcharts[i].id.split("_");
+                       tdataID = barcharts[i].id;
+                       canvasID = tmp[0] + "_canvas";
+                       textID = tmp[0] + "_text";
+                       if(document.getElementById(tdataID)) {
+                               get_input(tdataID,canvasID);
+                               if(colorSlice.length > 0) {
+                                       j = 0; dat = ""; for(dat in ChartData) {j++; }
+                                       if(j > 0 && j == colorSlice.length) {
+                                               setBarChart(canvasID,textID);
+                                       }
+                               }
+                       }
+               }
+               for(i=0; i < linecharts.length; i++) {
+                       tmp = linecharts[i].id.split("_");
+                       tdataID = linecharts[i].id;
+                       canvasID = tmp[0] + "_canvas";
+                       textID = tmp[0] + "_text";
+                       if(document.getElementById(tdataID)) {
+                               get_input(tdataID,canvasID,true);
+                               if(colorSlice.length > 0) {
+                                       if(ChartData.length == colorSlice.length) {
+                                               setLineChart(canvasID,textID);
+                                       }
+                               }
+                       }
+               }
+       }\r
+}
+// canvas chart extension
+
+// invisible select extension
+function setListPos(opt) {
+       if(!isIE) { //(degrade IE)
+               var ref = document.getElementById('list');
+               var x = findPosX(ref); var y = findPosY(ref);
+               var obj = document.getElementById('jumplist');
+               obj.style.position = 'fixed'; obj.style.left = x + 'px'; obj.style.top = y + 'px';      
+               var vol = document.getElementById('volumelist');
+               ref = document.getElementById('volume');
+               x = findPosX(ref); y = findPosY(ref);
+               vol.style.position = 'fixed'; vol.style.left = x + 'px'; vol.style.top = y + 'px';      
+               var pnl = document.getElementById('navLinks');
+       }
+       if(opt) {
+               if (isIE) {
+                       //(degrade IE)
+                       //obj.style.filter = "alpha(opacity=0)";
+                       //vol.style.filter = "alpha(opacity=0)";
+                       //pnl.style.filter = "alpha(opacity=90)";       
+               }else {
+                       obj.style.opacity = 0.0;
+                       vol.style.opacity = 0.0;
+                       pnl.style.opacity = 0.9;
+               }
+               if(!isOp && !isIE) {
+                       vol.onmouseover = function () { document.getElementById('volume').style.color="rgb(255, 0, 0)"; return false; }
+                       vol.onmouseout  = function () { document.getElementById('volume').style.color=""; return false; }
+                       obj.onmouseover = function () { document.getElementById('list').style.color="rgb(255, 0, 0)"; return false; }
+                       obj.onmouseout  = function () { document.getElementById('list').style.color=""; return false; }
+               }
+       }
+}
+// invisible select extension
+
+// transition extension
+function switchFade() {
+       if(tranSitions && s5mode && fadeModus) {
+               fadeModus = false; 
+               playDelay = playDelay-(2*fadeDuration);
+               document.getElementById('fade').style.color="";
+       }else if(tranSitions && s5mode && !fadeModus) {
+               fadeModus = true; 
+               playDelay = playDelay+(2*fadeDuration);
+               document.getElementById('fade').style.color=highLight;
+       }
+       currentSlide();
+}
+function opacity(ids, opacStart, opacEnd, millisec) {\r var speed = Math.round(millisec / 100);\r        var timer = 0;\r if(opacStart > opacEnd) {\r              for(var i = opacStart; i >= opacEnd; i--) {\r                    window.setTimeout("changeOpac(" + i + ",'" + ids + "')",(timer * speed));\r                      timer++;\r               }\r      } else if(opacStart < opacEnd) {\r               for(var i = opacStart; i <= opacEnd; i++) {\r                    window.setTimeout("changeOpac(" + i + ",'" + ids + "')",(timer * speed));\r                      timer++;\r               }\r      }
+}\rfunction changeOpac(opacity, ids) {\r var obj = document.getElementById(ids); 
+       if (isIE) {
+               obj.style.filter = "alpha(opacity=" + opacity + ")";\r   } else {\r               obj.style.opacity = (opacity / 100);\r   }\r}\rfunction shiftOpacity(ids, millisec) {\r     if(document.getElementById(ids).style.opacity != '') {\r         var currentOpac = document.getElementById(ids).style.opacity * 100;
+       } else {
+               var currentOpac = 0;
+       }
+       if(currentOpac == 0) {
+               opacity(ids, currentOpac, 100, millisec);\r      } else if(currentOpac > 0) {
+               opacity(ids, currentOpac, 0, millisec);\r        }\r}
+// transition extension
+
+// autoplay extension
+function autoPlay() {
+       if (s5mode && autoMatic && !playPause) {\r
+               if ((snum >= (smax-1)) && playLoop) {
+                       goTo(0);
+                       autoRun = setTimeout('autoPlay();',playDelay);\r
+               }else if ((snum >= (smax-1)) && !playLoop) {
+                       stopPlay();\r
+               }else {
+                       if (!incrementals[snum] || incpos >= incrementals[snum].length) {
+                               go(1);
+                               if (incrementals[snum].length >0) {
+                                       clearTimeout(autoRun); autoRun = null;
+                                       incrDelay = parseInt(playDelay/(incrementals[snum].length+1));
+                                       remainDer = parseInt(playDelay-(incrDelay*incrementals[snum].length));
+                                       autoRun = setTimeout('autoPlayIncr()',incrDelay);
+                               }
+                       } else {
+                               clearTimeout(autoRun); autoRun = null;
+                               incrDelay = incrDuration;
+                               remainDer = parseInt(playDelay-(incrementals[snum].length*incrDuration));
+                               autoRun = setTimeout('autoPlayIncr()',incrDelay);
+                       }
+                       autoRun = setTimeout('autoPlay();',playDelay);
+               }  
+       }\r
+}
+function autoPlayIncr() {
+       if (incpos < incrementals[snum].length) {
+               subgo(1);
+               autoRun = setTimeout('autoPlayIncr();',incrDelay);
+       }else {
+               autoRun = setTimeout('nop();',remainDer);
+       }
+}
+function nop() {
+       // no operation dummy
+}
+function togglePlay() {\r
+       if (autoRun && s5mode) {
+               stopPlay();
+       }else if (!autoRun && s5mode) {
+               startPlay();
+       }
+}
+function stopPlay() {\r
+       if (autoRun && s5mode) {
+               clearTimeout(autoRun); autoRun = null; 
+               autoMatic = false; playPause = false;
+               document.getElementById('auto').style.color="";
+               document.getElementById('pause').style.color="";
+               currentSlide();
+       }
+}
+function startPlay() {
+       if (!autoRun && s5mode) {
+               playPause = false; autoMatic = true;
+               document.getElementById('pause').style.color="";
+               document.getElementById('auto').style.color=highLight;
+               autoRun = setTimeout('autoPlay();',playDelay); 
+               currentSlide();
+       }\r
+}
+function pausePlay() {
+       if (s5mode && autoMatic) {
+               if (playPause) {
+                       playPause = false; autoRun = setTimeout('autoPlay();',playDelay);
+                       document.getElementById('pause').style.color="";
+               }else {\r
+                       if (autoRun){ 
+                               clearTimeout(autoRun); autoRun = null; playPause = true;
+                               document.getElementById('pause').style.color=highLight;
+                       }
+               }
+               currentSlide();
+       }\r
+}
+function switchLoop() {
+       if(s5mode) {
+               if (playLoop) {
+                       playLoop = false; document.getElementById('loop').style.color="";
+               }else {
+                       playLoop = true; document.getElementById('loop').style.color=highLight;
+               } 
+       }
+       currentSlide();
+}
+function setDelay(val) {
+       if(s5mode) {
+               var delay = Math.max(5,Math.min(val,300));
+               playDelay = (fadeModus == true) ? ((delay*1000)+(2*fadeDuration)) : (delay*1000);
+       }
+}
+// autoplay extension
+
+// audio extension
+function createSoundManagerScript() {
+       if(typeof soundManager=="undefined") {
+               onerrorSM2();   
+       }else {
+               var script=document.createElement('SCRIPT');
+               var tx=document.createTextNode("soundManager.createMovie();");
+               script.appendChild(tx);
+               document.getElementsByTagName("body")[0].appendChild(script);
+       }
+}
+//soundManager.onload = function() {
+function onloadSM2() {
+       if(!isIE) { //(degrade IE)      
+               swfUnloaded = false;\r
+               preloadSounds();
+       }
+}\r
+//soundManager.onerror = function() {
+function onerrorSM2() {
+       if(typeof soundManager!="undefined") {
+               soundManager.destruct;
+               delete soundManager;
+       }       
+       audioSupport = false; swfUnloaded = true;
+       if(audioError && !isIE && !isOp) {
+               var dv = document.createElement('div'); dv.id = "guru";
+               var d2=document.createElement('div'); dv.appendChild(d2);\r              var tx=document.createTextNode('Guru Meditation - SoundManager failed to load/initialize!');
+               d2.appendChild(tx);     document.getElementById('slide0').appendChild(dv);
+       }
+}
+function audioSetup() {
+       if(sound[0]) {
+               playSound(0); 
+       }else if(sound[bgSoundItem] && !sound[0]) {
+               playSound(bgSoundItem); 
+       }
+}
+function fadeoutSound(ids, option) {
+       if(curSoundID >= 0  && !swfUnloaded) {
+               if(isNaN(ids)) {
+                       if(ids == "bgSound") {
+                               var cnum = parseInt(bgSoundItem);
+                       }else {
+                               for (var i = 0; i < (sound.length-1); i++) {
+                                       if(sound[i] && ids == sound[i]["id"]) {
+                                               var cnum = i;
+                                               break;
+                                       }
+                               }
+                       }
+               }else {
+                       var cnum = ids;
+                       ids = sound[cnum]["id"];
+               }       
+               var vol = getMaxVolume(sound[cnum]["volume"]);
+               var millisec = fadeDuration;
+               var speed = Math.round(millisec / vol);\r                var timer = 0;\r         for(var i = vol; i > 0; i--) {\r                 setTimeout("fadeout(" + i + ",'" + ids + "')",(timer * speed));\r                        timer++;\r               }
+               if(option) setTimeout("stopSound('"+ids+"')",millisec);
+       }
+}
+function fadeout(volume, id) {\r        soundManager.setVolume(id,volume);\r}
+function stopSound(ids) {
+       var sid;
+       if(isNaN(ids)) {
+               sid = ids;
+       }else if(sound[ids]) {
+               sid = sound[ids]["id"];
+       }
+       if(sid!='' && curSoundID >= 0) {
+               soundManager.stop(sid);
+               curSoundID = -1;
+       }
+}
+function toggleSounds() {
+       if(audioSupport && !swfUnloaded) {
+               stopAllSounds();
+       }else if (!audioSupport && !swfUnloaded) {
+               allowSounds();
+       }
+}
+function allowSounds() {
+       if(!swfUnloaded) {
+               audioSupport = true;
+               document.getElementById('audio').style.color=highLight;
+               currentSlide();
+       }
+}
+function stopAllSounds() {
+       if(curSoundID >= 0) {
+               stopSound(curSoundID);
+       }else {
+               soundManager.stopAll();
+               curSoundID = -1;
+       }
+       audioSupport = false;
+       document.getElementById('audio').style.color="";
+       currentSlide();
+}
+function playSound(id) {
+       if(audioSupport && !swfUnloaded) {
+               var url, sid, vol, lps, cnum;
+               if(isNaN(id)) {
+                       sid = id;
+                       if(sid == "bgSound") {
+                               cnum = parseInt(bgSoundItem);
+                       }else {
+                               cnum = getSoundID(id);
+                       }
+               }else {
+                       cnum = parseInt(id); 
+                       if(sound[cnum]) sid = sound[cnum]["id"];
+               }               
+               if(sound[cnum] && sound[cnum]["url"]!='' && sid!=''){
+                       url = sound[cnum]["url"];
+                       vol = (sound[cnum]["volume"]!='')?getMaxVolume(sound[cnum]["volume"]):getMaxVolume(100);
+                       lps = (sound[cnum]["loops"])?true:false;                        
+                       if(lps) {
+                               soundManager.play(sid,{volume:vol,onplay:function(){curSoundID=cnum;},onfinish:function(){soundManager.play(sid,{volume:getMaxVolume(sound[cnum]["volume"])});}});
+                       }else { 
+                               soundManager.play(sid,{volume:vol,onplay:function(){curSoundID=cnum;},onfinish:function(){curSoundID=-1;}});
+                       }
+               }
+       }       
+}
+function getSoundID(str) {
+       for (var i = 0; i < (sound.length-1); i++) {
+               if(sound[i] && str == sound[i]["id"]) {
+                       var id = i;
+                       break;
+               }
+       }
+       return id;
+}
+function setVolume() {
+       var vol = document.getElementById('volumelist');
+       if(audioSupport && !swfUnloaded) {
+               audioVolume = parseInt(vol.value);
+               if(curSoundID >= 0) {
+                       if(sound[curSoundID]) {
+                               var sid = sound[curSoundID]["id"];
+                               var vid = getMaxVolume(sound[curSoundID]["volume"]);
+                               soundManager.setVolume(sid,vid);
+                       }
+               }\r      }       
+}
+function getMaxVolume(value) {
+       if(audioVolume>0) {var factor = audioVolume/100;}else {var factor = 0;}
+       return Math.max(0,Math.min(parseInt(value*factor),audioVolume));
+}
+function preloadSounds() {
+       var temp = ''; var parm = ''; var t = ''; var cl = '';
+       var objects = document.getElementsByTagName('object');
+       for (var i=0; i < objects.length; i++) {
+               if(objects[i].type.toLowerCase() == 'audio/mp3' && objects[i].data != '') {
+                       objects[i].width = 0; objects[i].height = 0;
+                       if(objects[i].parentNode.tagName == 'DIV') {
+                               cl = objects[i].parentNode.className.toLowerCase();                     
+                               if(cl == 'presentation' || cl == 'slide') {
+                                       if(cl == 'presentation') {
+                                               t = parseInt(bgSoundItem);
+                                       }else {
+                                               t = parseInt(objects[i].parentNode.id.slice(5, objects[i].parentNode.id.length));
+                                       }       
+                                       sound[t] = new Object();
+                                       if(t < bgSoundItem) {
+                                               sound[t]["id"] = objects[i].parentNode.id;
+                                       }else {
+                                               sound[t]["id"] = "bgSound";
+                                       }       
+                                       sound[t]["url"] = objects[i].data;
+                                       sound[t]["volume"] = 100; sound[t]["loops"] = false;
+                                       if(objects[i].archive != '') {
+                                               parm = objects[i].archive.toLowerCase().split(',');
+                                               for (var j=0; j < parm.length; j++) {
+                                                       if(parm[j] == 'loop') sound[t]["loops"] = true;
+                                                       if(parm[j].search(/^volume/) != -1) {
+                                                               var tmp = parm[j].split(':');
+                                                               sound[t]["volume"] = parseInt(tmp[1]);
+                                                       }
+                                               }
+                                       }
+                                       soundManager.createSound(sound[t]["id"],sound[t]["url"]);
+                               }
+                       }                       
+               }\r
+       }
+}
+// audio extension
+
+// help extension
+function createHelpReq() {
+       if(!document.getElementById("HelpReq")) {
+               var obj = document.getElementsByTagName("body")[0].firstChild;
+               var pg = document.createElement('div');
+               pg.id = "HelpReq";
+               if (pg.addEventListener) {
+                       pg.addEventListener("onclick",dumpHelpReq,false);
+               } else if (pg.attachEvent) {
+                       pg.attachEvent("onclick",dumpHelpReq);
+               }       
+               pg.style.position = 'absolute';
+               pg.style.left = 0 + 'px';
+               pg.style.top = 0 + 'px';
+               pg.style.width = 100 + '%';\r
+               pg.style.height = 100 + '%';
+               pg.style.margin = 0 + 'px';
+               pg.style.padding = 0 + 'px';
+               if (isIE) {
+                       pg.style.filter = "alpha(opacity=90)";  
+               }else {
+                       pg.style.opacity = 0.9;
+               }\r              pg.style.zIndex = 9999;
+               pg.style.backgroundColor="rgb(64,64,64)";
+               pg.style.textAlign = "center";\r         pg.style.verticalAlign = "middle";
+               pg.style.backgroundPosition="center center";
+               pg.style.backgroundRepeat="no-repeat";
+               pg.style.backgroundImage="url(ui/graphic_support/help.jpg)";
+               document.getElementsByTagName("body")[0].insertBefore(pg,obj);
+               if(document.getElementById("HelpReq")) {
+                       helpmode = true;
+               }
+       }
+}
+function dumpHelpReq() {
+       if(document.getElementById("HelpReq")) {
+               document.body.removeChild(document.getElementById('HelpReq'));
+               helpmode = false;
+       }
+}
+// help extension
+
+//DEBUG
+function ConsoleLog(value) {
+       if(window.console) {
+               window.console.log(value);\r
+       }       
+}
+//DEBUG
+
+document.write('<style type="text/css" media="screen" id="blockStyle">.presentation, .layout {display: none; }</style>');
+
+if(!isIE && !isOp) {
+       document.write('<script type="text/javascript" src="ui/audio_support/soundmanager2.js"></script>');
+       if(typeof soundManager!="undefined") {
+               var allMetas = document.getElementsByTagName('meta');
+               for (var i = 0; i< allMetas.length; i++) {
+                       if (allMetas[i].name == 'audioDebug') {
+                               var audioDebug = (allMetas[i].content == "true") ? true : false;
+                               soundManager.defaultOptions.debugMode = audioDebug;
+                       }                                               
+               }
+       }
+}
+
+window.onload = createSlideShow;
+window.onresize = function(){setTimeout('windowChange()',5);}
\ No newline at end of file