<?xml version="1.0"?><!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>SVG Flip</title>

	<style>
	body{margin:0;overflow:hidden}
	#links{position:absolute;bottom:10px;width:100%;text-align:center;font-family:arial}
	#links a{color:#eee;text-decoration:none}
	#links a:hover{color:#fff;text-decoration:underline}
	</style>
</head>
<body>
<div id="links">
<a href="http://www.paulbrunt.co.uk">&lt; Back to my blog for more information</a>...<a href="http://blenderart.org/">Onwards to blenderart magazine website &gt;</a>

</div>




<svg id="svg" xmlns="http://www.w3.org/2000/svg" version="1.1"
style="width:100%; height:100%;" xmlns:xlink="http://www.w3.org/1999/xlink">  

<defs>
<linearGradient id="shadow" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style="stop-color:rgb(0,0,0);
stop-opacity:0"/>
<stop offset="50%" style="stop-color:rgb(0,0,0);
stop-opacity:0.05"/>
<stop offset="85%" style="stop-color:rgb(255,255,255);
stop-opacity:0.25"/>
<stop offset="100%" style="stop-color:rgb(0,0,0);
stop-opacity:0.6"/>
</linearGradient>

<linearGradient id="shade" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style="stop-color:rgb(0,0,0);
stop-opacity:0.3"/>
<stop offset="100%" style="stop-color:rgb(0,0,0);
stop-opacity:0"/>

</linearGradient>

<linearGradient id="shade2" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style="stop-color:rgb(0,0,0);
stop-opacity:0"/>
<stop offset="100%" style="stop-color:rgb(0,0,0);
stop-opacity:0.3"/>
</linearGradient>

<linearGradient id="bgGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:rgb(200,200,200);
stop-opacity:1"/>
<stop offset="100%" style="stop-color:rgb(80,80,80);
stop-opacity:1"/>
</linearGradient>



<!--background shadow grads-->
<linearGradient id="bgshad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style="stop-color:rgb(0,0,0);
stop-opacity:0.2"/>

<stop offset="100%" style="stop-color:rgb(0,0,0);
stop-opacity:0"/>
</linearGradient>
<radialGradient id="bgshad2" gradientUnits="userSpaceOnUse"
                      cx="0" cy="0" r="7" fx="0" fy="0">
        <stop offset="0%" style="stop-color:rgb(0,0,0); stop-opacity:0.2" />
        <stop offset="100%" style="stop-color:rgb(0,0,0); stop-opacity:0" />
</radialGradient>

<linearGradient id="bgshad3" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style="stop-color:rgb(0,0,0);
stop-opacity:0"/>
<stop offset="100%" style="stop-color:rgb(0,0,0);
stop-opacity:0.2"/>
</linearGradient>

<linearGradient id="bgshad4" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:rgb(0,0,0);
stop-opacity:0"/>
<stop offset="100%" style="stop-color:rgb(0,0,0);
stop-opacity:0.2"/>

</linearGradient>

<linearGradient id="bgshad5" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:rgb(0,0,0);
stop-opacity:0.2"/>
<stop offset="100%" style="stop-color:rgb(0,0,0);
stop-opacity:0"/>
</linearGradient>


</defs>


<rect id="background" x="0" y="0" height="600" width="1000" fill="url(#bgGrad)" />

<g id="layout"></g>
<!--
<image xlink:href="/svgflip/SVG.svg#test" x="0" y="0" width="740" height="499"/>
-->

<!--svg logo-->

      <g
         transform="translate(-200 -400)"
	 style="opacity: 0.1;"
         id="svglogo">
        <path
           d="M 523.89417,284.8582 C 523.89417,238.83583 486.55835,201.49992 440.53588,201.49992 C 394.51351,201.49992 357.1776,238.83574 357.1776,284.8582 C 324.62057,252.32474 271.84178,252.32474 239.28499,284.8582 C 206.75153,317.41523 206.75153,370.19402 239.28499,402.75081 C 193.26262,402.75081 155.9267,440.08663 155.9267,486.1091 C 155.9267,532.13147 193.26253,569.46739 239.28499,569.46739 C 206.75153,602.02441 206.75153,654.8032 239.28499,687.35999 C 271.84201,719.89346 324.62081,719.89346 357.1776,687.35999 C 357.1776,733.38236 394.51342,770.71828 440.53588,770.71828 C 486.55826,770.71828 523.89417,733.38246 523.89417,687.35999 C 556.4512,719.89346 609.22999,719.89346 641.78678,687.35999 C 674.32024,654.80297 674.32024,602.02418 641.78678,569.46739 C 687.80915,569.46739 725.12122,532.13156 725.12122,486.1091 C 725.12122,440.08673 687.80896,402.75081 641.78678,402.75081 C 674.32024,370.19379 674.32024,317.41499 641.78678,284.8582 C 609.22975,252.32474 556.45096,252.32474 523.89417,284.8582 z"
           id="_151038768"
           style="fill:#000000;fill-rule:evenodd" />
        <path
           d="M 472.43163,316.77919 L 472.43163,409.08312 L 537.71024,343.80451 C 537.71024,332.26947 542.11237,320.71093 550.91668,311.90666 C 568.54877,294.27457 597.12741,294.27457 614.73575,311.90666 C 632.36784,329.51524 632.36784,358.09383 614.73575,375.72573 C 605.93149,384.53 594.37289,388.93217 582.8379,388.93217 L 517.55929,454.21078 L 609.86322,454.21078 C 618.03192,446.04209 629.30795,440.98082 641.78463,440.98082 C 666.69085,440.98082 686.88892,461.20241 686.88892,486.10863 C 686.88892,511.01486 666.69085,531.23644 641.78463,531.23644 C 629.30795,531.23644 618.03192,526.17518 609.86322,518.00648 L 517.55929,518.00648 L 582.8379,583.28509 C 594.37294,583.28509 605.93149,587.68722 614.73575,596.49153 C 632.36784,614.12362 632.36784,642.70226 614.73575,660.3106 C 597.12717,677.94269 568.54859,677.94269 550.91668,660.3106 C 542.11242,651.50634 537.71024,639.94774 537.71024,628.41275 L 472.43163,563.13414 L 472.43163,655.43807 C 480.60033,663.60677 485.66159,674.8828 485.66159,687.35948 C 485.66159,712.2657 465.44001,732.46377 440.53378,732.46377 C 415.62756,732.46377 395.40597,712.2657 395.40597,687.35948 C 395.40597,674.8828 400.46724,663.60677 408.63593,655.43807 L 408.63593,563.13414 L 343.35732,628.41275 C 343.35732,639.94779 338.95519,651.50634 330.15088,660.3106 C 312.51879,677.94269 283.94015,677.94269 266.33181,660.3106 C 248.69972,642.70202 248.69972,614.12344 266.33181,596.49153 C 275.13608,587.68727 286.69467,583.28509 298.22966,583.28509 L 363.50827,518.00648 L 271.20434,518.00648 C 263.03565,526.17518 251.75961,531.23644 239.28293,531.23644 C 214.37671,531.23644 194.17864,511.01486 194.17864,486.10863 C 194.17864,461.20241 214.37671,440.98082 239.28293,440.98082 C 251.75961,440.98082 263.03565,446.04209 271.20434,454.21078 L 363.50827,454.21078 L 298.22966,388.93217 C 286.69462,388.93217 275.13608,384.53004 266.33181,375.72573 C 248.69972,358.09364 248.69972,329.515 266.33181,311.90666 C 283.94039,294.27457 312.51897,294.27457 330.15088,311.90666 C 338.95514,320.71093 343.35732,332.26952 343.35732,343.80451 L 408.63593,409.08312 L 408.63593,316.77919 C 400.46724,308.6105 395.40597,297.33446 395.40597,284.85778 C 395.40597,259.95156 415.62756,239.75349 440.53378,239.75349 C 465.44001,239.75349 485.66159,259.95156 485.66159,284.85778 C 485.66159,297.33446 480.60033,308.6105 472.43163,316.77919 z"
           id="_151037224"
           style="fill:#ffffff;fill-rule:evenodd" />
      </g>


