diff --git a/planetarium/README.md b/planetarium/README.md new file mode 100644 index 0000000..d27bbde --- /dev/null +++ b/planetarium/README.md @@ -0,0 +1,7 @@ +The Planetarium +=============== + +[The Planetarium][demo_url] is a CSS3 experiment that was created for the launch of Firefox 4. It's been featured as a demo in the [Mozilla's Web'O'Wonder][wow_url] gallery. + +[wow_url]: http://demos.mozilla.org +[demo_url]: http://mozillademos.org/demos/planetarium/demo.html \ No newline at end of file diff --git a/planetarium/css/style.css b/planetarium/css/style.css new file mode 100644 index 0000000..188d7df --- /dev/null +++ b/planetarium/css/style.css @@ -0,0 +1,570 @@ +/* Fonts */ + + @font-face { + font-family: 'Franchise'; + src: url('../fonts/Franchise-Bold.ttf') format('truetype'); + font-weight: normal; + font-style: normal; + } + + @font-face { + font-family: 'Bebas'; + src: url('../fonts/BEBAS___-webfont.ttf') format('truetype'); + font-weight: normal; + font-style: normal; + } + + @font-face { + font-family: 'CartoGothicStd-Book'; + src: url('../fonts/CartoGothicStd-Book-webfont.ttf') format('truetype'), url('../fonts/CartoGothicStd-Book-webfont.woff') format('woff'); + font-weight: normal; + font-style: normal; + } + + @font-face { + font-family: 'MarketingScript'; + src: url('../fonts/MarketingScript.ttf') format('truetype'); + font-weight: normal; + font-style: normal; + } + +/* Generic transition properties */ + + ul#planets { + -moz-transition: 0.5s all linear; + -webkit-transition: 0.5s all linear; + -o-transition: 0.5s all linear; + transition: 0.5s all linear; + } + + .content, .content h1, #dock, .window { + -moz-transition: 0.5s all ease-out; + -webkit-transition: 0.5s all ease-out; + -o-transition: 0.5s all ease-out; + transition: 0.5s all ease-out; + } + + .reflect { + -moz-transition: 0.5s all ease-in; -moz-transition-delay:0.2s; + -webkit-transition: 0.5s all ease-in; -webkit-transition-delay:0.2s; + -o-transition: 0.5s all ease-in; -o-transition-delay:0.2s; + transition: 0.5s all ease-in; transition-delay:0.2s; + } + .content li { + -moz-transition: 0.5s all ease-in-out; + -webkit-transition: 0.5s all ease-in-out; + -o-transition: 0.5s all ease-in-out; + transition: 0.5s all ease-in-out; + } + .content li:nth-child(1) {-moz-transition-delay:0.1s;-webkit-transition-delay:0.1s;-o-transition-delay:0.1s;transition-delay:0.1s;} + .content li:nth-child(2) {-moz-transition-delay:0.2s;-webkit-transition-delay:0.2s;-o-transition-delay:0.2s;transition-delay:0.2s;} + .content li:nth-child(3) {-moz-transition-delay:0.3s;-webkit-transition-delay:0.3s;-o-transition-delay:0.3s;transition-delay:0.3s;} + .content li:nth-child(4) {-moz-transition-delay:0.4s;-webkit-transition-delay:0.4s;-o-transition-delay:0.4s;transition-delay:0.4s;} + + #previous, #next, #next img, #previous img, #dock li, .planet svg, #moveleft, #moveright, #counter, #starfield { + -moz-transition: 0.2s all ease-in-out; + -webkit-transition: 0.2s all ease-in-out; + -o-transition: 0.2s all ease-in-out; + transition: 0.2s all ease-in-out; + } + + #back { + -moz-transition: 1s box-shadow linear, 1s color linear, 0.2s background-color linear, 0.2s top ease; + -webkit-transition: 1s -webkit-box-shadow linear, 1s color linear, 0.2s background-color linear, 0.2s top ease; + -o-transition: 1s box-shadow linear, 1s color linear, 0.2s background-color linear, 0.2s top ease; + transition: 1s box-shadow linear, 1s color linear, 0.2s background-color linear, 0.2s top ease; + } + + #title {-moz-transition:0.5s opacity ease;-webkit-transition:0.5s opacity ease;-o-transition:0.5s opacity ease;transition:0.5s opacity ease;} + #glow {-moz-transition:0.5s all ease;-webkit-transition:0.5s all ease;-o-transition:0.5s all ease;transition:0.5s all ease;} + + #instructions {-moz-transition:1s color linear, 0.5s opacity linear;-webkit-transition:1s color linear, 0.5s opacity linear;-o-transition:1s color linear, 0.5s opacity linear;transition:1s color linear, 0.5s opacity linear;} + + #ruler { + -moz-transition:0.2s bottom ease, 1.5s left ease-out; + -webkit-transition:0.2s bottom ease, 1.5s left ease-out; + -o-transition:0.2s bottom ease, 1.5s left ease-out; + transition:0.2s bottom ease, 1.5s left ease-out; + text-align:center; + } + + #moveleft.hover #previous, #moveleft.hover #previous img, #moveright.hover #next, #moveright.hover #next img { + -moz-transition:0s;-webkit-transition:0s;-o-transition:0s;transition:0s; + } + + +/* Fonts and color */ + + .franchise {font: 100px 'Franchise', Arial, sans-serif;} + .bebas {font: 25px 'Bebas', Arial, sans-serif; word-spacing:5px;} + .carto {font:18px 'CartoGothicStd-Book', Arial, sans-serif;} + .marketing {font:51px 'MarketingScript', serif;} + + .mass {color:#75d0ff;} + .perimeter {color:#fff075;} + .revolution {color:#ff7575;} + .temperature {color:#4bfe86;} + + h1 {color:#eee; -moz-transform-origin:center center;-webkit-transform-origin:center center;-o-transform-origin:center center;transform-origin:center center;font-size:10em;} + + h1.bebas {font-size:72px;font-weight:normal;color:#ddd;} + h2.bebas {font-size:14px;color:#eee;margin-left:30px;margin-top:20px;font-weight:normal;color:#ccc;} + + a {text-decoration:none;color:#75d0ff;} + a:hover {color:#aae2ff;} + +/* GUI layout */ + + #moveleft, #moveright {position:absolute;height:100%;width:15%;top:0;} + #moveleft {left:-15%;} + #moveright {right:-15%;} + #moveright:hover #next, #moveleft:hover #previous {-moz-transition:0s;-webkit-transition:0s;-o-transition:0s;transition:0s;} + #previous, #next {height:90px;width:190px;position:absolute;top:50%;margin-top:-45px;background:rgba(255,255,255,0.1);border-radius:10px;} + #previous {left:-100px;text-align:right;} + #next {right:-100px;} + #previous img, #next img {margin:20px 25px; opacity:0.6;} + #next img {margin:20px 25px; opacity:0.6;-moz-transform:rotate(180deg);-webkit-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg);} + #previous:hover, #next:hover {cursor:pointer; background:rgba(255,255,255,0.2);} + #previous:hover img, #next:hover img {opacity:1;} + + #ruler {position:absolute;width:10000px;left:-4500px;height:50px;background:rgba(255,255,255,0.1) url('../img/ruler.png') repeat-x center top;bottom:-100px;border-radius:0px;} + #gui.visible #ruler {bottom:0px;} + + .mercury #ruler {left:-1000px;} + .venus #ruler {left:-2000px;} + .earth #ruler {left:-3000px;} + .mars #ruler {left:-4000px;} + .jupiter #ruler {left:-5000px;} + .saturn #ruler {left:-6000px;} + .uranus #ruler {left:-7000px;} + .neptune #ruler {left:-8000px;} + + #counter {position:absolute;left:0%;width:100%;bottom:-100px;text-align:center;color:#ccc;} + #counter span.carto {font-size:11px;} + #counter span.bebas {font-size:18px;} + #gui.visible #counter {bottom:5px;} + + #gui.visible #dock {-moz-transform:translateY(-200px);-webkit-transform:translateY(-200px);-o-transform:translateY(-200px);transform:translateY(-200px);} + #gui.visible #previous {-moz-transform:translateX(0px);-webkit-transform:translateX(0px);-o-transform:translateX(0px);transform:translateX(0px);} + #gui.visible #next {-moz-transform:translateX(0px);-webkit-transform:translateX(0px);-o-transform:translateX(0px);transform:translateX(0px);} + #gui.visible #moveleft {left:0;} + #gui.visible #moveright {right:0;} + + #back {position:absolute;height:150px;width:300px;border-radius:10px;top:-150px;background:rgba(255,255,255,0.1);left:50%;margin-left:-150px;text-align:center;color:#ccc;} + #back span {text-transform:uppercase;position:relative;top:100px;font-size:14px;} + #back:hover {cursor:pointer;background-color:rgba(255,255,255,0.2);} + .visible #back {top:-75px;} + #back.glowing {color:#eee;box-shadow:0px 0px 5px #999;-webkit-box-shadow:0px 0px 5px #999;} + #back:hover, #back.glowing:hover {color:#eee;} + + + .visible .content {pointer-events:none;} + .shrink .content {opacity:0;z-index:1;} + .shrink .content .reflect {background-position:-700px 0px;} + .shrink .content .window {-moz-transform:scale(0);-webkit-transform:scale(0);-o-transform:scale(0);transform:scale(0);} + .shrink .content ul li {-moz-transform:translateY(-100px) scale(0);-webkit-transform:translateY(-100px) scale(0);-o-transform:translateY(-100px) scale(0);transform:translateY(-100px) scale(0);} + + .content.left {-moz-transform:translateX(-4000px);-webkit-transform:translateX(-4000px);-o-transform:translateX(-4000px);transform:translateX(-4000px);} + .content.right { -moz-transform:translateX(3500px);-webkit-transform:translateX(3500px);-o-transform:translateX(3500px);transform:translateX(3500px);} + + +/* Planet content generic layout */ + + .content {opacity:1; display:inline;position:absolute; left:50%;height:500px;top:50%;margin-top:-250px;pointer-events:none;} + .content article {padding-top:0;} + .content .reflect {background:url('../img/reflect.png') no-repeat 500px 0px;padding:5px 30px; border-radius:10px;} + .content .window {background:rgba(255,255,255,0.1);width:550px;margin:0;border-radius:10px;border:1px solid rgba(255,255,255,0.2);-moz-transform:scale(1);-webkit-transform:scale(1);-o-transform:scale(1);transform:scale(1);} + .content .window h1 {float:left;padding:0 15px 0 0;margin:0;position:relative;top:5px;left:-2px;height:100px;} + .content .window p {font-size:18px;line-height:30px;padding-top:0px;color:#ccc;font-size:18px; font-family:'CartoGothicStd-Book', sans-serif;} + .content ul {list-style-type:none;position:relative;top:-5px;margin-left:-18px;} + .content ul li {position:relative;float:none;margin:10px 0;opacity:1;} + .content ul li img {margin-right:15px;position:relative;top:15px;} + .content ul li span {display:block;font-size:12px;padding-left:60px;word-spacing:3px;} + .content ul li span.exposant {display:inline;font-size:11px;padding-left:3px;position:relative;top:-15px;} + +/*Mercury Content */ + + #mercury-missions {width:600px} + #mercury-missions ul {text-align:center;margin:0 auto;width:470px;} + #mercury-missions ul li {float:left;padding-left:100px;margin-bottom:30px;} + #mercury-missions ul li:first-child {padding-left:0px;} + #mercury-missions ul li:nth-child(1) {-moz-transition-delay:0.5s;-webkit-transition-delay:0.5s;-o-transition-delay:0.5s;transition-delay:0.5s;} + #mercury-missions ul li:nth-child(2) {-moz-transition-delay:0.8s;-webkit-transition-delay:0.8s;-o-transition-delay:0.8s;transition-delay:0.8s;} + #mercury-missions ul li:nth-child(3) {-moz-transition-delay:1.1s;-webkit-transition-delay:1.1s;-o-transition-delay:1.1s;transition-delay:1.1s;} + #mariner10 {margin-left:30px;opacity:1;} + #techarrow {position:relative;top:-40px;left:-40px;-moz-transition:0.5s all ease 1.5s;-moz-transform:scaleX(1);-moz-transform-origin:0 center;-webkit-transition:0.5s all ease 1.5s;-webkit-transform:scaleX(1);-webkit-transform-origin:0 center;-o-transition:0.5s all ease 1.5s;-o-transform:scaleX(1);-o-transform-origin:0 center;transition:0.5s all ease 1.5s;transform:scaleX(1);transform-origin:0 center;} + #messenger {float:right;margin-left:-40px;position:relative;left:-35px;opacity:1;-moz-transition:0.5s all ease 1.7s;-moz-transform:translateX(0px);-moz-transform-origin:0 center;-webkit-transition:0.5s all ease 1.7s;-webkit-transform:translateX(0px);-webkit-transform-origin:0 center;-o-transition:0.5s all ease 1.7s;-o-transform:translateX(0px);-o-transform-origin:0 center;-o-transition-delay:1s;transition:0.5s all ease 1.7s;transform:translateX(0px);transform-origin:0 center;} + + .shrink #mercury-missions ul li, .left #mercury-missions ul li, .right #mercury-missions ul li {-moz-transform:translateX(0) translateY(0) scale(0);-webkit-transform:translateX(0) translateY(0) scale(0);-o-transform:translateX(0) translateY(0) scale(0);transform:translateX(0) translateY(0) scale(0);} + .shrink #techarrow, .left #techarrow, .right #techarrow {opacity:0;-moz-transform:scaleX(0);-webkit-transform:scaleX(0);-o-transform:scaleX(0);transform:scaleX(0);} + .shrink #messenger, .left #messenger, .right #messenger {opacity:0;-moz-transform:translateX(-300px);-webkit-transform:translateX(-300px);-o-transform:translateX(-300px);transform:translateX(-300px);} + .shrink #mariner10 {opacity:0;} + +/* Venus Content */ + + ul#venus-atmosphere {margin-top:50px;} + ul#venus-atmosphere li {width:100%;font-size:14px;padding:0;margin:0;border-top:1px solid #999;} + ul#venus-atmosphere li span:nth-child(1) {text-align:center;width:100%;position:absolute;font-size:24px;margin-left:-70px;margin-top:-20px;} + ul#venus-atmosphere li span:nth-child(2) {float:right;font-size:inherit;} + ul#venus-atmosphere li:nth-child(1) {color:#75d0ff;height:225px;} + ul#venus-atmosphere li:nth-child(2) {color:#fff075;height:165px;margin-top:-165px;} + ul#venus-atmosphere li:nth-child(3) {color:#4bfe86;height:115px;margin-top:-115px;background:url('../img/venussurface.png') no-repeat center bottom;} + ul#venus-atmosphere li:nth-child(4) {color:#ff7575;} + + .shrink .content ul#venus-atmosphere li {-moz-transform:translateY(500px) scaleX(0) scaleY(0);-webkit-transform:translateY(500px) scaleX(0) scaleY(0);-o-transform:translateY(500px) scaleX(0) scaleY(0);transform:translateY(500px) scaleX(0) scaleY(0);} + .right ul#venus-atmosphere li {-moz-transform:translateX(1000px);-webkit-transform:translateX(1000px);-o-transform:translateX(1000px);transform:translateX(1000px);} + .left ul#venus-atmosphere li {-moz-transform:translateX(-500px);-webkit-transform:translateX(-500px);-o-transform:translateX(-500px);transform:translateX(-500px);} + +/*Earth Content */ + + .grid {background:url('../img/grid.png') repeat;} + + .moon {float:right;height:135px;width:225px;text-align:center;border:1px solid rgba(255,255,255,0);margin-top:30px;background-position:8px 8px;} + .moon img {margin-top:20px;margin-left:20px;opacity:0;-moz-transform:scale(0);-moz-transition:0.5s all ease;-moz-transition-delay:0.5s;-webkit-transform:scale(0);-webkit-transition:0.5s all ease;-webkit-transition-delay:0.5s;-o-transform:scale(0);-o-transition:0.5s all ease;-o-transition-delay:0.5s;transform:scale(0);transition:0.5s all ease;transition-delay:0.5s;} + .moon img#distance {margin-top:40px;margin-left:0px;-moz-transform:scaleX(0);-moz-transition-delay:0.8s;-webkit-transform:scaleX(0);-webkit-transition-delay:0.8s;-o-transform:scaleX(0);-o-transition-delay:0.8s;transform:scaleX(0);transition-delay:0.8s;} + + .visible .moon img {opacity:1;-moz-transform:scale(1);-webkit-transform:scale(1);-o-transform:scale(1);transform:scale(1);} + .visible .moon img#distance {-moz-transform:scaleX(1);-webkit-transform:scaleX(1);-o-transform:scaleX(1);transform:scaleX(1);} + + .right ul#earth-facts li {-moz-transform:translateX(1000px);-webkit-transform:translateX(1000px);-o-transform:translateX(1000px);transform:translateX(1000px);} + .left ul#earth-facts li {-moz-transform:translateX(-500px);-webkit-transform:translateX(-500px);-o-transform:translateX(1000px);transform:translateX(1000px);} + +/* Mars Content */ + + ul#volcanoes {margin-top:50px;} + ul#volcanoes li {width:100%;font-size:18px;padding:0;margin:0;} + ul#volcanoes li span {float:right;font-size:inherit;} + ul#volcanoes li:nth-child(1) {color:#ff7575;height:200px;background:url('../img/olympus.png') no-repeat center bottom;} + ul#volcanoes li:nth-child(2) {color:#75d0ff;height:110px;margin-top:-110px;background:url('../img/everest.png') no-repeat 100px bottom;} + ul#volcanoes li:nth-child(3) {color:#4bfe86;height:60px;margin-top:-60px;background:url('../img/fuji.png') no-repeat 400px bottom;} + ul#volcanoes li hr {margin:0;border:0;height:1px;background:#999;margin-top:4px;} + + .shrink .content ul#volcanoes li {-moz-transform:translateY(500px) scaleX(0) scaleY(0);-webkit-transform:translateY(500px) scaleX(0) scaleY(0);-o-transform:translateY(500px) scaleX(0) scaleY(0);transform:translateY(500px) scaleX(0) scaleY(0);} + .right ul#volcanoes li {-moz-transform:translateX(1000px);-webkit-transform:translateX(1000px);-o-transform:translateX(1000px);transform:translateX(1000px);} + .left ul#volcanoes li {-moz-transform:translateX(-500px);-webkit-transform:translateX(-500px);-o-transform:translateX(-500px);transform:translateX(-500px);} + + +/* Jupiter Content */ + + #jupiter-info ul {float:right;margin-top:15px;} + #jupiter-info ul li:nth-child(1) {color:#fff075;} + #jupiter-info ul li:nth-child(2) {color:#75d0ff;} + #jupiter-info ul li:nth-child(3) {color:#4bfe86;} + #jupiter-info ul li:nth-child(4) {color:#ff7575;} + + #galilean-moons {height:235px;width:346px;margin-top:35px;border:1px solid rgba(255,255,255,0.2);background-position:8px 5px;color:#ddd;} + #galilean-moons h2 {font-size:18px;margin:0;padding:0;font-weight:normal;} + #galilean-moons span {font-size:12px;display:block;} + + .right ul#jupiter-moons li {-moz-transform:translateX(1000px);-webkit-transform:translateX(1000px);-o-transform:translateX(1000px);transform:translateX(1000px);} + .left ul#jupiter-moons li {-moz-transform:translateX(-500px);-webkit-transform:translateX(-500px);-o-transform:translateX(-500px);transform:translateX(-500px);} + +/* Saturn Content */ + + #rings-origin {height:210px;width:100%;margin-top:35px;color:#ccc;} + #rings-origin h2 {font-size:14px;float:right;margin:-15px 0 0 0;padding:0;} + #rings-origin p {float:right;text-align:right;font-size:13px;clear:both;line-height:21px;margin-top:5px;} + #rings-origin ul {margin:5px 0px 0px -35px;} + #rings-origin ul li {height:72px;margin:0;padding:0;} + #rings-origin ul li span:nth-child(1) {display:block;height:40px;width:40px;border-radius:20px;text-align:center;line-height:38px;color:#000;font-size:22px;padding:0;} + #rings-origin ul li:nth-child(1) span:nth-child(1) {background:#75d0ff} + #rings-origin ul li:nth-child(2) span:nth-child(1) {background:#fff075} + #rings-origin ul li:nth-child(3) span:nth-child(1) {background:#4bfe86} + #rings-origin ul li img.saturnarrow {position:absolute;top:-10px;left:30px;opacity:1;-moz-transition:0.5s all ease;-moz-transform-origin:0 center;-webkit-transition:0.5s all ease;-webkit-transform-origin:0 center;-o-transition:0.5s all ease;-o-transform-origin:0 center;transition:0.5s all ease;transform-origin:0 center;} + #rings-origin ul li img.rings {position:absolute;top:-12px;opacity:1;-moz-transition:0.5s all ease;-webkit-transition:0.5s all ease;-o-transition:0.5s all ease;transition:0.5s all ease;} + #rings-origin ul li:nth-child(1) img.rings {left:130px;-moz-transition-delay:0.8s;-webkit-transition-delay:0.8s;-o-transition-delay:0.8s;transition-delay:0.8s;} + #rings-origin ul li:nth-child(2) img.rings {left:230px;-moz-transition-delay:1.2s;-webkit-transition-delay:1.2s;-o-transition-delay:1.2s;transition-delay:1.2s;} + #rings-origin ul li:nth-child(3) img.rings {left:330px;-moz-transition-delay:1.6s;-webkit-transition-delay:1.6s;-o-transition-delay:1.6s;transition-delay:1.6s;} + #rings-origin ul li:nth-child(1) img.saturnarrow {-moz-transition-delay:0.8s;-webkit-transition-delay:0.8s;-o-transition-delay:0.8s;transition-delay:0.8s;} + #rings-origin ul li:nth-child(2) img.saturnarrow {-moz-transition-delay:1.2s;-webkit-transition-delay:1.2s;-o-transition-delay:1.2s;transition-delay:1.2s;} + #rings-origin ul li:nth-child(3) img.saturnarrow {-moz-transition-delay:1.6s;-webkit-transition-delay:1.6s;-o-transition-delay:1.6s;transition-delay:1.6s;} + + .shrink .content #rings-origin img.saturnarrow {-moz-transform:scaleX(0);-webkit-transform:scaleX(0);-o-transform:scaleX(0);transform:scaleX(0);} + .left #rings-origin img.saturnarrow {-moz-transform:scaleX(0);-webkit-transform:scaleX(0);-o-transform:scaleX(0);transform:scaleX(0);} + .right #rings-origin img.saturnarrow {-moz-transform:scaleX(0);-webkit-transform:scaleX(0);-o-transform:scaleX(0);transform:scaleX(0);} + .shrink .content #rings-origin img.rings {opacity:0;left:0;} + .left #rings-origin img.rings, .right #rings-origin img.rings {opacity:0;-moz-transform:translateX(-200px);-webkit-transform:translateX(-200px);-o-transform:translateX(-200px);transform:translateX(-200px);} + + .right #rings-origin ul li {-moz-transform:translateX(500px);-webkit-transform:translateX(500px);-o-transform:translateX(500px);transform:translateX(500px);} + .left #rings-origin ul li {-moz-transform:translateX(-1000px);-webkit-transform:translateX(-1000px);-o-transform:translateX(-1000px);transform:translateX(-1000px);} + +/* Uranus Content */ + + #uranus-atmosphere {height:250px;position:relative;width:50%;} + + #uranus-atmosphere div div:nth-child(1) {width:45px;opacity:0.5;display:inline-block;-moz-transform:skewY(30deg) translateY(0px);-webkit-transform:skewY(30deg) translateY(0px);-o-transform:skewY(30deg) translateY(0px);transform:skewY(30deg) translateY(0px);} + #uranus-atmosphere div div:nth-child(2) {width:45px;opacity:0.8;display:inline-block;position:relative;left:-4px;-moz-transform:skewY(-30deg);-webkit-transform:skewY(-30deg);-o-transform:skewY(-30deg);transform:skewY(-30deg);} + #uranus-atmosphere div div:nth-child(3) {width:65px;height:65px;opacity:0.65;position:relative;left:12.5px;-moz-transform:scaleY(0.58) rotate(45deg);-webkit-transform:scaleY(0.58) rotate(45deg);-o-transform:scaleY(0.58) rotate(45deg);transform:scaleY(0.58) rotate(45deg);} + #uranus-atmosphere div span {position:absolute;left:120px;font-size:12px;} + + #hydrogen, #helium, #methane, #deuteride {position:absolute;left:50px;} + + #deuteride {top:55px;color:#fff075;-moz-transition:0.5s all ease-out;-moz-transition-delay:0.5s;-webkit-transition:0.5s all ease-out;-webkit-transition-delay:0.5s;-o-transition:0.5s all ease-out;-o-transition-delay:0.5s;transition:0.5s all ease-out;transition-delay:0.5s;} + #deuteride div {background:#fff075;} + #deuteride div:nth-child(1) {height:2px;} + #deuteride div:nth-child(2) {height:2px;} + #deuteride div:nth-child(3) {top:-52px;} + #deuteride span {top:-15px;width:300px;} + + #methane {top:62px;color:#ff7575;-moz-transition:0.5s all ease-out;-moz-transition-delay:0.4s;-webkit-transition:0.5s all ease-out;-webkit-transition-delay:0.4s;-o-transition:0.5s all ease-out;-o-transition-delay:0.4s;transition:0.5s all ease-out;transition-delay:0.4s;} + #methane div {background:#ff7575;} + #methane div:nth-child(1) {height:5px;} + #methane div:nth-child(2) {height:5px;} + #methane div:nth-child(3) {top:-55px;} + #methane span {top:20px;} + + #helium {top:78px;color:#4bfe86;-moz-transition:0.5s all ease-out;-moz-transition-delay:0.3s;-webkit-transition:0.5s all ease-out;-webkit-transition-delay:0.3s;-o-transition:0.5s all ease-out;-o-transition-delay:0.3s;transition:0.5s all ease-out;transition-delay:0.3s;} + #helium div {background:#4bfe86;} + #helium div:nth-child(1) {height:20px;} + #helium div:nth-child(2) {height:20px;} + #helium div:nth-child(3) {top:-70px;} + #helium span {top:45px;} + + #hydrogen {top:100px;color:#75d0ff;-moz-transition:0.5s all ease-out;-moz-transition-delay:0.2s;-webkit-transition:0.5s all ease-out;-webkit-transition-delay:0.2s;-o-transition:0.5s all ease-out;-o-transition-delay:0.2s;transition:0.5s all ease-out;transition-delay:0.2s;} + #hydrogen div {background:#75d0ff;} + #hydrogen div:nth-child(1) {height:110px;} + #hydrogen div:nth-child(2) {height:110px;} + #hydrogen div:nth-child(3) {top:-160px;} + #hydrogen span {top:65px} + + + #uranus-atmosphere div {opacity:1;-moz-transform:translateY(0px);-webkit-transform:translateY(0px);-o-transform:translateY(0px);transform:translateY(0px);} + .shrink #uranus-atmosphere div {opacity:0;-moz-transform:translateY(-500px);-webkit-transform:translateY(-500px);-o-transform:translateY(-500px);transform:translateY(-500px);} + .left #uranus-atmosphere div {opacity:0;-moz-transform:translateX(-1000px);-webkit-transform:translateX(-1000px);-o-transform:translateX(-1000px);transform:translateX(-1000px);} + .right #uranus-atmosphere div {opacity:0;-moz-transform:translateX(500px);-webkit-transform:translateX(500px);-o-transform:translateX(500px);transform:translateX(500px);} + + #axial-tilt {float:right;width:43%;height:207px;margin-top:30px;border:1px solid rgba(255,255,255,0.2);background-position:6px 6px;} + #axial-tilt h2 {float:right;margin-right:20px;} + #axial-tilt img {-moz-transform:rotate(-98deg);-webkit-transform:rotate(-98deg);-o-transform:rotate(-98deg);transform:rotate(-98deg);position:relative;left:50%;margin-left:-69px;margin-top:30px;opacity:0.9;-moz-transition:0.5s all ease 1.2s;-webkit-transition:0.5s all ease 1.2s;-o-transition:0.5s all ease 1.2s;transition:0.5s all ease 1.2s;} + #axial-tilt span {font-size:30px;color:#555;position:relative;top:-69px;left:29px;opacity:1;-moz-transition:0.2s opacity ease 1.6s;-webkit-transition:0.2s opacity ease 1.6s;-o-transition:0.2s opacity ease 1.6s;transition:0.2s opacity ease 1.6s;} + + .shrink #axial-tilt img, .left #axial-tilt img, .right #axial-tilt img {opacity:0;-moz-transform:rotate(0deg);-webkit-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg);} + .shrink #axial-tilt span, .left #axial-tilt span, .right #axial-tilt span {opacity:0;} + +/* Neptune Content */ + + #neptune-facts {margin:20px 0 0 -55px;} + #neptune-facts li {float:left;margin:0 10px;} + #neptune-facts li:nth-child(1) {color:#75d0ff;} + #neptune-facts li:nth-child(2) {color:#ff7575;} + #neptune-facts li:nth-child(3) {color:#fff075;margin-right:0px;} + #neptune-facts li img {margin:0 10px;float:left;} + #neptune-facts li:nth-child(1) img {margin-left:0;} + #neptune-facts li span {display:inline;padding:0;} + #neptune-facts li span.carto {float:left;text-transform:uppercase;} + #neptune-facts li:nth-child(1) span.carto {margin-left:64px;} + #neptune-facts li:nth-child(2) span.carto {margin-left:55px;} + #neptune-facts li:nth-child(3) span.carto {margin-left:48px;} + + .left #neptune-facts li {opacity:0;-moz-transform:translateX(-1000px);-webkit-transform:translateX(-1000px);-o-transform:translateX(-1000px);transform:translateX(-1000px);} + .right #neptune-facts li {opacity:0;-moz-transform:translateX(500px);-webkit-transform:translateX(500px);-o-transform:translateX(500px);transform:translateX(500px);} + + #flyby {width:700px;clear:both;} + #flyby img {vertical-align:middle;float:none;margin-top:20px;display:inline-block;} + #flyby img:nth-child(1) {margin-left:30px;position:relative;top:-8px;-moz-transition:0.5s;-moz-transition-delay:1s;-webkit-transition:0.5s;-webkit-transition-delay:1s;-o-transition:0.5s;-o-transition-delay:1s;transition:0.5s;transition-delay:1s;} + #flyby img:nth-child(2) {position:relative;left:0px;top:-8px;-moz-transition:0.5s all ease;-moz-transition-delay:1s;-moz-transform-origin:right center;-webkit-transition:0.5s all ease;-webkit-transition-delay:1s;-webkit-transform-origin:right center;-o-transition:0.5s all ease;-o-transition-delay:1s;-o-transform-origin:right center;transition:0.5s all ease;transition-delay:1s;transform-origin:right center;} + #flyby img#voyager2 {position:relative;top:26px;left:-92px;margin-left:0px;-moz-transition:0.5s all ease;-moz-transition-delay:0.5s;-webkit-transition:0.5s all ease;-webkit-transition-delay:0.5s;-o-transition:0.5s all ease;-o-transition-delay:0.5s;transition:0.5s all ease;transition-delay:0.5s;} + + .shrink img#voyager2 {opacity:0;-moz-transform:translateX(-400px) translateY(-100px);-webkit-transform:translateX(-400px) translateY(-100px);-o-transform:translateX(-400px) translateY(-100px);transform:translateX(-400px) translateY(-100px);} + .shrink #flyby img:nth-child(2), .right #flyby img:nth-child(2) {-moz-transform:scaleX(0);-webkit-transform:scaleX(0);-o-transform:scaleX(0);transform:scaleX(0);} + .shrink #flyby img:nth-child(1), .right #flyby img:nth-child(1) {opacity:0;} + + +/* Starfield */ + + #starfield {background: url('../img/bg.jpg') repeat center center;width:5000px;height:200%;left:50%;margin-left:-2500px;z-index:-1;pointer-events:none;-moz-transition:0.5s -moz-transform ease;-webkit-transition:0.5s -webkit-transform ease;-o-transition:0.5s -o-transform ease;transition:0.5s transform ease;} + + .mercury #starfield {-moz-transform:translateX(250px);-webkit-transform:translateX(250px);-o-transform:translateX(250px);transform:translateX(250px);} + .venus #starfield {-moz-transform:translateX(175px);-webkit-transform:translateX(175px);-o-transform:translateX(175px);transform:translateX(175px);} + .earth #starfield {-moz-transform:translateX(100px);-webkit-transform:translateX(100px);-o-transform:translateX(100px);transform:translateX(100px);} + .mars #starfield {-moz-transform:translateX(25px);-webkit-transform:translateX(25px);-o-transform:translateX(25px);transform:translateX(25px);} + .jupiter #starfield {-moz-transform:translateX(-50px);-webkit-transform:translateX(-50px);-o-transform:translateX(-50px);transform:translateX(-50px);} + .saturn #starfield {-moz-transform:translateX(-125px);-webkit-transform:translateX(-125px);-o-transform:translateX(-125px);transform:translateX(-125px);} + .uranus #starfield {-moz-transform:translateX(-200px);-webkit-transform:translateX(-200px);-o-transform:translateX(-200px);transform:translateX(-200px);} + .neptune #starfield {-moz-transform:translateX(-275px);-webkit-transform:translateX(-275px);-o-transform:translateX(-275px);transform:translateX(-275px);} + + +/* General Layout */ + + html, body {height:100%;width:100%; margin:0; padding:0;} + body {background:#000; overflow:hidden;font-family:Georgia, sans-serif;color:#f4f4f4;background-position:0 0;} + + #container {position:absolute;left:0;top:0;pointer-events:none;} + + ul#planets {list-style-type:none;height:100px;width:50%;} + ul#planets li {position:absolute; left:0px; top:0px;-moz-transform-origin:center center;-webkit-transform-origin:center center;-o-transform-origin:center center;transform-origin:center center;background:transparent;} + ul#planets.delayed, #instructions.delayed {-moz-transition-delay:1s;-webkit-transition-delay:1s;-o-transition-delay:1s;transition-delay:1s;} + + .planet {overflow:visible;-moz-transform-origin:center center;-webkit-transform-origin:center center;-o-transform-origin:center center;transform-origin:center center;} + .planet .clipmask {border-radius:50%;-webkit-border-radius:300px;-o-border-radius:300px;overflow:hidden;} + .planet:hover {cursor:pointer;} + + .planet {pointer-events:none;z-index:0;} + .system .planet {pointer-events:auto;z-index:2;} + + #saturn {margin-top:-350px;} + #uranus {margin-top:-300px;} + + #glow {position:absolute;top:0px;left:50%;margin-left:-696px;pointer-events:none;opacity:0;-moz-transform-origin:center 0;-moz-transform:scale(0);-webkit-transform-origin:center 0;-webkit-transform:scale(0);-o-transform-origin:center 0;-o-transform:scale(0);transform-origin:center 0;transform:scale(0);} + .system #glow {opacity:1;-moz-transform:scale(1);-webkit-transform:scale(1);-o-transform:scale(1);transform:scale(1);} + + + #title {position:absolute;width:600px;left:50%;top:0;margin-left:-300px;text-align:center;opacity:0;} + #title h1 {text-shadow:0px 5px 0px #999;margin-bottom:0px;padding-bottom:0px;line-height:120px;} + #title h1 {text-align:left;padding-left:105px;} /* Ugly win xp chrome fix */ + #title h1 span {position:absolute;top:22px;left:82px;text-shadow:none;letter-spacing:1.5px;} + #title #subtitle {font-variant:small-caps;display:block;color:#999;margin-top:-15px;} /* Absolutely positioned due to a weird difference between Fx4 Mac Os and Fx4 Win Xp */ + .showcredits #title:hover {cursor:pointer;} + .system #title {opacity:1;} + + #instructions {position:absolute;left:50%;margin-left:-170px;width:300px;text-align:center;bottom:15%;text-transform:uppercase;font-size:14px;color:#aaa;border-radius:5px;background:rgba(255,255,255,0.1);padding:20px;opacity:0;} + .system #instructions {opacity:1;} + #instructions.glowing {color:#ccc;} + + #toggle-credits {position:absolute;bottom:6%;left:50%;width:150px;margin-left:-75px;color:#aaa;text-align:center;opacity:0;z-index:6;-moz-transition:0.25s text-shadow ease, 0.5s opacity linear;-webkit-transition:0.25s all ease;-o-transition:0.25s all ease;transition:0.25s all ease;} + #toggle-credits:hover {cursor:pointer;color:#fff;text-shadow:0px 0px 15px #fff;} + #toggle-credits .marketing {font-size:18px;width:98px;} + .system #toggle-credits {opacity:1;} + + +/* Credits */ + + .showcredits ul#planets {opacity:0;pointer-events:none;} + .showcredits li.planet {pointer-events:none;} + + #credits {position:absolute;left:50%;top:35%;width:460px;height:350px;margin:0 0 0 -230px;opacity:0;pointer-events:none;z-index:0;-moz-transition:1s all ease-out 0s;-webkit-transition:1s all ease-out 0s;-o-transition:1s all ease-out 0s;transition:1s all ease-out 0s;} + #credits a {-moz-transition:0.2s all ease;-webkit-transition:0.2s all ease;-o-transition:0.2s all ease;transition:0.2s all ease;} + #credits a:hover {text-shadow:0px 0px 5px #fff;-moz-text-shadow:0px 0px 5px #fff;-webkit-text-shadow:0px 0px 5px #fff;-o-text-shadow:0px 0px 5px #fff;} + #credits.alwaysontop {z-index:5;} + + #madeby {display:block;margin:0 0 30px 0;text-align:center;font-size:14px;opacity:0;-moz-transition:1s all ease;-webkit-transition:1s all ease;-o-transition:1s all ease;transition:1s all ease;} + + #door div {height:75px;width:45px;margin:0 auto;} + #door div:nth-child(1) {background:#fff url('../img/astronauts.png') no-repeat bottom center;} + #door div:nth-child(2) {height:80px;margin-top:-80px;background:#000 url('../img/bg.jpg');-moz-transform-origin:center 0;-moz-transition:1s all ease;-webkit-transform-origin:center 0;-webkit-transition:1s all ease;-o-transform-origin:center 0;-o-transition:1s all ease;transform-origin:center 0;transition:1s all ease;} + #doorlight div {width:111px;height:60px;margin:0 auto;} + #doorlight div:nth-child(1) {background:#000 url('../img/doorlight.png') no-repeat top center;} + #doorlight div:nth-child(2) {background:#000 url('../img/bg.jpg') repeat;margin-top:-60px;-moz-transform-origin:center bottom;-moz-transition:1s all ease;-moz-transform:scaleY(1);-webkit-transform-origin:center bottom;-webkit-transition:1s all ease;-webkit-transform:scaleY(1);-o-transform-origin:center bottom;-o-transition:1s all ease;-o-transform:scaleY(1);transform-origin:center bottom;transition:1s all ease;transform:scaleY(1);} + + #authors {position:relative;top:-130px;margin-bottom:-130px;-moz-transition:0.5s all ease;-moz-transform:scale(0);-webkit-transition:0.5s all ease;-webkit-transform:scale(0);-o-transition:0.5s all ease;-o-transform:scale(0);transition:0.5s all ease;transform:scale(0);} + #authors p {width:150px;display:inline-block;} + #authors span {display:block;line-height:25px;text-align:center;} + #authors p span:nth-child(1) {font-size:20px;} + #authors p span:nth-child(2) {font-size:15px;} + #authors p span:nth-child(3) {font-size:14px;} + #franck {margin-left:-150px;position:absolute;right:0px;top:0px;} + + #typefaces {margin-top:50px;text-align:center;opacity:0;color:#ddd;-moz-transition:1s all ease;-webkit-transition:1s all ease;-o-transition:1s all ease;transition:1s all ease;} + #typefaces header span {display:inline-block;} + #typefaces .separator {height:1px;width:183px;border-bottom:1px solid #ccc;} + #title-hr {display:block;margin:0 auto;height:25px;width:85px;font-size:16px;text-shadow:0px 0px 10px #000;} + #typefaces ul {list-style-type:none;text-align:left;margin:20px 0 0 0;padding:0;} + #typefaces li {float:left;padding:0 15px;min-width:60px;} + #typefaces li.carto, #typefaces li span.marketing {font-size:12px;} + #typefaces li:first-child {padding-left:0;} + #typefaces li:last-child {padding-right:0;} + + .showcredits #credits {opacity:1;pointer-events:auto;} + .showcredits #madeby {opacity:1;-moz-transition-delay:1s;-webkit-transition-delay:1s;-o-transition-delay:1s;transition-delay:1s;} + .showcredits #door div:nth-child(2) {-moz-transform:scaleY(0);-moz-transition-delay:1s;-webkit-transform:scaleY(0);-webkit-transition-delay:1s;-o-transform:scaleY(0);-o-transition-delay:1s;transform:scaleY(0);transition-delay:1s;} + .showcredits #doorlight div:nth-child(2) {-moz-transform:scaleY(0);-moz-transition-delay:1s;-webkit-transform:scaleY(0);-webkit-transition-delay:1s;-o-transform:scaleY(0);-o-transition-delay:1s;transform:scaleY(0);transition-delay:1s;} + .showcredits #authors {-moz-transform:scale(1);-moz-transition-delay:2s;-webkit-transform:scale(1);-webkit-transition-delay:2s;-o-transform:scale(1);-o-transition-delay:2s;transform:scale(1);transition-delay:2s;} + .showcredits #typefaces {opacity:1;-moz-transition-delay:3s;-webkit-transition-delay:3s;-o-transition-delay:3s;transition-delay:3s;} + .showcredits #instructions {opacity:0;} + +/* Loading screen */ + + ul#planets.loading {opacity:0;pointer-events:none;} + #instructions.loading, #toggle-credits.loading {opacity:0;} + + +/* Counters */ + + #counters div { -moz-transition-property:opacity; -webkit-transition-property:opacity; -o-transition-property:opacity; transition-property:opacity; + -moz-transition-duration: 1.5s; -webkit-transition-duration: 1.5s; -o-transition-duration: 1.5s; transition-duration: 1.5s; + -moz-transition-timing-function: ease-out; -webkit-transition-timing-function: ease-out; -o-transition-timing-function: ease-out; transition-timing-function: ease-out; + } + + +/* Media Queries */ + + @media screen and (min-width: 2000px) { + #ruler {width:15000px;} + #starfield {width:10000px;margin-left:-5000px;} + } + + @media screen and (max-width: 1500px) { + section.content { + -moz-transform:scale(0.9); -moz-transform-origin:0 center; + -webkit-transform:scale(0.9); -webkit-transform-origin:0 center; + -o-transform:scale(0.9); -o-transform-origin:0 center; + transform:scale(0.9); transform-origin:0 center; + } + } + + @media screen and (max-width: 1300px) { + section.content { + -moz-transform:scale(0.8); -moz-transform-origin:0 center; + -webkit-transform:scale(0.8); -webkit-transform-origin:0 center; + -o-transform:scale(0.8); -o-transform-origin:0 center; + transform:scale(0.8); transform-origin:0 center; + } + } + + @media screen and (max-width: 1100px) { + section.content { + -moz-transform:scale(0.6); -moz-transform-origin:0 center; + -webkit-transform:scale(0.6); -webkit-transform-origin:0 center; + -o-transform:scale(0.6); -o-transform-origin:0 center; + transform:scale(0.6); transform-origin:0 center; + } + + #title, #credits { + -moz-transform:scale(0.7); -moz-transform-origin:center 0; + -webkit-transform:scale(0.7); -webkit-transform-origin:center 0; + -o-transform:scale(0.7); -o-transform-origin:center 0; + transform:scale(0.7); transform-origin:center 0; + } + + #counter { + -moz-transform:scale(0.7); -moz-transform-origin:center bottom; + -webkit-transform:scale(0.7); -webkit-transform-origin:center bottom; + -o-transform:scale(0.7); -o-transform-origin:center bottom; + transform:scale(0.7); transform-origin:center bottom; + } + + #ruler { + -moz-transform:scale(0.7); -moz-transform-origin:left bottom; + -webkit-transform:scale(0.7); -webkit-transform-origin:left bottom; + -o-transform:scale(0.7); -o-transform-origin:left bottom; + transform:scale(0.7); transform-origin:left bottom; + } + + #instructions, #toggle-credits, #back { + -moz-transform:scale(0.7); + -webkit-transform:scale(0.7); + -o-transform:scale(0.7); + transform:scale(0.7); + } + + #previous, #next { + height:70px; + margin-top:-35px; + width:160px; + } + + #previous img, #next img { + margin:20px 19px; + width:30px; + } + + .mercury #ruler {left:-700px;} + .venus #ruler {left:-1400px;} + .earth #ruler {left:-2100px;} + .mars #ruler {left:-2800px;} + .jupiter #ruler {left:-3500px;} + .saturn #ruler {left:-4200px;} + .uranus #ruler {left:-4900px;} + .neptune #ruler {left:-5600px;} + + } \ No newline at end of file diff --git a/planetarium/demo.html b/planetarium/demo.html new file mode 100644 index 0000000..b444cce --- /dev/null +++ b/planetarium/demo.html @@ -0,0 +1,374 @@ + + + + + + + + + The Planetarium + + +
+
+ +
+ + + +
+