<!--nav stuff-->
 <g id="nav"> 
    <g transform="matrix(1.5,0,0,1.5,-9.5467,-26.928585)">
      <rect
         width="450"
         height="25"
         rx="9.166667"
         ry="10"
         x="6.4644661"
         y="18.493656"
         id="rect5538"
         style="fill:url(#linearGradient6571);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
      <path
         d="M 153.56976,5.0293752 C 156.50318,13.696664 151.379,22.721875 140.74131,27.624098 C 130.10363,32.526322 116.21805,32.261485 105.9786,26.961078 C 95.739149,21.66067 91.326616,12.453568 94.931771,3.9109874 L 124.03831,9.91327 L 153.56976,5.0293752 z"
         transform="matrix(7.3106795,0,0,0.5886218,-674.19566,17.076855)"
         id="path5540"
         style="fill:url(#linearGradient6573);fill-opacity:1;stroke:none;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />

    </g>
    <text x="310" y="25" id="pagestext" style="font-family:arial;fill:#ffffff">Page 1 of 38</text>
    
    <path
       d="M 26.74414,7.3949252 L 26.74414,10.580945 C 25.50422,9.9879752 24.33439,9.5459152 23.23466,9.2547852 C 22.13491,8.9636952 21.0729,8.8181452 20.04864,8.8181252 C 18.26963,8.8181452 16.89495,9.1631652 15.9246,9.8531752 C 14.96501,10.543235 14.48522,11.524375 14.48522,12.796615 C 14.48522,13.864025 14.80328,14.672665 15.43942,15.222515 C 16.08632,15.761625 17.30466,16.198285 19.09445,16.532505 L 21.06752,16.936825 C 23.50419,17.400455 25.29937,18.219875 26.45303,19.395075 C 27.61745,20.559525 28.19967,22.122885 28.19969,24.085165 C 28.19967,26.424825 27.4126,28.198435 25.83847,29.405995 C 24.27509,30.613555 21.97857,31.217335 18.94889,31.217335 C 17.80601,31.217335 16.58767,31.087955 15.29386,30.829195 C 14.01082,30.570425 12.67927,30.187675 11.2992,29.680925 L 11.2992,26.317005 C 12.62536,27.060955 13.92457,27.621605 15.19682,27.998965 C 16.46907,28.376335 17.71976,28.565015 18.94889,28.565015 C 20.81414,28.565015 22.25351,28.198435 23.26701,27.465265 C 24.28048,26.732105 24.78723,25.686275 24.78725,24.327755 C 24.78723,23.141765 24.42065,22.214535 23.6875,21.546055 C 22.96511,20.877585 21.77372,20.376235 20.11333,20.041985 L 18.12408,19.653845 C 15.68739,19.168675 13.92457,18.408555 12.83561,17.373495 C 11.74664,16.338445 11.20216,14.899085 11.20216,13.055375 C 11.20216,10.920595 11.9515,9.2386352 13.45017,8.0094852 C 14.95962,6.7803852 17.03512,6.1658252 19.67667,6.1657952 C 20.80874,6.1658252 21.9624,6.2682452 23.13763,6.4730752 C 24.31283,6.6779552 25.515,6.9852352 26.74414,7.3949252 M 39.52059,30.748325 L 30.30214,6.6024552 L 33.71458,6.6024552 L 41.36428,26.931565 L 49.03015,6.6024552 L 52.42642,6.6024552 L 43.22414,30.748325 L 39.52059,30.748325 M 72.39972,27.303535 L 72.39972,20.818275 L 67.06273,20.818275 L 67.06273,18.133605 L 75.63427,18.133605 L 75.63427,28.500315 C 74.37277,29.395215 72.98192,30.074465 71.4617,30.538085 C 69.94145,30.990915 68.31879,31.217335 66.59372,31.217335 C 62.82007,31.217335 59.86586,30.117595 57.73107,27.918105 C 55.60705,25.707835 54.54504,22.635025 54.54504,18.699655 C 54.54504,14.753525 55.60705,11.680715 57.73107,9.4812052 C 59.86586,7.2709552 62.82007,6.1658252 66.59372,6.1657952 C 68.16785,6.1658252 69.66113,6.3598952 71.07356,6.7480152 C 72.49674,7.1361852 73.80673,7.7076152 75.00353,8.4623252 L 75.00353,11.939455 C 73.79595,10.915205 72.51291,10.144305 71.15442,9.6267552 C 69.7959,9.1092552 68.36731,8.8504952 66.86865,8.8504652 C 63.91442,8.8504952 61.69337,9.6752952 60.20549,11.324895 C 58.72838,12.974525 57.98983,15.432775 57.98983,18.699655 C 57.98983,21.955765 58.72838,24.408625 60.20549,26.058235 C 61.69337,27.707855 63.91442,28.532665 66.86865,28.532665 C 68.02229,28.532665 69.05195,28.435635 69.95764,28.241555 C 70.8633,28.036705 71.67732,27.724035 72.39972,27.303535"
       id="path5542"
       style="fill:#00ff00;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
   <path
       d="M 91.9762,29.656605 L 90.33699,29.656605 C 89.52319,29.656585 88.84891,29.352235 88.31414,28.743545 C 87.8026,28.155815 87.54684,27.494635 87.54685,26.760005 L 90.33699,26.760005 L 90.33699,23.517075 L 87.54685,23.517075 L 87.54685,11.552875 L 82.69898,11.552875 L 82.69898,23.517075 L 80.50174,23.517075 L 80.50174,26.760005 L 82.69898,26.760005 C 82.81523,28.754025 83.51276,30.286285 84.79158,31.356785 C 86.07039,32.448235 87.8026,32.993965 89.98822,32.993995 L 91.9762,32.993995 L 91.9762,29.656605 M 98.83657,11.552875 L 94.23283,11.552875 L 94.23283,32.993995 L 98.83657,32.993995 L 98.83657,11.552875 M 106.64352,30.223335 C 106.64351,29.509665 106.39937,28.911455 105.9111,28.428705 C 105.42282,27.945915 104.79504,27.704535 104.02776,27.704555 C 103.26047,27.704535 102.64431,27.935425 102.17929,28.397215 C 101.71426,28.879965 101.48175,29.478175 101.48175,30.191845 C 101.48175,30.905485 101.71426,31.493195 102.17929,31.954995 C 102.64431,32.437735 103.27209,32.679125 104.06263,32.679145 C 104.82992,32.679125 105.44607,32.448235 105.9111,31.986475 C 106.39937,31.524685 106.64351,30.936965 106.64352,30.223335 M 106.32962,11.552875 L 101.72589,11.552875 L 101.72589,26.728525 L 106.32962,26.728525 L 106.32962,11.552875 M 125.47152,18.227635 C 125.47151,16.023705 124.75072,14.187095 123.30916,12.717805 C 121.86758,11.248515 119.94936,10.513875 117.5545,10.513875 C 116.08966,10.513875 114.8341,10.954665 113.78781,11.836235 L 113.78781,4.2484052 L 109.14919,4.2484052 L 109.14919,19.455545 C 109.14919,21.491545 109.89323,23.149745 111.38131,24.430135 C 112.89263,25.710505 114.7876,26.350695 117.06622,26.350705 C 119.57734,26.350695 121.62344,25.553075 123.20454,23.957865 C 124.71584,22.425595 125.47151,20.515525 125.47152,18.227635 M 120.83291,18.322095 C 120.8329,19.455535 120.51901,20.505025 119.89124,21.470575 C 119.17044,22.604005 118.22877,23.170735 117.06622,23.170745 C 116.57794,23.170735 116.08966,23.055295 115.6014,22.824415 C 114.36908,22.236685 113.76455,20.756905 113.78781,18.385065 L 113.78781,17.251615 C 113.7878,16.349045 114.10169,15.551435 114.72948,14.858775 C 115.35725,14.166105 116.14779,13.819775 117.1011,13.819775 C 118.2404,13.819775 119.17044,14.323525 119.89124,15.331045 C 120.51901,16.233605 120.8329,17.230615 120.83291,18.322095"
       id="path5544"
       style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />

    <path
       d="M 431.92573,18.688795 L 420.2468,30.367735 L 420.2468,7.0098652 L 431.92573,18.688795"
       id="next"
       fill="#ffffff"
       style="fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
    <path
       d="M 294.60744,30.556175 L 282.92852,18.877245 L 294.60744,7.1983052 L 294.60744,30.556175"
       id="prev"
       fill="#ffffff"
       style="fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
    <path
       d="M 604.27763,10.209235 C 604.2776,12.064935 603.70305,13.569085 602.55394,14.721665 C 601.32173,15.966485 599.6119,16.588895 597.42444,16.588885 C 595.14002,16.588895 593.27098,15.764785 591.81728,14.116555 C 590.48817,12.618185 589.82361,10.889285 589.82363,8.9298552 C 589.82361,4.9188252 592.04571,2.9133052 596.48992,2.9132752 C 598.67738,2.9133052 600.54641,3.6855452 602.09706,5.2300052 C 603.55075,6.6823052 604.2776,8.3420452 604.27763,10.209235 M 598.5874,19.545305 L 597.88132,19.320545 L 597.56981,17.349595 L 597.23753,17.349595 L 597.46598,19.216805 L 597.21677,19.216805 C 596.8014,19.216815 596.30298,19.332075 595.72152,19.562585 C 595.08465,19.804645 594.70392,20.058215 594.57932,20.323305 L 593.85247,17.436045 C 592.10801,17.366895 590.55046,16.675335 589.17985,15.361365 C 587.76765,14.001305 587.06158,12.433775 587.06158,10.658755 C 587.06158,8.9529252 587.42847,7.6389552 588.16226,6.7168552 C 588.57757,6.1751552 589.70593,5.2588452 591.5473,3.9679052 C 590.01051,5.3395252 589.24214,6.9762152 589.24215,8.8779852 C 589.24214,10.906575 589.89284,12.698865 591.19426,14.254865 C 592.6618,15.995305 594.56546,16.865515 596.90525,16.865505 C 597.25136,16.865515 597.66669,16.865515 598.15129,16.865505 L 598.5874,19.545305 M 600.49798,30.696705 C 600.49797,31.088595 600.29722,31.434375 599.89575,31.734055 C 599.49422,32.033725 599.03734,32.183565 598.5251,32.183565 C 597.98513,32.183565 597.50057,32.016435 597.07139,31.682185 C 596.69757,31.394025 596.48989,31.100115 596.44838,30.800445 L 594.74546,20.911135 C 594.67622,20.542305 594.96003,20.219575 595.59693,19.942945 C 596.19223,19.677855 596.85677,19.545305 597.59058,19.545305 C 598.08897,19.545305 598.46277,19.735485 598.712,20.115835 L 600.26955,29.451905 L 600.49798,30.696705 M 603.61307,10.157365 C 603.61306,8.4630652 602.94157,6.9589252 601.59866,5.6449352 C 600.18645,4.2503152 598.48355,3.5529952 596.48992,3.5529652 C 592.4749,3.5529952 590.46739,5.3683352 590.46741,8.9990052 C 590.46739,10.785555 591.07657,12.358855 592.29493,13.718905 C 593.62402,15.217295 595.32,15.966485 597.38291,15.966475 C 599.37653,15.966485 600.93408,15.401715 602.05554,14.272155 C 603.09387,13.223305 603.61306,11.851705 603.61307,10.157365 M 603.15619,10.347545 C 603.15616,12.791075 601.83399,14.508445 599.18966,15.499675 C 600.85101,13.932145 601.6817,12.272405 601.68173,10.520435 C 601.6817,8.8146052 601.03791,7.4026752 599.75037,6.2846352 C 598.46277,5.1551052 596.8014,4.5615152 594.76623,4.5038652 C 595.37539,4.2848952 596.03993,4.1753952 596.75989,4.1753752 C 598.55969,4.1753952 600.09646,4.8381452 601.37021,6.1636052 C 602.56085,7.4084352 603.15616,8.8030852 603.15619,10.347545 M 599.70884,9.7943052 C 599.70881,10.762505 599.14118,11.667295 598.00593,12.508675 C 598.14435,11.598135 598.21358,10.952685 598.2136,10.572305 C 598.21358,9.9153452 597.94361,9.2353052 597.40367,8.5322052 C 597.19597,8.2671252 596.64911,7.6850652 595.76307,6.7860152 C 596.8014,6.8206152 597.70824,7.1145252 598.48357,7.6677552 C 599.3004,8.2555952 599.70881,8.9644452 599.70884,9.7943052 M 593.31252,12.992765 C 592.74487,12.831415 592.28108,12.341565 591.92113,11.523205 C 591.61651,10.854715 591.46423,10.209255 591.46423,9.5868352 C 591.46423,8.8261352 591.69958,8.2210252 592.17032,7.7714852 C 592.66873,9.2929352 593.04945,11.033365 593.31252,12.992765"
       id="zoom"
       fill="#ffffff"
       style="fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />

        <path
       d="M 567.16204,25.410285 L 553.35345,25.410285 C 552.23363,25.813925 551.13988,26.015755 550.0722,26.015755 C 549.00447,26.015755 547.90421,25.813925 546.77142,25.410285 L 532.98235,25.410285 L 532.98235,24.570435 L 534.05657,23.066535 L 534.05657,16.484505 L 539.05657,11.894655 C 539.83781,12.076965 540.66463,12.168105 541.53704,12.168095 C 542.10994,12.168105 542.89119,11.979305 543.88079,11.601685 C 544.87036,11.211075 545.8339,11.015765 546.77142,11.015755 C 548.37296,11.015765 549.47322,11.621235 550.0722,12.832155 C 550.64509,11.621235 551.73884,11.015765 553.35345,11.015755 C 554.29092,11.015765 555.25446,11.211075 556.24407,11.601685 C 557.23363,11.979305 558.01488,12.168105 558.58782,12.168095 C 559.46019,12.168105 560.29352,12.076965 561.08782,11.894655 L 566.06829,16.484505 L 566.06829,23.066535 L 567.16204,24.570435 L 567.16204,25.410285 M 565.34563,16.543095 L 560.83392,12.285285 C 560.19586,12.415505 559.4667,12.480605 558.64642,12.480595 C 557.8391,12.480605 556.96019,12.291805 556.0097,11.914185 C 555.05915,11.536595 554.17373,11.347795 553.35345,11.347785 C 551.89509,11.347795 550.87296,11.868625 550.28704,12.910285 L 550.46282,17.129035 C 551.10082,16.126435 552.16202,15.625135 553.64642,15.625125 C 554.90941,15.625135 556.24405,15.859515 557.65032,16.328255 C 559.06956,16.797005 560.2154,17.031385 561.08782,17.031375 C 562.25966,17.031385 563.67893,16.868625 565.34563,16.543095 M 565.34563,23.574345 L 565.34563,17.011845 C 564.69456,17.142065 563.28831,17.285295 561.12688,17.441535 C 560.22842,17.454565 559.05003,17.233205 557.59173,16.777465 C 556.14639,16.321745 554.83129,16.093885 553.64642,16.093875 C 552.03181,16.093885 550.8404,16.810035 550.0722,18.242315 C 549.30395,16.810035 548.11254,16.093885 546.49798,16.093875 C 545.31307,16.093885 543.99145,16.321745 542.53313,16.777465 C 541.08781,17.233205 539.91594,17.454565 539.01751,17.441535 C 537.59823,17.428515 536.18547,17.285295 534.77923,17.011845 L 534.77923,23.574345 L 547.08392,23.574345 C 547.72192,22.688935 548.71801,22.246225 550.0722,22.246215 C 551.42634,22.246225 552.41592,22.688935 553.04095,23.574345 L 565.34563,23.574345 M 549.85735,12.910285 C 549.25838,11.868625 548.22973,11.347795 546.77142,11.347785 C 545.95109,11.347795 545.06567,11.536595 544.11517,11.914185 C 543.17765,12.291805 542.30526,12.480605 541.49798,12.480595 C 540.67765,12.480605 539.94849,12.415505 539.31048,12.285285 L 534.77923,16.543095 C 536.45891,16.868625 537.88469,17.031385 539.05657,17.031375 C 539.92896,17.031385 541.06828,16.797005 542.47454,16.328255 C 543.8938,15.859515 545.23494,15.625135 546.49798,15.625125 C 547.98233,15.625135 549.04353,16.126435 549.68157,17.129035 L 549.85735,12.910285"
       id="flip"
       fill="#ffffff"
       style="fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" />
    <path
       d="M 658.94548,18.338935 C 657.94284,20.148835 656.71238,21.691805 655.25408,22.967835 C 651.75144,26.066805 647.40249,27.616275 642.2072,27.616275 C 637.01187,27.616275 632.65641,26.066805 629.1408,22.967835 C 627.68246,21.691805 626.44548,20.148835 625.42986,18.338935 C 626.44548,16.529055 627.68246,14.979575 629.1408,13.690495 C 632.65641,10.591555 637.01187,9.0420752 642.2072,9.0420552 C 647.40249,9.0420752 651.75144,10.591555 655.25408,13.690495 C 656.71238,14.979575 657.94284,16.529055 658.94548,18.338935 M 655.76189,18.338935 C 655.12384,17.219155 654.3491,16.216555 653.43767,15.331115 C 651.25014,13.221765 648.55483,11.900145 645.35173,11.366275 C 646.74494,11.965255 647.86473,12.883225 648.71111,14.120185 C 649.57046,15.396235 650.00014,16.802485 650.00017,18.338935 C 650.00014,19.862385 649.57697,21.249095 648.73064,22.499085 C 647.89728,23.749095 646.79702,24.680085 645.42986,25.292055 C 650.14337,24.484775 653.58738,22.167065 655.76189,18.338935 M 648.37908,18.338935 C 648.37905,16.672285 647.77358,15.246505 646.56267,14.061585 C 645.35171,12.876715 643.89338,12.284265 642.18767,12.284245 C 641.28921,12.284265 640.43635,12.466555 639.62908,12.831115 L 638.98455,11.366275 C 634.25797,12.173585 630.80094,14.497805 628.61345,18.338935 C 629.25147,19.458735 630.01969,20.454825 630.91814,21.327215 C 633.09261,23.423575 635.76188,24.745185 638.92595,25.292055 C 637.55875,24.680085 636.45849,23.749095 635.62517,22.499085 C 634.79182,21.249095 634.37516,19.862385 634.37517,18.338935 C 634.37516,17.414465 634.53792,16.516035 634.86345,15.643615 L 636.42595,16.131905 C 636.13948,16.848065 635.99625,17.583735 635.99626,18.338935 C 635.99625,20.018635 636.60172,21.450925 637.81267,22.635805 C 639.02359,23.807685 640.48192,24.393625 642.18767,24.393615 C 643.89338,24.393625 645.35171,23.807685 646.56267,22.635805 C 647.77358,21.450925 648.37905,20.018635 648.37908,18.338935 M 646.87517,18.338935 C 646.87515,19.601965 646.41291,20.682695 645.48845,21.581115 C 644.57697,22.479565 643.47671,22.928785 642.18767,22.928775 C 640.88557,22.928785 639.7788,22.479565 638.86736,21.581115 C 637.95588,20.682695 637.50016,19.601965 637.50017,18.338935 C 637.50016,17.779045 637.59781,17.238685 637.79314,16.717835 L 642.5783,18.885805 L 640.3322,14.139715 C 640.91812,13.879315 641.53661,13.749105 642.18767,13.749085 C 643.47671,13.749105 644.57697,14.198325 645.48845,15.096745 C 646.41291,15.995195 646.87515,17.075925 646.87517,18.338935"
       id="preview"
       fill="#ffffff"
       style="fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" />
  
  		<rect x="625" y="0" height="35" style="opacity:0;cursor:pointer" width="35" id="button1" onmouseover="document.getElementById('preview').setAttribute('fill','#ffff00');" onmouseout="document.getElementById('preview').setAttribute('fill','#ffffff');" onclick="pageFlip.setmode('preview')" />
		<rect x="580" y="0" height="35" style="opacity:0;cursor:pointer" width="35" id="button2" onmouseover="document.getElementById('zoom').setAttribute('fill','#ffff00');" onmouseout="document.getElementById('zoom').setAttribute('fill','#ffffff');" onclick="pageFlip.setmode('zoom')" />
		<rect x="530" y="0" height="35" style="opacity:0;cursor:pointer" width="40" id="button3" onmouseover="document.getElementById('flip').setAttribute('fill','#ffff00');" onmouseout="document.getElementById('flip').setAttribute('fill','#ffffff');" onclick="pageFlip.setmode('flip')" />

		<rect x="420" y="0" height="35" style="opacity:0;cursor:pointer" width="25" id="button5" onmouseover="document.getElementById('next').setAttribute('fill','#ffff00');" onmouseout="document.getElementById('next').setAttribute('fill','#ffffff');" onclick="pageFlip.nextpage()" />
		<rect x="280" y="0" height="35" style="opacity:0;cursor:pointer" width="25" id="button6" onmouseover="document.getElementById('prev').setAttribute('fill','#ffff00');" onmouseout="document.getElementById('prev').setAttribute('fill','#ffffff');" onclick="pageFlip.prevpage()" />

  </g>

  <defs
     id="defs5565">
    <defs
       id="defs2397">
      <linearGradient
         id="linearGradient3255">
        <stop
           id="stop3257"
           style="stop-color:#f9f9f9;stop-opacity:0.34042552"
           offset="0" />
        <stop
           id="stop3259"
           style="stop-color:#f9f9f9;stop-opacity:0"
           offset="1" />
      </linearGradient>
      <linearGradient
         id="linearGradient3215">
        <stop
           id="stop3217"
           style="stop-color:#999999;stop-opacity:0"
           offset="0" />
        <stop
           id="stop3219"
           style="stop-color:#000000;stop-opacity:0.6017316"
           offset="1" />

      </linearGradient>
      <linearGradient
         id="linearGradient3199">
        <stop
           id="stop3201"
           style="stop-color:#ffffff;stop-opacity:1"
           offset="0" />
        <stop
           id="stop3203"
           style="stop-color:#000000;stop-opacity:1"
           offset="1" />
      </linearGradient>
      <linearGradient
         id="linearGradient2407">
        <stop
           id="stop2409"
           style="stop-color:#4d4d4d;stop-opacity:1"
           offset="0" />
        <stop
           id="stop2411"
           style="stop-color:#000000;stop-opacity:1"
           offset="1" />
      </linearGradient>

      <linearGradient
         x1="231.66667"
         y1="12.5"
         x2="231.875"
         y2="31.666666"
         id="linearGradient2413"
         xlink:href="#linearGradient2407"
         gradientUnits="userSpaceOnUse"
         gradientTransform="translate(-3.5355339,7.6603235)" />
      <linearGradient
         x1="33.587574"
         y1="38.19754"
         x2="31.819805"
         y2="26.412428"
         id="linearGradient3205"
         xlink:href="#linearGradient3199"
         gradientUnits="userSpaceOnUse" />
      <linearGradient
         x1="231.9613"
         y1="19.865696"
         x2="231.875"
         y2="31.666666"
         id="linearGradient3213"
         xlink:href="#linearGradient3215"
         gradientUnits="userSpaceOnUse"
         gradientTransform="translate(-466.57747,-79.20855)" />
      <linearGradient
         x1="124.96523"
         y1="31.126474"
         x2="124.96523"
         y2="10.103861"
         id="linearGradient3261"
         xlink:href="#linearGradient3255"
         gradientUnits="userSpaceOnUse" />
    </defs>
    <linearGradient
       x1="231.66667"
       y1="12.5"
       x2="231.875"
       y2="31.666666"
       id="linearGradient5610"
       xlink:href="#linearGradient2407"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(-3.5355339,7.6603235)" />
    <linearGradient
       x1="124.96523"
       y1="31.126474"
       x2="124.96523"
       y2="10.103861"
       id="linearGradient5612"
       xlink:href="#linearGradient3255"
       gradientUnits="userSpaceOnUse" />
    <linearGradient
       x1="231.9613"
       y1="19.865696"
       x2="231.875"
       y2="31.666666"
       id="linearGradient5627"
       xlink:href="#linearGradient3215"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(-1.5,0,0,-1.5,799.86621,668.81282)" />
    <linearGradient
       x1="231.9613"
       y1="19.865696"
       x2="231.875"
       y2="31.666666"
       id="linearGradient6564"
       xlink:href="#linearGradient3215"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(-1.5,0,0,-1.5,690.31951,99.41594)" />

    <linearGradient
       x1="231.66667"
       y1="12.5"
       x2="231.875"
       y2="31.666666"
       id="linearGradient6571"
       xlink:href="#linearGradient2407"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(-3.5355339,7.6603235)" />
    <linearGradient
       x1="124.96523"
       y1="31.126474"
       x2="124.96523"
       y2="10.103861"
       id="linearGradient6573"
       xlink:href="#linearGradient3255"
       gradientUnits="userSpaceOnUse" />
  </defs>
 

</svg>  



<script id="pagestemplate" type="text/xml"><![CDATA[
<g id="layout" xmlns="http://www.w3.org/2000/svg">
	<clipPath id="pageclip">
	<rect id="pagecliprect" rx="0" ry="0" x="0" y="0" height="{pageHeight}" width="{pageWidth}" fill="rgb(0,0,0)" />
	</clipPath>




	<clipPath id="clip1">
	<rect x="-1000" y="-5000" id="mask1rect" height="5000" width="5000" fill="rgb(0,0,0)" />
	</clipPath>



	<clipPath id="clip2">
	
	<rect x="-1000" y="0" id="mask2rect" height="5000" width="5000" fill="rgb(0,0,0)" />
	
	</clipPath>


	<!--bgshadow-->
	<g id="backshadows" x="0" y="0">
	<g id="rshadow">
	<rect fill="url(#bgshad2)" x="0" y="-7" width="7" height="7" transform="translate({stageX+pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})" />
	<rect fill="url(#bgshad1)" x="0" y="0" width="7" height="{pageHeight}" transform="translate({stageX+pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})" />
	<rect fill="url(#bgshad2)" x="0" y="0" width="7" height="7" transform="translate({stageX+pageWidth*scaleX} {stageY+pageHeight*scaleY}) scale({scaleX} {scaleY})" />
	</g>

	<g id="lshadow">
	<rect fill="url(#bgshad2)" x="-7" y="-7" width="7" height="7" transform="translate({stageX-pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})" />
	<rect fill="url(#bgshad3)" x="-7" y="0" width="7" height="{pageHeight}" transform="translate({stageX-pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})" />
	<rect fill="url(#bgshad2)" x="-7" y="0" width="7" height="7" transform="translate({stageX-pageWidth*scaleX} {stageY+pageHeight*scaleY}) scale({scaleX} {scaleY})" />
	</g>

	<rect id="tshadow" fill="url(#bgshad4)" x="0" y="-7" width="{pageWidth*2}" height="7" transform="translate({stageX-pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})" />
	<rect id="bshadow" fill="url(#bgshad5)" x="0" y="{pageHeight}" width="{pageWidth*2}" height="7" transform="translate({stageX-pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})" />
	<rect x="{stageX-pageWidth*scaleX}" style="opacity:0.5;" y="{stageY}" height="{pageHeight*scaleY}" width="{pageWidth*scaleX*2}" fill="#000000" />
	</g>
	
	<!--intro stuff-->
	<g
     id="intro" transform="translate({20*scaleX} {20*scaleY}) translate({stageX-pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})">
     <text x="8" y="54" style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial;-inkscape-font-specification:Arial">
     <tspan>The latest project is finally finished, I say finished but as always there is stuff </tspan>
     <tspan x="8" y="72">that could be done to improve things(and a few bugs in need of fixing). I decided</tspan><tspan
         x="8.5714321"
         y="89.555817"
         id="tspan2389"
         >to see what SVG was capable of. So, I set about creating a page turning document </tspan><tspan
         x="8.5714321"
         y="107.05582"
         id="tspan2575"
         >viewer.</tspan><tspan
         x="8.5714321"
         y="142.05582"
         id="tspan2625"
         >Unfortunatley, despite my best efforts this demo is very slow in firefox and opera, but</tspan><tspan
         x="8.5714321"
         y="159.55582"
         id="tspan2627"
         >webkit based browsers, especially chrome seem to work very well.</tspan><tspan
         x="8.5714321"
         y="194.55582"
         id="tspan2535"
         style="font-size:14px;font-weight:bold;fill:#ffffff;-inkscape-font-specification:Arial Bold">Big thanks to the benderart peeps for letting me use blenderart magazine in </tspan>
	 <tspan
   id="tspan2577"
         x="8.5714321"
         y="210.55582"
   style="font-weight:bold;-inkscape-font-specification:Arial Bold">this demo.</tspan><tspan
         x="8.5714321"
         y="247.05582"
         id="tspan2587"
         >Simply click and drag the corners to turn the pages or use the navigation and mode</tspan><tspan
         x="8.5714321"
         y="264.55582"
         id="tspan2589"
         >buttons as follows: </tspan>
     </text>
    
    <path
       d="M 25.280421,6.7447999 L 25.280421,9.9308199 C 24.040501,9.3378499 22.870671,8.8957899 21.770941,8.6046599 C 20.671191,8.3135699 19.609181,8.1680199 18.584921,8.1679999 C 16.805911,8.1680199 15.431231,8.5130399 14.460881,9.2030499 C 13.501291,9.8931099 13.021501,10.87425 13.021501,12.14649 C 13.021501,13.2139 13.339561,14.02254 13.975701,14.57239 C 14.622601,15.1115 15.840941,15.54816 17.630731,15.88238 L 19.603801,16.2867 C 22.040471,16.75033 23.835651,17.56975 24.989311,18.74495 C 26.153731,19.9094 26.735951,21.47276 26.735971,23.43504 C 26.735951,25.7747 25.948881,27.54831 24.374751,28.75587 C 22.811371,29.96343 20.514851,30.56721 17.485171,30.56721 C 16.342291,30.56721 15.123951,30.43783 13.830141,30.17907 C 12.547101,29.9203 11.215551,29.53755 9.835481,29.0308 L 9.835481,25.66688 C 11.161641,26.41083 12.460851,26.97148 13.733101,27.34884 C 15.005351,27.72621 16.256041,27.91489 17.485171,27.91489 C 19.350421,27.91489 20.789791,27.54831 21.803291,26.81514 C 22.816761,26.08198 23.323511,25.03615 23.323531,23.67763 C 23.323511,22.49164 22.956931,21.56441 22.223781,20.89593 C 21.501391,20.22746 20.310001,19.72611 18.649611,19.39186 L 16.660361,19.00372 C 14.223671,18.51855 12.460851,17.75843 11.371891,16.72337 C 10.282921,15.68832 9.738441,14.24896 9.738441,12.40525 C 9.738441,10.27047 10.487781,8.5885099 11.986451,7.3593599 C 13.495901,6.1302599 15.571401,5.5156999 18.212951,5.5156699 C 19.345021,5.5156999 20.498681,5.6181199 21.673911,5.8229499 C 22.849111,6.0278299 24.051281,6.3351099 25.280421,6.7447999 M 38.056871,30.0982 L 28.838421,5.9523299 L 32.250861,5.9523299 L 39.900561,26.28144 L 47.566431,5.9523299 L 50.962701,5.9523299 L 41.760421,30.0982 L 38.056871,30.0982 M 70.936001,26.65341 L 70.936001,20.16815 L 65.599011,20.16815 L 65.599011,17.48348 L 74.170551,17.48348 L 74.170551,27.85019 C 72.909051,28.74509 71.518201,29.42434 69.997981,29.88796 C 68.477731,30.34079 66.855071,30.56721 65.130001,30.56721 C 61.356351,30.56721 58.402141,29.46747 56.267351,27.26798 C 54.143331,25.05771 53.081321,21.9849 53.081321,18.04953 C 53.081321,14.1034 54.143331,11.03059 56.267351,8.8310799 C 58.402141,6.6208299 61.356351,5.5156999 65.130001,5.5156699 C 66.704131,5.5156999 68.197411,5.7097699 69.609841,6.0978899 C 71.033021,6.4860599 72.343011,7.0574899 73.539811,7.8121999 L 73.539811,11.28933 C 72.332231,10.26508 71.049191,9.4941799 69.690701,8.9766299 C 68.332181,8.4591299 66.903591,8.2003699 65.404931,8.2003399 C 62.450701,8.2003699 60.229651,9.0251699 58.741771,10.67477 C 57.264661,12.3244 56.526111,14.78265 56.526111,18.04953 C 56.526111,21.30564 57.264661,23.7585 58.741771,25.40811 C 60.229651,27.05773 62.450701,27.88254 65.404931,27.88254 C 66.558571,27.88254 67.588231,27.78551 68.493921,27.59143 C 69.399581,27.38658 70.213601,27.07391 70.936001,26.65341"
       id="path5542"
       style="fill:#00ff00;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
    <path
       d="M 90.51248,29.00648 L 88.87327,29.00648 C 88.05947,29.00646 87.38519,28.70211 86.85042,28.09342 C 86.33888,27.50569 86.08312,26.84451 86.08313,26.10988 L 88.87327,26.10988 L 88.87327,22.86695 L 86.08313,22.86695 L 86.08313,10.90275 L 81.23526,10.90275 L 81.23526,22.86695 L 79.038021,22.86695 L 79.038021,26.10988 L 81.23526,26.10988 C 81.35151,28.1039 82.04904,29.63616 83.32786,30.70666 C 84.60667,31.79811 86.33888,32.34384 88.5245,32.34387 L 90.51248,32.34387 L 90.51248,29.00648 M 97.37285,10.90275 L 92.76911,10.90275 L 92.76911,32.34387 L 97.37285,32.34387 L 97.37285,10.90275 M 105.1798,29.57321 C 105.17979,28.85954 104.93565,28.26133 104.44738,27.77858 C 103.9591,27.29579 103.33132,27.05441 102.56404,27.05443 C 101.79675,27.05441 101.18059,27.2853 100.71557,27.74709 C 100.25054,28.22984 100.01803,28.82805 100.01803,29.54172 C 100.01803,30.25536 100.25054,30.84307 100.71557,31.30487 C 101.18059,31.78761 101.80837,32.029 102.59891,32.02902 C 103.3662,32.029 103.98235,31.79811 104.44738,31.33635 C 104.93565,30.87456 105.17979,30.28684 105.1798,29.57321 M 104.8659,10.90275 L 100.26217,10.90275 L 100.26217,26.0784 L 104.8659,26.0784 L 104.8659,10.90275 M 124.0078,17.57751 C 124.00779,15.37358 123.287,13.53697 121.84544,12.06768 C 120.40386,10.59839 118.48564,9.8637499 116.09078,9.8637499 C 114.62594,9.8637499 113.37038,10.30454 112.32409,11.18611 L 112.32409,3.5982799 L 107.68547,3.5982799 L 107.68547,18.80542 C 107.68547,20.84142 108.42951,22.49962 109.91759,23.78001 C 111.42891,25.06038 113.32388,25.70057 115.6025,25.70058 C 118.11362,25.70057 120.15972,24.90295 121.74082,23.30774 C 123.25212,21.77547 124.00779,19.8654 124.0078,17.57751 M 119.36919,17.67197 C 119.36918,18.80541 119.05529,19.8549 118.42752,20.82045 C 117.70672,21.95388 116.76505,22.52061 115.6025,22.52062 C 115.11422,22.52061 114.62594,22.40517 114.13768,22.17429 C 112.90536,21.58656 112.30083,20.10678 112.32409,17.73494 L 112.32409,16.60149 C 112.32408,15.69892 112.63797,14.90131 113.26576,14.20865 C 113.89353,13.51598 114.68407,13.16965 115.63738,13.16965 C 116.77668,13.16965 117.70672,13.6734 118.42752,14.68092 C 119.05529,15.58348 119.36918,16.58049 119.36919,17.67197"
       id="path5544"
       style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
    <path
       d="M 43.014136,341.6075 L 31.335206,353.28644 L 31.335206,329.92857 L 43.014136,341.6075"
       id="next"
       style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
    <path
       d="M 44.086744,311.04848 L 32.407824,299.36955 L 44.086744,287.69061 L 44.086744,311.04848"
       id="path5550"
       style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
    <path
       d="M 47.680713,411.91985 C 47.680683,413.77555 47.106133,415.2797 45.957023,416.43228 C 44.724813,417.6771 43.014983,418.29951 40.827523,418.2995 C 38.543103,418.29951 36.674063,417.4754 35.220363,415.82717 C 33.891253,414.3288 33.226693,412.5999 33.226713,410.64047 C 33.226693,406.62944 35.448793,404.62392 39.893003,404.62389 C 42.080463,404.62392 43.949493,405.39616 45.500143,406.94062 C 46.953833,408.39292 47.680683,410.05266 47.680713,411.91985 M 41.990483,421.25592 L 41.284403,421.03116 L 40.972893,419.06021 L 40.640613,419.06021 L 40.869063,420.92742 L 40.619853,420.92742 C 40.204483,420.92743 39.706063,421.04269 39.124603,421.2732 C 38.487733,421.51526 38.107003,421.76883 37.982403,422.03392 L 37.255553,419.14666 C 35.511093,419.07751 33.953543,418.38595 32.582933,417.07198 C 31.170733,415.71192 30.464663,414.14439 30.464663,412.36937 C 30.464663,410.66354 30.831553,409.34957 31.565343,408.42747 C 31.980653,407.88577 33.109013,406.96946 34.950383,405.67852 C 33.413593,407.05014 32.645223,408.68683 32.645233,410.5886 C 32.645223,412.61719 33.295923,414.40948 34.597343,415.96548 C 36.064883,417.70592 37.968543,418.57613 40.308333,418.57612 C 40.654443,418.57613 41.069773,418.57613 41.554373,418.57612 L 41.990483,421.25592 M 43.901063,432.40732 C 43.901053,432.79921 43.700303,433.14499 43.298833,433.44467 C 42.897303,433.74434 42.440423,433.89418 41.928183,433.89418 C 41.388213,433.89418 40.903653,433.72705 40.474473,433.3928 C 40.100653,433.10464 39.892973,432.81073 39.851463,432.51106 L 38.148543,422.62175 C 38.079303,422.25292 38.363113,421.93019 39.000013,421.65356 C 39.595313,421.38847 40.259853,421.25592 40.993663,421.25592 C 41.492053,421.25592 41.865853,421.4461 42.115083,421.82645 L 43.672633,431.16252 L 43.901063,432.40732 M 47.016153,411.86798 C 47.016143,410.17368 46.344653,408.66954 45.001743,407.35555 C 43.589533,405.96093 41.886633,405.26361 39.893003,405.26358 C 35.877983,405.26361 33.870473,407.07895 33.870493,410.70962 C 33.870473,412.49617 34.479653,414.06947 35.698013,415.42952 C 37.027103,416.92791 38.723083,417.6771 40.785993,417.67709 C 42.779613,417.6771 44.337163,417.11233 45.458623,415.98277 C 46.496953,414.93392 47.016143,413.56232 47.016153,411.86798 M 46.559273,412.05816 C 46.559243,414.50169 45.237073,416.21906 42.592743,417.21029 C 44.254093,415.64276 45.084783,413.98302 45.084813,412.23105 C 45.084783,410.52522 44.440993,409.11329 43.153453,407.99525 C 41.865853,406.86572 40.204483,406.27213 38.169313,406.21448 C 38.778473,405.99551 39.443013,405.88601 40.162973,405.88599 C 41.962773,405.88601 43.499543,406.54876 44.773293,407.87422 C 45.963933,409.11905 46.559243,410.5137 46.559273,412.05816 M 43.111923,411.50492 C 43.111893,412.47312 42.544263,413.37791 41.409013,414.21929 C 41.547433,413.30875 41.616663,412.6633 41.616683,412.28292 C 41.616663,411.62596 41.346693,410.94592 40.806753,410.24282 C 40.599053,409.97774 40.052193,409.39568 39.166153,408.49663 C 40.204483,408.53123 41.111323,408.82514 41.886653,409.37837 C 42.703483,409.96621 43.111893,410.67506 43.111923,411.50492 M 36.715603,414.70338 C 36.147953,414.54203 35.684163,414.05218 35.324213,413.23382 C 35.019593,412.56533 34.867313,411.91987 34.867313,411.29745 C 34.867313,410.53675 35.102663,409.93164 35.573403,409.4821 C 36.071813,411.00355 36.452533,412.74398 36.715603,414.70338"
       id="zoom"
       style="font-size:25.87099266px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
    <path
       d="M 55.011835,387.72494 L 41.203245,387.72494 C 40.083425,388.12858 38.989675,388.33041 37.921995,388.33041 C 36.854265,388.33041 35.754005,388.12858 34.621215,387.72494 L 20.832145,387.72494 L 20.832145,386.88509 L 21.906365,385.38119 L 21.906365,378.79916 L 26.906365,374.20931 C 27.687605,374.39162 28.514425,374.48276 29.386835,374.48275 C 29.959735,374.48276 30.740985,374.29396 31.730585,373.91634 C 32.720155,373.52573 33.683695,373.33042 34.621215,373.33041 C 36.222755,373.33042 37.323015,373.93589 37.921995,375.14681 C 38.494885,373.93589 39.588635,373.33042 41.203245,373.33041 C 42.140715,373.33042 43.104255,373.52573 44.093865,373.91634 C 45.083425,374.29396 45.864675,374.48276 46.437615,374.48275 C 47.309985,374.48276 48.143315,374.39162 48.937615,374.20931 L 53.918085,378.79916 L 53.918085,385.38119 L 55.011835,386.88509 L 55.011835,387.72494 M 53.195425,378.85775 L 48.683715,374.59994 C 48.045655,374.73016 47.316495,374.79526 46.496215,374.79525 C 45.688895,374.79526 44.809985,374.60646 43.859495,374.22884 C 42.908945,373.85125 42.023525,373.66245 41.203245,373.66244 C 39.744885,373.66245 38.722755,374.18328 38.136835,375.22494 L 38.312615,379.44369 C 38.950615,378.44109 40.011815,377.93979 41.496215,377.93978 C 42.759205,377.93979 44.093845,378.17417 45.500115,378.64291 C 46.919355,379.11166 48.065195,379.34604 48.937615,379.34603 C 50.109455,379.34604 51.528725,379.18328 53.195425,378.85775 M 53.195425,385.889 L 53.195425,379.3265 C 52.544355,379.45672 51.138105,379.59995 48.976675,379.75619 C 48.078215,379.76922 46.899825,379.54786 45.441525,379.09212 C 43.996185,378.6364 42.681085,378.40854 41.496215,378.40853 C 39.881605,378.40854 38.690195,379.12469 37.921995,380.55697 C 37.153745,379.12469 35.962335,378.40854 34.347775,378.40853 C 33.162865,378.40854 31.841245,378.6364 30.382925,379.09212 C 28.937605,379.54786 27.765735,379.76922 26.867305,379.75619 C 25.448025,379.74317 24.035265,379.59995 22.629025,379.3265 L 22.629025,385.889 L 34.933715,385.889 C 35.571715,385.00359 36.567805,384.56088 37.921995,384.56087 C 39.276135,384.56088 40.265715,385.00359 40.890745,385.889 L 53.195425,385.889 M 37.707145,375.22494 C 37.108175,374.18328 36.079525,373.66245 34.621215,373.66244 C 33.800885,373.66245 32.915465,373.85125 31.964965,374.22884 C 31.027445,374.60646 30.155055,374.79526 29.347775,374.79525 C 28.527445,374.79526 27.798285,374.73016 27.160275,374.59994 L 22.629025,378.85775 C 24.308705,379.18328 25.734485,379.34604 26.906365,379.34603 C 27.778755,379.34604 28.918075,379.11166 30.324335,378.64291 C 31.743595,378.17417 33.084735,377.93979 34.347775,377.93978 C 35.832125,377.93979 36.893325,378.44109 37.531365,379.44369 L 37.707145,375.22494"
       id="flip"
       style="font-size:40px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Webdings;-inkscape-font-specification:Webdings Bold" />
    <path
       d="M 59.922157,459.4455 C 58.919517,461.2554 57.689057,462.79837 56.230757,464.0744 C 52.728117,467.17337 48.379167,468.72284 43.183877,468.72284 C 37.988547,468.72284 33.633087,467.17337 30.117477,464.0744 C 28.659137,462.79837 27.422157,461.2554 26.406537,459.4455 C 27.422157,457.63562 28.659137,456.08614 30.117477,454.79706 C 33.633087,451.69812 37.988547,450.14864 43.183877,450.14862 C 48.379167,450.14864 52.728117,451.69812 56.230757,454.79706 C 57.689057,456.08614 58.919517,457.63562 59.922157,459.4455 M 56.738567,459.4455 C 56.100517,458.32572 55.325777,457.32312 54.414347,456.43768 C 52.226817,454.32833 49.531507,453.00671 46.328407,452.47284 C 47.721617,453.07182 48.841407,453.98979 49.687787,455.22675 C 50.547137,456.5028 50.976817,457.90905 50.976847,459.4455 C 50.976817,460.96895 50.553647,462.35566 49.707317,463.60565 C 48.873957,464.85566 47.773697,465.78665 46.406537,466.39862 C 51.120047,465.59134 54.564057,463.27363 56.738567,459.4455 M 49.355757,459.4455 C 49.355727,457.77885 48.750257,456.35307 47.539347,455.16815 C 46.328387,453.98328 44.870057,453.39083 43.164347,453.39081 C 42.265887,453.39083 41.413027,453.57312 40.605757,453.93768 L 39.961227,452.47284 C 35.234647,453.28015 31.777617,455.60437 29.590127,459.4455 C 30.228147,460.5653 30.996367,461.56139 31.894817,462.43378 C 34.069287,464.53014 36.738557,465.85175 39.902627,466.39862 C 38.535427,465.78665 37.435167,464.85566 36.601847,463.60565 C 35.768497,462.35566 35.351837,460.96895 35.351847,459.4455 C 35.351837,458.52103 35.514597,457.6226 35.840127,456.75018 L 37.402627,457.23847 C 37.116157,457.95463 36.972927,458.6903 36.972937,459.4455 C 36.972927,461.1252 37.578397,462.55749 38.789347,463.74237 C 40.000267,464.91425 41.458597,465.50019 43.164347,465.50018 C 44.870057,465.50019 46.328387,464.91425 47.539347,463.74237 C 48.750257,462.55749 49.355727,461.1252 49.355757,459.4455 M 47.851847,459.4455 C 47.851827,460.70853 47.389587,461.78926 46.465127,462.68768 C 45.553647,463.58613 44.453387,464.03535 43.164347,464.03534 C 41.862247,464.03535 40.755477,463.58613 39.844037,462.68768 C 38.932557,461.78926 38.476837,460.70853 38.476847,459.4455 C 38.476837,458.88561 38.574487,458.34525 38.769817,457.8244 L 43.554977,459.99237 L 41.308877,455.24628 C 41.894797,454.98588 42.513287,454.85567 43.164347,454.85565 C 44.453387,454.85567 45.553647,455.30489 46.465127,456.20331 C 47.389587,457.10176 47.851827,458.18249 47.851847,459.4455"
       id="preview"
       style="font-size:40px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Webdings;-inkscape-font-specification:Webdings" />
    <text
       x="74.95433"
       y="309.15244"
       id="text2591"
       style="font-size:32px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial;-inkscape-font-specification:Arial"><tspan
         x="74.95433"
         y="309.15244"
         id="tspan2593">Backwards</tspan><tspan
         x="74.95433"
         y="349.15244"
         id="tspan2595">Forwards</tspan><tspan
         x="74.95433"
         y="389.15244"
         id="tspan2597">Page Turning Mode</tspan><tspan
         x="74.95433"
         y="429.15244"
         id="tspan2599">Zoom Mode</tspan><tspan
         x="74.95433"
         y="469.15244"
         id="tspan2601">Preview Mode</tspan></text>
  </g>
	


	<!--page 1-->
	<g id="page1" transform="translate({stageX-pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})">
		<g clip-path="url(#pageclip)" id="resize1">
			<g id="page1content">
			<rect x="0" y="0" height="{pageHeight}" width="{pageWidth}" fill="rgb(200,200,200)" />
			</g>
			<!--pageshadow-->
			<rect  x="1" y="-{pageHeight/2}"  height="{pageHeight*2}" width="{pageWidth}" fill="url(#shadow)" />
			<rect  id="page1shadow" x="1" y="-{pageHeight}"  height="{pageHeight*3}" width="{pageWidth}" fill="url(#shade2)"  />
		</g>
	</g>

	<!--page 6-->
	<g id="page6">
		<g clip-path="url(#pageclip)" transform="translate({stageX} {stageY}) scale({scaleX} {scaleY})">
			<g id="page6content">
			<rect x="0" y="0" height="{pageHeight}" width="{pageWidth}" fill="rgb(200,200,200)" />
			</g>
			<!--pageshadow-->
			<rect  x="1" y="-{pageHeight/2}"  height="{pageHeight*2}" width="{pageWidth}" fill="url(#shadow)" transform="rotate(180 {pageWidth/2} {pageHeight/2})" />
			
			<rect  id="page6shadow" x="1" y="-{pageHeight}"  height="{pageHeight*3}" width="{pageWidth}" fill="url(#shade)"  />

		</g>
	</g>


	<!--pages 2+3-->
	<g id="pages2to3" clip-path="url(#clip2)" transform="translate({stageX-pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})">
		

		<g id="page3" clip-path="url(#pageclip)">
			<g id="page3content">
			<rect x="0" y="0" height="{pageHeight}" width="{pageWidth}" fill="rgb(200,200,200)" />
			</g>
			<rect  x="1" y="-{pageHeight/2}"  height="{pageHeight*2}" width="{pageWidth}" fill="url(#shadow)" />
		</g>

		<g id="page2" clip-path="url(#pageclip)">
			<g id="page2content">
			<rect x="0" y="0" height="{pageHeight}" width="{pageWidth}" fill="rgb(150,50,80)" />
			</g>
			<!--pageshadow-->
			<rect  x="1" y="-{pageHeight/2}"  id="shadow2" height="{pageHeight*2}" width="{pageWidth}" fill="url(#shadow)" />
		</g>
	</g>

	<!--pages 4+5-->
	<g id="pages4to5" clip-path="url(#clip1)" transform="translate({stageX} {stageY}) scale({scaleX} {scaleY})">
		<g id="page4" clip-path="url(#pageclip)">
		<g id="page4content">
			<rect x="0" y="0" height="{pageHeight}" width="{pageWidth}" fill="rgb(200,200,200)" />
		</g>
		<rect  x="1" y="-{pageHeight/2}"  height="{pageHeight*2}" width="{pageWidth}" fill="url(#shadow)" transform="rotate(180 {pageWidth/2} {pageHeight/2})" />
		</g>

		<g id="page5" clip-path="url(#pageclip)">
		<g id="page5content">
			<rect x="0" y="0" height="{pageHeight}" width="{pageWidth}" fill="rgb(200,200,200)" />
		</g>
		<!--pageshadow-->
		<rect  x="1" y="-{pageHeight/2}"  id="shadow1" height="{pageHeight*2}" width="{pageWidth}" fill="url(#shadow)" />
		</g>
		

	</g>
</g>
]]>
</script>