ThePlanetarium

+ An HTML5 Astronomical Adventure +
+ +
+ click on a planet to start +
+ +
+ view credits +
+ +
+ Made on Earth by Little Workshop +
+
+
+
+
+
+
+
+
+

+ design by + Guillaume Lecollinet + @glecollinet +

+

+ code by + Franck Lecollinet + @whatthefranck +

+
+
+
+ + typefaces + +
+ +
+
+ + + +
+
+ +
+
+ +
+ DISTANCE FROM THE SUN
+ +
+ +
+ Back to space +
+ +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + +
+ +
+ + + + \ No newline at end of file diff --git a/planetarium/fonts/BEBAS___-webfont.ttf b/planetarium/fonts/BEBAS___-webfont.ttf new file mode 100755 index 0000000..800b51e Binary files /dev/null and b/planetarium/fonts/BEBAS___-webfont.ttf differ diff --git a/planetarium/fonts/CartoGothicStd-Book-webfont.ttf b/planetarium/fonts/CartoGothicStd-Book-webfont.ttf new file mode 100644 index 0000000..097a7cd Binary files /dev/null and b/planetarium/fonts/CartoGothicStd-Book-webfont.ttf differ diff --git a/planetarium/fonts/CartoGothicStd-Book-webfont.woff b/planetarium/fonts/CartoGothicStd-Book-webfont.woff new file mode 100644 index 0000000..96e780b Binary files /dev/null and b/planetarium/fonts/CartoGothicStd-Book-webfont.woff differ diff --git a/planetarium/fonts/Franchise-Bold.ttf b/planetarium/fonts/Franchise-Bold.ttf new file mode 100755 index 0000000..75d0b33 Binary files /dev/null and b/planetarium/fonts/Franchise-Bold.ttf differ diff --git a/planetarium/fonts/MarketingScript.ttf b/planetarium/fonts/MarketingScript.ttf new file mode 100644 index 0000000..23ac028 Binary files /dev/null and b/planetarium/fonts/MarketingScript.ttf differ diff --git a/planetarium/img/246min.png b/planetarium/img/246min.png new file mode 100644 index 0000000..98dfe29 Binary files /dev/null and b/planetarium/img/246min.png differ diff --git a/planetarium/img/30years.png b/planetarium/img/30years.png new file mode 100644 index 0000000..dadba8a Binary files /dev/null and b/planetarium/img/30years.png differ diff --git a/planetarium/img/astronauts.png b/planetarium/img/astronauts.png new file mode 100644 index 0000000..d5d1643 Binary files /dev/null and b/planetarium/img/astronauts.png differ diff --git a/planetarium/img/bg.jpg b/planetarium/img/bg.jpg new file mode 100644 index 0000000..61cb12f Binary files /dev/null and b/planetarium/img/bg.jpg differ diff --git a/planetarium/img/callistopicto.png b/planetarium/img/callistopicto.png new file mode 100644 index 0000000..a3472ac Binary files /dev/null and b/planetarium/img/callistopicto.png differ diff --git a/planetarium/img/distance.png b/planetarium/img/distance.png new file mode 100644 index 0000000..72f2b87 Binary files /dev/null and b/planetarium/img/distance.png differ diff --git a/planetarium/img/doorlight.png b/planetarium/img/doorlight.png new file mode 100644 index 0000000..44bcc12 Binary files /dev/null and b/planetarium/img/doorlight.png differ diff --git a/planetarium/img/earth.jpg b/planetarium/img/earth.jpg new file mode 100644 index 0000000..ae483a4 Binary files /dev/null and b/planetarium/img/earth.jpg differ diff --git a/planetarium/img/earthicon.png b/planetarium/img/earthicon.png new file mode 100644 index 0000000..ebaa1f9 Binary files /dev/null and b/planetarium/img/earthicon.png differ diff --git a/planetarium/img/europapicto.png b/planetarium/img/europapicto.png new file mode 100644 index 0000000..8db2963 Binary files /dev/null and b/planetarium/img/europapicto.png differ diff --git a/planetarium/img/everest.png b/planetarium/img/everest.png new file mode 100644 index 0000000..ea25f99 Binary files /dev/null and b/planetarium/img/everest.png differ diff --git a/planetarium/img/fuji.png b/planetarium/img/fuji.png new file mode 100644 index 0000000..2e494ac Binary files /dev/null and b/planetarium/img/fuji.png differ diff --git a/planetarium/img/ganymedepicto.png b/planetarium/img/ganymedepicto.png new file mode 100644 index 0000000..b66cc60 Binary files /dev/null and b/planetarium/img/ganymedepicto.png differ diff --git a/planetarium/img/glow.png b/planetarium/img/glow.png new file mode 100644 index 0000000..84d8453 Binary files /dev/null and b/planetarium/img/glow.png differ diff --git a/planetarium/img/grid.png b/planetarium/img/grid.png new file mode 100644 index 0000000..6ec9206 Binary files /dev/null and b/planetarium/img/grid.png differ diff --git a/planetarium/img/iopicto.png b/planetarium/img/iopicto.png new file mode 100644 index 0000000..a5164fb Binary files /dev/null and b/planetarium/img/iopicto.png differ diff --git a/planetarium/img/jupiter.jpg b/planetarium/img/jupiter.jpg new file mode 100644 index 0000000..3f9a7bc Binary files /dev/null and b/planetarium/img/jupiter.jpg differ diff --git a/planetarium/img/mariner10.png b/planetarium/img/mariner10.png new file mode 100644 index 0000000..9de8907 Binary files /dev/null and b/planetarium/img/mariner10.png differ diff --git a/planetarium/img/mars.jpg b/planetarium/img/mars.jpg new file mode 100644 index 0000000..475f424 Binary files /dev/null and b/planetarium/img/mars.jpg differ diff --git a/planetarium/img/mass.svg b/planetarium/img/mass.svg new file mode 100644 index 0000000..da31e4c --- /dev/null +++ b/planetarium/img/mass.svg @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/planetarium/img/mercury.jpg b/planetarium/img/mercury.jpg new file mode 100644 index 0000000..028c287 Binary files /dev/null and b/planetarium/img/mercury.jpg differ diff --git a/planetarium/img/mercuryobs1.png b/planetarium/img/mercuryobs1.png new file mode 100644 index 0000000..4bd3c59 Binary files /dev/null and b/planetarium/img/mercuryobs1.png differ diff --git a/planetarium/img/mercuryobs2.png b/planetarium/img/mercuryobs2.png new file mode 100644 index 0000000..5a57e4a Binary files /dev/null and b/planetarium/img/mercuryobs2.png differ diff --git a/planetarium/img/mercuryobs3.png b/planetarium/img/mercuryobs3.png new file mode 100644 index 0000000..b6f2aeb Binary files /dev/null and b/planetarium/img/mercuryobs3.png differ diff --git a/planetarium/img/messenger.png b/planetarium/img/messenger.png new file mode 100644 index 0000000..dcfbd42 Binary files /dev/null and b/planetarium/img/messenger.png differ diff --git a/planetarium/img/neptune.jpg b/planetarium/img/neptune.jpg new file mode 100644 index 0000000..786d8fc Binary files /dev/null and b/planetarium/img/neptune.jpg differ diff --git a/planetarium/img/olympus.png b/planetarium/img/olympus.png new file mode 100644 index 0000000..8343a92 Binary files /dev/null and b/planetarium/img/olympus.png differ diff --git a/planetarium/img/perimeter.svg b/planetarium/img/perimeter.svg new file mode 100644 index 0000000..dc2b158 --- /dev/null +++ b/planetarium/img/perimeter.svg @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/planetarium/img/previous.svg b/planetarium/img/previous.svg new file mode 100644 index 0000000..55fc17b --- /dev/null +++ b/planetarium/img/previous.svg @@ -0,0 +1,8 @@ + + + + + + diff --git a/planetarium/img/reflect.png b/planetarium/img/reflect.png new file mode 100644 index 0000000..196807a Binary files /dev/null and b/planetarium/img/reflect.png differ diff --git a/planetarium/img/revolution.svg b/planetarium/img/revolution.svg new file mode 100644 index 0000000..e396acb --- /dev/null +++ b/planetarium/img/revolution.svg @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/planetarium/img/rings1.png b/planetarium/img/rings1.png new file mode 100644 index 0000000..f4cf65c Binary files /dev/null and b/planetarium/img/rings1.png differ diff --git a/planetarium/img/rings2.png b/planetarium/img/rings2.png new file mode 100644 index 0000000..4291e79 Binary files /dev/null and b/planetarium/img/rings2.png differ diff --git a/planetarium/img/rings3.png b/planetarium/img/rings3.png new file mode 100644 index 0000000..6c928bf Binary files /dev/null and b/planetarium/img/rings3.png differ diff --git a/planetarium/img/ruler.png b/planetarium/img/ruler.png new file mode 100644 index 0000000..0468d06 Binary files /dev/null and b/planetarium/img/ruler.png differ diff --git a/planetarium/img/satellite.png b/planetarium/img/satellite.png new file mode 100644 index 0000000..eb92add Binary files /dev/null and b/planetarium/img/satellite.png differ diff --git a/planetarium/img/saturn-arrow1.png b/planetarium/img/saturn-arrow1.png new file mode 100644 index 0000000..821afc3 Binary files /dev/null and b/planetarium/img/saturn-arrow1.png differ diff --git a/planetarium/img/saturn-arrow2.png b/planetarium/img/saturn-arrow2.png new file mode 100644 index 0000000..5b1cde1 Binary files /dev/null and b/planetarium/img/saturn-arrow2.png differ diff --git a/planetarium/img/saturn-arrow3.png b/planetarium/img/saturn-arrow3.png new file mode 100644 index 0000000..3eee8a9 Binary files /dev/null and b/planetarium/img/saturn-arrow3.png differ diff --git a/planetarium/img/saturn.png b/planetarium/img/saturn.png new file mode 100644 index 0000000..9dff926 Binary files /dev/null and b/planetarium/img/saturn.png differ diff --git a/planetarium/img/spinner.gif b/planetarium/img/spinner.gif new file mode 100644 index 0000000..c95d05a Binary files /dev/null and b/planetarium/img/spinner.gif differ diff --git a/planetarium/img/temperature.svg b/planetarium/img/temperature.svg new file mode 100644 index 0000000..8ad9a41 --- /dev/null +++ b/planetarium/img/temperature.svg @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/planetarium/img/tilt.png b/planetarium/img/tilt.png new file mode 100644 index 0000000..8731d56 Binary files /dev/null and b/planetarium/img/tilt.png differ diff --git a/planetarium/img/time.png b/planetarium/img/time.png new file mode 100644 index 0000000..8ac701e Binary files /dev/null and b/planetarium/img/time.png differ diff --git a/planetarium/img/uranus.png b/planetarium/img/uranus.png new file mode 100644 index 0000000..db61a8a Binary files /dev/null and b/planetarium/img/uranus.png differ diff --git a/planetarium/img/venus.jpg b/planetarium/img/venus.jpg new file mode 100644 index 0000000..8ad1abe Binary files /dev/null and b/planetarium/img/venus.jpg differ diff --git a/planetarium/img/venussurface.png b/planetarium/img/venussurface.png new file mode 100644 index 0000000..f0c571b Binary files /dev/null and b/planetarium/img/venussurface.png differ diff --git a/planetarium/img/voyager2.png b/planetarium/img/voyager2.png new file mode 100644 index 0000000..bb6c10b Binary files /dev/null and b/planetarium/img/voyager2.png differ diff --git a/planetarium/img/wind.png b/planetarium/img/wind.png new file mode 100644 index 0000000..c9528d6 Binary files /dev/null and b/planetarium/img/wind.png differ diff --git a/planetarium/js/build.js b/planetarium/js/build.js new file mode 100644 index 0000000..4868ae3 --- /dev/null +++ b/planetarium/js/build.js @@ -0,0 +1,18 @@ +({ + appDir: "../", + baseUrl: "js/", + dir: "../../planetarium-build", + optimize: "closure", + optimizeCss: "none", + + paths: { + "jquery": "require-jquery-1.4.4.min" + }, + + modules: [ + { + name: "main", + exclude: ["jquery"] + } + ] +}) \ No newline at end of file diff --git a/planetarium/js/camera.js b/planetarium/js/camera.js new file mode 100644 index 0000000..b539cf3 --- /dev/null +++ b/planetarium/js/camera.js @@ -0,0 +1,105 @@ + +define(["constants"], function(Constants) { + + var Camera = Class.extend({ + + init: function(system) { + this.w = 0; + this.h = 0; + this.system = system; + this._focusedPlanet = this.system.getPlanet("mars"); + this._focusPlanetIndex = 0; + this.currentView = Constants.VIEW.SYSTEM; + + this.resize(); + }, + + update: function() { + this.resize(); + + if (this.currentView === Constants.VIEW.PLANET) { + this.changeToPlanetView(); + } + if (this.currentView === Constants.VIEW.SYSTEM) { + this.changeToSystemView(); + } + }, + + resize: function() { + this.w = $(window).width(); + this.h = $(window).height(); + }, + + /** + * Centers and zooms on a specific planet. + * By scaling and moving the whole solar system we simulate a zooming effect and a camera movement. + */ + focusPlanet: function(planetName) { + var planet = this.system.getPlanet(planetName), + s = 1; + + this._focusedPlanet = planet; + this._focusedPlanetIndex = this.system.getPlanetIndex(planetName); + + if(this.w < 1100) { + s = 0.6; + } else if(this.w < 1300) { + s = 0.8; + } else if(this.w < 1500) { + s = 0.9; + } + + var m = (1 / planet.m) * s; // System scale factor when the focused planet is at scale 1 + this.system.scale(m); + + this.system.distance = this.w; + var distanceFromLeftToPlanet = this.system.getDistanceTo(planetName); + + var x = -distanceFromLeftToPlanet - Constants.IMG_SIZE * s; + var y = (this.h / 2) - (Constants.IMG_SIZE / 2); // The focused planet must be in the center of the Y axis + this.system.move(x, y); + + this.currentView = Constants.VIEW.PLANET; + }, + + focusPlanetIndex: function(index) { + var planet = this.system.getPlanetAt(index); + this.focusPlanet(planet.getName()); + }, + + focusNextPlanet: function() { + var newIndex = this._focusedPlanetIndex + 1; + var lastPlanetIndex = this.system.getNbPlanets() - 1; + this.focusPlanetIndex(newIndex > lastPlanetIndex ? lastPlanetIndex : newIndex); + }, + + focusPreviousPlanet: function() { + var newIndex = this._focusedPlanetIndex - 1; + this.focusPlanetIndex(newIndex < 0 ? 0 : newIndex); + }, + + getFocusedPlanet: function() { + return this._focusedPlanet; + }, + + setFocusedPlanet: function(name) { + this._focusedPlanet = this.system.getPlanet(name); + }, + + changeToSystemView: function() { + this.currentView = Constants.VIEW.SYSTEM; + this.system.fit(this.w, this.h); + }, + + changeToPlanetView: function() { + this.currentView = Constants.VIEW.PLANET; + this.focusPlanet(this._focusedPlanet.getName()); + }, + + getCurrentView: function() { + return this.currentView; + } + }); + + return Camera; +}); diff --git a/planetarium/js/class.js b/planetarium/js/class.js new file mode 100644 index 0000000..8894389 --- /dev/null +++ b/planetarium/js/class.js @@ -0,0 +1,64 @@ +/* Simple JavaScript Inheritance + * By John Resig http://ejohn.org/ + * MIT Licensed. + */ +// Inspired by base2 and Prototype +(function(){ + var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; + + // The base Class implementation (does nothing) + this.Class = function(){}; + + // Create a new Class that inherits from this class + Class.extend = function(prop) { + var _super = this.prototype; + + // Instantiate a base class (but only create the instance, + // don't run the init constructor) + initializing = true; + var prototype = new this(); + initializing = false; + + // Copy the properties over onto the new prototype + for (var name in prop) { + // Check if we're overwriting an existing function + prototype[name] = typeof prop[name] == "function" && + typeof _super[name] == "function" && fnTest.test(prop[name]) ? + (function(name, fn){ + return function() { + var tmp = this._super; + + // Add a new ._super() method that is the same method + // but on the super-class + this._super = _super[name]; + + // The method only need to be bound temporarily, so we + // remove it when we're done executing + var ret = fn.apply(this, arguments); + this._super = tmp; + + return ret; + }; + })(name, prop[name]) : + prop[name]; + } + + // The dummy class constructor + function Class() { + // All construction is actually done in the init method + if ( !initializing && this.init ) + this.init.apply(this, arguments); + } + + // Populate our constructed prototype object + Class.prototype = prototype; + + // Enforce the constructor to be what we expect + Class.constructor = Class; + + // And make this class extendable + Class.extend = arguments.callee; + + return Class; + }; +})(); diff --git a/planetarium/js/constants.js b/planetarium/js/constants.js new file mode 100644 index 0000000..3141d89 --- /dev/null +++ b/planetarium/js/constants.js @@ -0,0 +1,17 @@ + +define({ + // Camera view + VIEW: { + PLANET: 0, + SYSTEM: 1 + }, + + /** + * Planet JPEG file size in pixels + * @type {number} + */ + IMG_SIZE: 600, + + // Miscellaneous + TRANSITION_END: "transitionend webkitTransitionEnd oTransitionEnd" +}); \ No newline at end of file diff --git a/planetarium/js/counter.js b/planetarium/js/counter.js new file mode 100644 index 0000000..74845a3 --- /dev/null +++ b/planetarium/js/counter.js @@ -0,0 +1,72 @@ + +define(["jquery"], function($) { + + var Counter = Class.extend({ + UPDATE_FREQ: 40, + + init: function(container, start, end, zeroes) { + this.start = start; + this.end = end; + this.zeroes = zeroes || 0; + + if(container) { + this.el = document.createElement("div"); + container.appendChild(this.el); + $(this.el).css("opacity", start < end ? start/end : 1); + } + }, + + onStep: function(callback) { + this.stepCallback = callback; + }, + + onStop: function(callback) { + this.stopCallback = callback; + }, + + zeroFill: function(number, width) { + width -= number.toString().length; + if (width > 0) { + return new Array( width + (/\./.test( number ) ? 2 : 1) ).join( '0' ) + number; + } + return number; + }, + + run: function() { + var self = this, + start = this.start, + end = this.end; + + setTimeout(function() { + $(self.el).css("opacity", start < end ? 1 : end/start); + }, 50); + + var updater = setInterval(function() { + var value = Math.round($(self.el).css("opacity") * (start < end ? end : start)); + value = self.zeroes > 0 ? self.zeroFill(value, self.zeroes) : value; + if(self.stepCallback) { + self.stepCallback(value); + } + if(self.finished) { + clearInterval(updater); + } + }, this.UPDATE_FREQ); + + var stop = function() { + self.finished = true; + if(self.stopCallback) { + self.stopCallback(); + } + }; + this.el.addEventListener("transitionend", stop, true); + this.el.addEventListener("webkitTransitionEnd", stop, true); + this.el.addEventListener("oTransitionEnd", stop, true); + }, + + stop: function() { + this.finished = true; + } + }); + + return Counter; +}); diff --git a/planetarium/js/init.js b/planetarium/js/init.js new file mode 100644 index 0000000..676327d --- /dev/null +++ b/planetarium/js/init.js @@ -0,0 +1,242 @@ + +define(["jquery", "constants", "planetarium"], function($, Constants, Planetarium) { + + $(document).ready(function() { + var demo = null, + readyToFadeIn = false, + + messageHandlers = { + start_demo: function() { + var waiting = setInterval(function() { + if(readyToFadeIn) { + playFadeInIntro(); + clearInterval(waiting); + } else { + log.debug("Loading assets..."); + } + }, 100); + }, + stop_demo: function() { + postToParent("finished_exit"); + } + }, + + postToParent = function(message) { + window.parent.postMessage(message, '*'); + log.debug("Sent : "+message); + }, + + initDemo = function() { + window.addEventListener("message", function(event) { + var message = event.data; + if(message in messageHandlers) { + log.debug("Received : " + message); + messageHandlers[message](); + } + }, false); + + $(document).bind("keydown", function() { return false; }); // Prevent any keyboard interaction while the demo is loading + + postToParent("loaded"); // Tell the demo gallery we're ready to go + loadImages(onImagesLoaded); + + if(window === window.top) { + // If we're not in a iframe, fake an incoming message from the demo gallery + window.postMessage("start_demo", '*'); + } + }, + + loadImages = function(onload_callback) { + var images = ["mercury.jpg", "venus.jpg", "earth.jpg", "mars.jpg", "jupiter.jpg", "saturn.png", "uranus.png", "neptune.jpg"], + loadedCount = 0; + + for(var i=0, nb=images.length; i < nb; i += 1) { + var filename = images[i], + name = filename.split('.')[0], + filetype = filename.split('.')[1], + $li = $("#"+ name), + $div = $("
"), + $img = $("\"\""); + + if(filetype === "png") { // PNGs don't need a clipmask + $li.append($img); + } else { + $div.append($img); + $li.append($div); + } + + $img.bind("load", function () { + loadedCount += 1; + if(loadedCount === nb) { + setTimeout(function() { + onload_callback(); + }, 1000); // Fake loading time + } + }); + } + }, + + startDemo = function(ready_callback) { + demo = new Planetarium(); + demo.onChangeView(function(view) { + if(view === Constants.VIEW.SYSTEM) { + postToParent("show_exit_ui"); + } else { + postToParent("hide_exit_ui"); + } + }); + demo.run(); + + $("#previous").click(function() { + demo.previousPlanet(); + }); + + $("#next").click(function() { + demo.nextPlanet(); + }); + + $("#back").click(function() { + if(demo.getCurrentView() === Constants.VIEW.PLANET) { + demo.showSystemView(); + } + }); + + $("li.planet").click(function() { + if(demo.getCurrentView() === Constants.VIEW.SYSTEM) { + demo.zoomOnPlanet(this.id); + } + }); + + $("#moveleft").mousemove(function(e){ + var y = e.pageY; + $("#previous").css("top" , y + "px"); + }); + + $("#moveleft").mouseleave(function() { + $("#previous").css("top" , "50%"); + }); + + $("#moveright").mousemove(function(e){ + var y = e.pageY; + $("#next").css("top" , y + "px"); + }); + + $("#moveright").mouseleave(function() { + $("#next").css("top" , "50%"); + }); + + var toggleCredits = function() { + var $togglespan = $("#toggle-credits span"); + + if($("body").hasClass("showcredits")) { + $togglespan.html("back to demo"); + } else { + $togglespan.html("view credits"); + } + }; + + $("#toggle-credits").click(function() { + var $body = $("body"); + + if($body.hasClass("showcredits")) { + $("ul#planets").addClass("delayed"); + $("#instructions").addClass("delayed"); + $("#credits").removeClass("alwaysontop"); + $body.removeClass("showcredits"); + + setTimeout(function() { + $("ul#planets").removeClass("delayed"); + $("#instructions").removeClass("delayed"); + }, 1000); + + } else { + $body.addClass("showcredits"); + + setTimeout(function() { + $("#credits").addClass("alwaysontop"); + }, 1000); + } + + toggleCredits(); + }); + + $("#title").click(function() { + var $body = $("body"); + + if($body.hasClass("showcredits")) { + $("ul#planets").addClass("delayed"); + $("#instructions").addClass("delayed"); + $("#credits").removeClass("alwaysontop"); + $body.removeClass("showcredits"); + + setTimeout(function() { + $("#instructions").removeClass("delayed"); + $("ul#planets").removeClass("delayed"); + }, 1000); + } + + toggleCredits(); + }); + + $(window).resize(function() { + demo.refresh(); + }); + + $(document).unbind("keydown").bind("keydown", function(e) { + var key = e.which; + var keys = [32, 37, 38, 39, 40]; + + if(keys.indexOf(key) !== -1) { + switch(key) { + case 32: // Spacebar + break; + case 37: // Left + demo.previousPlanet(); + break; + case 39: // Right + demo.nextPlanet(); + break; + case 38: // Up + if(demo.getCurrentView() === Constants.VIEW.SYSTEM) { + demo.showPlanetView(); + } + break; + case 40: // Down + if(demo.getCurrentView() === Constants.VIEW.PLANET) { + demo.showSystemView(); + } + break; + } + return false; + } + }); + + ready_callback(); + }, + + onImagesLoaded = function() { + startDemo(function() { + readyToFadeIn = true; + }); + }, + + playFadeInIntro = function() { + $("#spinner").remove(); + $("#planets").removeClass("loading"); + setTimeout(function() { + $("#instructions").removeClass("loading"); + setTimeout(function() { + $("#toggle-credits").removeClass("loading"); + }, 800); + }, 1000); + }; + + initDemo(); + }); + + $(window).mousedown(function(e) { + if(e.which === 2) { + e.preventDefault(); + } + }); +}); diff --git a/planetarium/js/log.js b/planetarium/js/log.js new file mode 100644 index 0000000..d20fd5d --- /dev/null +++ b/planetarium/js/log.js @@ -0,0 +1,26 @@ + +var log = { + level: "info", + + info: function(message) { + if(this.level === "info" || this.level === "debug") { + if(window.console) { + console.info(message); + } + } + }, + + debug: function(message) { + if(this.level === "debug") { + if(window.console) { + console.log(message); + } + } + }, + + error: function(message) { + if(window.console) { + console.error(message); + } + } +}; \ No newline at end of file diff --git a/planetarium/js/main.js b/planetarium/js/main.js new file mode 100644 index 0000000..c6cfaf1 --- /dev/null +++ b/planetarium/js/main.js @@ -0,0 +1,5 @@ + +define(["class", "log"], function() { + log.level = "info"; + require(["init"]); +}); \ No newline at end of file diff --git a/planetarium/js/planet.js b/planetarium/js/planet.js new file mode 100644 index 0000000..ad8df49 --- /dev/null +++ b/planetarium/js/planet.js @@ -0,0 +1,19 @@ + +define(["transformable", "constants"], function(Transformable, Constants) { + + var Planet = Transformable.extend({ + getName: function() { + return this.id; + }, + + getDiameter: function(scale) { + if (scale === undefined) { + scale = 1; + } + var diameter = Constants.IMG_SIZE * this.m * scale; + return diameter; + } + }); + + return Planet; +}); \ No newline at end of file diff --git a/planetarium/js/planetarium.js b/planetarium/js/planetarium.js new file mode 100644 index 0000000..1e3d0fa --- /dev/null +++ b/planetarium/js/planetarium.js @@ -0,0 +1,419 @@ + +define(["raphael", "constants", "solarsystem", "camera", "satellites", "counter"], + function(R, Constants, SolarSystem, Camera, SatelliteSystem, Counter) { + + var Planetarium = Class.extend({ + + init: function() { + this.started = false; + this.moving = false; + + this.currentKm = 0; + + var self = this; + var callback = function() { + self.moving = false; + }; + + $("li.planet").bind(Constants.TRANSITION_END, callback); + }, + + run: function() { + this.started = true; + this.disableTransitions(); // Disable CSS3 transitions for initial solar system setup + + this.system = new SolarSystem(); + this.camera = new Camera(this.system); + + this.earthGraph = new EarthSystem("earth-moon", 130, 130, 1.06); + this.jupiterGraph = new JupiterSystem("galilean-moons", 500, 330, 0.7); + + this.distanceCounter = null; + + this.earthGraph.draw(); + this.jupiterGraph.draw(); + + this.showSystemView(); + this.removeHiddenContentForAllPlanets(); + + this.enableTransitions(); + + this.moving = false; + this.userHasZoomedOnce = false; + }, + + refresh: function() { + if(this.started) { + this.camera.update(); + } + }, + + toggleBodyClass: function() { + var view = this.camera.getCurrentView(), + planetName = this.camera.getFocusedPlanet().getName(); + + if(view === Constants.VIEW.SYSTEM) { + $("body").removeClass(planetName).addClass("system"); + } + else { // PLANET_VIEW + $("body").addClass(planetName).removeClass("system"); + } + }, + + getCurrentView: function() { + return this.camera.getCurrentView(); + }, + + onCurrentPlanetTransitionOver: function(callback) { + var name = this.camera.getFocusedPlanet().getName(), + currentInfo = $("#"+name+"-info"), + transitionEndWrapper = function() { + callback(); + currentInfo.unbind(Constants.TRANSITION_END, transitionEndWrapper); + }; + + currentInfo.bind(Constants.TRANSITION_END, transitionEndWrapper); + }, + + showSystemView: function() { + var self = this; + + if(!this.moving) { + this.camera.changeToSystemView(); + this.toggleBodyClass(); + this.hidePlanetInfo(); + this.resetAllOtherPlanets(); + + this.onCurrentPlanetTransitionOver(function() { + self.removeHiddenContentForAllPlanets(); + }); + + this.moving = true; + + this.updateGalleryUI(); + } + }, + + showPlanetView: function() { + var self = this; + + if(!this.moving) { + this.camera.changeToPlanetView(); + this.toggleBodyClass(); + this.hidePlanetsContentOnLeft(); + this.hidePlanetsContentOnRight(); + + this.showPlanetInfo(); + + this.onCurrentPlanetTransitionOver(function() { + self.removeHiddenContentForAllPlanets(); + }); + + this.moving = true; + + this.updateGalleryUI(); + if(!this.userHasZoomedOnce) { + this.userHasZoomedOnce = true; + } + } + }, + + onChangeView: function(callback) { + this.changeview_callback = callback; + }, + + updateGalleryUI: function() { + if(this.userHasZoomedOnce) { + this.changeview_callback(this.getCurrentView()); + } + }, + + isPreviousPlanet: function() { + var current = this.camera.getFocusedPlanet().getName(), + index = this.system.getPlanetIndex(current); + + return index > 0; + }, + + isNextPlanet: function() { + var current = this.camera.getFocusedPlanet().getName(), + index = this.system.getPlanetIndex(current); + + return index < 7; + }, + + getPreviousPlanetName: function() { + var current = this.camera.getFocusedPlanet().getName(), + index = this.system.getPlanetIndex(current); + + return this.system.getPlanetNameAt(index - 1); + }, + + getNextPlanetName: function() { + var current = this.camera.getFocusedPlanet().getName(), + index = this.system.getPlanetIndex(current); + + return this.system.getPlanetNameAt(index + 1); + }, + + nextPlanet: function() { + var name = "", + self = this, + $body = $("body"); + + if(!this.moving && this.camera.getCurrentView() === Constants.VIEW.PLANET && this.isNextPlanet()) { + name = this.camera.getFocusedPlanet().getName(); + $("#"+name+"-info").addClass("left"); + $body.removeClass(name); + + this.camera.focusNextPlanet(); + + name = this.camera.getFocusedPlanet().getName(); + $("#"+name+"-info").removeClass("right"); + $body.addClass(name); + + this.showPlanetInfo(); + + this.moving = true; + } + }, + + previousPlanet: function() { + var name = "", + self = this, + $body = $("body"); + + if(!this.moving && this.camera.getCurrentView() === Constants.VIEW.PLANET && this.isPreviousPlanet()) { + name = this.camera.getFocusedPlanet().getName(); + $("#"+name+"-info").addClass("right"); + $body.removeClass(name); + + this.camera.focusPreviousPlanet(); + + name = this.camera.getFocusedPlanet().getName(); + $("#"+name+"-info").removeClass("left"); + $body.addClass(name); + + this.showPlanetInfo(); + + this.moving = true; + } + }, + + zoomOnPlanet: function(planetName) { + this.camera.setFocusedPlanet(planetName); + this.showPlanetView(); + }, + + disableTransitions: function() { + function doDisable(prefix) { + $("li.planet").css(prefix + "transition-duration", "0s"); + } + doDisable("-moz-"); + doDisable("-webkit-"); + doDisable("-o-"); + }, + + enableTransitions: function() { + setTimeout(function() { + function doEnable(prefix) { + $("li.planet").css(prefix + "transition-duration", "0.5s").css("-moz-transition-timing-function", "ease"); + } + doEnable("-moz-"); + doEnable("-webkit-"); + doEnable("-o-"); + }, 100); + }, + + createCounter: function(start, end) { + var self = this; + + if(this.distanceCounter) { + this.distanceCounter.stop(); + this.distanceCounter = null; + } + this.distanceCounter = new Counter($("#counters").get(0), start, end); + + this.distanceCounter.onStep(function(value) { + $("#kilometers").text(addCommas(value)+" KM"); + }); + this.distanceCounter.onStop(function() { + self.distanceCounter = null; + }); + + this.distanceCounter.run(); + }, + + showPlanetInfo: function() { + var name = this.camera.getFocusedPlanet().getName(), + index = this.system.getPlanetIndex(name), + start = this.currentKm, + end = this.system.getPlanetDistanceToSun(index), + $gui = $("#gui"); + + $gui.addClass("visible"); + $gui.removeClass("shrink"); + + this.createCounter(start, end); + this.currentKm = end; + + this.updateGraphs(); + + // Navigation buttons visiblity + if(name === "neptune") { + $("#moveright").hide(); + } else if(name === "mercury") { + $("#moveleft").hide(); + } else { + $("#moveleft").show(); + $("#moveright").show(); + } + }, + + hidePlanetInfo: function() { + var $gui = $("#gui"), + $starfield = $("#starfield"); + + $gui.addClass("shrink"); + $gui.removeClass("visible"); + $starfield.removeClass("reset"); + $starfield.removeClass("zoom"); + + this.currentKm = 0; + this.updateGraphs(); + }, + + updateGraphs: function() { + var planetName = this.camera.getFocusedPlanet().getName(), + view = this.camera.getCurrentView(), + pause = false; + + if(view === Constants.VIEW.PLANET) { + if(planetName === "jupiter") { + this.jupiterGraph.play(); + } else if(planetName === "earth") { + this.earthGraph.play(); + } else { + pause = true; + } + } else { + pause = true; + } + + if(pause) { + this.earthGraph.pause(); + this.jupiterGraph.pause(); + } + }, + + resetAllOtherPlanets: function() { + var current = this.camera.getFocusedPlanet().getName(); + + this.system.forEachPlanet(function(planet) { + var $info = $("#"+planet.id+"-info"); + + $info.removeClass("left").removeClass("right"); + + if(planet.id !== current) { + $info.addClass("hidden"); + } + }); + }, + + removeHiddenContentForAllPlanets: function() { + this.system.forEachPlanet(function(planet) { + $("#"+planet.id+"-info").removeClass("hidden"); + }); + }, + + forPlanetsOnLeft: function(callback) { + var self = this, + current = this.camera.getFocusedPlanet().getName(), + index = this.system.getPlanetIndex(current); + + for(var i=index-1; i >= 0; i -= 1) { + (function(j) { + var name = self.system.getPlanetNameAt(j); + callback(name); + })(i); + } + }, + + forPlanetsOnRight: function(callback) { + var self = this, + current = this.camera.getFocusedPlanet().getName(), + index = this.system.getPlanetIndex(current); + + for(var i=index+1; i < 8; i += 1) { + (function(j) { + var name = self.system.getPlanetNameAt(j); + callback(name); + })(i); + } + }, + + hidePlanetsContentOnLeft: function() { + this.forPlanetsOnLeft(function(name) { + $("#"+name+"-info").addClass("left").addClass("hidden"); + }); + }, + + hidePlanetsContentOnRight: function() { + this.forPlanetsOnRight(function(name) { + $("#"+name+"-info").addClass("right").addClass("hidden"); + }); + }, + + hidePlanetsImageOnLeft: function() { + this.forPlanetsOnLeft(function(name) { + $("#"+name).addClass("hidden"); + }); + }, + + hidePlanetsImageOnRight: function() { + this.forPlanetsOnRight(function(name) { + $("#"+name).addClass("hidden"); + }); + }, + + changeName: function(name) { + $(".content h1").html(name); + } + }); + + var JupiterSystem = SatelliteSystem.extend({ + init: function(divId, width, height, scale) { + this._super(divId, width, height, scale); + this.planetRadius = 10; + this.satellites = {"io":{o: 40, r: 5, a: 25, s: 0.8, c: "#fff075"}, + "europa":{o: 60, r: 5, a: 60, s: 0.4, c: "#75d0ff"}, + "ganymede":{o: 90, r: 5, a: 140, s: 0.2, c: "#4bfe86"}, + "callisto":{o: 150, r: 5, a: 250, s: 0.1, c: "#ff7575"}}; + } + }); + + var EarthSystem = SatelliteSystem.extend({ + init: function(divId, width, height, scale) { + this._super(divId, width, height, scale); + + this.satellites = {"moon":{o: 47, r: 4.5, a: -45, s: 0.5, c: "white"}}; + } + }); + + /** + * @author http://www.mredkj.com/javascript/numberFormat.html#addcommas + */ + var addCommas = function addCommas(str) { + str += ''; + x = str.split('.'); + x1 = x[0]; + x2 = x.length > 1 ? '.' + x[1] : ''; + var rgx = /(\d+)(\d{3})/; + while (rgx.test(x1)) { + x1 = x1.replace(rgx, '$1' + ',' + '$2'); + } + return x1 + x2; + }; + + return Planetarium; +}); diff --git a/planetarium/js/raphael-min.js b/planetarium/js/raphael-min.js new file mode 100644 index 0000000..e5e7126 --- /dev/null +++ b/planetarium/js/raphael-min.js @@ -0,0 +1,7 @@ +/* + * Raphael 1.5.2 - JavaScript Vector Library + * + * Copyright (c) 2010 Dmitry Baranovskiy (http://raphaeljs.com) + * Licensed under the MIT (http://raphaeljs.com/license.html) license. + */ +(function(){function a(){if(a.is(arguments[0],G)){var b=arguments[0],d=bV[m](a,b.splice(0,3+a.is(b[0],E))),e=d.set();for(var g=0,h=b[w];g";bg=bf.firstChild;bg.style.behavior="url(#default#VML)";if(!(bg&&typeof bg.adj=="object"))return a.type=null;bf=null}a.svg=!(a.vml=a.type=="VML");j[e]=a[e];k=j[e];a._id=0;a._oid=0;a.fn={};a.is=function(a,b){b=x.call(b);if(b=="finite")return!O[f](+a);return b=="null"&&a===null||b==typeof a||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||J.call(a).slice(8,-1).toLowerCase()==b};a.angle=function(b,c,d,e,f,g){{if(f==null){var h=b-d,i=c-e;if(!h&&!i)return 0;return((h<0)*180+y.atan(-i/-h)*180/D+360)%360}return a.angle(b,c,f,g)-a.angle(d,e,f,g)}};a.rad=function(a){return a%360*D/180};a.deg=function(a){return a*180/D%360};a.snapTo=function(b,c,d){d=a.is(d,"finite")?d:10;if(a.is(b,G)){var e=b.length;while(e--)if(B(b[e]-c)<=d)return b[e]}else{b=+b;var f=c%b;if(fb-d)return c-f+b}return c};function bh(){var a=[],b=0;for(;b<32;b++)a[b]=(~(~(y.random()*16)))[H](16);a[12]=4;a[16]=(a[16]&3|8)[H](16);return"r-"+a[v]("")}a.setWindow=function(a){h=a;g=h.document};var bi=function(b){if(a.vml){var c=/^\s+|\s+$/g,d;try{var e=new ActiveXObject("htmlfile");e.write("");e.close();d=e.body}catch(a){d=createPopup().document.body}var f=d.createTextRange();bi=bm(function(a){try{d.style.color=r(a)[Y](c,p);var b=f.queryCommandValue("ForeColor");b=(b&255)<<16|b&65280|(b&16711680)>>>16;return"#"+("000000"+b[H](16)).slice(-6)}catch(a){return"none"}})}else{var h=g.createElement("i");h.title="Raphaël Colour Picker";h.style.display="none";g.body[l](h);bi=bm(function(a){h.style.color=a;return g.defaultView.getComputedStyle(h,p).getPropertyValue("color")})}return bi(b)},bj=function(){return"hsb("+[this.h,this.s,this.b]+")"},bk=function(){return"hsl("+[this.h,this.s,this.l]+")"},bl=function(){return this.hex};a.hsb2rgb=function(b,c,d,e){if(a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b){d=b.b;c=b.s;b=b.h;e=b.o}return a.hsl2rgb(b,c,d/2,e)};a.hsl2rgb=function(b,c,d,e){if(a.is(b,"object")&&"h"in b&&"s"in b&&"l"in b){d=b.l;c=b.s;b=b.h}if(b>1||c>1||d>1){b/=360;c/=100;d/=100}var f={},g=["r","g","b"],h,i,j,k,l,m;if(c){d<0.5?h=d*(1+c):h=d+c-d*c;i=2*d-h;for(var n=0;n<3;n++){j=b+1/3*-(n-1);j<0&&j++;j>1&&j--;j*6<1?f[g[n]]=i+(h-i)*6*j:j*2<1?f[g[n]]=h:j*3<2?f[g[n]]=i+(h-i)*(2/3-j)*6:f[g[n]]=i}}else f={r:d,g:d,b:d};f.r*=255;f.g*=255;f.b*=255;f.hex="#"+(16777216|f.b|f.g<<8|f.r<<16).toString(16).slice(1);a.is(e,"finite")&&(f.opacity=e);f.toString=bl;return f};a.rgb2hsb=function(b,c,d){if(c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b){d=b.b;c=b.g;b=b.r}if(c==null&&a.is(b,F)){var e=a.getRGB(b);b=e.r;c=e.g;d=e.b}if(b>1||c>1||d>1){b/=255;c/=255;d/=255}var f=z(b,c,d),g=A(b,c,d),h,i,j=f;{if(g==f)return{h:0,s:0,b:f,toString:bj};var k=f-g;i=k/f;b==f?h=(c-d)/k:c==f?h=2+(d-b)/k:h=4+(b-c)/k;h/=6;h<0&&h++;h>1&&h--}return{h:h,s:i,b:j,toString:bj}};a.rgb2hsl=function(b,c,d){if(c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b){d=b.b;c=b.g;b=b.r}if(c==null&&a.is(b,F)){var e=a.getRGB(b);b=e.r;c=e.g;d=e.b}if(b>1||c>1||d>1){b/=255;c/=255;d/=255}var f=z(b,c,d),g=A(b,c,d),h,i,j=(f+g)/2,k;if(g==f)k={h:0,s:0,l:j};else{var l=f-g;i=j<0.5?l/(f+g):l/(2-f-g);b==f?h=(c-d)/l:c==f?h=2+(d-b)/l:h=4+(b-c)/l;h/=6;h<0&&h++;h>1&&h--;k={h:h,s:i,l:j}}k.toString=bk;return k};a._path2string=function(){return this.join(",")[Y](ba,"$1")};function bm(a,b,c){function d(){var g=Array[e].slice.call(arguments,0),h=g[v]("►"),i=d.cache=d.cache||{},j=d.count=d.count||[];if(i[f](h))return c?c(i[h]):i[h];j[w]>=1000&&delete i[j.shift()];j[L](h);i[h]=a[m](b,g);return c?c(i[h]):i[h]}return d}a.getRGB=bm(function(b){if(!b||!(!((b=r(b)).indexOf("-")+1)))return{r:-1,g:-1,b:-1,hex:"none",error:1};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none"};!(_[f](b.toLowerCase().substring(0,2))||b.charAt()=="#")&&(b=bi(b));var c,d,e,g,h,i,j,k=b.match(N);if(k){if(k[2]){g=T(k[2].substring(5),16);e=T(k[2].substring(3,5),16);d=T(k[2].substring(1,3),16)}if(k[3]){g=T((i=k[3].charAt(3))+i,16);e=T((i=k[3].charAt(2))+i,16);d=T((i=k[3].charAt(1))+i,16)}if(k[4]){j=k[4][s]($);d=S(j[0]);j[0].slice(-1)=="%"&&(d*=2.55);e=S(j[1]);j[1].slice(-1)=="%"&&(e*=2.55);g=S(j[2]);j[2].slice(-1)=="%"&&(g*=2.55);k[1].toLowerCase().slice(0,4)=="rgba"&&(h=S(j[3]));j[3]&&j[3].slice(-1)=="%"&&(h/=100)}if(k[5]){j=k[5][s]($);d=S(j[0]);j[0].slice(-1)=="%"&&(d*=2.55);e=S(j[1]);j[1].slice(-1)=="%"&&(e*=2.55);g=S(j[2]);j[2].slice(-1)=="%"&&(g*=2.55);(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360);k[1].toLowerCase().slice(0,4)=="hsba"&&(h=S(j[3]));j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsb2rgb(d,e,g,h)}if(k[6]){j=k[6][s]($);d=S(j[0]);j[0].slice(-1)=="%"&&(d*=2.55);e=S(j[1]);j[1].slice(-1)=="%"&&(e*=2.55);g=S(j[2]);j[2].slice(-1)=="%"&&(g*=2.55);(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360);k[1].toLowerCase().slice(0,4)=="hsla"&&(h=S(j[3]));j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsl2rgb(d,e,g,h)}k={r:d,g:e,b:g};k.hex="#"+(16777216|g|e<<8|d<<16).toString(16).slice(1);a.is(h,"finite")&&(k.opacity=h);return k}return{r:-1,g:-1,b:-1,hex:"none",error:1}},a);a.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||0.75},c=this.hsb2rgb(b.h,b.s,b.b);b.h+=0.075;if(b.h>1){b.h=0;b.s-=0.2;b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b})}return c.hex};a.getColor.reset=function(){delete this.start};a.parsePathString=bm(function(b){if(!b)return null;var c={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},d=[];a.is(b,G)&&a.is(b[0],G)&&(d=bo(b));d[w]||r(b)[Y](bb,function(a,b,e){var f=[],g=x.call(b);e[Y](bc,function(a,b){b&&f[L](+b)});if(g=="m"&&f[w]>2){d[L]([b][n](f.splice(0,2)));g="l";b=b=="m"?"l":"L"}while(f[w]>=c[g]){d[L]([b][n](f.splice(0,c[g])));if(!c[g])break}});d[H]=a._path2string;return d});a.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=C(j,3)*a+C(j,2)*3*i*c+j*3*i*i*e+C(i,3)*g,l=C(j,3)*b+C(j,2)*3*i*d+j*3*i*i*f+C(i,3)*h,m=a+2*i*(c-a)+i*i*(e-2*c+a),n=b+2*i*(d-b)+i*i*(f-2*d+b),o=c+2*i*(e-c)+i*i*(g-2*e+c),p=d+2*i*(f-d)+i*i*(h-2*f+d),q=(1-i)*a+i*c,r=(1-i)*b+i*d,s=(1-i)*e+i*g,t=(1-i)*f+i*h,u=90-y.atan((m-o)/(n-p))*180/D;(m>o||n1){x=y.sqrt(x);c=x*c;d=x*d}var z=c*c,A=d*d,C=(f==g?-1:1)*y.sqrt(B((z*A-z*u*u-A*t*t)/(z*u*u+A*t*t))),E=C*c*u/d+(a+h)/2,F=C*-d*t/c+(b+i)/2,G=y.asin(((b-F)/d).toFixed(9)),H=y.asin(((i-F)/d).toFixed(9));G=aH&&(G=G-D*2);!g&&H>G&&(H=H-D*2)}var I=H-G;if(B(I)>k){var J=H,K=h,L=i;H=G+k*(g&&H>G?1:-1);h=E+c*y.cos(H);i=F+d*y.sin(H);m=bt(h,i,c,d,e,0,g,K,L,[H,J,E,F])}I=H-G;var M=y.cos(G),N=y.sin(G),O=y.cos(H),P=y.sin(H),Q=y.tan(I/4),R=4/3*c*Q,S=4/3*d*Q,T=[a,b],U=[a+R*N,b-S*M],V=[h+R*P,i-S*O],W=[h,i];U[0]=2*T[0]-U[0];U[1]=2*T[1]-U[1];{if(j)return[U,V,W][n](m);m=[U,V,W][n](m)[v]()[s](",");var X=[];for(var Y=0,Z=m[w];Y"1e12"&&(l=0.5);B(n)>"1e12"&&(n=0.5);if(l>0&&l<1){q=bu(a,b,c,d,e,f,g,h,l);p[L](q.x);o[L](q.y)}if(n>0&&n<1){q=bu(a,b,c,d,e,f,g,h,n);p[L](q.x);o[L](q.y)}i=f-2*d+b-(h-2*f+d);j=2*(d-b)-2*(f-d);k=b-d;l=(-j+y.sqrt(j*j-4*i*k))/2/i;n=(-j-y.sqrt(j*j-4*i*k))/2/i;B(l)>"1e12"&&(l=0.5);B(n)>"1e12"&&(n=0.5);if(l>0&&l<1){q=bu(a,b,c,d,e,f,g,h,l);p[L](q.x);o[L](q.y)}if(n>0&&n<1){q=bu(a,b,c,d,e,f,g,h,n);p[L](q.x);o[L](q.y)}return{min:{x:A[m](0,p),y:A[m](0,o)},max:{x:z[m](0,p),y:z[m](0,o)}}}),bw=bm(function(a,b){var c=bq(a),d=b&&bq(b),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1];b.Y=a[2];break;case"A":a=["C"][n](bt[m](0,[b.x,b.y][n](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x));d=b.y+(b.y-(b.by||b.y));a=["C",c,d][n](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x));b.qy=b.y+(b.y-(b.qy||b.y));a=["C"][n](bs(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1];b.qy=a[2];a=["C"][n](bs(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][n](br(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][n](br(b.x,b.y,a[1],b.y));break;case"V":a=["C"][n](br(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][n](br(b.x,b.y,b.X,b.Y));break}return a},h=function(a,b){if(a[b][w]>7){a[b].shift();var e=a[b];while(e[w])a.splice(b++,0,["C"][n](e.splice(0,6)));a.splice(b,1);k=z(c[w],d&&d[w]||0)}},i=function(a,b,e,f,g){if(a&&b&&a[g][0]=="M"&&b[g][0]!="M"){b.splice(g,0,["M",f.x,f.y]);e.bx=0;e.by=0;e.x=a[g][1];e.y=a[g][2];k=z(c[w],d&&d[w]||0)}};for(var j=0,k=z(c[w],d&&d[w]||0);j0.5)*2-1;C(e-0.5,2)+C(f-0.5,2)>0.25&&(f=y.sqrt(0.25-C(e-0.5,2))*g+0.5)&&f!=0.5&&(f=f.toFixed(5)-0.00001*g)}return p});b=b[s](/\s*\-\s*/);if(d=="linear"){var i=b.shift();i=-S(i);if(isNaN(i))return null;var j=[0,0,y.cos(i*D/180),y.sin(i*D/180)],k=1/(z(B(j[2]),B(j[3]))||1);j[2]*=k;j[3]*=k;if(j[2]<0){j[0]=-j[2];j[2]=0}if(j[3]<0){j[1]=-j[3];j[3]=0}}var m=bx(b);if(!m)return null;var n=a.getAttribute(I);n=n.match(/^url\(#(.*)\)$/);n&&c.defs.removeChild(g.getElementById(n[1]));var o=bG(d+"Gradient");o.id=bh();bG(o,d=="radial"?{fx:e,fy:f}:{x1:j[0],y1:j[1],x2:j[2],y2:j[3]});c.defs[l](o);for(var q=0,t=m[w];q1?G.opacity/100:G.opacity});case"stroke":G=a.getRGB(o);h[R](n,G.hex);n=="stroke"&&G[f]("opacity")&&bG(h,{"stroke-opacity":G.opacity>1?G.opacity/100:G.opacity});break;case"gradient":(({circle:1,ellipse:1})[f](c.type)||r(o).charAt()!="r")&&bI(h,o,c.paper);break;case"opacity":i.gradient&&!i[f]("stroke-opacity")&&bG(h,{"stroke-opacity":o>1?o/100:o});case"fill-opacity":if(i.gradient){var H=g.getElementById(h.getAttribute(I)[Y](/^url\(#|\)$/g,p));if(H){var J=H.getElementsByTagName("stop");J[J[w]-1][R]("stop-opacity",o)}break}default:n=="font-size"&&(o=T(o,10)+"px");var K=n[Y](/(\-.)/g,function(a){return V.call(a.substring(1))});h.style[K]=o;h[R](n,o);break}}}bM(c,d);m?c.rotate(m.join(q)):S(j)&&c.rotate(j,true)},bL=1.2,bM=function(b,c){if(b.type!="text"||!(c[f]("text")||c[f]("font")||c[f]("font-size")||c[f]("x")||c[f]("y")))return;var d=b.attrs,e=b.node,h=e.firstChild?T(g.defaultView.getComputedStyle(e.firstChild,p).getPropertyValue("font-size"),10):10;if(c[f]("text")){d.text=c.text;while(e.firstChild)e.removeChild(e.firstChild);var i=r(c.text)[s]("\n");for(var j=0,k=i[w];jb.height&&(b.height=e.y+e.height-b.y);e.x+e.width-b.x>b.width&&(b.width=e.x+e.width-b.x)}}a&&this.hide();return b};bN[e].attr=function(b,c){if(this.removed)return this;if(b==null){var d={};for(var e in this.attrs)this.attrs[f](e)&&(d[e]=this.attrs[e]);this._.rt.deg&&(d.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(d.scale=this.scale());d.gradient&&d.fill=="none"&&(d.fill=d.gradient)&&delete d.gradient;return d}if(c==null&&a.is(b,F)){if(b=="translation")return cz.call(this);if(b=="rotation")return this.rotate();if(b=="scale")return this.scale();if(b==I&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;return this.attrs[b]}if(c==null&&a.is(b,G)){var g={};for(var h=0,i=b.length;h"));m.W=h.w=m.paper.span.offsetWidth;m.H=h.h=m.paper.span.offsetHeight;m.X=h.x;m.Y=h.y+Q(m.H/2);switch(h["text-anchor"]){case"start":m.node.style["v-text-align"]="left";m.bbx=Q(m.W/2);break;case"end":m.node.style["v-text-align"]="right";m.bbx=-Q(m.W/2);break;default:m.node.style["v-text-align"]="center";break}}};bI=function(a,b){a.attrs=a.attrs||{};var c=a.attrs,d,e="linear",f=".5 .5";a.attrs.gradient=b;b=r(b)[Y](bd,function(a,b,c){e="radial";if(b&&c){b=S(b);c=S(c);C(b-0.5,2)+C(c-0.5,2)>0.25&&(c=y.sqrt(0.25-C(b-0.5,2))*((c>0.5)*2-1)+0.5);f=b+q+c}return p});b=b[s](/\s*\-\s*/);if(e=="linear"){var g=b.shift();g=-S(g);if(isNaN(g))return null}var h=bx(b);if(!h)return null;a=a.shape||a.node;d=a.getElementsByTagName(I)[0]||cd(I);!d.parentNode&&a.appendChild(d);if(h[w]){d.on=true;d.method="none";d.color=h[0].color;d.color2=h[h[w]-1].color;var i=[];for(var j=0,k=h[w];j")}}catch(a){cd=function(a){return g.createElement("<"+a+" xmlns=\"urn:schemas-microsoft.com:vml\" class=\"rvml\">")}}bV=function(){var b=by[m](0,arguments),c=b.container,d=b.height,e,f=b.width,h=b.x,i=b.y;if(!c)throw new Error("VML container not found.");var k=new j,n=k.canvas=g.createElement("div"),o=n.style;h=h||0;i=i||0;f=f||512;d=d||342;f==+f&&(f+="px");d==+d&&(d+="px");k.width=1000;k.height=1000;k.coordsize=b_*1000+q+b_*1000;k.coordorigin="0 0";k.span=g.createElement("span");k.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";n[l](k.span);o.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",f,d);if(c==1){g.body[l](n);o.left=h+"px";o.top=i+"px";o.position="absolute"}else c.firstChild?c.insertBefore(n,c.firstChild):c[l](n);bz.call(k,k,a.fn);return k};k.clear=function(){this.canvas.innerHTML=p;this.span=g.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas[l](this.span);this.bottom=this.top=null};k.remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=bF(a);return true}}var ce=navigator.userAgent.match(/Version\\x2f(.*?)\s/);navigator.vendor=="Apple Computer, Inc."&&(ce&&ce[1]<4||navigator.platform.slice(0,2)=="iP")?k.safari=function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});h.setTimeout(function(){a.remove()})}:k.safari=function(){};var cf=function(){this.returnValue=false},cg=function(){return this.originalEvent.preventDefault()},ch=function(){this.cancelBubble=true},ci=function(){return this.originalEvent.stopPropagation()},cj=(function(){{if(g.addEventListener)return function(a,b,c,d){var e=o&&u[b]?u[b]:b,g=function(e){if(o&&u[f](b))for(var g=0,h=e.targetTouches&&e.targetTouches.length;g1&&(a=Array[e].splice.call(arguments,0,arguments[w]));return new cC(a)};k.setSize=bU;k.top=k.bottom=null;k.raphael=a;function co(){return this.x+q+this.y}bO.resetScale=function(){if(this.removed)return this;this._.sx=1;this._.sy=1;this.attrs.scale="1 1"};bO.scale=function(a,b,c,d){if(this.removed)return this;if(a==null&&b==null)return{x:this._.sx,y:this._.sy,toString:co};b=b||a;!(+b)&&(b=a);var e,f,g,h,i=this.attrs;if(a!=0){var j=this.getBBox(),k=j.x+j.width/2,l=j.y+j.height/2,m=B(a/this._.sx),o=B(b/this._.sy);c=+c||c==0?c:k;d=+d||d==0?d:l;var r=this._.sx>0,s=this._.sy>0,t=~(~(a/B(a))),u=~(~(b/B(b))),x=m*t,y=o*u,z=this.node.style,A=c+B(k-c)*x*(k>c==r?1:-1),C=d+B(l-d)*y*(l>d==s?1:-1),D=a*t>b*u?o:m;switch(this.type){case"rect":case"image":var E=i.width*m,F=i.height*o;this.attr({height:F,r:i.r*D,width:E,x:A-E/2,y:C-F/2});break;case"circle":case"ellipse":this.attr({rx:i.rx*m,ry:i.ry*o,r:i.r*D,cx:A,cy:C});break;case"text":this.attr({x:A,y:C});break;case"path":var G=bp(i.path),H=true,I=r?x:m,J=s?y:o;for(var K=0,L=G[w];Kr)p=n.data[r*l];else{p=a.findDotsAtSegment(b,c,d,e,f,g,h,i,r/l);n.data[r]=p}r&&(k+=C(C(o.x-p.x,2)+C(o.y-p.y,2),0.5));if(j!=null&&k>=j)return p;o=p}if(j==null)return k},cr=function(b,c){return function(d,e,f){d=bw(d);var g,h,i,j,k="",l={},m,n=0;for(var o=0,p=d.length;oe){if(c&&!l.start){m=cq(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);k+=["C",m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k;k=["M",m.x,m.y+"C",m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]][v]();n+=j;g=+i[5];h=+i[6];continue}if(!b&&!c){m=cq(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j;g=+i[5];h=+i[6]}k+=i}l.end=k;m=b?n:c?l:a.findDotsAtSegment(g,h,i[1],i[2],i[3],i[4],i[5],i[6],1);m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},cs=cr(1),ct=cr(),cu=cr(0,1);bO.getTotalLength=function(){if(this.type!="path")return;if(this.node.getTotalLength)return this.node.getTotalLength();return cs(this.attrs.path)};bO.getPointAtLength=function(a){if(this.type!="path")return;return ct(this.attrs.path,a)};bO.getSubpath=function(a,b){if(this.type!="path")return;if(B(this.getTotalLength()-b)<"1e-6")return cu(this.attrs.path,a).end;var c=cu(this.attrs.path,b,1);return a?cu(c,a).end:c};a.easing_formulas={linear:function(a){return a},"<":function(a){return C(a,3)},">":function(a){return C(a-1,3)+1},"<>":function(a){a=a*2;if(a<1)return C(a,3)/2;a-=2;return(C(a,3)+2)/2},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==0||a==1)return a;var b=0.3,c=b/4;return C(2,-10*a)*y.sin((a-c)*(2*D)/b)+1},bounce:function(a){var b=7.5625,c=2.75,d;if(a<1/c)d=b*a*a;else if(a<2/c){a-=1.5/c;d=b*a*a+0.75}else if(a<2.5/c){a-=2.25/c;d=b*a*a+0.9375}else{a-=2.625/c;d=b*a*a+0.984375}return d}};var cv=[],cw=function(){var b=+(new Date);for(var c=0;cd)return d;while(cf?c=e:d=e;e=(d-c)/2+c}return e}return n(a,1/(200*f))}bO.onAnimation=function(a){this._run=a||0;return this};bO.animate=function(c,d,e,g){var h=this;h.timeouts=h.timeouts||[];if(a.is(e,"function")||!e)g=e||null;if(h.removed){g&&g.call(h);return h}var i={},j={},k=false,l={};for(var m in c)if(c[f](m)){if(X[f](m)||h.paper.customAttributes[f](m)){k=true;i[m]=h.attr(m);i[m]==null&&(i[m]=W[m]);j[m]=c[m];switch(X[m]){case"along":var n=cs(c[m]),o=ct(c[m],n*!(!c.back)),p=h.getBBox();l[m]=n/d;l.tx=p.x;l.ty=p.y;l.sx=o.x;l.sy=o.y;j.rot=c.rot;j.back=c.back;j.len=n;c.rot&&(l.r=S(h.rotate())||0);break;case E:l[m]=(j[m]-i[m])/d;break;case"colour":i[m]=a.getRGB(i[m]);var q=a.getRGB(j[m]);l[m]={r:(q.r-i[m].r)/d,g:(q.g-i[m].g)/d,b:(q.b-i[m].b)/d};break;case"path":var t=bw(i[m],j[m]);i[m]=t[0];var u=t[1];l[m]=[];for(var v=0,x=i[m][w];v0){k.splice(o-1,2);o-=2}}function K(k,o){var s;if(k.charAt(0)===".")if(o){if(da.packages[o])o=[o];else{o=o.split("/");o=o.slice(0,o.length-1)}k=o.concat(k.split("/"));D(k);s=da.packages[o=k[0]];k=k.join("/");if(s&&k===o+"/"+s.main)k=o}return k}function L(k,o){var s=k?k.indexOf("!"):-1,x=null,E=o?o.name:null,Q=k,M,V;if(s!==-1){x=k.substring(0,s);k=k.substring(s+1,k.length)}if(x){x= +K(x,E);x=Sa[x]||x}if(k){if(x)M=(s=Y[x])?s.normalize?s.normalize(k,function(ba){return K(ba,E)}):K(k,E):"__$p"+E+"@"+k;else M=K(k,E);V=Ta[M];if(!V){V=F.toModuleUrl?F.toModuleUrl(J,k,o):J.nameToUrl(k,null,o);Ta[M]=V}}return{prefix:x,name:M,parentMap:o,url:V,originalName:Q,fullName:x?x+"!"+M:M}}function aa(){var k=true,o=da.priorityWait,s,x;if(o){for(x=0;s=o[x];x++)if(!ia[s]){k=false;break}k&&delete da.priorityWait}return k}function P(k){return function(o){k.exports=o}}function Ga(k,o,s){return function(){var x= +[].concat(bb.call(arguments,0)),E;if(s&&R(E=x[x.length-1]))E.__requireJsBuild=true;x.push(o);return k.apply(null,x)}}function cb(k,o){o=Ga(J.require,k,o);Fa(o,{nameToUrl:Ga(J.nameToUrl,k),toUrl:Ga(J.toUrl,k),isDefined:Ga(J.isDefined,k),ready:F.ready,isBrowser:F.isBrowser});if(F.paths)o.paths=F.paths;return o}function lb(k){var o,s,x,E,Q,M,V,ba=Ha[k];if(ba)for(E=0;s=ba[E];E++){o=s.fullName;s=L(s.originalName,s.parentMap);s=s.fullName;x=ea[o];if(s!==o){ea[s]=x;delete ea[o];for(Q=0;Q0;M--){Q=s.slice(0,M).join("/");if(x[Q]){s.splice(0,M,x[Q]);break}else if(Q=E[Q]){k=k===Q.name?Q.location+"/"+Q.main:Q.location+"/"+Q.lib;s.splice(0,M,k);break}}o=s.join("/")+(o||".js");o=(o.charAt(0)==="/"||o.match(/^\w+:/)?"":V.baseUrl)+o}}return V.urlArgs?o+((o.indexOf("?")===-1?"?": +"&")+V.urlArgs):o}};J.jQueryCheck=Va;J.resume=ca;return J}function ib(){var y,D,K;if(za&&za.readyState==="interactive")return za;y=document.getElementsByTagName("script");for(D=y.length-1;D>-1&&(K=y[D]);D--)if(K.readyState==="interactive")return za=K;return null}var pb=/(\/\*([\s\S]*?)\*\/|\/\/(.*)$)/mg,Ka=/require\(["']([^'"\s]+)["']\)/g,ab=/^\.\//,Qa=Object.prototype.toString,fa=Array.prototype,bb=fa.slice,ob=fa.splice,na=!!(typeof window!=="undefined"&&navigator&&document),Ja=!na&&typeof importScripts!== +"undefined",Aa=na&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,eb="_r@@",pa={},w={},c=[],za=null,qb=false,Ya=false,Sa={text:"require/text",i18n:"require/i18n",order:"require/order"},F;fa={};var Za,W,wa,La,Ma,ra,Na,oa,jb,Oa,va,Pa,$a,sa;if(typeof require!=="undefined")if(R(require))return;else fa=require;F=require=function(y,D,K){var L="_",aa;if(!I(y)&&typeof y!=="string"){aa=y;if(I(D)){y=D;D=K}else y=[]}if(aa&&aa.context)L=aa.context;K=w[L]||(w[L]=Ra(L));aa&&K.configure(aa); +return K.require(y,D)};F.version="0.22.0";F.isArray=I;F.isFunction=R;F.mixin=Fa;F.jsExtRegExp=/^\/|:|\?|\.js$/;W=F.s={contexts:w,skipAsync:{},isPageLoaded:!na,readyCalls:[]};if(F.isAsync=F.isBrowser=na){wa=W.head=document.getElementsByTagName("head")[0];if(La=document.getElementsByTagName("base")[0])wa=W.head=La.parentNode}F.onError=function(y){throw y;};F.load=function(y,D,K){var L=y.contextName,aa=y.urlFetched,P=y.loaded;qb=false;P[D]||(P[D]=false);if(!aa[K]){y.scriptCount+=1;F.attach(K,L,D);aa[K]= +true;if(y.jQuery&&!y.jQueryIncremented){y.jQuery.readyWait+=1;y.jQueryIncremented=true}}};define=F.def=function(y,D,K){var L;if(typeof y!=="string"){K=D;D=y;y=null}if(!F.isArray(D)){K=D;D=[]}if(!y&&!D.length&&F.isFunction(K))if(K.length){K.toString().replace(pb,"").replace(Ka,function(aa,P){D.push(P)});D=["require","exports","module"].concat(D)}if(Ya){L=Za||ib();if(!L)return F.onError(new Error("ERROR: No matching script interactive for "+K));y||(y=L.getAttribute("data-requiremodule"));L=w[L.getAttribute("data-requirecontext")]}(L? +L.defQueue:c).push([y,D,K])};F.execCb=function(y,D,K){return D.apply(null,K)};F.onScriptLoad=function(y){var D=y.currentTarget||y.srcElement,K;if(y.type==="load"||Aa.test(D.readyState)){za=null;y=D.getAttribute("data-requirecontext");K=D.getAttribute("data-requiremodule");w[y].completeLoad(K);D.removeEventListener?D.removeEventListener("load",F.onScriptLoad,false):D.detachEvent("onreadystatechange",F.onScriptLoad)}};F.attach=function(y,D,K,L,aa){var P;if(na){L=L||F.onScriptLoad;P=document.createElement("script"); +P.type=aa||"text/javascript";P.charset="utf-8";P.async=!W.skipAsync[y];P.setAttribute("data-requirecontext",D);P.setAttribute("data-requiremodule",K);if(P.addEventListener)P.addEventListener("load",L,false);else{Ya=true;P.attachEvent("onreadystatechange",L)}P.src=y;Za=P;La?wa.insertBefore(P,La):wa.appendChild(P);Za=null;return P}else if(Ja){L=w[D];D=L.loaded;D[K]=false;importScripts(y);L.completeLoad(K)}return null};W.baseUrl=fa.baseUrl;if(na&&(!W.baseUrl||!wa)){Ma=document.getElementsByTagName("script"); +Na=fa.baseUrlMatch?fa.baseUrlMatch:/(requireplugins-|require-)?jquery[\-\d\.]*(min)?\.js(\W|$)/i;for(va=Ma.length-1;va>-1&&(ra=Ma[va]);va--){if(!wa)wa=ra.parentNode;if(!Oa&&(Oa=ra.getAttribute("data-main"))){fa.deps=fa.deps?fa.deps.concat(Oa):[Oa];if(!fa.baseUrl&&(oa=ra.src)){oa=oa.split("/");oa.pop();W.baseUrl=fa.baseUrl=oa.length?oa.join("/"):"./"}}if(!W.baseUrl&&(oa=ra.src))if(jb=oa.match(Na)){W.baseUrl=oa.substring(0,jb.index);break}}}F.pageLoaded=function(){if(!W.isPageLoaded){W.isPageLoaded= +true;Pa&&clearInterval(Pa);if($a)document.readyState="complete";F.callReady()}};F.checkReadyState=function(){var y=W.contexts,D;for(D in y)if(!(D in pa))if(y[D].waitCount)return;W.isDone=true;F.callReady()};F.callReady=function(){var y=W.readyCalls,D,K,L;if(W.isPageLoaded&&W.isDone){if(y.length){W.readyCalls=[];for(D=0;K=y[D];D++)K()}y=W.contexts;for(L in y)if(!(L in pa)){D=y[L];if(D.jQueryIncremented){D.jQuery.readyWait-=1;D.jQueryIncremented=false}}}};F.ready=function(y){W.isPageLoaded&&W.isDone? +y():W.readyCalls.push(y);return F};if(na){if(document.addEventListener){document.addEventListener("DOMContentLoaded",F.pageLoaded,false);window.addEventListener("load",F.pageLoaded,false);if(!document.readyState){$a=true;document.readyState="loading"}}else if(window.attachEvent){window.attachEvent("onload",F.pageLoaded);if(self===self.top)Pa=setInterval(function(){try{if(document.body){document.documentElement.doScroll("left");F.pageLoaded()}}catch(y){}},30)}document.readyState==="complete"&&F.pageLoaded()}F(fa); +if(typeof setTimeout!=="undefined"){sa=W.contexts[fa.context||"_"];sa.requireWait=true;setTimeout(function(){sa.requireWait=false;sa.takeGlobalQueue();sa.jQueryCheck();sa.scriptCount||sa.resume();F.checkReadyState()},0)}})(); +(function(R,I){function Fa(a,b,d){if(d===I&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):qb.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=I}return d}function xa(){return false}function Ra(){return true}function ib(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function pb(a){var b,d,e,f,h,m,l,p,A,v,G,O=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= +h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)G=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var Z=h.live.slice(0);for(l=0;ld)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;G=f.handleObj.origHandler.apply(f.elem,arguments);if(G===false||a.isPropagationStopped()){d=f.level;if(G===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Ka(a,b){return(a&&a!=="*"?a+".": +"")+b.replace(oa,"`").replace(jb,"&")}function ab(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function Qa(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(cb.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function fa(a){return c.nodeName(a,"table")? +a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function bb(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var m in e[h])c.event.add(this,h,e[h][m],e[h][m].data)}}})}function ob(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)} +function na(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Ua:mb,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function Ja(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Q.test(a)?e(a,h):Ja(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)? +e(a,""):c.each(b,function(f,h){Ja(a+"["+f+"]",h,d,e)});else e(a,b)}function Aa(a,b){var d={};c.each(tb.concat.apply([],tb.slice(0,b)),function(){d[this]=a});return d}function eb(a){if(!rb[a]){var b=c("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";rb[a]=d}return rb[a]}function pa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var w=R.document,c=function(){function a(){if(!b.isReady){try{w.documentElement.doScroll("left")}catch(j){setTimeout(a, +1);return}b.ready()}}var b=function(j,t){return new b.fn.init(j,t)},d=R.jQuery,e=R.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,m=/\S/,l=/^\s+/,p=/\s+$/,A=/\W/,v=/\d/,G=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,O=/^[\],:{}\s]*$/,Z=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,B=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,X=/(?:^|:|,)(?:\s*\[)+/g,ja=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,q=navigator.userAgent,r=false, +u=[],C,H=Object.prototype.toString,T=Object.prototype.hasOwnProperty,ha=Array.prototype.push,ka=Array.prototype.slice,la=String.prototype.trim,S=Array.prototype.indexOf,Ea={};b.fn=b.prototype={init:function(j,t){var z,N;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!t&&w.body){this.context=w;this[0]=w.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((z=h.exec(j))&&(z[1]||!t))if(z[1]){N=t?t.ownerDocument||t:w;if(j=G.exec(j))if(b.isPlainObject(t)){j= +[w.createElement(j[1])];b.fn.attr.call(j,t,true)}else j=[N.createElement(j[1])];else{j=b.buildFragment([z[1]],[N]);j=(j.cacheable?j.fragment.cloneNode(true):j.fragment).childNodes}return b.merge(this,j)}else{if((t=w.getElementById(z[2]))&&t.parentNode){if(t.id!==z[2])return f.find(j);this.length=1;this[0]=t}this.context=w;this.selector=j;return this}else if(!t&&!A.test(j)){this.selector=j;this.context=w;j=w.getElementsByTagName(j);return b.merge(this,j)}else return!t||t.jquery?(t||f).find(j):b(t).find(j); +else if(b.isFunction(j))return f.ready(j);if(j.selector!==I){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},toArray:function(){return ka.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,t,z){var N=b();b.isArray(j)?ha.apply(N,j):b.merge(N,j);N.prevObject=this;N.context=this.context;if(t==="find")N.selector=this.selector+(this.selector?" ": +"")+z;else if(t)N.selector=this.selector+"."+t+"("+z+")";return N},each:function(j,t){return b.each(this,j,t)},ready:function(j){b.bindReady();if(b.isReady)j.call(w,b);else u&&u.push(j);return this},eq:function(j){return j===-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(ka.apply(this,arguments),"slice",ka.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(t,z){return j.call(t, +z,t)}))},end:function(){return this.prevObject||b(null)},push:ha,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,t,z,N,$,U=arguments[0]||{},ga=1,ma=arguments.length,sb=false;if(typeof U==="boolean"){sb=U;U=arguments[1]||{};ga=2}if(typeof U!=="object"&&!b.isFunction(U))U={};if(ma===ga){U=this;--ga}for(;ga0))if(u){var t=0,z=u;for(u=null;j=z[t++];)j.call(w,b);b.fn.trigger&&b(w).trigger("ready").unbind("ready")}}},bindReady:function(){if(!r){r=true;if(w.readyState=== +"complete")return setTimeout(b.ready,1);if(w.addEventListener){w.addEventListener("DOMContentLoaded",C,false);R.addEventListener("load",b.ready,false)}else if(w.attachEvent){w.attachEvent("onreadystatechange",C);R.attachEvent("onload",b.ready);var j=false;try{j=R.frameElement==null}catch(t){}w.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in +j},isNaN:function(j){return j==null||!v.test(j)||isNaN(j)},type:function(j){return j==null?String(j):Ea[H.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&&!T.call(j,"constructor")&&!T.call(j.constructor.prototype,"isPrototypeOf"))return false;var t;for(t in j);return t===I||T.call(j,t)},isEmptyObject:function(j){for(var t in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!== +"string"||!j)return null;j=b.trim(j);if(O.test(j.replace(Z,"@").replace(B,"]").replace(X,"")))return R.JSON&&R.JSON.parse?R.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&m.test(j)){var t=w.getElementsByTagName("head")[0]||w.documentElement,z=w.createElement("script");z.type="text/javascript";if(b.support.scriptEval)z.appendChild(w.createTextNode(j));else z.text=j;t.insertBefore(z,t.firstChild);t.removeChild(z)}},nodeName:function(j, +t){return j.nodeName&&j.nodeName.toUpperCase()===t.toUpperCase()},each:function(j,t,z){var N,$=0,U=j.length,ga=U===I||b.isFunction(j);if(z)if(ga)for(N in j){if(t.apply(j[N],z)===false)break}else for(;$
a";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],m=w.createElement("select"),l=m.appendChild(w.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length, +htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:l.selected,deleteExpando:true,optDisabled:false,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};m.disabled=true;c.support.optDisabled= +!l.disabled;b.type="text/javascript";try{b.appendChild(w.createTextNode("window."+e+"=1;"))}catch(p){}a.insertBefore(b,a.firstChild);if(R[e]){c.support.scriptEval=true;delete R[e]}try{delete b.test}catch(A){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function v(){c.support.noCloneEvent=false;d.detachEvent("onclick",v)});d.cloneNode(true).fireEvent("onclick")}d=w.createElement("div");d.innerHTML=""; +a=w.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var v=w.createElement("div");v.style.width=v.style.paddingLeft="1px";w.body.appendChild(v);c.boxModel=c.support.boxModel=v.offsetWidth===2;if("zoom"in v.style){v.style.display="inline";v.style.zoom=1;c.support.inlineBlockNeedsLayout=v.offsetWidth===2;v.style.display="";v.innerHTML="
";c.support.shrinkWrapBlocks=v.offsetWidth!== +2}v.innerHTML="
t
";var G=v.getElementsByTagName("td");c.support.reliableHiddenOffsets=G[0].offsetHeight===0;G[0].style.display="";G[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&G[0].offsetHeight===0;v.innerHTML="";w.body.removeChild(v).style.display="none"});a=function(v){var G=w.createElement("div");v="on"+v;var O=v in G;if(!O){G.setAttribute(v,"return;");O=typeof G[v]==="function"}return O}; +c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var za={},qb=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==R?za:a;var e=a.nodeType,f=e?a[c.expando]:null,h=c.cache;if(!(e&&!f&&typeof b==="string"&&d===I)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h, +b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==I)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==R?za:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);else if(d)delete f[e];else for(var m in a)delete a[m]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()]; +if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,m=e.length;h-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h=0;else if(c.nodeName(this,"select")){var G=c.makeArray(v);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),G)>=0});if(!G.length)this.selectedIndex=-1}else this.value=v}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return I;if(e&&b in c.attrFn)return c(a)[b](d); +e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==I;b=e&&c.props[b]||b;var h=Za.test(b);if((b in a||a[b]!==I)&&e&&!h){if(f){b==="type"&&W.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:wa.test(a.nodeName)||La.test(a.nodeName)&&a.href?0:I;return a[b]}if(!c.support.style&& +e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return I;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?I:a}});var ra=/\.(.*)$/,Na=/^(?:textarea|input|select)$/i,oa=/\./g,jb=/ /g,Oa=/[^\w\s.|`]/g,va=function(a){return a.replace(Oa,"\\$&")},Pa={focusin:0,focusout:0};c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==R&&!a.frameElement)a= +R;if(d===false)d=xa;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var m=a.nodeType?"events":"__events__",l=h[m],p=h.handle;if(typeof l==="function"){p=l.handle;l=l.events}else if(!l){a.nodeType||(h[m]=h=function(){});h.events=l={}}if(!p)h.handle=p=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(p.elem,arguments):I};p.elem=a;b=b.split(" ");for(var A=0,v;m=b[A++];){h=f?c.extend({},f):{handler:d,data:e};if(m.indexOf(".")> +-1){v=m.split(".");m=v.shift();h.namespace=v.slice(0).sort().join(".")}else{v=[];h.namespace=""}h.type=m;if(!h.guid)h.guid=d.guid;var G=l[m],O=c.event.special[m]||{};if(!G){G=l[m]=[];if(!O.setup||O.setup.call(a,e,v,p)===false)if(a.addEventListener)a.addEventListener(m,p,false);else a.attachEvent&&a.attachEvent("on"+m,p)}if(O.add){O.add.call(a,h);if(!h.handler.guid)h.handler.guid=d.guid}G.push(h);c.event.global[m]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType=== +8)){if(d===false)d=xa;var f,h,m=0,l,p,A,v,G,O,Z=a.nodeType?"events":"__events__",B=c.data(a),X=B&&B[Z];if(B&&X){if(typeof X==="function"){B=X;X=X.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in X)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[m++];){v=f;l=f.indexOf(".")<0;p=[];if(!l){p=f.split(".");f=p.shift();A=new RegExp("(^|\\.)"+c.map(p.slice(0).sort(),va).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(G=X[f])if(d){v=c.event.special[f]||{};for(h= +e||0;h=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return I;a.result=I;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType? +c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var m;e=a.target;var l=f.replace(ra,""),p=c.nodeName(e,"a")&&l==="click",A=c.event.special[l]||{};if((!A._default||A._default.call(d,a)===false)&&!p&&!(e&&e.nodeName&& +c.noData[e.nodeName.toLowerCase()])){try{if(e[l]){if(m=e["on"+l])e["on"+l]=null;c.event.triggered=true;e[l]()}}catch(v){}if(m)e["on"+l]=m;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||R.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType? +"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var m=d.length;f-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},K=function(a,b){var d=a.target,e,f;if(!(!Na.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=D(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===I||f===e))if(e!=null||f){a.type="change";a.liveFired= +I;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return K.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return K.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",D(a))}},setup:function(){if(this.type=== +"file")return false;for(var a in y)c.event.add(this,a+".specialChange",y[a]);return Na.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return Na.test(this.nodeName)}};y=c.event.special.change.filters;y.focus=y.beforeactivate}w.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){Pa[b]++===0&&w.addEventListener(a,d,true)},teardown:function(){--Pa[b]=== +0&&w.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=I}var m=b==="one"?c.proxy(f,function(p){c(this).unbind(p,m);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var l=this.length;h0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});R.attachEvent&&!R.addEventListener&&c(R).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); +(function(){function a(g,i,n,q,r,u){r=0;for(var C=q.length;r0){T=H;break}}H=H[g]}q[r]=T}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,m=true;[0,0].sort(function(){m=false;return 0});var l=function(g,i,n,q){n=n||[];var r=i=i||w;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var u,C,H,T,ha,ka=true,la=l.isXML(i),S=[],Ea=g;do{d.exec("");if(u=d.exec(Ea)){Ea=u[3];S.push(u[1]);if(u[2]){T= +u[3];break}}}while(u);if(S.length>1&&A.exec(g))if(S.length===2&&p.relative[S[0]])C=ja(S[0]+S[1],i);else for(C=p.relative[S[0]]?[i]:l(S.shift(),i);S.length;){g=S.shift();if(p.relative[g])g+=S.shift();C=ja(g,C)}else{if(!q&&S.length>1&&i.nodeType===9&&!la&&p.match.ID.test(S[0])&&!p.match.ID.test(S[S.length-1])){u=l.find(S.shift(),i,la);i=u.expr?l.filter(u.expr,u.set)[0]:u.set[0]}if(i){u=q?{expr:S.pop(),set:O(q)}:l.find(S.pop(),S.length===1&&(S[0]==="~"||S[0]==="+")&&i.parentNode?i.parentNode:i,la);C= +u.expr?l.filter(u.expr,u.set):u.set;if(S.length>0)H=O(C);else ka=false;for(;S.length;){u=ha=S.pop();if(p.relative[ha])u=S.pop();else ha="";if(u==null)u=i;p.relative[ha](H,u,la)}}else H=[]}H||(H=C);H||l.error(ha||g);if(f.call(H)==="[object Array]")if(ka)if(i&&i.nodeType===1)for(g=0;H[g]!=null;g++){if(H[g]&&(H[g]===true||H[g].nodeType===1&&l.contains(i,H[g])))n.push(C[g])}else for(g=0;H[g]!=null;g++)H[g]&&H[g].nodeType===1&&n.push(C[g]);else n.push.apply(n,H);else O(H,n);if(T){l(T,r,n,q);l.uniqueSort(n)}return n}; +l.uniqueSort=function(g){if(B){h=m;g.sort(B);if(h)for(var i=1;i0};l.find=function(g,i,n){var q;if(!g)return[];for(var r=0,u=p.order.length;r":function(g,i){var n,q=typeof i==="string",r=0,u=g.length;if(q&&!/\W/.test(i))for(i=i.toLowerCase();r=0))n||q.push(C);else if(n)i[u]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&& +"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,q,r,u){i=g[1].replace(/\\/g,"");if(!u&&p.attrMap[i])g[1]=p.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,q,r){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=l(g[3],null,null,i);else{g=l.filter(g[3],i,n,true^r);n||q.push.apply(q,g);return false}else if(p.match.POS.test(g[0])||p.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}}, +filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!l(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"=== +g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,q){return i===q.length-1},even:function(g,i){return i%2=== +0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return in[3]-0},nth:function(g,i,n){return n[3]-0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,q){var r=i[1],u=p.filters[r];if(u)return u(g,n,i,q);else if(r==="contains")return(g.textContent||g.innerText||l.getText([g])||"").indexOf(i[3])>=0;else if(r==="not"){i=i[3];n=0;for(q=i.length;n= +0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];g=p.attrHandle[n]?p.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);n=g+"";var q=i[2];i=i[4];return g==null?q==="!=":q==="="?n===i:q==="*="?n.indexOf(i)>=0:q==="~="?(" "+n+" ").indexOf(i)>=0:!i?n&&g!==false:q==="!="?n!==i:q==="^="? +n.indexOf(i)===0:q==="$="?n.substr(n.length-i.length)===i:q==="|="?n===i||n.substr(0,i.length+1)===i+"-":false},POS:function(g,i,n,q){var r=p.setFilters[i[2]];if(r)return r(g,n,i,q)}}},A=p.match.POS,v=function(g,i){return"\\"+(i-0+1)};for(var G in p.match){p.match[G]=new RegExp(p.match[G].source+/(?![^\[]*\])(?![^\(]*\))/.source);p.leftMatch[G]=new RegExp(/(^(?:.|\r|\n)*?)/.source+p.match[G].source.replace(/\\(\d+)/g,v))}var O=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g); +return i}return g};try{Array.prototype.slice.call(w.documentElement.childNodes,0)}catch(Z){O=function(g,i){var n=0;i=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(i,g);else if(typeof g.length==="number")for(var q=g.length;n";n.insertBefore(g,n.firstChild);if(w.getElementById(i)){p.find.ID=function(q,r,u){if(typeof r.getElementById!=="undefined"&&!u)return(r=r.getElementById(q[1]))?r.id===q[1]||typeof r.getAttributeNode!=="undefined"&&r.getAttributeNode("id").nodeValue=== +q[1]?[r]:I:[]};p.filter.ID=function(q,r){var u=typeof q.getAttributeNode!=="undefined"&&q.getAttributeNode("id");return q.nodeType===1&&u&&u.nodeValue===r}}n.removeChild(g);n=g=null})();(function(){var g=w.createElement("div");g.appendChild(w.createComment(""));if(g.getElementsByTagName("*").length>0)p.find.TAG=function(i,n){n=n.getElementsByTagName(i[1]);if(i[1]==="*"){i=[];for(var q=0;n[q];q++)n[q].nodeType===1&&i.push(n[q]);n=i}return n};g.innerHTML="";if(g.firstChild&&typeof g.firstChild.getAttribute!== +"undefined"&&g.firstChild.getAttribute("href")!=="#")p.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();w.querySelectorAll&&function(){var g=l,i=w.createElement("div");i.innerHTML="

";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){l=function(q,r,u,C){r=r||w;q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!C&&!l.isXML(r))if(r.nodeType===9)try{return O(r.querySelectorAll(q),u)}catch(H){}else if(r.nodeType===1&&r.nodeName.toLowerCase()!== +"object"){var T=r.getAttribute("id"),ha=T||"__sizzle__";T||r.setAttribute("id",ha);try{return O(r.querySelectorAll("#"+ha+" "+q),u)}catch(ka){}finally{T||r.removeAttribute("id")}}return g(q,r,u,C)};for(var n in g)l[n]=g[n];i=null}}();(function(){var g=w.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(w.documentElement,"[test!='']:sizzle")}catch(q){n=true}if(i)l.matchesSelector=function(r,u){u=u.replace(/\=\s*([^'"\]]*)\s*\]/g, +"='$1']");if(!l.isXML(r))try{if(n||!p.match.PSEUDO.test(u)&&!/!=/.test(u))return i.call(r,u)}catch(C){}return l(u,null,null,[r]).length>0}})();(function(){var g=w.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){p.order.splice(1,0,"CLASS");p.find.CLASS=function(i,n,q){if(typeof n.getElementsByClassName!=="undefined"&& +!q)return n.getElementsByClassName(i[1])};g=null}}})();l.contains=w.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:w.documentElement.compareDocumentPosition?function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};l.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var ja=function(g,i){var n,q=[],r="";for(i=i.nodeType?[i]:i;n=p.match.PSEUDO.exec(g);){r+=n[0];g=g.replace(p.match.PSEUDO,"")}g= +p.relative[g]?g+"*":g;n=0;for(var u=i.length;n0)for(var h=d;h0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var m,l={},p=1;if(h&&a.length){e=0;for(f=a.length;e-1:c(h).is(a))d.push({selector:m,elem:h,level:p})}h=h.parentNode;p++}}return d}m=db.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a|| +typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(ab(a[0])||ab(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", +d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? +a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,e){var f=c.map(this,b,d);aa.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||Ga.test(e))&&P.test(a))f=f.reverse();return this.pushStack(f,a,lb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a= +a[b];a&&a.nodeType!==9&&(d===I||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ia=/ jQuery\d+="(?:\d+|null)"/g,Ca=/^\s+/,ya=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Va=/<([\w:]+)/,gb=/\s]+\/)>/g,ca={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};ca.optgroup=ca.option;ca.tbody=ca.tfoot=ca.colgroup=ca.caption=ca.thead;ca.th=ca.td;if(!c.support.htmlSerialize)ca._default= +[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==I)return this.empty().append((this[0]&&this[0].ownerDocument||w).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d= +this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments, +true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments, +false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ia,"").replace(J,'="$1">').replace(Ca,"")],e)[0]}else return this.cloneNode(true)});if(a===true){bb(this,b);bb(this.find("*"),b.find("*"))}return b},html:function(a){if(a===I)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ia,""):null; +else if(typeof a==="string"&&!Xa.test(a)&&(c.support.leadingWhitespace||!Ca.test(a))&&!ca[(Va.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ya,"<$1>");try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?h.cloneNode(true):h)}l.length&&c.each(l, +ob)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:w;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===w&&!Xa.test(a[0])&&(c.support.checkClone||!hb.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"}, +function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f0?this.clone(true):this).get();c(d[f])[b](m);e=e.concat(m)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||w;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||w;for(var f=[],h=0,m;(m=a[h])!=null;h++){if(typeof m=== +"number")m+="";if(m){if(typeof m==="string"&&!Wa.test(m))m=b.createTextNode(m);else if(typeof m==="string"){m=m.replace(ya,"<$1>");var l=(Va.exec(m)||["",""])[1].toLowerCase(),p=ca[l]||ca._default,A=p[0],v=b.createElement("div");for(v.innerHTML=p[1]+m+p[2];A--;)v=v.lastChild;if(!c.support.tbody){A=gb.test(m);l=l==="table"&&!A?v.firstChild&&v.firstChild.childNodes:p[1]===""&&!A?v.childNodes:[];for(p=l.length-1;p>=0;--p)c.nodeName(l[p],"tbody")&&!l[p].childNodes.length&&l[p].parentNode.removeChild(l[p])}!c.support.leadingWhitespace&& +Ca.test(m)&&v.insertBefore(b.createTextNode(Ca.exec(m)[0]),v.firstChild);m=v.childNodes}if(m.nodeType)f.push(m);else f=c.merge(f,m)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special, +h=c.support.deleteExpando,m=0,l;(l=a[m])!=null;m++)if(!(l.nodeName&&c.noData[l.nodeName.toLowerCase()]))if(d=l[c.expando]){if((b=e[d])&&b.events)for(var p in b.events)f[p]?c.event.remove(l,p):c.removeEvent(l,p,b.handle);if(h)delete l[c.expando];else l.removeAttribute&&l.removeAttribute(c.expando);delete e[d]}}});var da=/alpha\([^)]*\)/i,Da=/opacity=([^)]*)/,Ba=/-([a-z])/ig,Ta=/([A-Z])/g,Y=/^-?\d+(?:px)?$/i,ia=/^-?\d/,ua={position:"absolute",visibility:"hidden",display:"block"},Ua=["Left","Right"], +mb=["Top","Bottom"],ea,ta,qa,Ha=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===I)return this;return c.access(this,a,b,true,function(d,e,f){return f!==I?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){a=ea(a,"opacity","opacity");return a===""?"1":a}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a, +b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),m=a.style,l=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==I){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!l||!("set"in l)||(d=l.set(a,d))!==I)try{m[b]=d}catch(p){}}}else{if(l&&"get"in l&&(f=l.get(a,false,e))!==I)return f;return m[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==I)return e;else if(ea)return ea(a, +b,f)},swap:function(a,b,d){var e={};for(var f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(Ba,Ha)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=na(d,b,f);else c.swap(d,ua,function(){h=na(d,b,f)});if(h<=0){h=ea(d,b,b);if(h==="0px"&&qa)h=qa(d,b,b);if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px": +h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Y.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return Da.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){a=a.style;a.zoom=1;b=c.isNaN(b)?"":"alpha(opacity="+b*100+")";var d=a.filter||"";a.filter=da.test(d)?d.replace(da,b):a.filter+" "+b}};if(w.defaultView&&w.defaultView.getComputedStyle)ta= +function(a,b,d){var e;d=d.replace(Ta,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return I;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(w.documentElement.currentStyle)qa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Y.test(f)&&ia.test(f)){d=h.left;e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left= +d;a.runtimeStyle.left=e}return f===""?"auto":f};ea=ta||qa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var k=c.now(),o=/)<[^<]*)*<\/script>/gi,s=/^(?:select|textarea)/i,x=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, +E=/^(?:GET|HEAD)$/,Q=/\[\]$/,M=/\=\?(&|$)/,V=/\?/,ba=/([?&])_=[^&]*/,fb=/^(\w+:)?\/\/([^\/?#]+)/,nb=/%20/g,wb=/#.*$/,ub=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&ub)return ub.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b, +complete:function(m,l){if(l==="success"||l==="notmodified")h.html(f?c("
").append(m.responseText.replace(o,"")).find(f):m.responseText);d&&h.each(d,[m.responseText,l,m])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||s.test(this.nodeName)||x.test(this.type))}).map(function(a,b){a=c(this).val(); +return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a, +b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new R.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}}, +ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),m=E.test(h);b.url=b.url.replace(wb,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")M.test(b.url)||(b.url+=(V.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||!M.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&& +M.test(b.data)||M.test(b.url))){d=b.jsonpCallback||"jsonp"+k++;if(b.data)b.data=(b.data+"").replace(M,"="+d+"$1");b.url=b.url.replace(M,"="+d+"$1");b.dataType="script";var l=R[d];R[d]=function(q){if(c.isFunction(l))l(q);else{R[d]=I;try{delete R[d]}catch(r){}}f=q;c.handleSuccess(b,B,e,f);c.handleComplete(b,B,e,f);v&&v.removeChild(G)}}if(b.dataType==="script"&&b.cache===null)b.cache=false;if(b.cache===false&&m){var p=c.now(),A=b.url.replace(ba,"$1_="+p);b.url=A+(A===b.url?(V.test(b.url)?"&":"?")+"_="+ +p:"")}if(b.data&&m)b.url+=(V.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");p=(p=fb.exec(b.url))&&(p[1]&&p[1].toLowerCase()!==location.protocol||p[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&p){var v=w.getElementsByTagName("head")[0]||w.documentElement,G=w.createElement("script");if(b.scriptCharset)G.charset=b.scriptCharset;G.src=b.url;if(!d){var O=false;G.onload=G.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=== +"loaded"||this.readyState==="complete")){O=true;c.handleSuccess(b,B,e,f);c.handleComplete(b,B,e,f);G.onload=G.onreadystatechange=null;v&&G.parentNode&&v.removeChild(G)}}}v.insertBefore(G,v.firstChild);return I}var Z=false,B=b.xhr();if(B){b.username?B.open(h,b.url,b.async,b.username,b.password):B.open(h,b.url,b.async);try{if(b.data!=null&&!m||a&&a.contentType)B.setRequestHeader("Content-Type",b.contentType);if(b.ifModified){c.lastModified[b.url]&&B.setRequestHeader("If-Modified-Since",c.lastModified[b.url]); +c.etag[b.url]&&B.setRequestHeader("If-None-Match",c.etag[b.url])}p||B.setRequestHeader("X-Requested-With","XMLHttpRequest");B.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(X){}if(b.beforeSend&&b.beforeSend.call(b.context,B,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");B.abort();return false}b.global&&c.triggerGlobal(b,"ajaxSend",[B,b]);var ja=B.onreadystatechange=function(q){if(!B||B.readyState===0|| +q==="abort"){Z||c.handleComplete(b,B,e,f);Z=true;if(B)B.onreadystatechange=c.noop}else if(!Z&&B&&(B.readyState===4||q==="timeout")){Z=true;B.onreadystatechange=c.noop;e=q==="timeout"?"timeout":!c.httpSuccess(B)?"error":b.ifModified&&c.httpNotModified(B,b.url)?"notmodified":"success";var r;if(e==="success")try{f=c.httpData(B,b.dataType,b)}catch(u){e="parsererror";r=u}if(e==="success"||e==="notmodified")d||c.handleSuccess(b,B,e,f);else c.handleError(b,B,e,r);d||c.handleComplete(b,B,e,f);q==="timeout"&& +B.abort();if(b.async)B=null}};try{var g=B.abort;B.abort=function(){B&&Function.prototype.call.call(g,B);ja("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){B&&!Z&&ja("timeout")},b.timeout);try{B.send(m||b.data==null?null:b.data)}catch(n){c.handleError(b,B,null,n);c.handleComplete(b,B,e,f)}b.async||ja();return B}},param:function(a,b){var d=[],e=function(h,m){m=c.isFunction(m)?m():m;d[d.length]=encodeURIComponent(h)+"="+encodeURIComponent(m)};if(b===I)b=c.ajaxSettings.traditional;if(c.isArray(a)|| +a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)Ja(f,a[f],b,e);return d.join("&").replace(nb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a, +"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304}, +httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});if(R.ActiveXObject)c.ajaxSettings.xhr=function(){if(R.location.protocol!=="file:")try{return new R.XMLHttpRequest}catch(a){}try{return new R.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}; +c.support.ajax=!!c.ajaxSettings.xhr();var rb={},xb=/^(?:toggle|show|hide)$/,yb=/^([+\-]=)?([\d+.\-]+)(.*)$/,kb,tb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(Aa("show",3),a,b,d);else{d=0;for(var e=this.length;d=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:Aa("show",1),slideUp:Aa("hide",1),slideToggle:Aa("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&& +b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype= +{update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-10000?a:0},custom:function(a,b,d){function e(m){return f.step(m)}var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos= +this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!kb)kb=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= +this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(l,p){f.style["overflow"+p]=h.overflow[l]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var m in this.options.curAnim)c.style(this.elem,m,this.options.orig[m]);this.options.complete.call(this.elem)}return false}else{a= +b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
"; +a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b); +c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a,"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),m=c.css(a,"top"),l=c.css(a,"left"),p=e==="absolute"&&c.inArray("auto",[m,l])>-1;e={};var A={};if(p)A=f.position();m=p?A.top:parseInt(m, +10)||0;l=p?A.left:parseInt(l,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+m;if(b.left!=null)e.left=b.left-h.left+l;"using"in b?b.using.call(a,e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=vb.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0], +"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||w.body;a&&!vb.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==I)return this.each(function(){if(h=pa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=pa(f))?"pageXOffset"in +h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(m){var l=c(this);l[d](e.call(this, +m,l[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===I){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}});typeof define!=="undefined"&&define("jquery",[],function(){return c})})(window); diff --git a/planetarium/js/satellites.js b/planetarium/js/satellites.js new file mode 100644 index 0000000..83aaf37 --- /dev/null +++ b/planetarium/js/satellites.js @@ -0,0 +1,86 @@ + +define(["raphael"], function(R) { + + var SatelliteSystem = Class.extend({ + ANIMATION_INTERVAL: 20, + DEFAULT_PLANET_RADIUS: 20, + DEFAULT_PLANET_COLOR: "white", + DEFAULT_ORBIT_COLOR: "white", + + init: function(divId, width, height, scale) { + this.r = R(divId, width, height); + this.scale = scale || 1; + this.animation = null; + this.x = (width / 2) * this.scale; + this.y = (height / 2) * this.scale; + this.orbitStyle = { stroke: this.DEFAULT_ORBIT_COLOR }; + this.planetStyle = { "stroke-width": 0, fill: this.DEFAULT_PLANET_COLOR }; + this.setPlanetRadius(this.DEFAULT_PLANET_RADIUS); + this.satellites = {}; + }, + + setPlanetRadius: function(radius) { + this.planetRadius = radius * this.scale; + }, + + forEachSatellite: function(callback) { + for(var name in this.satellites) { + if(this.satellites.hasOwnProperty(name)) { + callback(this.satellites[name]); + } + } + }, + + drawPlanet: function() { + this.r.circle(this.x, this.y, this.planetRadius).attr(this.planetStyle); + }, + + drawOrbits: function() { + var self = this, + f = this.scale; + + this.forEachSatellite(function(s) { + self.r.circle(self.x, self.y, s.o * f).attr(self.orbitStyle); + }); + }, + + drawSatellites: function() { + var self = this, + f = this.scale; + + this.forEachSatellite(function(s) { + s.e = self.r.circle(self.x + (s.o * f), self.y, s.r * f) + .attr({ "stroke-width": 0, fill: s.c}) + .rotate(s.a, self.x, self.y); + }); + }, + + draw: function() { + this.drawPlanet(); + this.drawOrbits(); + this.drawSatellites(); + }, + + play: function() { + var self = this; + + if(!this.animation) { + this.animation = setInterval(function() { + self.forEachSatellite(function(s) { + s.e.rotate(s.a, self.x, self.y); + s.a += s.s; + }); + }, this.ANIMATION_INTERVAL); + } + }, + + pause: function() { + if(this.animation) { + clearInterval(this.animation); + this.animation = null; + } + } + }); + + return SatelliteSystem; +}); diff --git a/planetarium/js/solarsystem.js b/planetarium/js/solarsystem.js new file mode 100644 index 0000000..abbb256 --- /dev/null +++ b/planetarium/js/solarsystem.js @@ -0,0 +1,184 @@ + +define(["constants", "planet"], function(Constants, Planet) { + + var SolarSystem = Class.extend({ + DEFAULT_HEIGHT: 300, // Default distance from the top of the screen (in pixels) + + /** + * Creates the solar system + */ + init: function() { + this.planets = { + mercury: new Planet("mercury", 0.4, 0), + venus: new Planet("venus", 0.9, 0), + earth: new Planet("earth", 1, 0), + mars: new Planet("mars", 0.53, 0), + jupiter: new Planet("jupiter", 11.2, 0), + saturn: new Planet("saturn", 9.4, 90), + uranus: new Planet("uranus", 4, 0), + neptune: new Planet("neptune", 3.8, 0) + }; + + this.planetPositions = {}; + this.planetsOrder = ["mercury", "venus", "earth", "mars", "jupiter", "saturn", "uranus", "neptune"]; + this.planetsDistance = [46001200, 107476259, 147098290, 206669000, 740573600, 1353572956, 2748938461, 4452940833]; + + this.distance = 100; // Default distance between planets + this.multiplier = 1; // Default planet scale multiplier + }, + + getPlanet: function(name) { + return this.planets[name]; + }, + + getNbPlanets: function() { + return this.planetsOrder.length; + }, + + getPlanetIndex: function(name) { + for(var i=0; i this.planetsOrder.length-1) { + throw Error("This planet index is out of bounds"); + } + + return this.planetsOrder[index]; + }, + + getPlanetAt: function(index) { + return this.planets[this.getPlanetNameAt(index)]; + }, + + forEachPlanet: function(f) { + for(var i=0; i w || availableWidth < 0) { + this.distance = 100; + availableWidth = w - (nbPlanets * this.distance); + } + + this.forEachPlanet(function(planet) { + diameterSum += planet.getDiameter(); + }); + + var k = availableWidth / diameterSum; + + this.scale(k); + this.move(0, (h / 2) - (Constants.IMG_SIZE / 2)); + }, + + /** + * Get the total width (in pixels) from the left of the system to the specified planet. + * This sums up each planet diameter and distances between planets, up to the planet passed in argument. + * @return {number} Distance + */ + getDistanceTo: function(planetName) { + var width = 0; + var d = this.distance; + var m = this.multiplier; + + this.forEachPlanetBefore(planetName, function(planet) { + width += planet.getDiameter(m) + d; + }); + return width; + }, + + getPlanetPosition: function(planetName) { + var pos = this.planetPositions[planetName]; + + pos.x += Constants.IMG_SIZE / 2; + pos.y += Constants.IMG_SIZE / 2; + + return pos; + }, + + getPlanetDiameter: function(planetName) { + return this.getPlanet(planetName).getDiameter(this.multiplier); + }, + + getPlanetScale: function(planetName) { + return this.getPlanet(planetName).m * this.multiplier; + }, + + getPlanetDistanceToSun: function(index) { + return this.planetsDistance[index]; + } + }); + + return SolarSystem; +}); diff --git a/planetarium/js/transformable.js b/planetarium/js/transformable.js new file mode 100644 index 0000000..2ce3fc1 --- /dev/null +++ b/planetarium/js/transformable.js @@ -0,0 +1,57 @@ + +define(function() { + /** + * Transformable represents a DOM element on which CSS3 transforms are applied. + */ + var Transformable = Class.extend({ + init: function(id, scale, angle) { + this.id = id; + this.m = scale; + this.s = scale; + this.r = angle; + + this.x = 0; + this.y = 0; + + this.transform(); + }, + + transform: function() { + var id = this.id, + x = this.x, + y = this.y, + s = this.s; + r = this.r; + + function doTransform(prefix) { + $("#" + id).css(prefix + "transform", "translateX(" + x + "px) translateY(" + y + "px) scale(" + s + ") rotate(" + r + "deg)"); + } + doTransform("-moz-"); + doTransform("-webkit-"); + doTransform("-o-"); + }, + + move: function(x, y) { + this.x = x; + this.y = y; + this.transform(); + }, + + moveX: function(x) { + this.x = x; + this.transform(); + }, + + moveY: function(y) { + this.y = y; + this.transform(); + }, + + scale: function(s) { + this.s = s; + this.transform(); + } + }); + + return Transformable; +}); diff --git a/planetarium/screenshot.jpg b/planetarium/screenshot.jpg new file mode 100644 index 0000000..7b9182b Binary files /dev/null and b/planetarium/screenshot.jpg differ