<script id="zoomtemplate" type="text/xml"><![CDATA[
<g id="layout" xmlns="http://www.w3.org/2000/svg"  xmlns:xlink="http://www.w3.org/1999/xlink">
	<clipPath id="pageclip">
	<rect  rx="0" ry="0" x="0" y="0" height="{pageHeight/2}" width="{pageWidth}" fill="rgb(0,0,0)"  />
	</clipPath>
	

	<!--bgshadow-->
	<g id="backshadows" x="0" y="0">
	<g id="rshadow">
	<rect fill="url(#bgshad2)" x="0" y="-7" width="7" height="7" transform="translate({stageX+pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})" />
	<rect fill="url(#bgshad1)" x="0" y="0" width="7" height="{pageHeight}" transform="translate({stageX+pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})" />
	<rect fill="url(#bgshad2)" x="0" y="0" width="7" height="7" transform="translate({stageX+pageWidth*scaleX} {stageY+pageHeight*scaleY}) scale({scaleX} {scaleY})" />
	</g>

	<g id="lshadow">
	<rect fill="url(#bgshad2)" x="-7" y="-7" width="7" height="7" transform="translate({stageX-pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})" />
	<rect fill="url(#bgshad3)" x="-7" y="0" width="7" height="{pageHeight}" transform="translate({stageX-pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})" />
	<rect fill="url(#bgshad2)" x="-7" y="0" width="7" height="7" transform="translate({stageX-pageWidth*scaleX} {stageY+pageHeight*scaleY}) scale({scaleX} {scaleY})" />
	</g>

	<rect id="tshadow" fill="url(#bgshad4)" x="0" y="-7" width="{pageWidth*2}" height="7" transform="translate({stageX-pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})" />
	<rect id="bshadow" fill="url(#bgshad5)" x="0" y="{pageHeight}" width="{pageWidth*2}" height="7" transform="translate({stageX-pageWidth*scaleX} {stageY}) scale({scaleX} {scaleY})" />
	<rect x="{stageX-pageWidth*scaleX}" y="{stageY}" height="{pageHeight*scaleY}" width="{pageWidth*scaleX*2}" fill="#ffffff" />
	</g>
	<g clip-path="url(#pageclip)" transform="translate({stageX-pageWidth*scaleX} {stageY}) scale({scaleX*2} {scaleY*2})">
	
	<g  id="zoomcontent" rx="0" ry="0" x="0" y="0" height="{pageHeight}" width="{pageWidth*2}" fill="rgb(0,0,0)">
	<image id="previewimage" xlink:href="" x="-{pageWidth/2}" y="0" height="{pageHeight}" width="{pageWidth*2}" />
	</g>
	
	</g>
	
 <g id="leftarrow" transform="translate({stageX-pageWidth*scaleX+10} {stageY+pageHeight*scaleY/2-100*scaleY}) scale({scaleX} {scaleY})" style="cursor:pointer" onclick="pageFlip.pageturned(-1);">
      <rect
         ry="10"
         rx="6.7285743"
         y="0"
         x="0"
         height="200"
         width="58"
         style="fill:#000000;fill-opacity:0.5497835;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />

    <path
       style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       d="M 0,75 L 20,150 L 20,0 L 0,75 z" transform="translate(15 30)" />
</g>

 <g id="rightarrow" transform="translate({stageX+pageWidth*scaleX-10-58*scaleX} {stageY+pageHeight*scaleY/2-100*scaleY}) scale({scaleX} {scaleY})" style="cursor:pointer" onclick="pageFlip.pageturned(1);">
      <rect
         ry="10"
         rx="6.7285743"
         y="0"
         x="0"
         height="200"
	 transform="rotate(180 29 100)"
         width="58"
         style="fill:#000000;fill-opacity:0.5497835;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />

    <path
       style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       d="M 0,75 L 20,150 L 20,0 L 0,75 z" transform="rotate(180 29 100) translate(15 30)" />
</g>


</g>
]]>
</script>

<script id="previewtemplate" type="text/xml"><![CDATA[
<g id="layout" xmlns="http://www.w3.org/2000/svg"  xmlns:xlink="http://www.w3.org/1999/xlink">
</g>
]]>

</script>

<script type="text/javascript">
<![CDATA[




	
	
function loadExternalSVG(url){
	var req = new XMLHttpRequest();
	req.url=url;
	req.onreadystatechange  = function()
	{ 
		 if(this.readyState  == 4)
		 {
			if(this.status  == 200){
				var content=document.importNode(this.responseXML.getElementsByTagName("svg")[0],true);
				var gs=document.getElementsByTagName("g");
				for(var i=0; i<gs.length;i++){
					if(this.url=gs[i].url){		
						gs[i].appendChild(content);
						
					}
				}
			}else{
				alert("Error code ");
			}
		 }
	}; 
	
	req.open("GET", url, true);
	req.send("");
}


function templateParser(template){
	this.template=template;
}

templateParser.prototype.setTemplate=function(template){
		this.template=template;
}
templateParser.prototype.setVariables=function(variables){
		this.variables=variables;
}
templateParser.prototype.getParsed=function(){
	if(this.variables){
		for(key in this.variables){
			eval(key+"="+this.variables[key]);
		}
	}
	var open=false;
	var output="";
	var buffer;
	for(var i=0;i<this.template.length;i++){
		if(this.template[i]=="{"){
			buffer="";
			open=true;
		}
		else if(this.template[i]=="}"){
			eval("val="+buffer+";");
			output=output+val;
			open=false;
		}
		else
		{
			if(!open) output=output+this.template[i];
				else buffer=buffer+this.template[i];
		}
	}
	return output;
};




function MoveToTop( svgNode )
{
   svgNode.parentNode.appendChild( svgNode );
}

var pageFlip={
	page5:document.getElementById("page5"),
	page2:document.getElementById("page2"),
	page1:document.getElementById("page1"),
	page6:document.getElementById("page6"),
	shadow1:document.getElementById("shadow1"),
	shadow2:document.getElementById("shadow2"),
	page6shadow:document.getElementById("page6shadow"),
	page1shadow:document.getElementById("page1shadow"),
	mask1rect:document.getElementById("mask1rect"),
	mask2rect:document.getElementById("mask2rect"),
	pageWidth:638,
	pageHeight:539,
	scaleX:10,
	scaleY:10,
	stageX:500,
	stageY:100,
	zoomTarget:0,
	zoomCurrent:0,
	margin:35,
	pagenum:0,
	BR:0,
	TR:1,
	BL:2,
	TL:3,
	stage:document.getElementById("svg"),
	pos:[[0,0],[0,0],[0,0],[0,0]],
	drag:null,
	mode:'flip',
	mouseclick:false,
	falling:false,
	layoutopacity:1,
	targetmode:'flip',
	pages:[],
	template:new templateParser(),
	//set the viewers mode
	setmode:function(mode){
		this.targetmode=mode;
		pageFlip.modefade('out');
	},
	modefade:function(type){
		if(this.mode=="zoom"){
			var svgs=document.getElementById('zoomcontent').getElementsByTagName("svg");
			if(svgs[0]) svgs[0].style.visibility="hidden";
		}
		if(type=='out') this.layoutopacity=this.layoutopacity*0.2;
		if(type=='in') this.layoutopacity=this.layoutopacity*5;
		if(this.layoutopacity<0.03){
			this.mode=this.targetmode;
			this.resize_position();
			if(this.mode!="preview") setTimeout("pageFlip.modefade('in');",16);
				else this.layoutopacity=1;
		}
		else if(this.layoutopacity<1 && type=='out')
		{
			setTimeout("pageFlip.modefade('out');",16);
		}
		else if(this.layoutopacity<1 && type=='in')
		{
			setTimeout("pageFlip.modefade('in');",16);
		}
		else if(this.layoutopacity>1 && type=='in')
		{
			this.layoutopacity=1;
			if(this.mode=="zoom"){
				var svgs=document.getElementById('zoomcontent').getElementsByTagName("svg");
				if(svgs[0]) svgs[0].style.visibility="";
			}
		}
		document.getElementById("layout").setAttribute("opacity",this.layoutopacity);
	},
	nextpage:function(){
		if(this.pagenum<this.pages.length){
			if(this.mode=="flip") this.turnleft();
			if(this.mode=="zoom") pageFlip.pageturned(1);
		}
	},
	prevpage:function(){
		if(this.pagenum>0){
			if(this.mode=="flip") this.turnright();
			if(this.mode=="zoom") pageFlip.pageturned(-1);
		}
		else
		{
			this.pagenum=0;
		}
	},
	//sets the pages to prokies when the page turning starts
	resize_position:function(){
		//remove the old layout
		var layout=document.getElementById("layout");
		if(layout){
			layout.parentNode.removeChild(layout);
			document.getElementById("nav").setAttribute("transform","translate("+(document.documentElement.clientWidth/2-350)+" "+(document.documentElement.clientHeight-90)+")");
				
			//calculate new dims
			var scale1=(document.documentElement.clientWidth/2-this.margin)/this.pageWidth;
			var scale2=(document.documentElement.clientHeight-this.margin*2-100)/this.pageHeight;
			this.scaleX=this.scaleY=Math.min(scale1,scale2);
			this.stageX=document.documentElement.clientWidth/2;
			this.stageY=((document.documentElement.clientHeight-100)-this.pageHeight*this.scaleY)/2;
				
			variables={};
			variables.pageWidth=this.pageWidth;
			variables.pageHeight=this.pageHeight;
			variables.scaleX=this.scaleX;
			variables.scaleY=this.scaleY;
			variables.stageX=this.stageX;
			variables.stageY=this.stageY;
			this.stage.style.height=document.documentElement.clientHeight+'px';
			this.stage.style.width=document.documentElement.clientWidth+'px';
			document.getElementById("background").setAttribute("height",document.documentElement.clientHeight)
			document.getElementById("background").setAttribute("width",document.documentElement.clientWidth);
				
			this.template.setVariables(variables);
		
			if(pageFlip.mode=='flip') pageFlip.flip_resize();
			if(pageFlip.mode=='zoom') pageFlip.zoom_resize();
			if(pageFlip.mode=='preview') pageFlip.preview_resize();
			if(pageFlip.mode=='flip' || pageFlip.mode=='zoom') this.ztop(document.getElementById("nav"));
		}
	},
	setproxies:function(){
		var content;
		this.pagenum=Math.ceil((this.pagenum)/2)*2;
		
		if(this.pagenum<3){
			this.page1.setAttribute("clip-path","url(#clip2)");
		}
		else 
		{
			this.page1.setAttribute("clip-path","");
		}
		if(this.pagenum>35){
			this.page6.setAttribute("clip-path","url(#clip1)");
		}
		else 
		{
			this.page6.setAttribute("clip-path","");
		}
		
		for(var i=1; i<7;i++){
			content=document.getElementById("page"+i+"content");
			while(content.firstChild) content.removeChild(content.firstChild);
			if(this.pagenum-4+i>=0 && this.pagenum-4+i<this.pages.length){
				var newimage=document.createElementNS("http://www.w3.org/2000/svg","image");
				newimage.setAttribute("height",this.pageHeight);
				newimage.setAttribute("width",this.pageWidth);
				newimage.setAttribute("x",0);
				newimage.setAttribute("y",0);
				newimage.setAttributeNS("http://www.w3.org/1999/xlink","href",this.pages[this.pagenum-4+i].proxy);
				newimage=content.appendChild(newimage);
			}
		}
		//load the next images in advance
		for(i=7+this.pagenum;i<14+this.pagenum;i++){
			if(this.pages[i]){
				var load=new Image();
				load.src=this.pages[i].proxy;
			}
		}
		this.corneranim[0](0,0);
		this.corneranim[2](0,0);
		if(pageFlip.pagenum==0){
			pageFlip.mask2rect.setAttribute("transform","rotate(0 0 0)");
		}
	},
	//this is messy there must be a better way?
	ztop:function(elem1){
	   var newelem=elem1.cloneNode(true);
	   var parent=elem1.parentNode
	   parent.removeChild(elem1);
	   parent.appendChild(newelem);
	   this.resetRef();
	},
	resetRef:function(){
	   this.page5=document.getElementById("page5");
	   this.page2=document.getElementById("page2");
	   this.page1=document.getElementById("page1");
	   this.page6=document.getElementById("page6");
	   this.shadow1=document.getElementById("shadow1");
	   this.shadow2=document.getElementById("shadow2");
	   this.mask1rect=document.getElementById("mask1rect");
	   this.mask2rect=document.getElementById("mask2rect");
	   this.page6shadow=document.getElementById("page6shadow");
	   this.page1shadow=document.getElementById("page1shadow");
	},
	mousedown:function(e){
		pageFlip.mouseclick=true;
		if(pageFlip.mode=='flip') pageFlip.flip_down(e);
		return false;
	},
	mouseup:function(e){
		pageFlip.mouseclick=false;
		if(pageFlip.mode=='flip') pageFlip.flip_up(e);
	},
	mousemove:function (e){
		if(pageFlip.mode=='flip') pageFlip.flip_move(e);
		if(pageFlip.mode=='zoom') pageFlip.zoom_move(e);
	},
	//funtion to set position of pages and masks
	corneranim:[
	function(pageX,pageY){
			if(pageFlip.pagenum==0){
				pageFlip.mask2rect.setAttribute("transform","rotate(0 0 0)");
			}
			var angle=(pageY/pageFlip.pageHeight*90);
			pageFlip.mask1rect.setAttribute("y",pageFlip.pageHeight);
			maxangle=Math.atan((pageX/2-pageFlip.pageWidth)/pageFlip.pageHeight)/3.141*360;
			if(angle<maxangle) angle=maxangle;
			pageFlip.page5.setAttribute("transform","translate("+(pageFlip.pageWidth-pageX)+" 0) rotate("+angle+" "+(pageX/2)+" "+pageFlip.pageHeight+")");
			pageFlip.mask1rect.setAttribute("transform","rotate("+(angle/2+90)+" "+(pageFlip.pageWidth-pageX/2)+" "+pageFlip.pageHeight+")");
			pageFlip.shadow1.setAttribute("transform","translate(-"+(pageFlip.pageWidth-pageX/2)+" 0) rotate("+(-angle/2)+" "+pageFlip.pageWidth+" "+pageFlip.pageHeight+")");
			
			pageFlip.page6shadow.setAttribute("transform","translate("+(pageFlip.pageWidth-pageX-1)+" 0) rotate("+(angle/2)+" "+(pageFlip.pageWidth-pageX/2)+" "+pageFlip.pageHeight+")");
	},
	function(pageX,pageY){
			if(pageFlip.pagenum==0){
				pageFlip.mask2rect.setAttribute("transform","rotate(0 0 0)");
			}
			pageFlip.mask1rect.setAttribute("y",-5000); //added this line
			var angle=(pageY/pageFlip.pageHeight*90);
			maxangle=Math.atan((pageX/2-pageFlip.pageWidth)/-pageFlip.pageHeight)/3.141*360;
			if(angle>maxangle) angle=maxangle;
			pageFlip.page5.setAttribute("transform","translate("+(pageFlip.pageWidth-pageX)+" 0) rotate("+(angle)+" "+(pageX/2)+" 0)");
			pageFlip.mask1rect.setAttribute("transform","rotate("+(angle/2+90+180)+" "+(pageFlip.pageWidth-pageX/2)+" 0)");
			pageFlip.shadow1.setAttribute("transform","translate(-"+(pageFlip.pageWidth-pageX/2)+" 0) rotate("+(-angle/2)+" "+pageFlip.pageWidth+" 0)");
			
			pageFlip.page6shadow.setAttribute("transform","translate("+(pageFlip.pageWidth-pageX-1)+" 0) rotate("+(angle/2)+" "+(pageX/2)+" 0)");
	},
	function(pageX,pageY){
			if(pageFlip.pagenum==pageFlip.pages.length){
				pageFlip.mask1rect.setAttribute("transform","rotate(0 0 0)");
			}
			var angle=-(pageY/pageFlip.pageHeight*90);
			pageFlip.mask2rect.setAttribute("y",pageFlip.pageHeight);
			maxangle=-Math.atan((pageX/2-pageFlip.pageWidth)/pageFlip.pageHeight)/3.141*360;
			if(angle>maxangle) angle=maxangle;
			pageFlip.page2.setAttribute("transform","translate("+(-pageFlip.pageWidth+pageX)+" 0) rotate("+angle+" "+(pageFlip.pageWidth-pageX/2)+" "+pageFlip.pageHeight+")");
			pageFlip.mask2rect.setAttribute("transform","rotate("+(angle/2+90+180)+" "+(pageX/2)+" "+pageFlip.pageHeight+")");
			pageFlip.shadow2.setAttribute("transform","rotate(180 "+(pageFlip.pageWidth/2)+" "+(pageFlip.pageHeight/2)+") translate(-"+(pageFlip.pageWidth-pageX/2)+" 0) rotate("+(-angle/2)+" "+pageFlip.pageWidth+" 0)");
			
			pageFlip.page1shadow.setAttribute("transform","translate("+(-pageFlip.pageWidth+pageX-1)+" 0) rotate("+(angle/2)+" "+(pageX/2)+" "+pageFlip.pageHeight+")");
	},
	function(pageX,pageY){
			if(pageFlip.pagenum==pageFlip.pages.length){
				pageFlip.mask1rect.setAttribute("transform","rotate(0 0 0)");
			}
			var angle=-(pageY/pageFlip.pageHeight*90);
			pageFlip.mask2rect.setAttribute("y",-5000);
			maxangle=-Math.atan((pageX/2-pageFlip.pageWidth)/-pageFlip.pageHeight)/3.141*360;
			if(angle<maxangle) angle=maxangle;
			pageFlip.page2.setAttribute("transform","translate("+(-pageFlip.pageWidth+pageX)+" 0) rotate("+angle+" "+(pageFlip.pageWidth-pageX/2)+" 0)");
			pageFlip.mask2rect.setAttribute("transform","rotate("+(angle/2+90)+" "+(pageX/2)+" 0)");
			pageFlip.shadow2.setAttribute("transform","rotate(180 "+(pageFlip.pageWidth/2)+" "+(pageFlip.pageHeight/2)+") translate(-"+(pageFlip.pageWidth-pageX/2)+" 0) rotate("+(-angle/2)+" "+pageFlip.pageWidth+" "+pageFlip.pageHeight+")");
			
			pageFlip.page1shadow.setAttribute("transform","translate("+(-pageFlip.pageWidth+pageX-1)+" 0) rotate("+(angle/2)+" "+(pageX/2)+" 0)");
	}
	],
	turnleft:function(){
			if(this.drag==null && (this.pos[0][0]==0 || this.pos[0][0]==this.pageWidth*2)){
				this.pos[0][0]=1;
				this.drag='autoleft';
				pageFlip.setproxies();
				pageFlip.ztop(document.getElementById("pages4to5"));
			}
			if(Math.abs(this.pos[0][0])<this.pageWidth && this.drag=='autoleft'){
				this.pos[0][0]=(this.pos[0][0])*2;
				this.pos[0][1]=this.pos[0][0]/this.pageWidth*this.pageHeight/5;
				this.corneranim[0](this.pos[0][0],this.pos[0][1]);
				setTimeout("pageFlip.turnleft()",16);
			}
			else
			{
				this.drag=null;
			}
	},
	turnright:function(){
			if(this.drag==null && (this.pos[2][0]==0 || this.pos[2][0]==this.pageWidth*2)){
				this.pos[2][0]=1;
				this.drag='autoright';
				pageFlip.setproxies();
				pageFlip.ztop(document.getElementById("pages2to3"));
			}
			if(Math.abs(this.pos[2][0])<this.pageWidth && this.drag=='autoright'){
				this.pos[2][0]=(this.pos[2][0])*2;
				this.pos[2][1]=this.pos[2][0]/this.pageWidth*this.pageHeight/5;
				this.corneranim[2](this.pos[2][0],this.pos[2][1]);
				setTimeout("pageFlip.turnright()",16);
			}
			else
			{
				this.drag=null;
			}
	},
	fall:function(){
			if(this.drag==null && pageFlip.mode=='flip' && pageFlip.drag!="autoleft" && pageFlip.drag!="autoright"){
				this.falling=false;
				for(var i=0;i<this.pos.length;i++){
					if((Math.abs(this.pos[i][0])>0 && Math.abs(this.pos[i][0])<this.pageWidth*2) || this.pos[i][1]!=0){

						if(Math.abs(this.pos[i][0])>=0 && Math.abs(this.pos[i][0])<=this.pageWidth) this.pos[i][0]=this.pos[i][0]*3/4;
						if(Math.abs(this.pos[i][0])>0 && Math.abs(this.pos[i][0])>this.pageWidth) this.pos[i][0]=this.pageWidth*2-(this.pageWidth*2-this.pos[i][0])*3/4;
						if(this.pos[i][1]!=0) this.pos[i][1]=this.pos[i][1]*5/6;
						if(this.pos[i][0]<1) this.pos[i][0]=0;
						if(this.pos[i][0]>this.pageWidth*2-1 && this.pos[i][0]!=this.pageWidth*2){
							this.pos[i][0]=this.pageWidth*2;
							//turn the page
							if(i==this.BR || i==this.TR) this.pageturned(2);
								else this.pageturned(-2);
						}
						if(Math.abs(this.pos[i][1])<2) this.pos[i][1]=0;
						this.corneranim[i](Math.round(this.pos[i][0]),Math.round(this.pos[i][1]));
						this.falling=true;
					}
				}
			}
			setTimeout("pageFlip.fall()",16);
	},
	scroll:function(){
		if(pageFlip.mode=='zoom'){
			if(this.zoomTarget!=this.zoomCurrent){
				this.zoomCurrent=this.zoomCurrent+(this.zoomTarget-this.zoomCurrent)/1.8;
				if(Math.round(this.zoomCurrent)==Math.round(this.zoomTarget)){
					this.zoomCurrent=this.zoomTarget;
					var svgs=document.getElementById('zoomcontent').getElementsByTagName("svg");
					if(svgs[0]) svgs[0].style.visibility="";
				}
				document.getElementById("zoomcontent").setAttribute("transform","translate(0 "+(-this.pageHeight/2-this.zoomCurrent)+")");
			}
		}
			setTimeout("pageFlip.scroll()",16);
	},
	explode:function(){
		if(pageFlip.mode=='preview'){
			var images=document.getElementById("layout").getElementsByTagName("image");
			for(var i=0; i<images.length;i++){
				if(!images[i].currentx) images[i].currentx=images[i].getAttribute("x");
				if(!images[i].currenty) images[i].currenty=images[i].getAttribute("y");
				if(Math.round(images[i].currentx)!=Math.round(images[i].targetx)){
					if(images[i].targetx) images[i].currentx=parseFloat(images[i].currentx)+(images[i].targetx-images[i].currentx)/15;
					images[i].setAttribute("x",Math.round(images[i].currentx));
				}
				if(Math.round(images[i].currenty)!=Math.round(images[i].targety)){
					if(images[i].targety) images[i].currenty=parseFloat(images[i].currenty)+(images[i].targety-images[i].currenty)/15;
					images[i].setAttribute("y",Math.round(images[i].currenty));
				}
			}
		}
		setTimeout("pageFlip.explode()",16);
	},
	pageturned:function(inc){
		this.pagenum=this.pagenum+inc;
		if(this.pagenum<0) this.pagenum=1;
		if(this.pagenum>this.pages.length) this.pagenum=this.pages.length;
		document.getElementById('pagestext').firstChild.nodeValue="Page "+(this.pagenum==0 ? 1 : this.pagenum)+" of "+this.pages.length;
		if(this.mode=="zoom") this.resize_position();
	},
	setpage:function(page){
		this.pagenum=page;
		document.getElementById('pagestext').firstChild.nodeValue="Page "+(this.pagenum==0 ? 1 : this.pagenum)+" of "+this.pages.length;
		this.setmode('flip');
	},
	init:function(url){
		var req = new XMLHttpRequest();
		req.url=url;
		req.open("GET", url, false);
		req.send("");
		var doc=req.responseXML;
		//alert(doc);
		this.pageHeight=parseInt(doc.getElementsByTagName("svgflip")[0].getAttribute("height"));
		this.pageWidth=parseInt(doc.getElementsByTagName("svgflip")[0].getAttribute("width"));
		var pages=doc.getElementsByTagName("page");
		for(var i=0;i<pages.length;i++){
			var page={}
			page.svg=pages[i].getAttribute("svg");
			page.proxy=pages[i].getAttribute("proxy");
			page.thumb=pages[i].getAttribute("thumb");
			this.pages.push(page);
		}
	//pre load images
		for(i=0;i<7;i++){
			var load=new Image();
			load.src=this.pages[i].proxy;
		}
		for(i=0;i<this.pages.length;i++){
			var load=new Image();
			load.src=this.pages[i].thumb;
		}
	
	//do event listners here instead!!!!!!!<<<<<<<<<<<<
		document.getElementById("svg").onmousemove=this.mousemove;
		document.getElementById("svg").onmousedown=this.mousedown;
		document.getElementById("svg").onmouseup=this.mouseup;
		window.onresize = function(){pageFlip.resize_position()};
		this.resize_position();
		this.fall();
		this.scroll();
		this.explode();
	},
	flip_move:function(e){
		offsetY=(e.clientY-(pageFlip.stageY+pageFlip.pageHeight*pageFlip.scaleY))/pageFlip.scaleY;
		offsetX=(e.clientX-(pageFlip.stageX+pageFlip.pageWidth*pageFlip.scaleX))/pageFlip.scaleX;
		var zonesize=this.pageHeight/5;
		if(!pageFlip.falling){
			if(offsetX>-zonesize && offsetX<zonesize && offsetY>-zonesize && offsetY<zonesize && pageFlip.pagenum<pageFlip.pages.length){
				if(pageFlip.drag==null){
					document.getElementById("svg").style.cursor='pointer';
					pageFlip.setproxies();
					pageFlip.ztop(document.getElementById("pages4to5"));
					pageFlip.drag=pageFlip.BR;
				}
			}
			else if(offsetX>-zonesize && offsetX<zonesize && offsetY+pageFlip.pageHeight>-zonesize && offsetY+pageFlip.pageHeight<zonesize && pageFlip.pagenum<pageFlip.pages.length){
				if(pageFlip.drag==null){
					document.getElementById("svg").style.cursor='pointer';
					pageFlip.setproxies();
					pageFlip.ztop(document.getElementById("pages4to5"));
					pageFlip.drag=pageFlip.TR;
				}
			}
			else if(offsetX+pageFlip.pageWidth*2>-zonesize && offsetX+pageFlip.pageWidth*2<zonesize && offsetY>-zonesize && offsetY<zonesize && pageFlip.pagenum!=0){
				if(pageFlip.drag==null){
					document.getElementById("svg").style.cursor='pointer';
					pageFlip.setproxies();
					pageFlip.ztop(document.getElementById("pages2to3"));
					pageFlip.drag=pageFlip.BL;
				}
			}
			else if(offsetX+pageFlip.pageWidth*2>-zonesize && offsetX+pageFlip.pageWidth*2<zonesize && offsetY+pageFlip.pageHeight>-zonesize && offsetY+pageFlip.pageHeight<zonesize && pageFlip.pagenum!=0){
				if(pageFlip.drag==null){
					document.getElementById("svg").style.cursor='pointer';
					pageFlip.setproxies();
					pageFlip.ztop(document.getElementById("pages2to3"));
					pageFlip.drag=pageFlip.TL;
				}
			}
			else if(!pageFlip.mouseclick)
			{
				document.getElementById("svg").style.cursor='';
				if(pageFlip.drag!="autoleft" && pageFlip.drag!="autoright") pageFlip.drag=null;
			}
		}
		//get pageX and pageY in page coords
		var pageX=-offsetX;
		if(pageX>pageFlip.pageWidth*2) pageX=pageFlip.pageWidth*2;
		if(pageX<0) pageX=0;
		var pageY=-offsetY;
		if(pageFlip.drag==pageFlip.BR){
			if(!pageFlip.mouseclick){
				if(pageFlip.pos[pageFlip.BR][0]==pageFlip.pageWidth*2) pageFlip.pos[pageFlip.BR][0]=0;
				pageX=(pageX+pageFlip.pos[pageFlip.BR][0]*5)/6;
				pageY=(pageY+pageFlip.pos[pageFlip.BR][1]*5)/6;
			}
			pageFlip.corneranim[pageFlip.BR](pageX,pageY);
			pageFlip.pos[pageFlip.BR]=[pageX,pageY];
		}
		if(pageFlip.drag==pageFlip.TR){
			pageY=pageY-pageFlip.pageHeight;
			if(!pageFlip.mouseclick){
				if(pageFlip.pos[pageFlip.TR][0]==pageFlip.pageWidth*2) pageFlip.pos[pageFlip.TR][0]=0;
				pageX=(pageX+pageFlip.pos[pageFlip.TR][0]*5)/6;
				pageY=(pageY+pageFlip.pos[pageFlip.TR][1]*5)/6;
			}
			pageFlip.corneranim[pageFlip.TR](pageX,pageY);
			pageFlip.pos[pageFlip.TR]=[pageX,pageY];
		}
		if(pageFlip.drag==pageFlip.BL){
			if(pageFlip.pos[pageFlip.BL][0]==pageFlip.pageWidth*2) pageFlip.pos[pageFlip.BL][0]=0;
			pageX=-pageX+pageFlip.pageWidth*2;
			if(!pageFlip.mouseclick){
				pageX=(pageX+pageFlip.pos[pageFlip.BL][0]*5)/6;
				pageY=(pageY+pageFlip.pos[pageFlip.BL][1]*5)/6;
			}
			pageFlip.corneranim[pageFlip.BL](pageX,pageY);
			pageFlip.pos[pageFlip.BL]=[pageX,pageY];
		}
		if(pageFlip.drag==pageFlip.TL){
			pageX=-pageX+pageFlip.pageWidth*2;
			pageY=pageY-pageFlip.pageHeight;
			if(!pageFlip.mouseclick){
				if(pageFlip.pos[pageFlip.TL][0]==pageFlip.pageWidth*2) pageFlip.pos[pageFlip.TL][0]=0;
				pageX=(pageX+pageFlip.pos[pageFlip.TL][0]*5)/6;
				pageY=(pageY+pageFlip.pos[pageFlip.TL][1]*5)/6;
			}
			pageFlip.corneranim[pageFlip.TL](pageX,pageY);
			pageFlip.pos[pageFlip.TL]=[pageX,pageY];
		}
	},
	flip_up:function(e){
		//if the page is fully turned the turn the page
		if(pageFlip.pos[pageFlip.drag][0]==pageFlip.pageWidth*2){
			if(pageFlip.drag==pageFlip.BR || pageFlip.drag==pageFlip.TR) pageFlip.pageturned(2);
					else pageFlip.pageturned(-2);
		}
		
		if(pageFlip.drag!="autoleft" && pageFlip.drag!="autoright") pageFlip.drag=null;
		document.getElementById("svg").style.cursor='';
	},
	flip_down:function(e){
		//offsets from bottom right corner!
		pageFlip.setproxies();
		y=(e.clientY-(pageFlip.stageY+pageFlip.pageHeight*pageFlip.scaleY))/pageFlip.scaleY;
		x=(e.clientX-(pageFlip.stageX+pageFlip.pageWidth*pageFlip.scaleX))/pageFlip.scaleX;
		var zonesize=pageFlip.pageHeight/5;
		if(x>-zonesize && x<zonesize && y>-zonesize && y<zonesize && pageFlip.pagenum<pageFlip.pages.length){
			pageFlip.ztop(document.getElementById("pages4to5"));
			pageFlip.drag=pageFlip.BR;
			document.getElementById("svg").style.cursor='pointer';
		}
		if(x>-15 && x<15 && y+pageFlip.pageHeight>-15 && y+pageFlip.pageHeight<15 && pageFlip.pagenum<pageFlip.pages.length){
			pageFlip.ztop(document.getElementById("pages4to5"));
			pageFlip.drag=pageFlip.TR;
			document.getElementById("svg").style.cursor='pointer';
		}
		if(x+pageFlip.pageWidth*2>-zonesize && x+pageFlip.pageWidth*2<zonesize && y>-zonesize && y<zonesize && pageFlip.pagenum!=0){
			pageFlip.ztop(document.getElementById("pages2to3"));
			pageFlip.drag=pageFlip.BL;
			document.getElementById("svg").style.cursor='pointer';
		}
		if(x+pageFlip.pageWidth*2>-zonesize && x+pageFlip.pageWidth*2<zonesize && y+pageFlip.pageHeight>-zonesize && y+pageFlip.pageHeight<zonesize && pageFlip.pagenum!=0){
			pageFlip.ztop(document.getElementById("pages2to3"));
			pageFlip.drag=pageFlip.TL;
			document.getElementById("svg").style.cursor='pointer';
		}
		pageFlip.flip_move(e);
	},
	flip_resize:function(){
		//get the template
		var templatecontent="";
		var contentnode=document.getElementById("pagestemplate").firstChild
		do{
		templatecontent=templatecontent+contentnode.nodeValue;
		}while(contentnode=contentnode.nextSibling);
		this.template.setTemplate(templatecontent);
			
		parser=new DOMParser();
		xmlDoc=parser.parseFromString(this.template.getParsed(),"text/xml");
		var pagesLayout=document.importNode(xmlDoc.firstChild,true);
		document.getElementById("svg").appendChild(pagesLayout);
		this.resetRef();
		this.setproxies();
	},
	zoom_resize:function(){
		//get the template
		var templatecontent="";
		var contentnode=document.getElementById("zoomtemplate").firstChild
		do{
		templatecontent=templatecontent+contentnode.nodeValue;
		}while(contentnode=contentnode.nextSibling);
		this.template.setTemplate(templatecontent);
		
		parser=new DOMParser();
		xmlDoc=parser.parseFromString(this.template.getParsed(),"text/xml");
		var zoomLayout=document.importNode(xmlDoc.firstChild,true);
		document.getElementById("svg").appendChild(zoomLayout);
		
		var url=this.pages[(this.pagenum-1<0 ? 0 : this.pagenum-1)].svg;
		document.getElementById('previewimage').setAttributeNS("http://www.w3.org/1999/xlink","href",this.pages[(this.pagenum-1<0 ? 0 : this.pagenum-1)].proxy);
		loadExternalSVG(url);
		document.getElementById('zoomcontent').url=url;
	},
	zoom_move:function(e){
		var origtarget=pageFlip.zoomTarget
		var svgs=document.getElementById('zoomcontent').getElementsByTagName("svg");
		pageFlip.zoomTarget=Math.round(((e.clientY-(pageFlip.stageY+pageFlip.pageHeight*pageFlip.scaleY))/pageFlip.scaleY)/2);
		if(pageFlip.zoomTarget>0) pageFlip.zoomTarget=0;
		if(pageFlip.zoomTarget<-pageFlip.pageHeight/2) pageFlip.zoomTarget=-pageFlip.pageHeight/2;
		if(pageFlip.zoomTarget!=origtarget) if(svgs[0]) svgs[0].style.visibility="hidden";
	},
	preview_resize:function(){
		//get the template
		var templatecontent="";
		var contentnode=document.getElementById("previewtemplate").firstChild
		do{
		templatecontent=templatecontent+contentnode.nodeValue;
		}while(contentnode=contentnode.nextSibling);
		this.template.setTemplate(templatecontent);
		
		parser=new DOMParser();
		xmlDoc=parser.parseFromString(this.template.getParsed(),"text/xml");
		var previewLayout=document.importNode(xmlDoc.firstChild,true);
		document.getElementById("svg").appendChild(previewLayout);
		var cols=9;
		
		content=document.getElementById("layout");
		var width=(this.pageWidth*this.scaleX*2*0.9)/cols;
		var targety=this.stageY;
		for(var i=0; i<this.pages.length;i++){
			if(i!=0 && i%cols==0) targety=targety+(width/this.pageWidth*this.pageHeight/9*10);
			
			var newimage=document.createElementNS("http://www.w3.org/2000/svg","image");
			newimage.setAttribute("height",width/this.pageWidth*this.pageHeight);
			newimage.setAttribute("width",width);
			newimage.setAttribute("x",this.stageX);
			newimage.setAttribute("y",this.stageY+this.pageHeight*this.scaleY/2);
			newimage.setAttribute("opacity",0.5);
			newimage.setAttributeNS("http://www.w3.org/1999/xlink","href",pageFlip.pages[i].thumb);
			newimage=content.appendChild(newimage);
			newimage.targetx=this.stageX+i%cols*(width/9*10)-this.pageWidth*this.scaleX;
			newimage.targety=targety;
			newimage.smallwidth=width;
			newimage.bigwidth=width*1.1;
			newimage.smallheight=width/this.pageWidth*this.pageHeight;
			newimage.bigheight=width/this.pageWidth*this.pageHeight*1.1;
			newimage.page=i;
			newimage.onmouseover=function(e){this.style.cursor='pointer'; this.setAttribute("opacity",1);this.setAttribute("width",this.bigwidth);this.setAttribute("height",this.bigheight);};
			newimage.onmouseout=function(e){this.style.cursor='pointer'; this.setAttribute("opacity",0.5);this.setAttribute("width",this.smallwidth);this.setAttribute("height",this.smallheight);};
			newimage.onmousedown=function(e){pageFlip.setpage(this.page)};
		}
		
	},
}
pageFlip.init("config.xml");



]]>
</script>
<script type="text/javascript"> 
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script> 
<script type="text/javascript"> 
var pageTracker = _gat._getTracker("UA-1964529-3");
pageTracker._trackPageview();
</script> 
</body>
</html>
