").append( jQuery.parseHTML( responseText ) ).find( selector ) :
+
+ // Otherwise use the full result
+ responseText );
+
+ }).complete( callback && function( jqXHR, status ) {
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
+ });
+ }
+
+ return this;
+};
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
+ jQuery.fn[ type ] = function( fn ){
+ return this.on( type, fn );
+ };
+});
+
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ type: "GET",
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ processData: true,
+ async: true,
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ throws: false,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ "*": allTypes,
+ text: "text/plain",
+ html: "text/html",
+ xml: "application/xml, text/xml",
+ json: "application/json, text/javascript"
+ },
+
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText",
+ json: "responseJSON"
+ },
+
+ // Data converters
+ // Keys separate source (or catchall "*") and destination types with a single space
+ converters: {
+
+ // Convert anything to text
+ "* text": String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ url: true,
+ context: true
+ }
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ return settings ?
+
+ // Building a settings object
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
+
+ // Extending ajaxSettings
+ ajaxExtend( jQuery.ajaxSettings, target );
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var // Cross-domain detection vars
+ parts,
+ // Loop variable
+ i,
+ // URL without anti-cache param
+ cacheURL,
+ // Response headers as string
+ responseHeadersString,
+ // timeout handle
+ timeoutTimer,
+
+ // To know if global events are to be dispatched
+ fireGlobals,
+
+ transport,
+ // Response headers
+ responseHeaders,
+ // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
+ globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
+ jQuery( callbackContext ) :
+ jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks("once memory"),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // The jqXHR state
+ state = 0,
+ // Default abort message
+ strAbort = "canceled",
+ // Fake xhr
+ jqXHR = {
+ readyState: 0,
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while ( (match = rheaders.exec( responseHeadersString )) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match == null ? null : match;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ var lname = name.toLowerCase();
+ if ( !state ) {
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Status-dependent callbacks
+ statusCode: function( map ) {
+ var code;
+ if ( map ) {
+ if ( state < 2 ) {
+ for ( code in map ) {
+ // Lazy-add the new callback in a way that preserves old ones
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
+ }
+ } else {
+ // Execute the appropriate callbacks
+ jqXHR.always( map[ jqXHR.status ] );
+ }
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ var finalText = statusText || strAbort;
+ if ( transport ) {
+ transport.abort( finalText );
+ }
+ done( 0, finalText );
+ return this;
+ }
+ };
+
+ // Attach deferreds
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Alias method option to type as per ticket #12004
+ s.type = options.method || options.type || s.method || s.type;
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
+
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefilter, stop there
+ if ( state === 2 ) {
+ return jqXHR;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger("ajaxStart");
+ }
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Save the URL in case we're toying with the If-Modified-Since
+ // and/or If-None-Match header later on
+ cacheURL = s.url;
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+ s.url = rts.test( cacheURL ) ?
+
+ // If there is already a '_' parameter, set its value
+ cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
+
+ // Otherwise add one to the end
+ cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
+ }
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
+ }
+ if ( jQuery.etag[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already and return
+ return jqXHR.abort();
+ }
+
+ // aborting is no longer a cancellation
+ strAbort = "abort";
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout(function() {
+ jqXHR.abort("timeout");
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch ( e ) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ // Callback for when everything is done
+ function done( status, nativeStatusText, responses, headers ) {
+ var isSuccess, success, error, response, modified,
+ statusText = nativeStatusText;
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ // Determine if successful
+ isSuccess = status >= 200 && status < 300 || status === 304;
+
+ // Get response data
+ if ( responses ) {
+ response = ajaxHandleResponses( s, jqXHR, responses );
+ }
+
+ // Convert no matter what (that way responseXXX fields are always set)
+ response = ajaxConvert( s, response, jqXHR, isSuccess );
+
+ // If successful, handle type chaining
+ if ( isSuccess ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ modified = jqXHR.getResponseHeader("Last-Modified");
+ if ( modified ) {
+ jQuery.lastModified[ cacheURL ] = modified;
+ }
+ modified = jqXHR.getResponseHeader("etag");
+ if ( modified ) {
+ jQuery.etag[ cacheURL ] = modified;
+ }
+ }
+
+ // if no content
+ if ( status === 204 || s.type === "HEAD" ) {
+ statusText = "nocontent";
+
+ // if not modified
+ } else if ( status === 304 ) {
+ statusText = "notmodified";
+
+ // If we have data, let's convert it
+ } else {
+ statusText = response.state;
+ success = response.data;
+ error = response.error;
+ isSuccess = !error;
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if ( status || !statusText ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger("ajaxStop");
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ }
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ url: url,
+ type: method,
+ dataType: type,
+ data: data,
+ success: callback
+ });
+ };
+});
+
+/* Handles responses to an ajax request:
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+ var firstDataType, ct, finalDataType, type,
+ contents = s.contents,
+ dataTypes = s.dataTypes;
+
+ // Remove auto dataType and get content-type in the process
+ while( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+/* Chain conversions given the request and the original response
+ * Also sets the responseXXX fields on the jqXHR instance
+ */
+function ajaxConvert( s, response, jqXHR, isSuccess ) {
+ var conv2, current, conv, tmp, prev,
+ converters = {},
+ // Work with a copy of dataTypes in case we need to modify it for conversion
+ dataTypes = s.dataTypes.slice();
+
+ // Create converters map with lowercased keys
+ if ( dataTypes[ 1 ] ) {
+ for ( conv in s.converters ) {
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
+ }
+ }
+
+ current = dataTypes.shift();
+
+ // Convert to each sequential dataType
+ while ( current ) {
+
+ if ( s.responseFields[ current ] ) {
+ jqXHR[ s.responseFields[ current ] ] = response;
+ }
+
+ // Apply the dataFilter if provided
+ if ( !prev && isSuccess && s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ prev = current;
+ current = dataTypes.shift();
+
+ if ( current ) {
+
+ // There's only work to do if current dataType is non-auto
+ if ( current === "*" ) {
+
+ current = prev;
+
+ // Convert response if prev dataType is non-auto and differs from current
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Seek a direct converter
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
+
+ // If none found, seek a pair
+ if ( !conv ) {
+ for ( conv2 in converters ) {
+
+ // If conv2 outputs current
+ tmp = conv2.split( " " );
+ if ( tmp[ 1 ] === current ) {
+
+ // If prev can be converted to accepted input
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
+ converters[ "* " + tmp[ 0 ] ];
+ if ( conv ) {
+ // Condense equivalence converters
+ if ( conv === true ) {
+ conv = converters[ conv2 ];
+
+ // Otherwise, insert the intermediate dataType
+ } else if ( converters[ conv2 ] !== true ) {
+ current = tmp[ 0 ];
+ dataTypes.unshift( tmp[ 1 ] );
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ // Apply converter (if not an equivalence)
+ if ( conv !== true ) {
+
+ // Unless errors are allowed to bubble, catch and return them
+ if ( conv && s[ "throws" ] ) {
+ response = conv( response );
+ } else {
+ try {
+ response = conv( response );
+ } catch ( e ) {
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return { state: "success", data: response };
+}
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /(?:java|ecma)script/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || jQuery("head")[0] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement("script");
+
+ script.async = true;
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( script.parentNode ) {
+ script.parentNode.removeChild( script );
+ }
+
+ // Dereference the script
+ script = null;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+
+ // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
+ // Use native DOM manipulation to avoid our domManip AJAX trickery
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( undefined, true );
+ }
+ }
+ };
+ }
+});
+var oldCallbacks = [],
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
+ this[ callback ] = true;
+ return callback;
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var callbackName, overwritten, responseContainer,
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
+ "url" :
+ typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
+ );
+
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
+
+ // Get callback name, remembering preexisting value associated with it
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+ s.jsonpCallback() :
+ s.jsonpCallback;
+
+ // Insert callback into url or form data
+ if ( jsonProp ) {
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
+ } else if ( s.jsonp !== false ) {
+ s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
+ }
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( callbackName + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Install callback
+ overwritten = window[ callbackName ];
+ window[ callbackName ] = function() {
+ responseContainer = arguments;
+ };
+
+ // Clean-up function (fires after converters)
+ jqXHR.always(function() {
+ // Restore preexisting value
+ window[ callbackName ] = overwritten;
+
+ // Save back as free
+ if ( s[ callbackName ] ) {
+ // make sure that re-using the options doesn't screw things around
+ s.jsonpCallback = originalSettings.jsonpCallback;
+
+ // save the callback name for future use
+ oldCallbacks.push( callbackName );
+ }
+
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+ overwritten( responseContainer[ 0 ] );
+ }
+
+ responseContainer = overwritten = undefined;
+ });
+
+ // Delegate to script
+ return "script";
+ }
+});
+var xhrCallbacks, xhrSupported,
+ xhrId = 0,
+ // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+ xhrOnUnloadAbort = window.ActiveXObject && function() {
+ // Abort all pending requests
+ var key;
+ for ( key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( undefined, true );
+ }
+ };
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject("Microsoft.XMLHTTP");
+ } catch( e ) {}
+}
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject ?
+ /* Microsoft failed to properly
+ * implement the XMLHttpRequest in IE7 (can't request local files),
+ * so we use the ActiveXObject when it is available
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
+ * we need a fallback.
+ */
+ function() {
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+// Determine support properties
+xhrSupported = jQuery.ajaxSettings.xhr();
+jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+xhrSupported = jQuery.support.ajax = !!xhrSupported;
+
+// Create transport if the browser can provide an xhr
+if ( xhrSupported ) {
+
+ jQuery.ajaxTransport(function( s ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !s.crossDomain || jQuery.support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+
+ // Get a new xhr
+ var handle, i,
+ xhr = s.xhr();
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
+ } else {
+ xhr.open( s.type, s.url, s.async );
+ }
+
+ // Apply custom fields if provided
+ if ( s.xhrFields ) {
+ for ( i in s.xhrFields ) {
+ xhr[ i ] = s.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( s.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( s.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
+ headers["X-Requested-With"] = "XMLHttpRequest";
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+ } catch( err ) {}
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( s.hasContent && s.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+ var status, responseHeaders, statusText, responses;
+
+ // Firefox throws exceptions when accessing properties
+ // of an xhr when a network error occurred
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
+ try {
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+
+ // Only called once
+ callback = undefined;
+
+ // Do not keep as active anymore
+ if ( handle ) {
+ xhr.onreadystatechange = jQuery.noop;
+ if ( xhrOnUnloadAbort ) {
+ delete xhrCallbacks[ handle ];
+ }
+ }
+
+ // If it's an abort
+ if ( isAbort ) {
+ // Abort it manually if needed
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ responses = {};
+ status = xhr.status;
+ responseHeaders = xhr.getAllResponseHeaders();
+
+ // When requesting binary data, IE6-9 will throw an exception
+ // on any attempt to access responseText (#11426)
+ if ( typeof xhr.responseText === "string" ) {
+ responses.text = xhr.responseText;
+ }
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && s.isLocal && !s.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+ } catch( firefoxAccessException ) {
+ if ( !isAbort ) {
+ complete( -1, firefoxAccessException );
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, responseHeaders );
+ }
+ };
+
+ if ( !s.async ) {
+ // if we're in sync mode we fire the callback
+ callback();
+ } else if ( xhr.readyState === 4 ) {
+ // (IE6 & IE7) if it's in cache and has been
+ // retrieved directly we need to fire the callback
+ setTimeout( callback );
+ } else {
+ handle = ++xhrId;
+ if ( xhrOnUnloadAbort ) {
+ // Create the active xhrs callbacks list if needed
+ // and attach the unload handler
+ if ( !xhrCallbacks ) {
+ xhrCallbacks = {};
+ jQuery( window ).unload( xhrOnUnloadAbort );
+ }
+ // Add to list of active xhrs callbacks
+ xhrCallbacks[ handle ] = callback;
+ }
+ xhr.onreadystatechange = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback( undefined, true );
+ }
+ }
+ };
+ }
+ });
+}
+var fxNow, timerId,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
+ rrun = /queueHooks$/,
+ animationPrefilters = [ defaultPrefilter ],
+ tweeners = {
+ "*": [function( prop, value ) {
+ var tween = this.createTween( prop, value ),
+ target = tween.cur(),
+ parts = rfxnum.exec( value ),
+ unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
+
+ // Starting value computation is required for potential unit mismatches
+ start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
+ rfxnum.exec( jQuery.css( tween.elem, prop ) ),
+ scale = 1,
+ maxIterations = 20;
+
+ if ( start && start[ 3 ] !== unit ) {
+ // Trust units reported by jQuery.css
+ unit = unit || start[ 3 ];
+
+ // Make sure we update the tween properties later on
+ parts = parts || [];
+
+ // Iteratively approximate from a nonzero starting point
+ start = +target || 1;
+
+ do {
+ // If previous iteration zeroed out, double until we get *something*
+ // Use a string for doubling factor so we don't accidentally see scale as unchanged below
+ scale = scale || ".5";
+
+ // Adjust and apply
+ start = start / scale;
+ jQuery.style( tween.elem, prop, start + unit );
+
+ // Update scale, tolerating zero or NaN from tween.cur()
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
+ }
+
+ // Update tween properties
+ if ( parts ) {
+ start = tween.start = +start || +target || 0;
+ tween.unit = unit;
+ // If a +=/-= token was provided, we're doing a relative animation
+ tween.end = parts[ 1 ] ?
+ start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
+ +parts[ 2 ];
+ }
+
+ return tween;
+ }]
+ };
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout(function() {
+ fxNow = undefined;
+ });
+ return ( fxNow = jQuery.now() );
+}
+
+function createTween( value, prop, animation ) {
+ var tween,
+ collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
+ index = 0,
+ length = collection.length;
+ for ( ; index < length; index++ ) {
+ if ( (tween = collection[ index ].call( animation, prop, value )) ) {
+
+ // we're done with this property
+ return tween;
+ }
+ }
+}
+
+function Animation( elem, properties, options ) {
+ var result,
+ stopped,
+ index = 0,
+ length = animationPrefilters.length,
+ deferred = jQuery.Deferred().always( function() {
+ // don't match elem in the :animated selector
+ delete tick.elem;
+ }),
+ tick = function() {
+ if ( stopped ) {
+ return false;
+ }
+ var currentTime = fxNow || createFxNow(),
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
+ // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
+ temp = remaining / animation.duration || 0,
+ percent = 1 - temp,
+ index = 0,
+ length = animation.tweens.length;
+
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( percent );
+ }
+
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
+
+ if ( percent < 1 && length ) {
+ return remaining;
+ } else {
+ deferred.resolveWith( elem, [ animation ] );
+ return false;
+ }
+ },
+ animation = deferred.promise({
+ elem: elem,
+ props: jQuery.extend( {}, properties ),
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
+ originalProperties: properties,
+ originalOptions: options,
+ startTime: fxNow || createFxNow(),
+ duration: options.duration,
+ tweens: [],
+ createTween: function( prop, end ) {
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
+ animation.tweens.push( tween );
+ return tween;
+ },
+ stop: function( gotoEnd ) {
+ var index = 0,
+ // if we are going to the end, we want to run all the tweens
+ // otherwise we skip this part
+ length = gotoEnd ? animation.tweens.length : 0;
+ if ( stopped ) {
+ return this;
+ }
+ stopped = true;
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( 1 );
+ }
+
+ // resolve when we played the last frame
+ // otherwise, reject
+ if ( gotoEnd ) {
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
+ } else {
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
+ }
+ return this;
+ }
+ }),
+ props = animation.props;
+
+ propFilter( props, animation.opts.specialEasing );
+
+ for ( ; index < length ; index++ ) {
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
+ if ( result ) {
+ return result;
+ }
+ }
+
+ jQuery.map( props, createTween, animation );
+
+ if ( jQuery.isFunction( animation.opts.start ) ) {
+ animation.opts.start.call( elem, animation );
+ }
+
+ jQuery.fx.timer(
+ jQuery.extend( tick, {
+ elem: elem,
+ anim: animation,
+ queue: animation.opts.queue
+ })
+ );
+
+ // attach callbacks from options
+ return animation.progress( animation.opts.progress )
+ .done( animation.opts.done, animation.opts.complete )
+ .fail( animation.opts.fail )
+ .always( animation.opts.always );
+}
+
+function propFilter( props, specialEasing ) {
+ var index, name, easing, value, hooks;
+
+ // camelCase, specialEasing and expand cssHook pass
+ for ( index in props ) {
+ name = jQuery.camelCase( index );
+ easing = specialEasing[ name ];
+ value = props[ index ];
+ if ( jQuery.isArray( value ) ) {
+ easing = value[ 1 ];
+ value = props[ index ] = value[ 0 ];
+ }
+
+ if ( index !== name ) {
+ props[ name ] = value;
+ delete props[ index ];
+ }
+
+ hooks = jQuery.cssHooks[ name ];
+ if ( hooks && "expand" in hooks ) {
+ value = hooks.expand( value );
+ delete props[ name ];
+
+ // not quite $.extend, this wont overwrite keys already present.
+ // also - reusing 'index' from above because we have the correct "name"
+ for ( index in value ) {
+ if ( !( index in props ) ) {
+ props[ index ] = value[ index ];
+ specialEasing[ index ] = easing;
+ }
+ }
+ } else {
+ specialEasing[ name ] = easing;
+ }
+ }
+}
+
+jQuery.Animation = jQuery.extend( Animation, {
+
+ tweener: function( props, callback ) {
+ if ( jQuery.isFunction( props ) ) {
+ callback = props;
+ props = [ "*" ];
+ } else {
+ props = props.split(" ");
+ }
+
+ var prop,
+ index = 0,
+ length = props.length;
+
+ for ( ; index < length ; index++ ) {
+ prop = props[ index ];
+ tweeners[ prop ] = tweeners[ prop ] || [];
+ tweeners[ prop ].unshift( callback );
+ }
+ },
+
+ prefilter: function( callback, prepend ) {
+ if ( prepend ) {
+ animationPrefilters.unshift( callback );
+ } else {
+ animationPrefilters.push( callback );
+ }
+ }
+});
+
+function defaultPrefilter( elem, props, opts ) {
+ /* jshint validthis: true */
+ var prop, value, toggle, tween, hooks, oldfire,
+ anim = this,
+ orig = {},
+ style = elem.style,
+ hidden = elem.nodeType && isHidden( elem ),
+ dataShow = jQuery._data( elem, "fxshow" );
+
+ // handle queue: false promises
+ if ( !opts.queue ) {
+ hooks = jQuery._queueHooks( elem, "fx" );
+ if ( hooks.unqueued == null ) {
+ hooks.unqueued = 0;
+ oldfire = hooks.empty.fire;
+ hooks.empty.fire = function() {
+ if ( !hooks.unqueued ) {
+ oldfire();
+ }
+ };
+ }
+ hooks.unqueued++;
+
+ anim.always(function() {
+ // doing this makes sure that the complete handler will be called
+ // before this completes
+ anim.always(function() {
+ hooks.unqueued--;
+ if ( !jQuery.queue( elem, "fx" ).length ) {
+ hooks.empty.fire();
+ }
+ });
+ });
+ }
+
+ // height/width overflow pass
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height animated
+ if ( jQuery.css( elem, "display" ) === "inline" &&
+ jQuery.css( elem, "float" ) === "none" ) {
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
+ style.display = "inline-block";
+
+ } else {
+ style.zoom = 1;
+ }
+ }
+ }
+
+ if ( opts.overflow ) {
+ style.overflow = "hidden";
+ if ( !jQuery.support.shrinkWrapBlocks ) {
+ anim.always(function() {
+ style.overflow = opts.overflow[ 0 ];
+ style.overflowX = opts.overflow[ 1 ];
+ style.overflowY = opts.overflow[ 2 ];
+ });
+ }
+ }
+
+
+ // show/hide pass
+ for ( prop in props ) {
+ value = props[ prop ];
+ if ( rfxtypes.exec( value ) ) {
+ delete props[ prop ];
+ toggle = toggle || value === "toggle";
+ if ( value === ( hidden ? "hide" : "show" ) ) {
+ continue;
+ }
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
+ }
+ }
+
+ if ( !jQuery.isEmptyObject( orig ) ) {
+ if ( dataShow ) {
+ if ( "hidden" in dataShow ) {
+ hidden = dataShow.hidden;
+ }
+ } else {
+ dataShow = jQuery._data( elem, "fxshow", {} );
+ }
+
+ // store state if its toggle - enables .stop().toggle() to "reverse"
+ if ( toggle ) {
+ dataShow.hidden = !hidden;
+ }
+ if ( hidden ) {
+ jQuery( elem ).show();
+ } else {
+ anim.done(function() {
+ jQuery( elem ).hide();
+ });
+ }
+ anim.done(function() {
+ var prop;
+ jQuery._removeData( elem, "fxshow" );
+ for ( prop in orig ) {
+ jQuery.style( elem, prop, orig[ prop ] );
+ }
+ });
+ for ( prop in orig ) {
+ tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
+
+ if ( !( prop in dataShow ) ) {
+ dataShow[ prop ] = tween.start;
+ if ( hidden ) {
+ tween.end = tween.start;
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
+ }
+ }
+ }
+ }
+}
+
+function Tween( elem, options, prop, end, easing ) {
+ return new Tween.prototype.init( elem, options, prop, end, easing );
+}
+jQuery.Tween = Tween;
+
+Tween.prototype = {
+ constructor: Tween,
+ init: function( elem, options, prop, end, easing, unit ) {
+ this.elem = elem;
+ this.prop = prop;
+ this.easing = easing || "swing";
+ this.options = options;
+ this.start = this.now = this.cur();
+ this.end = end;
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+ },
+ cur: function() {
+ var hooks = Tween.propHooks[ this.prop ];
+
+ return hooks && hooks.get ?
+ hooks.get( this ) :
+ Tween.propHooks._default.get( this );
+ },
+ run: function( percent ) {
+ var eased,
+ hooks = Tween.propHooks[ this.prop ];
+
+ if ( this.options.duration ) {
+ this.pos = eased = jQuery.easing[ this.easing ](
+ percent, this.options.duration * percent, 0, 1, this.options.duration
+ );
+ } else {
+ this.pos = eased = percent;
+ }
+ this.now = ( this.end - this.start ) * eased + this.start;
+
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ if ( hooks && hooks.set ) {
+ hooks.set( this );
+ } else {
+ Tween.propHooks._default.set( this );
+ }
+ return this;
+ }
+};
+
+Tween.prototype.init.prototype = Tween.prototype;
+
+Tween.propHooks = {
+ _default: {
+ get: function( tween ) {
+ var result;
+
+ if ( tween.elem[ tween.prop ] != null &&
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
+ return tween.elem[ tween.prop ];
+ }
+
+ // passing an empty string as a 3rd parameter to .css will automatically
+ // attempt a parseFloat and fallback to a string if the parse fails
+ // so, simple values such as "10px" are parsed to Float.
+ // complex values such as "rotate(1rad)" are returned as is.
+ result = jQuery.css( tween.elem, tween.prop, "" );
+ // Empty strings, null, undefined and "auto" are converted to 0.
+ return !result || result === "auto" ? 0 : result;
+ },
+ set: function( tween ) {
+ // use step hook for back compat - use cssHook if its there - use .style if its
+ // available and use plain properties where available
+ if ( jQuery.fx.step[ tween.prop ] ) {
+ jQuery.fx.step[ tween.prop ]( tween );
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
+ } else {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+ }
+};
+
+// Support: IE <=9
+// Panic based approach to setting things on disconnected nodes
+
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
+ set: function( tween ) {
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+};
+
+jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
+ var cssFn = jQuery.fn[ name ];
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return speed == null || typeof speed === "boolean" ?
+ cssFn.apply( this, arguments ) :
+ this.animate( genFx( name, true ), speed, easing, callback );
+ };
+});
+
+jQuery.fn.extend({
+ fadeTo: function( speed, to, easing, callback ) {
+
+ // show any hidden elements after setting opacity to 0
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
+
+ // animate to the value specified
+ .end().animate({ opacity: to }, speed, easing, callback );
+ },
+ animate: function( prop, speed, easing, callback ) {
+ var empty = jQuery.isEmptyObject( prop ),
+ optall = jQuery.speed( speed, easing, callback ),
+ doAnimation = function() {
+ // Operate on a copy of prop so per-property easing won't be lost
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
+
+ // Empty animations, or finishing resolves immediately
+ if ( empty || jQuery._data( this, "finish" ) ) {
+ anim.stop( true );
+ }
+ };
+ doAnimation.finish = doAnimation;
+
+ return empty || optall.queue === false ?
+ this.each( doAnimation ) :
+ this.queue( optall.queue, doAnimation );
+ },
+ stop: function( type, clearQueue, gotoEnd ) {
+ var stopQueue = function( hooks ) {
+ var stop = hooks.stop;
+ delete hooks.stop;
+ stop( gotoEnd );
+ };
+
+ if ( typeof type !== "string" ) {
+ gotoEnd = clearQueue;
+ clearQueue = type;
+ type = undefined;
+ }
+ if ( clearQueue && type !== false ) {
+ this.queue( type || "fx", [] );
+ }
+
+ return this.each(function() {
+ var dequeue = true,
+ index = type != null && type + "queueHooks",
+ timers = jQuery.timers,
+ data = jQuery._data( this );
+
+ if ( index ) {
+ if ( data[ index ] && data[ index ].stop ) {
+ stopQueue( data[ index ] );
+ }
+ } else {
+ for ( index in data ) {
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
+ stopQueue( data[ index ] );
+ }
+ }
+ }
+
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
+ timers[ index ].anim.stop( gotoEnd );
+ dequeue = false;
+ timers.splice( index, 1 );
+ }
+ }
+
+ // start the next in the queue if the last step wasn't forced
+ // timers currently will call their complete callbacks, which will dequeue
+ // but only if they were gotoEnd
+ if ( dequeue || !gotoEnd ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ finish: function( type ) {
+ if ( type !== false ) {
+ type = type || "fx";
+ }
+ return this.each(function() {
+ var index,
+ data = jQuery._data( this ),
+ queue = data[ type + "queue" ],
+ hooks = data[ type + "queueHooks" ],
+ timers = jQuery.timers,
+ length = queue ? queue.length : 0;
+
+ // enable finishing flag on private data
+ data.finish = true;
+
+ // empty the queue first
+ jQuery.queue( this, type, [] );
+
+ if ( hooks && hooks.stop ) {
+ hooks.stop.call( this, true );
+ }
+
+ // look for any active animations, and finish them
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
+ timers[ index ].anim.stop( true );
+ timers.splice( index, 1 );
+ }
+ }
+
+ // look for any animations in the old queue and finish them
+ for ( index = 0; index < length; index++ ) {
+ if ( queue[ index ] && queue[ index ].finish ) {
+ queue[ index ].finish.call( this );
+ }
+ }
+
+ // turn off finishing flag
+ delete data.finish;
+ });
+ }
+});
+
+// Generate parameters to create a standard animation
+function genFx( type, includeWidth ) {
+ var which,
+ attrs = { height: type },
+ i = 0;
+
+ // if we include width, step value is 1 to do all cssExpand values,
+ // if we don't include width, step value is 2 to skip over Left and Right
+ includeWidth = includeWidth? 1 : 0;
+ for( ; i < 4 ; i += 2 - includeWidth ) {
+ which = cssExpand[ i ];
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+ }
+
+ if ( includeWidth ) {
+ attrs.opacity = attrs.width = type;
+ }
+
+ return attrs;
+}
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show"),
+ slideUp: genFx("hide"),
+ slideToggle: genFx("toggle"),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.speed = function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
+
+ // normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
+ opt.queue = "fx";
+ }
+
+ // Queueing
+ opt.old = opt.complete;
+
+ opt.complete = function() {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue ) {
+ jQuery.dequeue( this, opt.queue );
+ }
+ };
+
+ return opt;
+};
+
+jQuery.easing = {
+ linear: function( p ) {
+ return p;
+ },
+ swing: function( p ) {
+ return 0.5 - Math.cos( p*Math.PI ) / 2;
+ }
+};
+
+jQuery.timers = [];
+jQuery.fx = Tween.prototype.init;
+jQuery.fx.tick = function() {
+ var timer,
+ timers = jQuery.timers,
+ i = 0;
+
+ fxNow = jQuery.now();
+
+ for ( ; i < timers.length; i++ ) {
+ timer = timers[ i ];
+ // Checks the timer has not already been removed
+ if ( !timer() && timers[ i ] === timer ) {
+ timers.splice( i--, 1 );
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ fxNow = undefined;
+};
+
+jQuery.fx.timer = function( timer ) {
+ if ( timer() && jQuery.timers.push( timer ) ) {
+ jQuery.fx.start();
+ }
+};
+
+jQuery.fx.interval = 13;
+
+jQuery.fx.start = function() {
+ if ( !timerId ) {
+ timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
+ }
+};
+
+jQuery.fx.stop = function() {
+ clearInterval( timerId );
+ timerId = null;
+};
+
+jQuery.fx.speeds = {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+};
+
+// Back Compat <1.8 extension point
+jQuery.fx.step = {};
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+jQuery.fn.offset = function( options ) {
+ if ( arguments.length ) {
+ return options === undefined ?
+ this :
+ this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ var docElem, win,
+ box = { top: 0, left: 0 },
+ elem = this[ 0 ],
+ doc = elem && elem.ownerDocument;
+
+ if ( !doc ) {
+ return;
+ }
+
+ docElem = doc.documentElement;
+
+ // Make sure it's not a disconnected DOM node
+ if ( !jQuery.contains( docElem, elem ) ) {
+ return box;
+ }
+
+ // If we don't have gBCR, just use 0,0 rather than error
+ // BlackBerry 5, iOS 3 (original iPhone)
+ if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
+ box = elem.getBoundingClientRect();
+ }
+ win = getWindow( doc );
+ return {
+ top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
+ left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
+ };
+};
+
+jQuery.offset = {
+
+ setOffset: function( elem, options, i ) {
+ var position = jQuery.css( elem, "position" );
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curCSSTop = jQuery.css( elem, "top" ),
+ curCSSLeft = jQuery.css( elem, "left" ),
+ calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
+ props = {}, curPosition = {}, curTop, curLeft;
+
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if ( options.top != null ) {
+ props.top = ( options.top - curOffset.top ) + curTop;
+ }
+ if ( options.left != null ) {
+ props.left = ( options.left - curOffset.left ) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+
+ position: function() {
+ if ( !this[ 0 ] ) {
+ return;
+ }
+
+ var offsetParent, offset,
+ parentOffset = { top: 0, left: 0 },
+ elem = this[ 0 ];
+
+ // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {
+ // we assume that getBoundingClientRect is available when computed position is fixed
+ offset = elem.getBoundingClientRect();
+ } else {
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent();
+
+ // Get correct offsets
+ offset = this.offset();
+ if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
+ parentOffset = offsetParent.offset();
+ }
+
+ // Add offsetParent borders
+ parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
+ parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
+ }
+
+ // Subtract parent offsets and element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ return {
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || docElem;
+ while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent || docElem;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
+ var top = /Y/.test( prop );
+
+ jQuery.fn[ method ] = function( val ) {
+ return jQuery.access( this, function( elem, method, val ) {
+ var win = getWindow( elem );
+
+ if ( val === undefined ) {
+ return win ? (prop in win) ? win[ prop ] :
+ win.document.documentElement[ method ] :
+ elem[ method ];
+ }
+
+ if ( win ) {
+ win.scrollTo(
+ !top ? val : jQuery( win ).scrollLeft(),
+ top ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ elem[ method ] = val;
+ }
+ }, method, val, arguments.length, null );
+ };
+});
+
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
+jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
+ // margin is only for outerHeight, outerWidth
+ jQuery.fn[ funcName ] = function( margin, value ) {
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
+
+ return jQuery.access( this, function( elem, type, value ) {
+ var doc;
+
+ if ( jQuery.isWindow( elem ) ) {
+ // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
+ // isn't a whole lot we can do. See pull request at this URL for discussion:
+ // https://github.com/jquery/jquery/pull/764
+ return elem.document.documentElement[ "client" + name ];
+ }
+
+ // Get document width or height
+ if ( elem.nodeType === 9 ) {
+ doc = elem.documentElement;
+
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
+ // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
+ return Math.max(
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
+ doc[ "client" + name ]
+ );
+ }
+
+ return value === undefined ?
+ // Get width or height on the element, requesting but not forcing parseFloat
+ jQuery.css( elem, type, extra ) :
+
+ // Set width or height on the element
+ jQuery.style( elem, type, value, extra );
+ }, type, chainable ? margin : undefined, chainable, null );
+ };
+ });
+});
+// Limit scope pollution from any deprecated API
+// (function() {
+
+// The number of elements contained in the matched element set
+jQuery.fn.size = function() {
+ return this.length;
+};
+
+jQuery.fn.andSelf = jQuery.fn.addBack;
+
+// })();
+if ( typeof module === "object" && module && typeof module.exports === "object" ) {
+ // Expose jQuery as module.exports in loaders that implement the Node
+ // module pattern (including browserify). Do not create the global, since
+ // the user will be storing it themselves locally, and globals are frowned
+ // upon in the Node module world.
+ module.exports = jQuery;
+} else {
+ // Otherwise expose jQuery to the global object as usual
+ window.jQuery = window.$ = jQuery;
+
+ // Register as a named AMD module, since jQuery can be concatenated with other
+ // files that may use define, but not via a proper concatenation script that
+ // understands anonymous AMD modules. A named AMD is safest and most robust
+ // way to register. Lowercase jquery is used because AMD module names are
+ // derived from file names, and jQuery is normally delivered in a lowercase
+ // file name. Do this after creating the global so that if an AMD module wants
+ // to call noConflict to hide this version of jQuery, it will work.
+ if ( typeof define === "function" && define.amd ) {
+ define( "jquery", [], function () { return jQuery; } );
+ }
+}
+
+})( window );
diff --git a/sources/esviji/js/vendor/modernizr.inlinesvg-smil-svg-touch-vibration-2.7.1.js b/sources/esviji/js/vendor/modernizr.inlinesvg-smil-svg-touch-vibration-2.7.1.js
new file mode 100644
index 0000000..a42fbbf
--- /dev/null
+++ b/sources/esviji/js/vendor/modernizr.inlinesvg-smil-svg-touch-vibration-2.7.1.js
@@ -0,0 +1,4 @@
+/* Modernizr 2.7.1 (Custom Build) | MIT & BSD
+ * Build: http://modernizr.com/download/#-inlinesvg-smil-svg-touch-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-prefixes-domprefixes-vibration
+ */
+;window.Modernizr=function(a,b,c){function A(a){j.cssText=a}function B(a,b){return A(m.join(a+";")+(b||""))}function C(a,b){return typeof a===b}function D(a,b){return!!~(""+a).indexOf(b)}function E(a,b){for(var d in a){var e=a[d];if(!D(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function F(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:C(f,"function")?f.bind(d||b):f}return!1}function G(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return C(b,"string")||C(b,"undefined")?E(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),F(e,b,c))}var d="2.7.1",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={svg:"http://www.w3.org/2000/svg"},r={},s={},t={},u=[],v=u.slice,w,x=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["",'"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},y={}.hasOwnProperty,z;!C(y,"undefined")&&!C(y.call,"undefined")?z=function(a,b){return y.call(a,b)}:z=function(a,b){return b in a&&C(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=v.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(v.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(v.call(arguments)))};return e}),r.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:x(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="
",(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(l.call(b.createElementNS(q.svg,"animate")))};for(var H in r)z(r,H)&&(w=H.toLowerCase(),e[w]=r[H](),u.push((e[w]?"":"no-")+w));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)z(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},A(""),i=k=null,e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return E([a])},e.testAllProps=G,e.testStyles=x,e.prefixed=function(a,b,c){return b?G(a,b,c):G(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+u.join(" "):""),e}(this,this.document),Modernizr.addTest("vibrate",!!Modernizr.prefixed("vibrate",navigator));
\ No newline at end of file
diff --git a/sources/esviji/js/vendor/mousetrap-1.3.2.min.js b/sources/esviji/js/vendor/mousetrap-1.3.2.min.js
new file mode 100644
index 0000000..e3d6d6e
--- /dev/null
+++ b/sources/esviji/js/vendor/mousetrap-1.3.2.min.js
@@ -0,0 +1,8 @@
+/* mousetrap v1.3.2 craig.is/killing/mice */
+(function(){function s(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent("on"+b,c)}function y(a){if("keypress"==a.type){var b=String.fromCharCode(a.which);a.shiftKey||(b=b.toLowerCase());return b}return h[a.which]?h[a.which]:z[a.which]?z[a.which]:String.fromCharCode(a.which).toLowerCase()}function t(a,b){a=a||{};var c=!1,d;for(d in m)a[d]&&m[d]>b?c=!0:m[d]=0;c||(p=!1)}function A(a,b,c,d,g){var f,e,h=[],j=c.type;if(!l[a])return[];"keyup"==j&&u(a)&&(b=[a]);for(f=0;f
d||h.hasOwnProperty(d)&&(q[h[d]]=d)}c=q[a]?"keydown":"keypress"}"keypress"==
+c&&b.length&&(c="keydown");return c}function C(a,b,c,d,g){r[a+":"+c]=b;a=a.replace(/\s+/g," ");var f=a.split(" "),e,h,j=[];if(1":".","?":"/","|":"\\"},E={option:"alt",command:"meta","return":"enter",escape:"esc"},q,l={},r={},m={},D,x=!1,p=!1,g=1;20>g;++g)h[111+g]="f"+g;for(g=0;9>=g;++g)h[g+96]=g;s(document,"keypress",w);s(document,"keydown",w);s(document,"keyup",w);var k={bind:function(a,b,c){a=a instanceof Array?a:[a];for(var d=0;d 1) {
+ _results = [];
+ for (_i = 0, _len = events.length; _i < _len; _i++) {
+ e = events[_i];
+ _results.push(Offline.on(e, handler, ctx));
+ }
+ return _results;
+ } else {
+ if (handlers[event] == null) {
+ handlers[event] = [];
+ }
+ return handlers[event].push([ctx, handler]);
+ }
+ };
+
+ Offline.off = function(event, handler) {
+ var ctx, i, _handler, _ref, _results;
+ if (handlers[event] == null) {
+ return;
+ }
+ if (!handler) {
+ return handlers[event] = [];
+ } else {
+ i = 0;
+ _results = [];
+ while (i < handlers[event].length) {
+ _ref = handlers[event][i], ctx = _ref[0], _handler = _ref[1];
+ if (_handler === handler) {
+ _results.push(handlers[event].splice(i, 1));
+ } else {
+ _results.push(i++);
+ }
+ }
+ return _results;
+ }
+ };
+
+ Offline.trigger = function(event) {
+ var ctx, handler, _i, _len, _ref, _ref1, _results;
+ if (handlers[event] != null) {
+ _ref = handlers[event];
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ _ref1 = _ref[_i], ctx = _ref1[0], handler = _ref1[1];
+ _results.push(handler.call(ctx));
+ }
+ return _results;
+ }
+ };
+
+ checkXHR = function(xhr, onUp, onDown) {
+ var checkStatus, _onreadystatechange;
+ checkStatus = function() {
+ if (xhr.status && xhr.status < 12000) {
+ return onUp();
+ } else {
+ return onDown();
+ }
+ };
+ if (xhr.onprogress === null) {
+ xhr.addEventListener('error', onDown, false);
+ xhr.addEventListener('timeout', onDown, false);
+ return xhr.addEventListener('load', checkStatus, false);
+ } else {
+ _onreadystatechange = xhr.onreadystatechange;
+ return xhr.onreadystatechange = function() {
+ if (xhr.readyState === 4) {
+ checkStatus();
+ } else if (xhr.readyState === 0) {
+ onDown();
+ }
+ return typeof _onreadystatechange === "function" ? _onreadystatechange.apply(null, arguments) : void 0;
+ };
+ }
+ };
+
+ Offline.checks = {};
+
+ Offline.checks.xhr = function() {
+ var e, xhr;
+ xhr = new XMLHttpRequest;
+ xhr.offline = false;
+ xhr.open('HEAD', Offline.getOption('checks.xhr.url'), true);
+ checkXHR(xhr, Offline.markUp, Offline.markDown);
+ try {
+ xhr.send();
+ } catch (_error) {
+ e = _error;
+ Offline.markDown();
+ }
+ return xhr;
+ };
+
+ Offline.checks.image = function() {
+ var img;
+ img = document.createElement('img');
+ img.onerror = Offline.markDown;
+ img.onload = Offline.markUp;
+ img.src = Offline.getOption('checks.image.url');
+ return void 0;
+ };
+
+ Offline.check = function() {
+ Offline.trigger('checking');
+ return Offline.checks[Offline.getOption('checks.active')]();
+ };
+
+ Offline.confirmUp = Offline.confirmDown = Offline.check;
+
+ Offline.onXHR = function(cb) {
+ var monitorXHR, _XDomainRequest, _XMLHttpRequest;
+ monitorXHR = function(req, flags) {
+ var _open;
+ _open = req.open;
+ return req.open = function(type, url, async, user, password) {
+ cb({
+ type: type,
+ url: url,
+ async: async,
+ flags: flags,
+ user: user,
+ password: password,
+ xhr: req
+ });
+ return _open.apply(req, arguments);
+ };
+ };
+ _XMLHttpRequest = window.XMLHttpRequest;
+ window.XMLHttpRequest = function(flags) {
+ var req, _overrideMimeType, _setRequestHeader;
+ req = new _XMLHttpRequest(flags);
+ monitorXHR(req, flags);
+ _setRequestHeader = req.setRequestHeader;
+ req.headers = {};
+ req.setRequestHeader = function(name, value) {
+ req.headers[name] = value;
+ return _setRequestHeader.call(req, name, value);
+ };
+ _overrideMimeType = req.overrideMimeType;
+ req.overrideMimeType = function(type) {
+ req.mimeType = type;
+ return _overrideMimeType.call(req, type);
+ };
+ return req;
+ };
+ extendNative(window.XMLHttpRequest, _XMLHttpRequest);
+ if (window.XDomainRequest != null) {
+ _XDomainRequest = window.XDomainRequest;
+ window.XDomainRequest = function() {
+ var req;
+ req = new _XDomainRequest;
+ monitorXHR(req);
+ return req;
+ };
+ return extendNative(window.XDomainRequest, _XDomainRequest);
+ }
+ };
+
+ init = function() {
+ if (Offline.getOption('interceptRequests')) {
+ Offline.onXHR(function(_arg) {
+ var xhr;
+ xhr = _arg.xhr;
+ if (xhr.offline !== false) {
+ return checkXHR(xhr, Offline.confirmUp, Offline.confirmDown);
+ }
+ });
+ }
+ if (Offline.getOption('checkOnLoad')) {
+ return Offline.check();
+ }
+ };
+
+ setTimeout(init, 0);
+
+ window.Offline = Offline;
+
+}).call(this);
diff --git a/sources/esviji/js/vendor/store+json2-1.3.7.min.js b/sources/esviji/js/vendor/store+json2-1.3.7.min.js
new file mode 100644
index 0000000..9546b92
--- /dev/null
+++ b/sources/esviji/js/vendor/store+json2-1.3.7.min.js
@@ -0,0 +1,2 @@
+/* Copyright (c) 2010-2012 Marcus Westin */
+this.JSON||(this.JSON={}),function(){function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;ndocument.w=window
+
diff --git a/sources/orbium/test/counter.html b/sources/orbium/test/counter.html
new file mode 100644
index 0000000..29c466d
--- /dev/null
+++ b/sources/orbium/test/counter.html
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sources/orbium/test/index.html b/sources/orbium/test/index.html
new file mode 100644
index 0000000..9ea6175
--- /dev/null
+++ b/sources/orbium/test/index.html
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
diff --git a/sources/pappu-pakia/README.md b/sources/pappu-pakia/README.md
new file mode 100644
index 0000000..a8e145d
--- /dev/null
+++ b/sources/pappu-pakia/README.md
@@ -0,0 +1,51 @@
+# Pappu Pakia
+
+
+
+This HTML5 Game (Pappu Pakia) has been happily made for the
+[Github Game Off 2012](https://github.com/blog/1303-github-game-off).
+
+**[PLAY THE GAME HERE](http://khele.in/pappu-pakia/)**
+
+## Credits
+
+Handsomely coded by [Rishabh](http://twitter.com/_rishabhp).
+Beautiful graphics by [Kushagra](http://twitter.com/solitarydesigns).
+
+## Sharing is Caring <3
+
+Some tricks and tips that we learnt while making this game has been
+shared on [CodeTheory](http://codetheory.in) and
+[CSSDeck](http://cssdeck.com/codecasts).
+
+## Game Libraries Used
+
+No Gaming/Physics Libraries/Frameworks used. All Custom Code and Custom Physics.
+Only jQuery used for quick and few DOM manipulations.
+
+## About
+
+Based on the compo's rules, the concepts
+that we tried to incorporate are fork, branch, push, pull, clone.
+
+You are pappu in the game, a little character. You need to
+click the mouse or tap (touch screen) to levitate else
+pappu will descend. If he hits the top or bottom boundaries
+that'll end the game.
+
+There will be some obstacles along the way like forks, branches
+and some enemies who are also known as "pakias". Hitting them
+will end the game. 3 types of pakias - sad (pull you),
+happy (push you), angry (kill you). Keep safe distance from
+them!
+
+There are some collectibles too! Coins for points (yellow for 50,
+pink for 100, red for 500, blue for 1000). Stars for invincibility
+for a short period. Berries spawning clones that'll destroy
+anything that comes in their way!
+
+Collisions are not super strict to make the gameplay a little less harder.
+
+No Libraries/Frameworks used. All Custom Code and Custom Physics.
+
+Hit Enter or Spacebar keys to (re)start the game.
\ No newline at end of file
diff --git a/sources/pappu-pakia/css/main.css b/sources/pappu-pakia/css/main.css
new file mode 100644
index 0000000..834c2b8
--- /dev/null
+++ b/sources/pappu-pakia/css/main.css
@@ -0,0 +1,361 @@
+@font-face{
+ font-family: 'Happy Sans';
+ src: url('../fonts/happy_sans-webfont.eot');
+ src: url('../fonts/happy_sans-webfont.eot?#iefix') format('embedded-opentype'),
+ url('../fonts/happy_sans-webfont.woff') format('woff'),
+ url('../fonts/happy_sans-webfont.ttf') format('truetype'),
+ url('../fonts/happy_sans-webfont.svg#webfont') format('svg');
+}
+
+@import url(http://fonts.googleapis.com/css?family=Open+Sans);
+
+* {
+ margin: 0; padding: 0;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+/* Loading */
+#loading {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ background: #FF6767;
+ z-index: 10;
+}
+
+#loading #barCont {
+ width: 400px;
+ height: 20px;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ margin: -10px 0 0 -200px;
+ background: black;
+}
+
+#loading #bar {
+ width: 0;
+ height: 20px;
+ position: absolute;
+ left: 0;
+ background: #F3FF67;
+}
+
+html, body {
+ width: 100%; height: 100%;
+}
+
+body {
+ background: #000 url(http://i.imgur.com/XgUk6.jpg) top center no-repeat fixed;
+ font-family: 'Open Sans', Verdana;
+}
+
+h1, #loadText {
+ text-align: center;
+ color: #fff;
+ margin-top: 20px;
+ font-family: 'Happy Sans', cursive;
+}
+
+#loadText {
+ line-height: 380px;
+ font-size: 30px;
+}
+
+#fps_count {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ font-size: 20px;
+ color: white;
+ font-family: 'Happy Sans', cursive;
+}
+
+.gads {
+ text-align: center;
+ max-width: 1000px;
+ margin: 20px auto;
+}
+
+#mute {
+ width: 49px;
+ height: 40px;
+ background: url(../img/mute.png) no-repeat;
+ display: block;
+ text-decoration: none;
+ outline: none;
+ position: absolute;
+ top: 15px;
+ right: 15px;
+ z-index: 15;
+ background-position: 0 0;
+}
+
+.container {
+ position: relative;
+ margin: 20px auto 50px;
+ width: auto;
+ max-width: 1000px;
+ height: 500px;
+}
+
+footer {
+ margin: 20px auto;
+ padding: 0 0 20px;
+ max-width: 1000px;
+}
+footer h3 {
+ color: #E7E7E7;
+ margin-top: 30px;
+ font-size: 18px;
+ margin-bottom: 10px;
+}
+footer p {
+ margin-bottom: 10px;
+ font-size: 13px;
+ font-weight: normal;
+ color: #D1D1D1;
+}
+footer a {
+ text-decoration: none;
+ color: #FF6767;
+}
+footer a:visited {
+ color: #7FFF67;
+}
+footer a:hover {
+ color: #67DBFF;
+}
+footer a:active {
+ color: #F3FF67;
+}
+footer a:focus {
+ color: #FF67ED;
+}
+
+
+canvas#game_main {
+ display: block;
+ margin: 0 auto;
+ position: absolute;
+}
+canvas#game_bg {
+ display: block;
+ margin: 0 auto;
+ position: absolute;
+}
+
+
+/* Score Board */
+#score_board {
+ position: absolute;
+ top: 0; left: 0; right: 0;
+ padding: 10px;
+ height: 10%;
+ text-align: left;
+ font-size: 30px;
+ font-weight: normal;
+ font-family: 'Happy Sans', cursive;
+
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -o-user-select: none;
+ user-select: none;
+}
+
+#invincible_timer {
+ width: 150px;
+ height: 10px;
+ position: absolute;
+ top: 20px;
+ left: 50%;
+ border: 1px solid #fff;
+ margin-left: -75px;
+ display: none;
+}
+#invincible_loader {
+ width: 100%; height: 100%;
+ background: #FDCF7D;
+}
+
+
+/* Start Screen */
+#start_screen {
+ position: absolute;
+ top: 0;
+ left: 0;
+ height: 100%;
+ z-index: 1;
+ width: 100%;
+
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -o-user-select: none;
+ user-select: none;
+}
+
+#title {
+ font-size: 67px;
+ line-height: 100px;
+ font-weight: normal;
+ color: #945430;
+ text-align: center;
+ margin: 0;
+ padding: 0;
+ text-shadow: 3px 3px 0px white;
+}
+
+#credits, #high_score, #last_score {
+ font: 36px 'Happy Sans', cursive;
+ color: white;
+ padding: 0;
+ text-align: center;
+ margin: -10px 0 10px;
+}
+
+#credits a {
+ color: #FFEEAA;
+ text-decoration: none;
+}
+
+.options {
+ height: 400px;
+ background-image: url(../img/stand.png);
+ background-position: bottom center;
+ width: 225px;
+ background-repeat: no-repeat;
+ position: absolute;
+ bottom: 0;
+ right: 50px;
+}
+
+.options:before {
+ content: '';
+ background-image: url(../img/dig.png);
+ background-repeat: no-repeat;
+ position: absolute;
+ width: 47px;
+ height: 49px;
+ bottom: -1px;
+ left: 50%;
+ margin-left: -27px;
+ z-index: -1;
+}
+
+.options ul {
+ margin: 0;
+ padding: 50px 0 0;
+ list-style: none;
+}
+
+.options ul li {
+ display: block;
+ font: 40px 'Happy Sans', cursive;
+ text-align: center;
+ margin: 0 0 20px;
+}
+
+.options ul li a {
+ color: #FFEEAA;
+ text-decoration: none;
+}
+
+.options ul li:first-child {
+ background: url(../img/plank_top.png) no-repeat top center;
+ height: 70px;
+ line-height: 70px;
+}
+
+.options ul li:nth-child(2) {
+ background: url(../img/plank_mid.png) no-repeat top center;
+ height: 63px;
+ line-height: 63px;
+}
+
+.options ul li:last-child {
+ background: url(../img/plank_bot.png) no-repeat top center;
+ height: 75px;
+ line-height: 75px;
+}
+
+.controls {
+ width: 200px;
+ height: 48px;
+ background: url(../img/controls.png) no-repeat top center;
+ margin: 10px auto;
+ position: absolute;
+ top: 60%; left: 50%;
+ margin-top: -24px; margin-left: -100px;
+}
+
+/* Share Buttons */
+#share_btns {
+ max-width: 420px;
+ overflow: hidden;
+ margin: 0 auto;
+}
+
+.share-button {
+ float: left;
+ margin-right: 10px;
+}
+
+#disqus_thread {
+ max-width: 1000px;
+ margin: 0 auto;
+}
+
+#disqus_thread a {
+ color: red;
+}
+
+div.comments-button a, div.chrome-button a{
+ background-color: #52a8e8;
+ background-image: -webkit-linear-gradient(top, #52a8e8, #377ad0);
+ background-image: -moz-linear-gradient(top, #52a8e8, #377ad0);
+ background-image: -ms-linear-gradient(top, #52a8e8, #377ad0);
+ background-image: -o-linear-gradient(top, #52a8e8, #377ad0);
+ background-image: linear-gradient(top, #52a8e8, #377ad0);
+ color: #fff;
+ font: normal 11px "open sans", sans-serif;
+ line-height: 1;
+ padding: 3px 5px;
+ text-align: center;
+ text-decoration: none;
+ width: 112px;
+ border-radius: 3px;
+}
+
+div.comments-button a:hover {
+ background-color: #3e9ee5;
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #3e9ee5), color-stop(100%, #206bcb));
+ background-image: -webkit-linear-gradient(top, #3e9ee5 0%, #206bcb 100%);
+ background-image: -moz-linear-gradient(top, #3e9ee5 0%, #206bcb 100%);
+ background-image: -ms-linear-gradient(top, #3e9ee5 0%, #206bcb 100%);
+ background-image: -o-linear-gradient(top, #3e9ee5 0%, #206bcb 100%);
+ background-image: linear-gradient(top, #3e9ee5 0%, #206bcb 100%);
+}
+
+div.chrome-button {
+ float: none;
+ display: block;
+ margin: 0 auto;
+ width: 200px;
+}
+
+div.chrome-button a {
+ width: 200px;
+ display: block;
+ margin: 20px auto;
+ font-size: 13px;
+ padding: 10px;
+ background-image: -webkit-linear-gradient(top, #5587da, #4d7cd6);
+ background-image: -moz-linear-gradient(top, #5587da, #4d7cd6);
+ background-image: -ms-linear-gradient(top, #5587da, #4d7cd6);
+ background-image: -o-linear-gradient(top, #5587da, #4d7cd6);
+ background-image: linear-gradient(top, #5587da, #4d7cd6);
+ box-shadow: inset 0px 2px 0px rgba(255, 255, 255, 0.4);
+}
\ No newline at end of file
diff --git a/sources/pappu-pakia/fonts/happy_sans-webfont.eot b/sources/pappu-pakia/fonts/happy_sans-webfont.eot
new file mode 100644
index 0000000..aaa745c
Binary files /dev/null and b/sources/pappu-pakia/fonts/happy_sans-webfont.eot differ
diff --git a/sources/pappu-pakia/fonts/happy_sans-webfont.svg b/sources/pappu-pakia/fonts/happy_sans-webfont.svg
new file mode 100644
index 0000000..2ff7064
--- /dev/null
+++ b/sources/pappu-pakia/fonts/happy_sans-webfont.svg
@@ -0,0 +1,240 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sources/pappu-pakia/fonts/happy_sans-webfont.ttf b/sources/pappu-pakia/fonts/happy_sans-webfont.ttf
new file mode 100644
index 0000000..2316919
Binary files /dev/null and b/sources/pappu-pakia/fonts/happy_sans-webfont.ttf differ
diff --git a/sources/pappu-pakia/fonts/happy_sans-webfont.woff b/sources/pappu-pakia/fonts/happy_sans-webfont.woff
new file mode 100644
index 0000000..811a826
Binary files /dev/null and b/sources/pappu-pakia/fonts/happy_sans-webfont.woff differ
diff --git a/sources/pappu-pakia/img/Thumbs.db b/sources/pappu-pakia/img/Thumbs.db
new file mode 100644
index 0000000..7b5dd64
Binary files /dev/null and b/sources/pappu-pakia/img/Thumbs.db differ
diff --git a/sources/pappu-pakia/img/angry_pakia.png b/sources/pappu-pakia/img/angry_pakia.png
new file mode 100644
index 0000000..e1e615b
Binary files /dev/null and b/sources/pappu-pakia/img/angry_pakia.png differ
diff --git a/sources/pappu-pakia/img/apple.png b/sources/pappu-pakia/img/apple.png
new file mode 100644
index 0000000..e62ea47
Binary files /dev/null and b/sources/pappu-pakia/img/apple.png differ
diff --git a/sources/pappu-pakia/img/back_trees.png b/sources/pappu-pakia/img/back_trees.png
new file mode 100644
index 0000000..ff62b83
Binary files /dev/null and b/sources/pappu-pakia/img/back_trees.png differ
diff --git a/sources/pappu-pakia/img/berries.png b/sources/pappu-pakia/img/berries.png
new file mode 100644
index 0000000..428364a
Binary files /dev/null and b/sources/pappu-pakia/img/berries.png differ
diff --git a/sources/pappu-pakia/img/bg_combined.png b/sources/pappu-pakia/img/bg_combined.png
new file mode 100644
index 0000000..92fb62e
Binary files /dev/null and b/sources/pappu-pakia/img/bg_combined.png differ
diff --git a/sources/pappu-pakia/img/branch.png b/sources/pappu-pakia/img/branch.png
new file mode 100644
index 0000000..6c33121
Binary files /dev/null and b/sources/pappu-pakia/img/branch.png differ
diff --git a/sources/pappu-pakia/img/clouds.png b/sources/pappu-pakia/img/clouds.png
new file mode 100644
index 0000000..006a7f7
Binary files /dev/null and b/sources/pappu-pakia/img/clouds.png differ
diff --git a/sources/pappu-pakia/img/coins.png b/sources/pappu-pakia/img/coins.png
new file mode 100644
index 0000000..003520a
Binary files /dev/null and b/sources/pappu-pakia/img/coins.png differ
diff --git a/sources/pappu-pakia/img/coins_old.png b/sources/pappu-pakia/img/coins_old.png
new file mode 100644
index 0000000..d60f159
Binary files /dev/null and b/sources/pappu-pakia/img/coins_old.png differ
diff --git a/sources/pappu-pakia/img/controls.png b/sources/pappu-pakia/img/controls.png
new file mode 100644
index 0000000..6bbf6e4
Binary files /dev/null and b/sources/pappu-pakia/img/controls.png differ
diff --git a/sources/pappu-pakia/img/dig.png b/sources/pappu-pakia/img/dig.png
new file mode 100644
index 0000000..cd40dc2
Binary files /dev/null and b/sources/pappu-pakia/img/dig.png differ
diff --git a/sources/pappu-pakia/img/fork_handle.png b/sources/pappu-pakia/img/fork_handle.png
new file mode 100644
index 0000000..478348e
Binary files /dev/null and b/sources/pappu-pakia/img/fork_handle.png differ
diff --git a/sources/pappu-pakia/img/fork_head.png b/sources/pappu-pakia/img/fork_head.png
new file mode 100644
index 0000000..62cd5ad
Binary files /dev/null and b/sources/pappu-pakia/img/fork_head.png differ
diff --git a/sources/pappu-pakia/img/front_trees.png b/sources/pappu-pakia/img/front_trees.png
new file mode 100644
index 0000000..f454995
Binary files /dev/null and b/sources/pappu-pakia/img/front_trees.png differ
diff --git a/sources/pappu-pakia/img/grass.png b/sources/pappu-pakia/img/grass.png
new file mode 100644
index 0000000..f6c5381
Binary files /dev/null and b/sources/pappu-pakia/img/grass.png differ
diff --git a/sources/pappu-pakia/img/ground.png b/sources/pappu-pakia/img/ground.png
new file mode 100644
index 0000000..6723bfd
Binary files /dev/null and b/sources/pappu-pakia/img/ground.png differ
diff --git a/sources/pappu-pakia/img/happy_pakia.png b/sources/pappu-pakia/img/happy_pakia.png
new file mode 100644
index 0000000..0bd3814
Binary files /dev/null and b/sources/pappu-pakia/img/happy_pakia.png differ
diff --git a/sources/pappu-pakia/img/log.png b/sources/pappu-pakia/img/log.png
new file mode 100644
index 0000000..9878667
Binary files /dev/null and b/sources/pappu-pakia/img/log.png differ
diff --git a/sources/pappu-pakia/img/mute.png b/sources/pappu-pakia/img/mute.png
new file mode 100644
index 0000000..3472ccb
Binary files /dev/null and b/sources/pappu-pakia/img/mute.png differ
diff --git a/sources/pappu-pakia/img/pappu.png b/sources/pappu-pakia/img/pappu.png
new file mode 100644
index 0000000..7d6d8e4
Binary files /dev/null and b/sources/pappu-pakia/img/pappu.png differ
diff --git a/sources/pappu-pakia/img/plank_bot.png b/sources/pappu-pakia/img/plank_bot.png
new file mode 100644
index 0000000..7a44a89
Binary files /dev/null and b/sources/pappu-pakia/img/plank_bot.png differ
diff --git a/sources/pappu-pakia/img/plank_mid.png b/sources/pappu-pakia/img/plank_mid.png
new file mode 100644
index 0000000..4d6f6d1
Binary files /dev/null and b/sources/pappu-pakia/img/plank_mid.png differ
diff --git a/sources/pappu-pakia/img/plank_top.png b/sources/pappu-pakia/img/plank_top.png
new file mode 100644
index 0000000..05ebf78
Binary files /dev/null and b/sources/pappu-pakia/img/plank_top.png differ
diff --git a/sources/pappu-pakia/img/sad_pakia.png b/sources/pappu-pakia/img/sad_pakia.png
new file mode 100644
index 0000000..6fe53d9
Binary files /dev/null and b/sources/pappu-pakia/img/sad_pakia.png differ
diff --git a/sources/pappu-pakia/img/stand.png b/sources/pappu-pakia/img/stand.png
new file mode 100644
index 0000000..048c8fe
Binary files /dev/null and b/sources/pappu-pakia/img/stand.png differ
diff --git a/sources/pappu-pakia/img/star.png b/sources/pappu-pakia/img/star.png
new file mode 100644
index 0000000..7b4c91f
Binary files /dev/null and b/sources/pappu-pakia/img/star.png differ
diff --git a/sources/pappu-pakia/index.htm b/sources/pappu-pakia/index.htm
new file mode 100644
index 0000000..81e6c6c
--- /dev/null
+++ b/sources/pappu-pakia/index.htm
@@ -0,0 +1,163 @@
+
+
+
+
+ Pappu Pakia | Khelein
+
+
+
+
+
+
+
+
+
+
+
+
pappu pakia
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ À propos
+
+ Ce jeu a été réalisé dans le cadre du Github
+ Game Off 2012 .
+
+
+ Dans le jeu, vous êtes Pappu, un petit personnage. Vous devez cliquez sur la souris ou tapoter (écran tactile)
+ pour faire léviter Pappu autrement il chutera. S'il heurte les limites inférieures ou supérieures, la partie sera terminée.
+
+
+ Il y aura des obstacles sur votre chemin : des fouches, des branches et des ennemis appelés « pakias ».
+ Si vous les heurtez, la partie sera terminée.
+ Il y a trois sortes de « pakias » : les tristes (ils vous poussent), les heureux (ils vous poussent) et les coléreux (ils vous tuent).
+ Gardez une distance de sécurité avec eux !
+
+
+ Il y a également quelques objets à collectionner ! Des pièces rapportent des points (50 pour les jaune, 100 pour les roses, 500 pour les rouge).
+ Les étoiles vous rendent invincibles pour une courte période.
+ Les grappes de raisin font apparaitre des clones qui détruisent tout ce qu'il y a sur leur chemin !
+
+
+ Collisions are not super strict
+ to make the gameplay a little less harder.
+
+
+ Appuyez sur « Entrée » ou la « barre d'espace » pour (re)commencer une partie.
+
+
+
+
+
+ Crédits
+
+ Codé par Rishabh .
+ Graphismes par Kushagra .
+
+
+
+ Merci à Rezoner pour la musique.
+
+
+ Lien
+
+ Code on Github |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sources/pappu-pakia/js/backgrounds.js b/sources/pappu-pakia/js/backgrounds.js
new file mode 100644
index 0000000..c7b172d
--- /dev/null
+++ b/sources/pappu-pakia/js/backgrounds.js
@@ -0,0 +1,454 @@
+(function() {
+
+ mit.Backgrounds = {
+
+ // Speeds and Velocities of Backgrounds
+ common_bg_speed: 1,
+
+ cloud_bg_move_speed: 0,
+ cloud_bg_vx: 0,
+
+ backtree_bg_move_speed: 0,
+ backtree_bg_vx: 0,
+
+ fronttree_bg_move_speed: 0,
+ fronttree_bg_vx: 0,
+
+ ground_bg_move_speed: 0,
+ ground_bg_vx: 0,
+
+ combined_bg_move_speed: 0,
+ combined_bg_vx: 0,
+
+ log_x: 40,
+ log_y: 0,
+
+ sky_gradient: {},
+
+ first_speed_inc: 0,
+ second_speed_inc: 0,
+ third_speed_inc: 0,
+
+ init: function(ctx) {
+ // Sky Gradient
+ this.sky_gradient = ctx.createLinearGradient(0, 0, 0, mit.H);
+ this.sky_gradient.addColorStop(0, '#06c4f4');
+ this.sky_gradient.addColorStop(1, '#7bd4f6');
+
+
+ // Clouds
+ // this.cloud_img = new Image();
+ // this.cloud_img.src = 'img/clouds.png';
+ this.cloud_img = mit.image.clouds;
+
+ this.cloud_img.width = mit.W;
+ this.cloud_img.height = mit.H;
+
+
+ // Back Trees
+ // this.backtree_img = new Image();
+ // this.backtree_img.src = 'img/back_trees.png';
+ this.backtree_img = mit.image.backtrees;
+
+ this.backtree_img.width = mit.W;
+ this.backtree_img.height = mit.H;
+
+
+ // Front Trees
+ // this.fronttree_img = new Image();
+ // this.fronttree_img.src = 'img/front_trees.png';
+ this.fronttree_img = mit.image.fronttrees;
+
+ this.fronttree_img.width = mit.W;
+ this.fronttree_img.height = mit.H;
+
+
+ // Ground
+ // this.ground_img = new Image();
+ // this.ground_img.src = 'img/ground.png';
+ this.ground_img = mit.image.ground;
+
+ this.ground_img.width = mit.W;
+ this.ground_img.height = mit.H;
+
+
+ // Grass
+ // this.grass_img = new Image();
+ // this.grass_img.src = 'img/grass.png';
+ this.grass_img = mit.image.grass;
+
+ this.grass_img.width = mit.W;
+ this.grass_img.height = mit.H;
+
+
+ // Log on which pappu sits
+ // this.log_img = new Image();
+ // this.log_img.src = 'img/log.png';
+ this.log_img = mit.image.log;
+
+
+ // Combined BG Image
+ // this.combined_bg_img = new Image();
+ // this.combined_bg_img.src = 'img/bg_combined.png';
+ this.combined_bg_img = mit.image.bg_combined;
+
+ // Reset all speed
+ this.resetAllSpeed();
+ },
+
+ resetAllSpeed: function() {
+ this.cloud_bg_move_speed = 2;
+ this.backtree_bg_move_speed = 3;
+ this.fronttree_bg_move_speed = 5;
+ this.ground_bg_move_speed = 7;
+
+ this.combined_bg_move_speed = 3;
+ },
+
+ drawClouds: function(ctx) {
+ var cloud_bg_vx_abs = Math.abs(this.cloud_bg_vx);
+
+ // fixing weird indexSizeError bugs for the most nonsensical browsers - opera and IE
+ try {
+ ctx.drawImage(
+ this.cloud_img,
+
+ cloud_bg_vx_abs,
+ 0,
+ mit.W + this.cloud_bg_vx,
+ mit.H,
+
+ 0, 0,
+ mit.W + this.cloud_bg_vx,
+ mit.H
+ );
+
+ ctx.drawImage(
+ this.cloud_img,
+
+ 0, 0,
+ cloud_bg_vx_abs,
+ mit.H,
+
+ mit.W + this.cloud_bg_vx,
+ 0,
+ cloud_bg_vx_abs,
+ mit.H
+ );
+ }
+ catch(e) {}
+ this.cloud_bg_vx -= this.cloud_bg_move_speed;
+
+ if (-this.cloud_bg_vx >= mit.W) {
+ this.cloud_bg_vx = 0;
+ }
+
+ return;
+ },
+
+ drawBackTrees: function(ctx) {
+ var backtree_bg_vx_abs = Math.abs(this.backtree_bg_vx);
+
+ // fixing weird indexSizeError bugs for the most nonsensical browsers - opera and IE
+ try {
+ ctx.drawImage(
+ this.backtree_img,
+
+ backtree_bg_vx_abs,
+ 0,
+ mit.W + this.backtree_bg_vx,
+ mit.H,
+
+ 0, 0,
+ mit.W + this.backtree_bg_vx,
+ mit.H
+ );
+
+ ctx.drawImage(
+ this.backtree_img,
+
+ 0, 0,
+ backtree_bg_vx_abs,
+ mit.H,
+
+ mit.W + this.backtree_bg_vx,
+ 0,
+ backtree_bg_vx_abs,
+ mit.H
+ );
+ }
+ catch(e) {}
+
+ if (mit.game_started)
+ this.backtree_bg_vx -= this.backtree_bg_move_speed * this.common_bg_speed;
+
+ if (-this.backtree_bg_vx >= mit.W) {
+ this.backtree_bg_vx = 0;
+ }
+
+ return;
+ },
+
+ drawFrontTrees: function(ctx) {
+ var fronttree_bg_vx_abs = Math.abs(this.fronttree_bg_vx);
+
+ // fixing weird indexSizeError bugs for the most nonsensical browsers - opera and IE
+ try {
+ ctx.drawImage(
+ this.fronttree_img,
+
+ fronttree_bg_vx_abs,
+ 0,
+ mit.W + this.fronttree_bg_vx,
+ mit.H,
+
+ 0, 0,
+ mit.W + this.fronttree_bg_vx,
+ mit.H
+ );
+
+ ctx.drawImage(
+ this.fronttree_img,
+
+ 0, 0,
+ fronttree_bg_vx_abs,
+ mit.H,
+
+ mit.W + this.fronttree_bg_vx,
+ 0,
+ fronttree_bg_vx_abs,
+ mit.H
+ );
+ }
+ catch(e) {}
+ if (mit.game_started)
+ this.fronttree_bg_vx -= this.fronttree_bg_move_speed * this.common_bg_speed;
+
+ if (-this.fronttree_bg_vx >= mit.W) {
+ this.fronttree_bg_vx = 0;
+ }
+
+ return;
+ },
+
+ drawGround: function(ctx) {
+ var ground_bg_vx_abs = Math.abs(this.ground_bg_vx);
+ // fixing weird indexSizeError bugs for the most nonsensical browsers - opera and IE
+ try {
+ ctx.drawImage(
+ this.ground_img,
+
+ ground_bg_vx_abs,
+ 0,
+ mit.W + this.ground_bg_vx,
+ mit.H,
+
+ 0, 0,
+ mit.W + this.ground_bg_vx,
+ mit.H
+ );
+
+ ctx.drawImage(
+ this.ground_img,
+
+ 0, 0,
+ ground_bg_vx_abs,
+ mit.H,
+
+ mit.W + this.ground_bg_vx,
+ 0,
+ ground_bg_vx_abs,
+ mit.H
+ );
+ }
+ catch(e) {}
+
+ if (mit.game_started)
+ this.ground_bg_vx -= this.ground_bg_move_speed * this.common_bg_speed;
+
+ if (-this.ground_bg_vx >= mit.W) {
+ this.ground_bg_vx = 0;
+ }
+
+ // console.log(-this.ground_bg_vx);
+
+ return;
+ },
+
+ drawGrass: function(ctx) {
+ var grass_bg_vx_abs = Math.abs(this.grass_bg_vx);
+ // fixing weird indexSizeError bugs for the most nonsensical browsers - opera and IE
+ try {
+ ctx.drawImage(
+ this.grass_img,
+
+ grass_bg_vx_abs,
+ 0,
+ mit.W + this.grass_bg_vx,
+ mit.H,
+
+ 0, 0,
+ mit.W + this.grass_bg_vx,
+ mit.H
+ );
+
+ ctx.drawImage(
+ this.grass_img,
+
+ 0, 0,
+ grass_bg_vx_abs,
+ mit.H,
+
+ mit.W + this.grass_bg_vx,
+ 0,
+ grass_bg_vx_abs,
+ mit.H
+ );
+ }
+ catch(e) {}
+
+ if (mit.game_started)
+ this.grass_bg_vx -= this.grass_bg_move_speed * this.common_bg_speed;
+
+ if (-this.grass_bg_vx >= mit.W) {
+ this.grass_bg_vx = 0;
+ }
+
+ return;
+ },
+
+ drawInitLog: function(ctx) {
+
+ this.log_y = mit.H-(this.log_img.height+45);
+
+ ctx.drawImage(this.log_img, this.log_x, this.log_y);
+
+ if (mit.game_started) {
+ this.log_x -= this.ground_bg_move_speed * this.common_bg_speed;
+ }
+ },
+
+ drawCombinedBG: function(ctx) {
+ var combined_bg_vx_abs = Math.abs(this.combined_bg_vx);
+ // fixing weird indexSizeError bugs for the most nonsensical browsers - opera and IE
+ try {
+ ctx.drawImage(
+ this.combined_bg_img,
+
+ combined_bg_vx_abs,
+ 0,
+ mit.W + this.combined_bg_vx,
+ mit.H,
+
+ 0, 0,
+ mit.W + this.combined_bg_vx,
+ mit.H
+ );
+
+ ctx.drawImage(
+ this.combined_bg_img,
+
+ 0, 0,
+ combined_bg_vx_abs,
+ mit.H,
+
+ mit.W + this.combined_bg_vx,
+ 0,
+ combined_bg_vx_abs,
+ mit.H
+ );
+ }
+ catch(e) {}
+
+ if (mit.game_started)
+ this.combined_bg_vx -= this.combined_bg_move_speed * this.common_bg_speed;
+
+ if (-this.combined_bg_vx >= mit.W) {
+ this.combined_bg_vx = 0;
+ }
+ },
+
+ // Draw Awesome Backgrounds
+ // Backgrounds have been made for 1000x500 dimensions
+ draw: function(ctx) {
+
+ if (mit.start_btn_clicked) {
+ if (!this.fps || this.fps === 5000)
+ this.fps = mit.fps;
+ }
+ else {
+ this.fps = 5000;
+ }
+
+
+ if (this.fps > 56) {
+
+ // Draw Linear Gradient for real/pure BG (sky/water)
+ ctx.save();
+ ctx.fillStyle = this.sky_gradient;
+ ctx.fillRect(0, 0, mit.W, mit.H);
+ ctx.restore();
+
+ // Clouds
+ this.drawClouds(ctx);
+
+ // Back Small Trees
+ this.drawBackTrees(ctx);
+
+ // Front Big Trees
+ this.drawFrontTrees(ctx);
+ }
+ else {
+ this.drawCombinedBG(ctx);
+ }
+
+ // Drawing the initial wood log on which
+ // Pappu gonna sit and bask in the cool and cozy
+ // environment.
+ if (this.log_x+100 > 0) {
+ this.drawInitLog(ctx);
+ }
+ else if (!mit.game_started) {
+ this.log_x = 40;
+ }
+
+ // Draw Ground now!
+ this.drawGround(ctx);
+
+
+ // Increasing speed based on points
+ if (mit.score > 200 && !this.first_speed_inc) {
+ this.cloud_bg_move_speed++;
+ this.backtree_bg_move_speed++;
+ this.fronttree_bg_move_speed++;
+ this.ground_bg_move_speed++;
+ this.combined_bg_move_speed++;
+
+ this.first_speed_inc = 1;
+ }
+
+ if (mit.score > 1000 && !this.second_speed_inc) {
+ this.cloud_bg_move_speed++;
+ this.backtree_bg_move_speed++;
+ this.fronttree_bg_move_speed++;
+ this.ground_bg_move_speed++;
+ this.combined_bg_move_speed++;
+
+ this.second_speed_inc = 1;
+ }
+
+ if (mit.score > 3000 && !this.third_speed_inc) {
+ this.cloud_bg_move_speed++;
+ this.backtree_bg_move_speed++;
+ this.fronttree_bg_move_speed++;
+ this.ground_bg_move_speed++;
+ this.combined_bg_move_speed++;
+
+ this.third_speed_inc = 1;
+ }
+
+ }
+
+ };
+
+}());
\ No newline at end of file
diff --git a/sources/pappu-pakia/js/branches.js b/sources/pappu-pakia/js/branches.js
new file mode 100644
index 0000000..5f5ed59
--- /dev/null
+++ b/sources/pappu-pakia/js/branches.js
@@ -0,0 +1,221 @@
+(function() {
+
+ // We're having lots of forks to
+ // make gameplay a little harder
+ // and incorporate ggo's required concepts.
+
+ // But we'll also try to incorporate
+ // 'branching' by adding some branches
+ // at random spots. So let the forks
+ // come, but sometimes there wont be forks,
+ // but a single branch (from top to bottom).
+ //
+ // The branches are gonna have a little hole
+ // in between or some other random position
+ // through which pappu will need to pass.
+ //
+ // If it collides at some part other than
+ // the hole, he'll decease.
+
+ mit.Branch = function() {
+ this.x = 0;
+ this.y = 0;
+
+ // Width
+ this.w;
+ // Height
+ this.h;
+
+ this.escape_x;
+ this.escape_y;
+ this.escape_w;
+ this.escape_h;
+
+ this.getBounds = function() {
+ var b = {};
+
+ b.start_x = this.x;
+ b.start_y = this.y;
+ b.end_x = this.x + this.w;
+ b.end_y = this.y + this.h;
+
+ return b;
+ };
+
+ this.getEscapeBounds = function() {
+ var b = {};
+
+ b.start_x = this.escape_x;
+ b.start_y = this.escape_y;
+ b.end_x = this.escape_x + this.escape_w;
+ b.end_y = this.escape_y + this.escape_h;
+
+ return b;
+ };
+ };
+
+
+ mit.BranchUtils = {
+
+ branch_img: {},
+
+ branches: [],
+ count: 4,
+
+ init: function() {
+ // Load Images
+ // this.branch_img = new Image();
+ // this.branch_img.src = 'img/branch.png';
+
+ this.branch_img = mit.image.branch;
+ },
+
+ /*
+ This method will generate a random x/y
+ position for the forks to start at.
+
+ Based on the `fork.edge` we can draw
+ the fork easily on the canvas edges.
+ */
+ getRandomBranchPos: function() {
+ // We have access to `branches` here
+ var pos = {};
+
+ if (this.branches[this.branches.length-1]) {
+ pos.x = this.branches[this.branches.length-1].x;
+ pos.x += utils.randomNumber(500, 2000);
+ }
+ else {
+ // First
+ pos.x = utils.randomNumber(2000, 2500);
+ }
+
+ var forks = mit.ForkUtils.forks;
+ /*var last_fork = forks[forks.length-1];
+
+ if (last_fork) {
+
+ if (Math.abs(pos.x - last_fork.x) < 300) {
+ pos.x = last_fork.x + 300;
+ }
+ }*/
+
+ if (forks.length) {
+ forks.forEach(function(fork) {
+ if (Math.abs(pos.x - fork.x) < 500)
+ pos.x = fork.x + 500;
+ });
+ }
+
+ return pos;
+ },
+
+ create: function() {
+ var branches = this.branches,
+ count = this.count;
+
+ if (branches.length < count) {
+
+ for (var i = 0; i < count - branches.length; i++) {
+ var branch = new mit.Branch();
+
+ var pos = this.getRandomBranchPos();
+ branch.x = pos.x;
+ branch.y = 0;
+
+ branch.w = this.branch_img.width;
+ branch.h = this.branch_img.height;
+
+ // Escape Positions
+ branch.escape_x = branch.x;
+ branch.escape_y = branch.y + utils.randomNumber(0, branch.h-150);
+
+ // Escape Area's Width/Height
+ branch.escape_w = this.branch_img.width;
+ branch.escape_h = 150;
+
+ branches.push(branch);
+ }
+ }
+ },
+
+ draw: function(ctx) {
+ var branches = this.branches,
+ branch_img = this.branch_img,
+ dead_branch = 0;
+
+ this.create();
+
+ // console.log(branches);
+
+ // Loop over branches and draw each of them
+ branches.forEach(function(branch, index) {
+
+ branch.x -= mit.Backgrounds.ground_bg_move_speed;
+
+ if (branch.x + branch.w < 0) {
+ dead_branch++;
+ return;
+ }
+
+ // Out of view port, no need to draw
+ if (branch.x > mit.W)
+ return;
+
+ // Escape Positions
+ branch.escape_x = branch.x;
+
+ ctx.drawImage(branch_img, branch.x, branch.y);
+
+ // Draw Escapes
+ ctx.save();
+ ctx.globalCompositeOperation = 'destination-out';
+ ctx.fillStyle = 'white';
+ ctx.fillRect(
+ branch.escape_x,
+ branch.escape_y,
+ branch.escape_w,
+ branch.escape_h
+ );
+ ctx.restore();
+ });
+
+ if (dead_branch) {
+ branches.splice(0, dead_branch);
+ }
+
+ return;
+ },
+
+ // Check collisions with branches
+ checkCollision: function() {
+ var first_branch = this.branches[0];
+
+ // Useless optimization
+ if (first_branch.x > mit.W/2)
+ return;
+
+ // Get Pappu Bounds
+ var pappu_bounds = mit.Pappu.getBounds(),
+ // Get Nearest Branch's Top Part's Bounds
+ branch_bounds = first_branch.getBounds();
+
+ if (utils.intersect(pappu_bounds, branch_bounds)) {
+ // console.log(pappu_bounds, branch_bounds);
+
+ // If the Escape Area intersects then pappu
+ // can escape, else game over matey!
+ var escape_bounds = first_branch.getEscapeBounds();
+
+ if (!utils.intersect(pappu_bounds, escape_bounds)) {
+ mit.gameOver();
+ }
+
+ }
+
+ return;
+ }
+
+ };
+
+}());
\ No newline at end of file
diff --git a/sources/pappu-pakia/js/collectibles.js b/sources/pappu-pakia/js/collectibles.js
new file mode 100644
index 0000000..0b9186b
--- /dev/null
+++ b/sources/pappu-pakia/js/collectibles.js
@@ -0,0 +1,293 @@
+(function() {
+
+ /*
+ We'll have some collectibles:
+
+ - Ones that give 50, 100, 500, 1000 points.
+
+ - One to clone pappu that'll kill all
+ forks, branches, pakias.
+
+ - One for pappu's invincibility
+ */
+
+ mit.Collectible = function() {
+
+ // x/y pos
+ this.x;
+ this.y;
+
+ // width/height
+ this.w;
+ this.h;
+
+ // Collectible Type - read above
+ this.type;
+
+ // Sound
+ this.sound = document.getElementById("ting");
+ this.sound.volume = 0.35;
+
+ // Some collectible types may have subtypes
+ // like coins of 50, 100, 500, 1000 and so on ...
+ this.sub_type;
+
+ this.getBounds = function() {
+ var b = {};
+
+ b.start_x = this.x;
+ b.start_y = this.y;
+ b.end_x = this.x + this.w;
+ b.end_y = this.y + this.h;
+
+ return b;
+ };
+
+
+ this.draw = function(ctx) {
+ switch (this.type) {
+
+ case 'coin':
+ this.drawCoin(ctx);
+ break;
+
+ case 'clone':
+ this.drawClone(ctx);
+ break;
+
+ case 'invincible':
+ this.drawInvincible(ctx);
+ break;
+
+ }
+
+ return;
+ };
+
+ this.drawCoin = function(ctx) {
+ // Get coin color based on sub type
+ var pos = mit.CollectibleUtils.getCoinSpritePos(this.sub_type);
+
+ ctx.drawImage(
+ mit.CollectibleUtils.coin_img,
+ pos.x, pos.y,
+ 30, 30,
+ this.x, this.y,
+ 30, 30
+ );
+ };
+
+ this.drawClone = function(ctx) {
+ ctx.drawImage(
+ mit.CollectibleUtils.clone_img,
+ this.x,
+ this.y
+ );
+ };
+
+ this.drawInvincible = function(ctx) {
+ ctx.drawImage(
+ mit.CollectibleUtils.invincible_img,
+ this.x,
+ this.y
+ );
+ };
+ };
+
+
+ mit.CollectibleUtils = {
+
+ collecs: [],
+
+ count: 2,
+
+ types: ['coin', 'clone', 'invincible'],
+ //types: ['invincible'],
+
+ sub_types: {
+ coin: [50, 100, 500]
+ },
+
+ init: function() {
+ // this.coin_img = new Image();
+ // this.coin_img.src = 'img/coins.png';
+ this.coin_img = mit.image.coins;
+
+ // this.clone_img = new Image();
+ // this.clone_img.src = 'img/berries.png';
+ this.clone_img = mit.image.berries;
+
+ // this.invincible_img = new Image();
+ // this.invincible_img.src = 'img/star.png';
+ this.invincible_img = mit.image.star;
+ },
+
+ getCoinSpritePos: function(sub_type) {
+
+ switch (sub_type) {
+ case 50:
+ // Yellow (first)
+ return {x: 0, y: 0};
+
+ case 100:
+ // Pink (second)
+ return {x: 30, y: 0};
+
+ case 500:
+ // Red (third)
+ // Pink (second)
+ return {x: 60, y: 0};
+
+ case 1000:
+ // Blue (last)
+ return {x: 90, y: 0};
+ }
+
+ },
+
+ getRandomPos: function() {
+ var pos = {};
+
+ var last = this.collecs[this.collecs.length - 1];
+
+ if (last) {
+ pos.x = last.x + utils.randomNumber(1000, 1500);
+ }
+ else {
+ pos.x = utils.randomNumber(2000, 3000);
+ pos.x = utils.randomNumber(500, 1000);
+ }
+
+ pos.y = utils.randomNumber(100, mit.H-100);
+
+ // Check Positioning with forks
+ var forks = mit.ForkUtils.forks;
+
+ if (forks.length) {
+ forks.forEach(function(fork) {
+ if (Math.abs(pos.x - fork.x) < 300)
+ pos.x = fork.x + 300;
+ });
+ }
+
+ // Check Positioning with branches
+ var branches = mit.BranchUtils.branches;
+
+ if (branches.length) {
+ branches.forEach(function(branch) {
+ if (Math.abs(pos.x - branch.x) < 300)
+ pos.x = branch.x + 300;
+ });
+ }
+
+ return pos;
+ },
+
+ create: function() {
+ var count = this.count - this.collecs.length;
+ var collec,
+ sub_types,
+ pos;
+
+ for (var i = 0; i < count; i++) {
+ collec = new mit.Collectible();
+
+ pos = this.getRandomPos();
+
+ collec.x = pos.x;
+ collec.y = pos.y;
+
+ collec.w = 30;
+ collec.h = 30;
+
+ // Type
+ collec.type = this.types[utils.randomNumber(0, this.types.length-1)];
+
+ // Choosing Sub types if any
+ sub_types = this.sub_types[collec.type];
+ if (sub_types)
+ collec.sub_type = sub_types[utils.randomNumber(0, sub_types.length-1)];
+
+ this.collecs.push(collec);
+ }
+ },
+
+ draw: function(ctx) {
+
+ var self = this;
+
+ self.create();
+
+ self.collecs.forEach(function(collec, i) {
+ if (collec.x < 0) {
+ // Moved off the left edge
+ /*var pos = self.getRandomPos();
+
+ collec.x = pos.x;
+ collec.y = pos.y;*/
+ self.collecs.splice(i,1);
+ }
+
+ collec.x -= mit.Backgrounds.ground_bg_move_speed;
+
+ collec.draw(ctx);
+ });
+
+ return;
+ },
+
+ checkCollision: function() {
+ // First collec
+ var collec = this.collecs[0],
+ // Get Pappu Bounds
+ pappu_bounds = mit.Pappu.getBounds(),
+ // Get Nearest Collectible Bounds
+ collec_bounds = collec.getBounds();
+
+ if (utils.intersect(pappu_bounds, collec_bounds)) {
+ // Pappu haz collected!
+ collec.sound.play();
+ // Determine type and perform action accordingly
+ switch (collec.type) {
+
+ case 'coin':
+ mit.score += collec.sub_type;
+ break;
+
+ case 'clone':
+ mit.Pappu.createClones(3);
+ break;
+
+ case 'invincible':
+ mit.Pappu.invincible = 1;
+
+ // Kush says we shouldnt add up
+ /*if (!mit.Pappu.invincibility_start) {
+ mit.Pappu.invincibility_time = 5000;
+ }
+ else {
+ var cur_time = new Date().getTime();
+ var prev_remaining_time = cur_time - mit.Pappu.invincibility_start;
+
+ mit.Pappu.invincibility_time = 5000 + prev_remaining_time;
+ }*/
+
+ mit.Pappu.invincibility_start = new Date().getTime();
+ mit.Pappu.invincibility_time = 5000;
+
+ // Show timer
+ mit.ui.invincible_timer.show();
+
+ break;
+ }
+
+ // Nuke the collectible
+ this.collecs.shift();
+ }
+
+ return;
+ }
+
+ };
+
+}());
\ No newline at end of file
diff --git a/sources/pappu-pakia/js/forks.js b/sources/pappu-pakia/js/forks.js
new file mode 100644
index 0000000..5fb0101
--- /dev/null
+++ b/sources/pappu-pakia/js/forks.js
@@ -0,0 +1,335 @@
+(function() {
+
+ // The Fork Class
+ // We'll have lots of forks.
+ // Each fork will be on object of this
+ // constructor.
+
+ mit.Fork = function() {
+ // Handle x/y
+ this.x = 0;
+ this.y = 0;
+
+ // W/H
+ this.w = 0;
+ this.h = 0;
+
+
+ // Head x/y
+ this.head_x = 0;
+ this.head_y = 0;
+
+ // Head W/H
+ this.head_w = 0;
+ this.head_h = 0;
+
+ // Edge on which the fork will stand on
+ this.edge = 'btm';
+
+ // Get Handle Bounds
+ this.getHandleBounds = function() {
+ var b = {};
+
+ b.start_x = this.x;
+ b.start_y = this.y;
+ b.end_x = this.x + this.w;
+ b.end_y = this.y + this.h;
+
+ //console.log(bounds);
+ return b;
+ };
+
+ // Get Head Bounds
+ this.getHeadBounds = function() {
+ var b = {};
+
+ b.start_x = this.head_x;
+ b.start_y = this.head_y;
+ b.end_x = this.head_x + this.head_w;
+ b.end_y = this.head_y + this.head_h;
+
+ return b;
+ };
+ };
+
+
+ // A ForkUtils class to help save the world
+
+ mit.ForkUtils = {
+
+ // Master array of all existing forks in memory
+ forks: [],
+ // Forks can be placed on top/bottom edges
+ edges: ['top', 'btm'],
+
+ // Images for fork handle, fork head and the digged part
+ fork_img: {},
+ fork_head_img: {},
+ dig_img: {},
+
+ // How many forks to have in memory ?
+ count: 6,
+
+ init: function() {
+ // Loading Images
+
+ // Fork handle
+ // this.fork_img = new Image();
+ // this.fork_img.src = 'img/fork_handle.png';
+ this.fork_img = mit.image.fork_handle;
+
+ // Fork Head
+ // this.fork_head_img = new Image();
+ // this.fork_head_img.src = 'img/fork_head.png';
+ this.fork_head_img = mit.image.fork_head;
+
+ // Dig Image
+ // this.dig_img = new Image();
+ // this.dig_img.src = 'img/dig.png';
+ },
+
+ /*
+ How do we go about positioning forks exactly ?
+
+ - Forks can appear on top or bottom edge.
+ - Forks should vary in sizes, but should be
+ mostly long to produce a harder gameplay.
+ - Forks should appear at random distance.
+ But there needs to be a range (or capping).
+ - Every fork object should know what edge it
+ is put on. This will help us calculate the
+ exact height based on entire canvas
+ height/width.
+ This means, we only need the x/y position
+ along with the edge, to put on the fork.
+ */
+
+ /*
+ This method will generate a random x/y
+ position for the forks to start at.
+
+ Based on the `fork.edge` we can draw
+ the fork easily on the canvas edges.
+ */
+
+ getRandomForkPos: function() {
+ // We have access to `forks` here
+ var pos = {};
+
+ if (this.forks[this.forks.length-1]) {
+ pos.x = this.forks[this.forks.length-1].x;
+
+ if (mit.score > 2500)
+ pos.x += utils.randomNumber(300,600);
+ else
+ pos.x += utils.randomNumber(500,800);
+ }
+ else {
+ pos.x = mit.W/1000 * 1050;
+ }
+
+ var branches = mit.BranchUtils.branches;
+ /*var last_branch = [branches.length-1];
+
+ if (last_branch) {
+ if (Math.abs(pos.x - last_branch.x) < 300)
+ pos.x = last_branch.x + 300;
+ }*/
+
+ if (branches.length) {
+ branches.forEach(function(branch) {
+ if (Math.abs(pos.x - branch.x) < 500)
+ pos.x = branch.x + 500;
+ });
+ }
+
+ return pos;
+ },
+
+ create: function() {
+ var fork_img = this.fork_img,
+ dig_img = this.dig_img,
+ fork_head_img = this.fork_head_img,
+ forks = this.forks,
+ count = this.count;
+
+ if (forks.length < count) {
+
+ for (var i = 0; i < count - forks.length; i++) {
+ var fork = new mit.Fork();
+
+ // Setting a Random Edge
+ fork.edge = this.edges[utils.randomNumber(0,1)];
+
+ // Setting the Dig Position
+ if (fork.edge === 'btm') {
+ var dig_rand = utils.randomNumber(3,5);
+
+ fork.dig_x = dig_img.width / dig_rand;
+ fork.dig_y = mit.H - dig_img.height;
+ // console.log(this.dig_img.width);
+
+ fork.y = 200 + utils.randomNumber(0,100);
+ fork.y += fork_head_img.height;
+ }
+
+ if (fork.edge === 'top') {
+ fork.y = 0 - utils.randomNumber(0,100);
+ fork.y -= fork_head_img.height;
+ }
+
+ var pos = this.getRandomForkPos();
+ fork.x = pos.x;
+
+ // Height and Width
+ fork.w = fork_img.width;
+ fork.h = fork_img.height;
+
+ forks.push(fork);
+ }
+
+ }
+ },
+
+ draw: function(ctx) {
+ var fork_img = this.fork_img,
+ dig_img = this.dig_img,
+ fork_head_img = this.fork_head_img,
+ forks = this.forks,
+ dead_forks = 0;
+
+ this.create();
+
+ // Loop over forks and draw each of them
+ forks.forEach(function(fork, index) {
+
+ fork.x -= mit.Backgrounds.ground_bg_move_speed;
+
+ if (fork.x + fork.w < 0) {
+ ++dead_forks;
+ return;
+ }
+
+ // Out of view port, no need to draw
+ if (fork.x > mit.W) {
+ // console.log('out of view port');
+ return;
+ }
+
+ if (fork.edge === 'top') {
+ // ctx.lineTo(fork.x, 0);
+
+ // Top forks need flippin
+ ctx.save();
+ ctx.translate(fork.x, fork.y);
+ ctx.translate(~~(fork_img.width/2), ~~(fork_img.height/2));
+ ctx.rotate( utils.toRadian(180) );
+ ctx.drawImage(fork_img, -~~(fork_img.width/2), -~~(fork_img.height/2));
+ ctx.restore();
+
+
+ fork.head_x = fork.x-~~(fork_head_img.width/8);
+ fork.head_y = fork.y+fork_img.height;
+
+ fork.head_w = fork_head_img.width;
+ fork.head_h = fork_head_img.height;
+
+ // Draw Fork Head
+ ctx.save();
+ ctx.translate(fork.head_x, fork.head_y);
+ ctx.translate(~~(fork_head_img.width/2), ~~(fork_head_img.height/2));
+ ctx.rotate( utils.toRadian(180) );
+ ctx.drawImage(fork_head_img, -~~(fork_head_img.width/2), -~~(fork_head_img.height/2));
+ ctx.restore();
+ }
+ else if (fork.edge === 'btm') {
+
+ ctx.drawImage(fork_img, fork.x, fork.y);
+
+ fork.head_x = fork.x-~~(fork_head_img.width/5);
+ fork.head_y = fork.y-fork_head_img.height;
+
+ fork.head_w = fork_head_img.width;
+ fork.head_h = fork_head_img.height;
+
+ // Draw Fork Head
+ ctx.save();
+ ctx.translate(fork.head_x, fork.head_y);
+ ctx.translate(1* ~~(fork_head_img.width/2), 1* ~~(fork_head_img.height/2));
+ ctx.scale(-1,1);
+ ctx.drawImage(
+ fork_head_img,
+ 1* -~~(fork_head_img.width/2),
+ 1* -~~(fork_head_img.height/2)
+ );
+ ctx.restore();
+ }
+
+ });
+
+ if (dead_forks) {
+ forks.splice(0, dead_forks);
+ }
+
+ return;
+ },
+
+ // Forks have black digs in grounds
+ // This function will draw those
+ drawDigs: function(ctx) {
+ // Loop over forks and draw digs for each of them
+ var dig_img = this.dig_img;
+
+ this.forks.forEach(function(fork, index) {
+
+ if (fork.edge === 'btm') {
+ ctx.drawImage(dig_img, fork.x - fork.dig_x, fork.dig_y);
+ }
+
+ });
+ },
+
+ // Check Fork Collision
+ checkCollision: function() {
+ var first_fork = this.forks[0];
+
+ // Useless optimization
+ if (first_fork.x > mit.W/2)
+ return;
+
+ // Get Pappu Bounds
+ var pappu_bounds = mit.Pappu.getBounds(),
+ // Get Nearest Fork's Handle's Bounds
+ fork_bounds = first_fork.getHandleBounds();
+
+ // Check whether pappu collided with the
+ // fork handle or not.
+ if (utils.intersect(pappu_bounds, fork_bounds)) {
+ // console.log(pappu_bounds, fork_bounds);
+ mit.gameOver();
+ }
+
+ // We'll have to check for collision with fork heads.
+ // If there's a collision pappu will be pushed!
+ var fork_head_bounds = first_fork.getHeadBounds();
+
+ // Check whether pappu collided with the
+ // fork head or not. With fork heads
+ // collision detection checks would be
+ // a little casual than super stern.
+
+ // if (utils.intersect(pappu_bounds, fork_head_bounds)) {
+
+ if (
+ pappu_bounds.end_x > fork_head_bounds.start_x+20 &&
+ fork_head_bounds.end_x-20 > pappu_bounds.start_x &&
+ pappu_bounds.end_y > fork_head_bounds.start_y+20 &&
+ fork_head_bounds.end_y-20 > pappu_bounds.start_y
+ ) {
+ mit.gameOver();
+ }
+ }
+
+ };
+
+}());
\ No newline at end of file
diff --git a/sources/pappu-pakia/js/jquery-1.8.2.min.js b/sources/pappu-pakia/js/jquery-1.8.2.min.js
new file mode 100644
index 0000000..8d529ce
--- /dev/null
+++ b/sources/pappu-pakia/js/jquery-1.8.2.min.js
@@ -0,0 +1,2 @@
+/*! jQuery v1.8.2 jquery.com | jquery.org/license */
+(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;ba ",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;be.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML=" ",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML=" ";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="
",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="
",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d ",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="
",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML=" ",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/ ]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""," "],legend:[1,""," "],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""," "],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X","
"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>$2>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1>$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sources/pappu-pakia/sound/flap.mp3 b/sources/pappu-pakia/sound/flap.mp3
new file mode 100644
index 0000000..5fa0556
Binary files /dev/null and b/sources/pappu-pakia/sound/flap.mp3 differ
diff --git a/sources/pappu-pakia/sound/flap.ogg b/sources/pappu-pakia/sound/flap.ogg
new file mode 100644
index 0000000..506c8c3
Binary files /dev/null and b/sources/pappu-pakia/sound/flap.ogg differ
diff --git a/sources/pappu-pakia/sound/jump1.mp3 b/sources/pappu-pakia/sound/jump1.mp3
new file mode 100644
index 0000000..968e592
Binary files /dev/null and b/sources/pappu-pakia/sound/jump1.mp3 differ
diff --git a/sources/pappu-pakia/sound/jump1.ogg b/sources/pappu-pakia/sound/jump1.ogg
new file mode 100644
index 0000000..baaf82a
Binary files /dev/null and b/sources/pappu-pakia/sound/jump1.ogg differ
diff --git a/sources/pappu-pakia/sound/jump2.mp3 b/sources/pappu-pakia/sound/jump2.mp3
new file mode 100644
index 0000000..a82b5a7
Binary files /dev/null and b/sources/pappu-pakia/sound/jump2.mp3 differ
diff --git a/sources/pappu-pakia/sound/jump2.ogg b/sources/pappu-pakia/sound/jump2.ogg
new file mode 100644
index 0000000..97d13c1
Binary files /dev/null and b/sources/pappu-pakia/sound/jump2.ogg differ
diff --git a/sources/pappu-pakia/sound/jump3.mp3 b/sources/pappu-pakia/sound/jump3.mp3
new file mode 100644
index 0000000..eafe2e0
Binary files /dev/null and b/sources/pappu-pakia/sound/jump3.mp3 differ
diff --git a/sources/pappu-pakia/sound/jump3.ogg b/sources/pappu-pakia/sound/jump3.ogg
new file mode 100644
index 0000000..10b189f
Binary files /dev/null and b/sources/pappu-pakia/sound/jump3.ogg differ
diff --git a/sources/pappu-pakia/sound/pappu-pakia2.3.mp3 b/sources/pappu-pakia/sound/pappu-pakia2.3.mp3
new file mode 100644
index 0000000..3a3e5dd
Binary files /dev/null and b/sources/pappu-pakia/sound/pappu-pakia2.3.mp3 differ
diff --git a/sources/pappu-pakia/sound/pappu-pakia2.3.ogg b/sources/pappu-pakia/sound/pappu-pakia2.3.ogg
new file mode 100644
index 0000000..8908439
Binary files /dev/null and b/sources/pappu-pakia/sound/pappu-pakia2.3.ogg differ
diff --git a/sources/pappu-pakia/sound/ting.mp3 b/sources/pappu-pakia/sound/ting.mp3
new file mode 100644
index 0000000..dc3c994
Binary files /dev/null and b/sources/pappu-pakia/sound/ting.mp3 differ
diff --git a/sources/pappu-pakia/sound/ting.ogg b/sources/pappu-pakia/sound/ting.ogg
new file mode 100644
index 0000000..0e2f7fe
Binary files /dev/null and b/sources/pappu-pakia/sound/ting.ogg differ
diff --git a/sources/roundball/assets/ball_0.png b/sources/roundball/assets/ball_0.png
new file mode 100644
index 0000000..3145e66
Binary files /dev/null and b/sources/roundball/assets/ball_0.png differ
diff --git a/sources/roundball/assets/ball_1.png b/sources/roundball/assets/ball_1.png
new file mode 100644
index 0000000..040d3cb
Binary files /dev/null and b/sources/roundball/assets/ball_1.png differ
diff --git a/sources/roundball/assets/ball_2.png b/sources/roundball/assets/ball_2.png
new file mode 100644
index 0000000..1a2da40
Binary files /dev/null and b/sources/roundball/assets/ball_2.png differ
diff --git a/sources/roundball/assets/ball_3.png b/sources/roundball/assets/ball_3.png
new file mode 100644
index 0000000..91f1fe4
Binary files /dev/null and b/sources/roundball/assets/ball_3.png differ
diff --git a/sources/roundball/assets/ball_4.png b/sources/roundball/assets/ball_4.png
new file mode 100644
index 0000000..4d2e327
Binary files /dev/null and b/sources/roundball/assets/ball_4.png differ
diff --git a/sources/roundball/assets/ball_5.png b/sources/roundball/assets/ball_5.png
new file mode 100644
index 0000000..39d9102
Binary files /dev/null and b/sources/roundball/assets/ball_5.png differ
diff --git a/sources/roundball/assets/helper1.jpg b/sources/roundball/assets/helper1.jpg
new file mode 100644
index 0000000..59945a1
Binary files /dev/null and b/sources/roundball/assets/helper1.jpg differ
diff --git a/sources/roundball/assets/helper2.jpg b/sources/roundball/assets/helper2.jpg
new file mode 100644
index 0000000..b9901aa
Binary files /dev/null and b/sources/roundball/assets/helper2.jpg differ
diff --git a/sources/roundball/assets/icon.png b/sources/roundball/assets/icon.png
new file mode 100644
index 0000000..2ea7eb6
Binary files /dev/null and b/sources/roundball/assets/icon.png differ
diff --git a/sources/roundball/assets/lime.png b/sources/roundball/assets/lime.png
new file mode 100644
index 0000000..2b3420f
Binary files /dev/null and b/sources/roundball/assets/lime.png differ
diff --git a/sources/roundball/assets/main_title.png b/sources/roundball/assets/main_title.png
new file mode 100644
index 0000000..f513726
Binary files /dev/null and b/sources/roundball/assets/main_title.png differ
diff --git a/sources/roundball/assets/selection.png b/sources/roundball/assets/selection.png
new file mode 100644
index 0000000..fff2a75
Binary files /dev/null and b/sources/roundball/assets/selection.png differ
diff --git a/sources/roundball/assets/shadow.png b/sources/roundball/assets/shadow.png
new file mode 100644
index 0000000..2d550c2
Binary files /dev/null and b/sources/roundball/assets/shadow.png differ
diff --git a/sources/roundball/assets/startup.jpg b/sources/roundball/assets/startup.jpg
new file mode 100644
index 0000000..68a30b8
Binary files /dev/null and b/sources/roundball/assets/startup.jpg differ
diff --git a/sources/roundball/assets/startup_ipad.jpg b/sources/roundball/assets/startup_ipad.jpg
new file mode 100644
index 0000000..45b0469
Binary files /dev/null and b/sources/roundball/assets/startup_ipad.jpg differ
diff --git a/sources/roundball/licence.txt b/sources/roundball/licence.txt
new file mode 100644
index 0000000..211fbfa
--- /dev/null
+++ b/sources/roundball/licence.txt
@@ -0,0 +1,2 @@
+Apache
+https://github.com/digitalfruit/limejs
diff --git a/sources/roundball/licence.txt~ b/sources/roundball/licence.txt~
new file mode 100644
index 0000000..77fc394
--- /dev/null
+++ b/sources/roundball/licence.txt~
@@ -0,0 +1 @@
+Apache
diff --git a/sources/roundball/roundball.html b/sources/roundball/roundball.html
new file mode 100644
index 0000000..0ffa4d3
--- /dev/null
+++ b/sources/roundball/roundball.html
@@ -0,0 +1,128 @@
+
+
+
+
+ Roundball
+
+
+
+
+
+
+
+
+
+
diff --git a/sources/roundball/roundball.js b/sources/roundball/roundball.js
new file mode 100644
index 0000000..c9e13c4
--- /dev/null
+++ b/sources/roundball/roundball.js
@@ -0,0 +1,140 @@
+var h=void 0,m=!0,n=null,p=!1,s,t=this;function aa(){}
+function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
+else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function u(a){return a!==h}function v(a){return"array"==ba(a)}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function w(a){return"string"==typeof a}function y(a){return"number"==typeof a}function da(a){return"function"==ba(a)}function ea(a){var b=typeof a;return"object"==b&&a!=n||"function"==b}function fa(a){return a[ga]||(a[ga]=++ha)}var ga="closure_uid_"+(1E9*Math.random()>>>0),ha=0;
+function ia(a,b,c){return a.call.apply(a.bind,arguments)}function ja(a,b,c){if(!a)throw Error();if(2")&&(a=a.replace(wa,">"));-1!=a.indexOf('"')&&(a=a.replace(xa,"""));return a}var ua=/&/g,va=//g,xa=/\"/g,ta=/[&<>\"]/;function ya(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})}
+function za(a){var b=w(h)?"undefined".replace(/([-()\[\]{}+?*.$\^|,:#c?Math.max(0,a.length+c):c;if(w(a))return!w(b)||1!=b.length?-1:a.indexOf(b,c);for(;c=arguments.length?A.slice.call(a,b):A.slice.call(a,b,c)}function Ja(a){for(var b={},c=0,d=0;d=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom};
+s.expand=function(a,b,c,d){ea(a)?(this.top-=a.top,this.right+=a.right,this.bottom+=a.bottom,this.left-=a.left):(this.top-=a,this.right+=b,this.bottom+=c,this.left-=d);return this};s.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};s.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};
+s.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};s.translate=function(a,b){a instanceof B?(this.left+=a.x,this.right+=a.x,this.top+=a.y,this.bottom+=a.y):(this.left+=a,this.right+=a,y(b)&&(this.top+=b,this.bottom+=b));return this};s.scale=function(a,b){var c=y(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function C(a,b){this.width=a;this.height=b}s=C.prototype;s.d=function(){return new C(this.width,this.height)};function La(a){return a.width*a.height}s.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};s.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};s.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};
+s.scale=function(a,b){var c=y(b)?b:a;this.width*=a;this.height*=c;return this};Ka.prototype.size=function(){return new C(this.right-this.left,this.bottom-this.top)};function Ma(){}Ma.prototype.z=aa;function D(a){return a.Jc?a.Jc:a}function Na(a,b){Oa(b,a);b.Jc=D(a);return b};var E=new Ma;E.Fa=function(){};
+E.Bd=function(){var a=this.La,b=this.Fb(),c=this.da||1,d=c/a,e;if(this.a){this.rb&&this.rb.contains(b)&&(e=La(this.rb.size())/La(b.size()))&&1.6>e&&0.5parseFloat(qb)){pb=String(vb);break a}}pb=qb}var wb={};
+function P(a){var b;if(!(b=wb[a])){b=0;for(var c=ra(String(pb)).split("."),d=ra(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f(0==x[1].length?0:parseInt(x[1],10))?1:0)||((0==q[2].length)<
+(0==x[2].length)?-1:(0==q[2].length)>(0==x[2].length)?1:0)||(q[2]x[2]?1:0)}while(0==b)}b=wb[a]=0<=b}return b}var xb=t.document,yb=!xb||!M?h:ob()||("CSS1Compat"==xb.compatMode?parseInt(pb,10):5);function zb(a,b){for(var c in a)b.call(h,a[c],c,a)}var Ab="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Oa(a,b){for(var c,d,e=1;e=a.keyCode)a.keyCode=-1}catch(b){}};var Fb={},Q={},Gb={},Hb={};function R(a,b,c,d,e){if(v(b)){for(var f=0;fe.keyCode||e.returnValue!=h)return m;a:{var l=p;if(0==e.keyCode)try{e.keyCode=-1;break a}catch(r){l=m}if(l||e.returnValue==h)e.returnValue=m}}l=new Eb;l.Ab(e,this);e=m;try{if(g){for(var q=[],x=l.currentTarget;x;x=x.parentNode)q.push(x);f=d[m];f.I=f.Y;for(var J=q.length-
+1;!l.oa&&0<=J&&f.I;J--)l.currentTarget=q[J],e&=Pb(f,q[J],c,m,l);if(k){f=d[p];f.I=f.Y;for(J=0;!l.oa&&J");c=c.join("")}c=a.createElement(c);d&&(w(d)?c.className=d:v(d)?Yb.apply(n,[c].concat(d)):cc(c,d));2a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return n}
+function tc(a,b,c){if(b instanceof C)c=b.height,b=b.width;else if(c==h)throw Error("missing height argument");a.style.width=uc(b);a.style.height=uc(c)}function uc(a){"number"==typeof a&&(a=Math.round(a)+"px");return a}function vc(a){if("none"!=qc(a,"display"))return wc(a);var b=a.style,c=b.display,d=b.visibility,e=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";a=wc(a);b.display=c;b.position=e;b.visibility=d;return a}
+function wc(a){var b=a.offsetWidth,c=a.offsetHeight,d=O&&!b&&!c;return(!u(b)||d)&&a.getBoundingClientRect?(a=rc(a),new C(a.right-a.left,a.bottom-a.top)):new C(b,c)}function xc(a){var b=$b(h),c=n;if(M)b=c=b.va.createStyleSheet(),M?b.cssText=a:b.innerHTML=a;else{var d=oc(b,"head")[0];d||(c=oc(b,"body")[0],d=b.Sc("head"),c.parentNode.insertBefore(d,c));var e=c=b.Sc("style");M?e.cssText=a:e.innerHTML=a;b.appendChild(d,c)}return c};var yc,zc,Ac,Bc,Cc,Dc,Ec;(function(){var a=O?"Webkit":N?"Moz":jb?"O":M?"ms":"",b=fc("div").style;yc="-"+a.toLowerCase()+"-transform";zc=function(a){return b[a]!==h?a:p};Ac=function(b){var d=b.charAt(0).toLowerCase()+b.substr(1),e=a+b;return zc(b)?b:zc(d)?d:zc(e)?e:h}})();var Fc=function(){var a=Ac("BorderRadius");return function(b,c,d,e){e=e?"%":"px";d=u(d)?d:c;c=(v(c)?c.join(e+" "):c)+e+"/"+((v(d)?d.join(e+" "):d)+e);c!=b.zd&&(b.style[a]=b.zd=c)}}();
+function Ta(a){this.Rb=[];this.precision=1;this.xb=m;this.qe&&Sa(this,a)}function Gc(a,b){a.xb=b;return a}Ta.prototype.scale=function(a,b){this.Rb.push("scale("+a+","+b+")");return this};Ta.prototype.rotate=function(a,b){var c;c=this.xb&&(Sb||Ub)?"rotate3d(0, 0, 1, "+a+(b?b:"deg")+")":"rotate("+a+(b?b:"deg")+")";0!=a&&this.Rb.push(c);return this};
+Ta.prototype.translate=function(a,b,c){var d=1/this.precision,e="translate";if(this.xb&&(Sb||Ub))e+="3d";e+="("+a*d+"px,"+b*d+"px";if(this.xb&&(Sb||Ub))e+=","+(c?c:0)*d+"px";this.Rb.push(e+")");return this};function Sa(a,b){if(1!=a.precision){var c=1/a.precision;a.scale(c,c);a.precision=1}1!=b&&(a.scale(b,b),a.precision=b);return a}Ta.prototype.toString=function(){1!=this.precision&&Sa(this,1);return this.Rb.join(" ")};
+var Ra=function(){var a=Ac("Transform");return function(b,c){var d=c.toString();d!=b.fe&&(b.style[a]=b.fe=d);oa=1}}(),Pa=function(){var a=Ac("TransformOrigin");return function(b,c,d,e){e=e?"%":"px";c=c+e+" "+d+e;c!=b.ge&&(b.style[a]=b.ge=c)}}();
+(function(){function a(a,b){if(!a.length)return a;for(var e=a.split("),"),f=0;fd;d++){for(;a[d].length;)c=a[d][0],c.update(d),c.p=0,c==a[d][0]&&a[d].shift();a[d]=[]}b=[[],[]]}})();var Lc=1,Ic=16,Jc=32,I=1,G=2,Qa=4,Hc=5;xc(".lime-director {position:absolute; -webkit-transform-origin: 0 0; -moz-transform-origin: 0 0; -o-transform-origin: 0 0; image-rendering: optimizeSpeed; overflow: hidden;}.lime-director div, .lime-director img, .lime-director canvas {-webkit-transform-origin: 0 0; -moz-transform-origin: 0 0; -o-transform-origin: 0 0; position: absolute; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -webkit-user-select: none; -webkit-user-drag: none;}.lime-scene {position:absolute; width:100%; height:100%; left: 0px; top: 0px; overflow: hidden; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;}.lime-fps {float: left; background: #333; color: #fff; position: absolute; top:0px; left: 0px; padding:2px 4px;}div.lime-layer {position: absolute; left: 0px; top: 0px; width:0px; height:0px; border: none !important;}.lime-cover {position: absolute; left: 0px; top: 0px;}.lime-button {cursor: pointer;}");function S(){Va.call(this);this.e=[];this.g=n;this.qa={};this.l={};this.W={};this.Ac={};this.Gc=m;this.q=p;this.vc=this.Zb=n;this.F={};this.Oa(1);this.b(0,0);this.c(0,0);this.La=1;this.P(0.5,0.5);this.J=0;this.l[Qa]||T(this,Lc);this.Ic=0;T(this,7);this.C=1;Mc(this,n);Nc(this,D(this.Ca[0]));T(this,64)}z(S,Rb);s=S.prototype;s.Ca=[K,E];
+function Nc(a,b){if(!a.n||D(a.n)!=b){for(var c=-1,d=0;dd[e]?-1:1}}s.Yb=p;function T(a,b,c,d){b&&!a.p&&pa(a,c,d);a.p|=b;if(64==b)for(c=0;d=a.e[c];c++)d instanceof S&&T(d,64);if(!u(a.p)||!b)a.p=0;b&&a.Aa&&(a.Od=p,T(a.Aa,-1));return a}s.Oa=function(a,b){this.u=1==arguments.length&&y(a)?new L(a,a):2==arguments.length?new L(arguments[0],arguments[1]):a;return this.l[G]?this:T(this,2)};
+s.b=function(a,b){this.h=2==arguments.length?new B(arguments[0],arguments[1]):a;return this.l[I]?this:T(this,Lc)};function Mc(a,b){if(b!=a.j){if(a.j){var c=a.j;delete c.ub;Tc(c,c.getParent());delete a.j.Aa}a.j=b;a.j&&(c=a.j,c.ub=m,c.q&&Uc(c,c.getParent()),a.j.Aa=a);T(a,4)}}s.P=function(a,b){this.ca=2==arguments.length?new L(arguments[0],arguments[1]):a;return T(this,Lc)};function Vc(a,b){a.zb=b;T(a,Jc);a.Hc=0}s.f=function(){return this.s};
+s.c=function(a,b){var c=this.s,d,e;d=2==arguments.length?new C(arguments[0],arguments[1]):a;var f=this.ca;if(c&&this.e.length)for(var g=0;ga){var b=0<=a&&this.e.length>a?this.e[a]:n;b.Aa&&Mc(b.Aa,n);b instanceof S?(this.q&&ad(b),Qc(b),b.g=n):lc(b);this.e.splice(a,1);a=T(this,64)}else a=this;return a};s.addEventListener=function(a){Vb&&"mouse"==a.substring(0,5)||(u(this.F[a])||(this.F[a]=[0,0]),this.q&&0==this.F[a][0]&&(this.F[a][0]=1,this.N().Ia.Jb(this,a)),this.F[a][1]++)};
+s.removeEventListener=function(a){Vb&&"mouse"==a.substring(0,5)||(this.q&&1==this.F[a][1]&&(this.F[a][0]=0,this.N().Ia.jb(this,a)),this.F[a][1]--,this.F[a][1]||delete this.F[a])};s.N=function(){return!this.q?n:this.Zb};s.yb=function(){return!this.q?n:this.vc};function ad(a){var b;a.ub||Tc(a,a.getParent());for(var c=0;b=a.e[c];c++)b instanceof S&&ad(b);for(var d in a.F){a.F[d][0]=0;if(!a.N())debugger;a.N().Ia.jb(a,d)}bd(a.N().Ia,a);a.q=p;a.Zb=n;a.vc=n}
+function $c(a){a.q=m;a.Zb=a.g.N();a.vc=a.g.yb();for(var b=0,c;c=a.e[b];b++)c instanceof S&&$c(c);for(var d in a.F)a.F[d][0]=1,a.N().Ia.Jb(a,d);a.ub&&(a.ub=m,a.q&&Uc(a,a.getParent()));bd(a.N().Ia,a)}function Uc(a,b){b.ta||(b.ta=[]);Ea(b.ta,a);!b&&!(b.getParent()instanceof F)&&Uc(a,b.getParent())}function Tc(a,b){b&&b.ta&&(Fa(b.ta,a),Tc(a,b.getParent()))}function H(a){var b=a.f();a=a.ca;return new Ka(-b.height*a.y,b.width*(1-a.x),b.height*(1-a.y),-b.width*a.x)}
+function Wc(a,b){var c=b||H(a),d=new B(c.left,c.top),e=new B(c.right,c.top),f=new B(c.left,c.bottom),c=new B(c.right,c.bottom),d=Ua(a,d),e=Ua(a,e),f=Ua(a,f),c=Ua(a,c);return new Ka(Math.floor(Math.min(d.y,e.y,f.y,c.y)),Math.ceil(Math.max(d.x,e.x,f.x,c.x)),Math.ceil(Math.max(d.y,e.y,f.y,c.y)),Math.floor(Math.min(d.x,e.x,f.x,c.x)))}
+s.Fb=function(){var a=H(this);a.left==a.right&&this.e.length&&(a=Wc(this.e[0],this.e[0].Fb()));for(var b=0,c;c=this.e[b];b++)if(1!=c.hc){var d=a;c=Wc(c,c.Fb());d.left=Math.min(d.left,c.left);d.top=Math.min(d.top,c.top);d.right=Math.max(d.right,c.right);d.bottom=Math.max(d.bottom,c.bottom)}return a};s.la=function(a){this.Ac[a]=1};s.ya=function(a){var b=this.ja(a.Ma);return H(this).contains(b)?(a.position=b,m):p};function cd(a,b){Ea(b.Ea,a);b.play()};function dd(){S.call(this);this.ab="lime-layer"}z(dd,S);dd.prototype.ya=function(a){for(var b=0,c;c=this.e[b];b++)if(c.ya(a))return a.position=this.ja(a.Ma),m;return p};var U=new function(){this.ba=[];this.Ga=p;this.bd=0;this.ac=1E3/30;this.za=0};function ed(a,b){this.w=this.jd=a;this.ic=u(b)?b:-1;this.ma=[]}ed.prototype.Qa=function(a){if(this.ma.length)if(this.w>a)this.w-=a;else{var b=this.jd+a-this.w;this.w=this.jd-(a-this.w);0>this.w&&(this.w=0);var c;for(a=this.ma.length;0<=--a;)(c=this.ma[a])&&(c[0]&&da(c[1]))&&c[1].call(c[2],b);-1!=this.ic&&(this.ic--,0==this.ic&&U.pb(c[1],c[2]))}};U.ba.push(new ed(0));
+for(var fd=["webkit","moz"],gd=0;gdpb?(t.mozRequestAnimationFrame(),this.Kc=ka(U.yd,this),t.addEventListener("MozBeforePaint",this.Kc,p)):(this.Ub=ka(U.wd,this),t.requestAnimationFrame(this.Ub)):this.bd=setInterval(ka(U.de,this),U.ac),this.Ga=m)};
+U.Uc=function(){this.Ga&&(U.Cc&&t.requestAnimationFrame?t.mozRequestAnimationFrame&&11>pb?t.removeEventListener("MozBeforePaint",this.Kc,p):t.cancelAnimationFrame(this.Ub):clearInterval(this.bd),this.Ga=p)};U.wd=function(a){var b=t.performance,c;b&&(c=b.now||b.webkitNow)?a=b.timing.navigationStart+c.call(b):a||(a=ma());b=a-this.za;0>b&&(b=1);U.$b(b);this.za=a;t.requestAnimationFrame(this.Ub)};U.yd=function(a){U.$b(a.timeStamp-this.za);this.za=a.timeStamp;t.mozRequestAnimationFrame()};
+U.de=function(){var a=ma(),b=a-this.za;0>b&&(b=1);U.$b(b);this.za=a};U.$b=function(a){for(var b=this.ba.slice(),c=b.length;0<=--c;)b[c].Qa(a);1==oa&&(/Firefox\/18./.test(fb())&&!na.je)&&(U.ld?(document.body.style.MozTransform="",U.ld=0):(document.body.style.MozTransform="scale(1,1)",U.ld=1),oa=0)};U.Ad=function(a){for(var b,c,d,e,f=this.ba.length;0<=--f;){b=this.ba[f];for(e=b.ma.length;0<=--e;)d=b.ma[e],c=d[2],da(c.N)&&(c=c.N(),c==a&&(d[0]=m))}};U.Nc=function(a,b,c){U.xc(a,b,c,1)};
+U.xc=function(a,b,c,d){U.wc(a,b,new ed(c,d))};var hd;function V(){Va.call(this);this.Ea=[];this.gc=[];this.Pb={};this.oe=p;this.m=1;this.wb=id;this.K=0}z(V,Rb);s=V.prototype;s.scope="";s.A=function(a){this.m=a;return this};s.play=function(){this.rc=0;this.Xc=this.K=1;U.wc(this.Qa,this);this.dispatchEvent({type:"start"})};s.stop=function(){if(0!=this.K){var a=this.gc;if(jd(this)&&this.la)for(var b=a.length;0<=--b;)this.la(a[b]);this.gc=[];this.Pb={};this.K=0;U.pb(this.Qa,this);this.dispatchEvent({type:"stop"})}};s.hb=function(){return{}};
+function kd(a,b){var c=fa(b);u(a.Pb[c])||(a.eb(b),a.Pb[c]=a.hb(b));return a.Pb[c]}s.eb=function(a){ld.Jb(this,a);this.K=1;Ea(this.gc,a);this.Ob&&(!this.qd&&this.Xa)&&this.Xa()};s.N=function(){return this.Ea[0]?this.Ea[0].N():n};s.Qa=function(a){this.Ob&&(!this.qd&&this.Xa)&&this.Xa();this.Xc&&(delete this.Xc,a=1);this.rc+=a;this.me=a;a=this.rc/(1E3*this.m);if(isNaN(a)||1<=a)a=1;a=this.ra(a,this.Ea);1==a&&this.stop()};
+s.ra=function(a,b){a=this.wb[0](a);isNaN(a)&&(a=1);for(var c=b.length;0<=--c;)this.update(a,b[c]);return a};function jd(a){return 0f;f++){x=((b*g+c)*g+d)*g-a;if(5E-5>(0<=x?x:0-x))return g;e=(3*b*g+2*c)*g+d;if(1E-6>(0<=e?e:0-e))break;g-=x/e}e=0;f=1;g=a;if(gf)return f;for(;e(0<=x-a?x-a:0-(x-a)))break;a>x?e=g:f=g;g=0.5*(f-e)+e}return g}var b=0,c=0,d=0,e=0,f=0,g=0;hd=function(k,l,r,q){return[function(x){d=3*k;c=3*(r-k)-d;b=1-d-c;g=3*l;f=3*(q-l)-g;e=1-g-f;return((e*a(x)+f)*a(x)+g)*a(x)},k,l,r,q]}})();var id=hd(0.42,0,0.58,1);var nd={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",
+darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",
+ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",
+lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",
+moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",
+seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function od(a){var b={};a=String(a);var c="#"==a.charAt(0)?a:"#"+a;if(pd.test(c))return b.ec=qd(c),b.type="hex",b;a:{var d=a.match(rd);if(d){var c=Number(d[1]),e=Number(d[2]),d=Number(d[3]);if(0<=c&&255>=c&&0<=e&&255>=e&&0<=d&&255>=d){c=[c,e,d];break a}}c=[]}if(c.length){e=c[0];a=c[1];c=c[2];e=Number(e);a=Number(a);c=Number(c);if(isNaN(e)||0>e||255a||255c||255c?c+=1:16*c?a+6*(b-a)*c:1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}var pd=/^#(?:[0-9a-f]{3}){1,2}$/i,rd=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;
+function sd(a){return 1==a.length?"0"+a:a};function vd(){Va.call(this)}z(vd,Rb);vd.prototype.fc=aa;function wd(a){if(a[0]instanceof vd)return a[0];v(a)||(a=Ga(arguments));return 2=q?(g-k)/(2*q):(g-k)/(2-2*q));d=[Math.round(l+
+360)%360,r,q];d[b]+=c;1c?c*(1+b):c+b-b*c,g=2*c-k,e=255*ud(g,k,d+1/3),f=255*ud(g,k,d),g=255*ud(g,k,d-1/3));d=[Math.round(e),Math.round(f),Math.round(g)];d.push(a.sa);return a.Na(d)}
+s.Na=function(a){var b=a;if(w(a))return this.ea=a,this;2=this.Pa?(c=1,d=1==this.Pa?1:(a-this.Pa)/(1-this.Pa)):(c=0,d=0!=this.Pa?a/this.Pa:1);-1==this.ia&&1==c&&(this.i[0].K=1,this.i[0].ra(1,b),this.i[0].stop());this.ia!=c&&(-1!=this.ia&&(this.i[this.ia].ra(1,b),this.i[this.ia].stop()),this.i[c].K=1);this.i[c].ra(d,b);this.ia=c;return a};function Gd(a){V.call(this);var b=Ga(arguments);v(a)&&(b=a);2c?this.Sa=new Fd(this.Sa,d.A(b-c)):bg;g++){var k=d,l=e;0==g?k++:l--;k>=a.cols||0>l||(k=a.M[k][l],$d(a,f,k),l=Vd(a).length,l>c&&(c=l,b=f),$d(a,f,k))}a.hint=b;b=a.cc;a=a.hint;b.hint=a;u(a)?U.Nc(b.Nb,b,3500):ae(b)};E.Va={};K.Va={};function X(){W.call(this);be(this,5)}z(X,W);X.prototype.id="roundedrect";X.prototype.Ca=[Na(K.B,K.Va),Na(E.B,E.Va)];function be(a,b){a.we=p;a.uc=b;return a}K.Va.z=function(a){this.f();K.B.z.call(this,a);Fc(a,[this.uc*this.La,this.uc*this.La])};
+E.Va.z=function(a){this.f();var b=H(this),c=this.uc,d=b.left,e=b.top,f=b.right-b.left,b=b.bottom-b.top;a.save();a.beginPath();a.moveTo(d+c,e);a.lineTo(d+f-c,e);a.quadraticCurveTo(d+f,e,d+f,e+c);a.lineTo(d+f,e+b-c);a.quadraticCurveTo(d+f,e+b,d+f-c,e+b);a.lineTo(d+c,e+b);a.quadraticCurveTo(d,e+b,d,e+b-c);a.lineTo(d,e+c);a.quadraticCurveTo(d,e,d+c,e);a.closePath();a.clip();E.B.z.call(this,a);this.Q&&(a.lineWidth*=2,a.stroke());a.restore()};function ce(a,b){dd.call(this);this.ab="lime-button";u(a)&&(this.R=a,this.appendChild(this.R),this.ob=-1,de(this,ee));u(b)&&fe(this,b);var c=this;R(this,["mousedown","touchstart","touchmove"],function(a){de(c,ge);a.Ra("mousemove",function(a){c.ya(a)?de(c,ge):de(c,ee)});a.Ra("touchmove",function(a){c.ya(a)||(de(c,ee),a.jb())});a.Ra(["mouseup","touchend"],function(a){c.ya(a)&&c.dispatchEvent({type:he});de(this,ee)})})}z(ce,dd);var ee=0,ge=1,he="click";
+function fe(a,b){a.ha=b;a.appendChild(b);a.ob=-1;de(a,ee)}function de(a,b){if(b!=a.ob){a.ob==ee&&b==ge&&a.dispatchEvent({type:"down"});a.ob==ge&&b==ee&&a.dispatchEvent({type:"up"});var c=a.R;u(a.ha)&&(ge==b?c=a.ha:Vc(a.ha,m));c!=a.R&&Vc(a.R,m);Vc(c,p);a.ob=b}};E.Ua={};K.Ua={};function Y(a){W.call(this);this.oc=p;T(this,4);this.r(a);ie(this,je);Z(this,14);$(this,"#000");ke(this,"center");le(this,"400");a=[0,0,0,0];u(h)&&(a[1]=a[3]=h);u(h)&&(a[2]=h);u(h)&&(a[3]=h);this.H=a;T(this,8);this.Md=p;this.ed=1.15;this.$d(n);this.o(255,255,255,0)}z(Y,W);Y.prototype.id="label";var je="Arial";Y.prototype.Ca=[Na(K.B,K.Ua),Na(E.B,E.Ua)];
+(function(){var a;Y.prototype.measureText=function(){u(a)||(a=document.createElement("canvas").getContext("2d"));var b=me(this)*this.xa;this.oc&&(b*=ra(this.fa).split("\n").length);a.font=this.xa+"px "+this.bc;var c=a.measureText(this.fa),c=O?c.width:c.width+1;Tb&&(c+=1);var d=this.Q?this.Q.Sb:0;return new C(this.H[1]+this.H[3]+c+2*d,this.H[0]+this.H[2]+b+2*d)}})();s=Y.prototype;s.f=function(){var a=S.prototype.f.call(this);return!a||!a.width&&!a.height?this.measureText():a};
+s.r=function(a){this.fa=a+"";T(this,4);delete this.Bc;return this};function le(a,b){a.Zc=b;T(a,8);return a}function ie(a,b){a.bc=b;T(a,8);return a}function Z(a,b){a.xa=b;T(a,8);return a}function $(a,b){a.Yc=b;T(a,8);return a}function me(a){var b=Math.abs(a.V.y)+2*a.aa;return a.Md?(a.ed+b)/a.xa:a.ed+b/a.xa}function ke(a,b){a.Fc=b;T(a,8);return a}
+s.$d=function(a,b,c,d){1==arguments.length&&a===n?(this.nb="#ccc",this.aa=0,this.Mb(0,0)):2==arguments.length?(this.nb=a,this.aa=b,this.Mb(new L(0,0))):3==arguments.length?(this.nb=a,this.aa=b,this.Mb(c)):(this.nb=a,this.aa=b,this.Mb(c,d));T(this,8)};s.Mb=function(a,b){this.V=2==arguments.length?new L(arguments[0],arguments[1]):a;T(this,8)};s.update=function(){this.p&4&&delete this.dd;S.prototype.update.apply(this,arguments)};
+K.Ua.z=function(a){K.B.z.call(this,a);var b=a.style;this.p&4&&(this.oc?a.innerHTML=sa(this.fa).replace(/\n/g," "):nc(a,this.fa));this.p&8&&(b.lineHeight=me(this),b.padding=Da(this.H,function(a){return a*Xc(this)},this).join("px ")+"px",b.color=this.Yc,b.fontFamily=this.bc,b.fontSize=this.xa*Xc(this)+"px",b.fontWeight=this.Zc,b.textAlign=this.Fc,b.textShadow=this.aa||this.V.x||this.V.y?this.nb+" "+this.V.x+"px "+this.V.y+"px "+this.aa+"px":"")};
+E.Ua.z=function(a){E.B.z.call(this,a);var b=H(this),c=-b.left-this.H[3]+b.right-this.H[1]+Math.abs(this.V.x)+Math.abs(2*this.aa),d=0;if(!this.Bc){var d=[],e=this.fa.length,f=this.fa.match(N?/[\s\.]+/g:/[\s-\.]+/g),g=0;if(f)for(var k=0;kc?(d.push(ra(e)),k--,e=f[g]):e+=f[g]);for(l=0;l-Math.PI/2?[d.right,d.bottom]:[d.left,d.bottom];d=(d[1]+1/q*d[0]-l+q*k)/(q+1/q);q=q*d+l-k*q;d-=k;q-=l;this.Xd=Math.sqrt((f*f+g*g)/(d*d+q*q))}f=Da(this.Ya,this.Ed,this);c=O?"-webkit-gradient(linear,"+100*this.v[0]+
+"% "+100*this.v[1]+"%,"+100*this.v[2]+"% "+100*this.v[3]+"%,"+f.join(",")+")":"linear-gradient("+100*this.v[0]+"% "+100*this.v[1]+"% "+Math.atan2((this.v[1]-this.v[3])*e,(this.v[2]-this.v[0])*c)+"rad,"+f.join(",")+")";N&&(c="-moz-"+c);a.style.background=c};s.lb=function(a,b){for(var c=this.v,d=H(b),e=d.right-d.left,f=d.bottom-d.top,c=a.createLinearGradient(d.left+e*c[0],d.top+f*c[1],d.left+e*c[2],d.top+f*c[3]),d=0;dthis.ga&&ae(this);ve(this.Qb,this.ga/this.Eb)};we.prototype.vd=function(){var a=parseInt(this.yc.fa,10);aa.Eb&&(a.ga=a.Eb);a.Qb&&ve(a.Qb,a.ga/a.Eb)}
+function ae(a){Mb(a.T,["mousedown","touchstart"],a.T.sc);U.pb(a.vd,a);U.pb(a.Tc,a);var b=be((new X).o(0,0,0,0.7).c(500,480).b(360,260).P(0.5,0),20);a.appendChild(b);var c=Z($((new Y).r(1>a.ga?"Temps \351coul\351 !":"Plus de d\351placements !"),"#ddd"),40).b(0,70);b.appendChild(c);c=$(Z((new Y).r("Votre score:"),24),"#ccc").b(0,145);b.appendChild(c);c=le($(Z((new Y).r(a.Hb),150),"#fff").b(0,240),700);b.appendChild(c);c=(new qe).r("R\351essayez").c(200,90).b(-110,400);b.appendChild(c);R(c,he,function(){ze(this.T.cols)},
+p,a);c=(new qe).r("Menu principal").c(200,90).b(110,400);b.appendChild(c);R(c,he,function(){se()})};function Ae(){F.call(this);this.a.style.cssText="background:rgba(255,255,255,.8)"}z(Ae,F);function Be(a){this.$a=a;this.identifier=0}Be.prototype.Ra=function(a,b,c){a=v(a)?a:[a];for(var d=0;d=a.wa.changedTouches.length&&(e=1)}else f.Ma=new B(a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,a.clientY+document.body.scrollTop+document.documentElement.scrollTop),e=1;if(u(this.pa[f.identifier])){for(var g=
+this.pa[f.identifier],k=0;ka.width/a.height?a.width/b.width:a.height/b.height);var c=b.width/this.f().width;this.Oa(c);a.width/a.heightd.screenX||0>d.screenY);b=new B(0,0);var k;d=e?bc(e):document;if(k=M)if(k=!(M&&9<=yb))k="CSS1Compat"!=$b(d).va.compatMode;k=k?d.body:d.documentElement;if(c!=k)if(c.getBoundingClientRect)d=rc(c),e=$b(e).va,c=!O&&"CSS1Compat"==e.compatMode?e.documentElement:e.body,e=e.parentWindow||e.defaultView,c=new B(e.pageXOffset||c.scrollLeft,e.pageYOffset||c.scrollTop),b.x=d.left+c.x,b.y=d.top+c.y;else if(e.getBoxObjectFor&&!g)d=e.getBoxObjectFor(c),c=e.getBoxObjectFor(k),b.x=d.screenX-
+c.screenX,b.y=d.screenY-c.screenY;else{d=c;do{b.x+=d.offsetLeft;b.y+=d.offsetTop;d!=c&&(b.x+=d.clientLeft||0,b.y+=d.clientTop||0);if(O&&"fixed"==qc(d,"position")){b.x+=e.body.scrollLeft;b.y+=e.body.scrollTop;break}d=d.offsetParent}while(d&&d!=c);if(jb||O&&"absolute"==f)b.y-=e.body.offsetTop;for(d=c;(d=sc(d))&&d!=e.body&&d!=k;)if(b.x-=d.scrollLeft,!jb||"TR"!=d.tagName)b.y-=d.scrollTop}this.vb=b;kb&&this.a.parentNode==document.body&&(this.md&&(b=this.md,lc(b.ownerNode||b.owningElement||b)),this.md=
+xc("html{height:"+(a.height+120)+"px;overflow:hidden;}"))};s.ya=function(a){a&&a.Ma&&(a.position=this.ja(a.Ma));return m};function Ke(a,b){Fe.call(this,a,b)}z(Ke,Fe);Ke.prototype.start=function(){Zc(this.cb,0);Vc(this.cb,p);var a=md((new Md(0)).A(this.m));R(a,"stop",function(){this.Gb&&Zc(this.Gb,1)},p,this);this.Gb&&cd(this.Gb,a);a=(new Md(1)).A(this.m);cd(this.cb,a);R(a,"stop",this.finish,p,this)};var xe=1;
+function se(){var a=new F,b=(new dd).b(360,0);/Chrome\/9\.0\.597/.test(fb())&&Nc(b,E);var c=(new W).o("assets/main_title.png").b(0,290);c.tc=m;b.appendChild(c);var d=(new dd).b(0,430);b.appendChild(d);var e=md(new Od(-720,0)),f=Le("Jeu classique").b(0,200);R(f,"click",function(){Hd=0;cd(d,e)});d.appendChild(f);f=Le("Jeu chronom\351tr\351").b(0,320);R(f,"click",function(){Hd=xe;cd(d,e)});d.appendChild(f);f=Le("Aide").b(0,440);R(f,"click",function(){var a=new re;ye(a);Je(a)});d.appendChild(f);c=(new dd).b(720,0);
+d.appendChild(c);f=Z($((new Y).r("Taille de la grille :"),"#fff"),24).b(0,140);c.appendChild(f);f=Le("6x6").b(0,200);R(f,"click",function(){ze(6)});c.appendChild(f);f=Le("7x7").b(0,320);R(f,"click",function(){ze(7)});c.appendChild(f);f=Le("8x8").b(0,440);R(f,"click",function(){ze(8)});c.appendChild(f);a.appendChild(b);ye(a);Je(a)}function Le(a){return(new qe(a)).c(300,90)}function ze(a){a=new we(a);Je(a)}
+function ye(a){var b=(new W).o("assets/lime.png"),c=Z($((new Y).r("R\351alis\351 avec"),"#fff"),24).b(280,960),b=(new ce(b)).Oa(0.3).b(420,960);R(b,"click",function(){window.location.href="http://www.limejs.com/"});a.appendChild(c);a.appendChild(b)}
+function Me(){var a=Id=new Ge(document.body,720,1004),b=document.createElement("meta");b.name="apple-mobile-web-app-capable";b.content="yes";document.getElementsByTagName("head").item(0).appendChild(b);b=document.createElement("meta");b.name="apple-mobile-web-app-status-bar-style";b.content="black";document.getElementsByTagName("head").item(0).appendChild(b);b=p;u(localStorage)&&(b=localStorage.getItem("_lime_visited"));/(ipod|iphone|ipad)/i.test(navigator.userAgent)&&(!window.navigator.be&&!b&&a.a.parentNode==
+document.body)&&(alert("Please install this page as a web app by clicking Share + Add to home screen."),u(localStorage)&&localStorage.setItem("_lime_visited",m));se()}var Ne=["rb","start"],Oe=t;!(Ne[0]in Oe)&&Oe.execScript&&Oe.execScript("var "+Ne[0]);for(var Pe;Ne.length&&(Pe=Ne.shift());)!Ne.length&&u(Me)?Oe[Pe]=Me:Oe=Oe[Pe]?Oe[Pe]:Oe[Pe]={};
diff --git a/sources/roundball/roundball.manifest b/sources/roundball/roundball.manifest
new file mode 100644
index 0000000..a90b7d1
--- /dev/null
+++ b/sources/roundball/roundball.manifest
@@ -0,0 +1,26 @@
+CACHE MANIFEST
+
+# If you use more files you need to manually list them here.
+# Don't remove next line
+# Updated on: 2013-04-16 12:54:42
+
+roundball.js
+assets/startup.jpg
+assets/startup_ipad.jpg
+assets/icon.png
+
+assets/ball_0.png
+assets/ball_1.png
+assets/ball_2.png
+assets/ball_3.png
+assets/ball_4.png
+assets/ball_5.png
+assets/helper1.jpg
+assets/helper2.jpg
+assets/lime.png
+assets/main_title.png
+assets/selection.png
+assets/shadow.png
+
+NETWORK:
+*
diff --git a/sources/sokojs/0.gif b/sources/sokojs/0.gif
new file mode 100644
index 0000000..35d42e8
Binary files /dev/null and b/sources/sokojs/0.gif differ
diff --git a/sources/sokojs/1.gif b/sources/sokojs/1.gif
new file mode 100644
index 0000000..472fd6f
Binary files /dev/null and b/sources/sokojs/1.gif differ
diff --git a/sources/sokojs/2.gif b/sources/sokojs/2.gif
new file mode 100644
index 0000000..fa870a8
Binary files /dev/null and b/sources/sokojs/2.gif differ
diff --git a/sources/sokojs/3.gif b/sources/sokojs/3.gif
new file mode 100644
index 0000000..77ab1d7
Binary files /dev/null and b/sources/sokojs/3.gif differ
diff --git a/sources/sokojs/4.gif b/sources/sokojs/4.gif
new file mode 100644
index 0000000..04643d7
Binary files /dev/null and b/sources/sokojs/4.gif differ
diff --git a/sources/sokojs/5.gif b/sources/sokojs/5.gif
new file mode 100644
index 0000000..815fdd1
Binary files /dev/null and b/sources/sokojs/5.gif differ
diff --git a/sources/sokojs/6.gif b/sources/sokojs/6.gif
new file mode 100644
index 0000000..dfbf759
Binary files /dev/null and b/sources/sokojs/6.gif differ
diff --git a/sources/sokojs/7.gif b/sources/sokojs/7.gif
new file mode 100644
index 0000000..5953f11
Binary files /dev/null and b/sources/sokojs/7.gif differ
diff --git a/sources/sokojs/8.gif b/sources/sokojs/8.gif
new file mode 100644
index 0000000..2cb4cc3
Binary files /dev/null and b/sources/sokojs/8.gif differ
diff --git a/sources/sokojs/9.gif b/sources/sokojs/9.gif
new file mode 100644
index 0000000..ecad03e
Binary files /dev/null and b/sources/sokojs/9.gif differ
diff --git a/sources/sokojs/Boxworld.htm b/sources/sokojs/Boxworld.htm
new file mode 100644
index 0000000..105fc3c
--- /dev/null
+++ b/sources/sokojs/Boxworld.htm
@@ -0,0 +1,32 @@
+
+Sokoban Borxworld
+
+
+
+
+
+
+
+
+Le jeu Boxworld (Sokoban crit en Javascript, licence GPL)
+a chang d'adresse :
+
+
+http://michel.buze.perso.neuf.fr/Boxworld/sokojs.htm
+
+
+Vous serez redigir automatiquement dans 8 secondes, sinon cliquez
+sur la nouvelle adresse...
+
+
+
+
+AJOUTEZ LA NOUVELLE ADRESSE A VOS FAVORIS !!!
+CLIQUEZ [ ICI ]
+
+
diff --git a/sources/sokojs/level.htm b/sources/sokojs/level.htm
new file mode 100644
index 0000000..4ff4a63
--- /dev/null
+++ b/sources/sokojs/level.htm
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sources/sokojs/level0.htm b/sources/sokojs/level0.htm
new file mode 100644
index 0000000..2699023
--- /dev/null
+++ b/sources/sokojs/level0.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level1.htm b/sources/sokojs/level1.htm
new file mode 100644
index 0000000..cc829dd
--- /dev/null
+++ b/sources/sokojs/level1.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level10.htm b/sources/sokojs/level10.htm
new file mode 100644
index 0000000..67a1514
--- /dev/null
+++ b/sources/sokojs/level10.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level11.htm b/sources/sokojs/level11.htm
new file mode 100644
index 0000000..2356fb9
--- /dev/null
+++ b/sources/sokojs/level11.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level12.htm b/sources/sokojs/level12.htm
new file mode 100644
index 0000000..18a07a0
--- /dev/null
+++ b/sources/sokojs/level12.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level13.htm b/sources/sokojs/level13.htm
new file mode 100644
index 0000000..cfa6112
--- /dev/null
+++ b/sources/sokojs/level13.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level14.htm b/sources/sokojs/level14.htm
new file mode 100644
index 0000000..174d1dc
--- /dev/null
+++ b/sources/sokojs/level14.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level15.htm b/sources/sokojs/level15.htm
new file mode 100644
index 0000000..b8c538a
--- /dev/null
+++ b/sources/sokojs/level15.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level16.htm b/sources/sokojs/level16.htm
new file mode 100644
index 0000000..83d8596
--- /dev/null
+++ b/sources/sokojs/level16.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level17.htm b/sources/sokojs/level17.htm
new file mode 100644
index 0000000..0adbd63
--- /dev/null
+++ b/sources/sokojs/level17.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level18.htm b/sources/sokojs/level18.htm
new file mode 100644
index 0000000..08bad32
--- /dev/null
+++ b/sources/sokojs/level18.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level19.htm b/sources/sokojs/level19.htm
new file mode 100644
index 0000000..c72382d
--- /dev/null
+++ b/sources/sokojs/level19.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level2.htm b/sources/sokojs/level2.htm
new file mode 100644
index 0000000..402be02
--- /dev/null
+++ b/sources/sokojs/level2.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level20.htm b/sources/sokojs/level20.htm
new file mode 100644
index 0000000..1e92d02
--- /dev/null
+++ b/sources/sokojs/level20.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level21.htm b/sources/sokojs/level21.htm
new file mode 100644
index 0000000..58df076
--- /dev/null
+++ b/sources/sokojs/level21.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level22.htm b/sources/sokojs/level22.htm
new file mode 100644
index 0000000..5375d74
--- /dev/null
+++ b/sources/sokojs/level22.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level23.htm b/sources/sokojs/level23.htm
new file mode 100644
index 0000000..97a7306
--- /dev/null
+++ b/sources/sokojs/level23.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level24.htm b/sources/sokojs/level24.htm
new file mode 100644
index 0000000..2be0c65
--- /dev/null
+++ b/sources/sokojs/level24.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level25.htm b/sources/sokojs/level25.htm
new file mode 100644
index 0000000..43d3cc1
--- /dev/null
+++ b/sources/sokojs/level25.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level26.htm b/sources/sokojs/level26.htm
new file mode 100644
index 0000000..bbc5952
--- /dev/null
+++ b/sources/sokojs/level26.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level27.htm b/sources/sokojs/level27.htm
new file mode 100644
index 0000000..35e6c30
--- /dev/null
+++ b/sources/sokojs/level27.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level28.htm b/sources/sokojs/level28.htm
new file mode 100644
index 0000000..28a1c03
--- /dev/null
+++ b/sources/sokojs/level28.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level29.htm b/sources/sokojs/level29.htm
new file mode 100644
index 0000000..636df60
--- /dev/null
+++ b/sources/sokojs/level29.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level3.htm b/sources/sokojs/level3.htm
new file mode 100644
index 0000000..3e37b76
--- /dev/null
+++ b/sources/sokojs/level3.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level30.htm b/sources/sokojs/level30.htm
new file mode 100644
index 0000000..412c8ee
--- /dev/null
+++ b/sources/sokojs/level30.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level31.htm b/sources/sokojs/level31.htm
new file mode 100644
index 0000000..bfeb1f9
--- /dev/null
+++ b/sources/sokojs/level31.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level32.htm b/sources/sokojs/level32.htm
new file mode 100644
index 0000000..0418db0
--- /dev/null
+++ b/sources/sokojs/level32.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level33.htm b/sources/sokojs/level33.htm
new file mode 100644
index 0000000..9129366
--- /dev/null
+++ b/sources/sokojs/level33.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level34.htm b/sources/sokojs/level34.htm
new file mode 100644
index 0000000..9dc1685
--- /dev/null
+++ b/sources/sokojs/level34.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level35.htm b/sources/sokojs/level35.htm
new file mode 100644
index 0000000..4e15db7
--- /dev/null
+++ b/sources/sokojs/level35.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level36.htm b/sources/sokojs/level36.htm
new file mode 100644
index 0000000..9241325
--- /dev/null
+++ b/sources/sokojs/level36.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level37.htm b/sources/sokojs/level37.htm
new file mode 100644
index 0000000..67034f6
--- /dev/null
+++ b/sources/sokojs/level37.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level38.htm b/sources/sokojs/level38.htm
new file mode 100644
index 0000000..08442e1
--- /dev/null
+++ b/sources/sokojs/level38.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level39.htm b/sources/sokojs/level39.htm
new file mode 100644
index 0000000..24c57de
--- /dev/null
+++ b/sources/sokojs/level39.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level4.htm b/sources/sokojs/level4.htm
new file mode 100644
index 0000000..749697b
--- /dev/null
+++ b/sources/sokojs/level4.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level40.htm b/sources/sokojs/level40.htm
new file mode 100644
index 0000000..975f192
--- /dev/null
+++ b/sources/sokojs/level40.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level41.htm b/sources/sokojs/level41.htm
new file mode 100644
index 0000000..78bda53
--- /dev/null
+++ b/sources/sokojs/level41.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level42.htm b/sources/sokojs/level42.htm
new file mode 100644
index 0000000..0971579
--- /dev/null
+++ b/sources/sokojs/level42.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level43.htm b/sources/sokojs/level43.htm
new file mode 100644
index 0000000..9c974dc
--- /dev/null
+++ b/sources/sokojs/level43.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level44.htm b/sources/sokojs/level44.htm
new file mode 100644
index 0000000..899d082
--- /dev/null
+++ b/sources/sokojs/level44.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level45.htm b/sources/sokojs/level45.htm
new file mode 100644
index 0000000..4ef41d4
--- /dev/null
+++ b/sources/sokojs/level45.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level46.htm b/sources/sokojs/level46.htm
new file mode 100644
index 0000000..a932330
--- /dev/null
+++ b/sources/sokojs/level46.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level47.htm b/sources/sokojs/level47.htm
new file mode 100644
index 0000000..2acceac
--- /dev/null
+++ b/sources/sokojs/level47.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level48.htm b/sources/sokojs/level48.htm
new file mode 100644
index 0000000..982f61f
--- /dev/null
+++ b/sources/sokojs/level48.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level49.htm b/sources/sokojs/level49.htm
new file mode 100644
index 0000000..7cb81df
--- /dev/null
+++ b/sources/sokojs/level49.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level5.htm b/sources/sokojs/level5.htm
new file mode 100644
index 0000000..87c7b65
--- /dev/null
+++ b/sources/sokojs/level5.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level50.htm b/sources/sokojs/level50.htm
new file mode 100644
index 0000000..551f42d
--- /dev/null
+++ b/sources/sokojs/level50.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level51.htm b/sources/sokojs/level51.htm
new file mode 100644
index 0000000..3c33cdf
--- /dev/null
+++ b/sources/sokojs/level51.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level52.htm b/sources/sokojs/level52.htm
new file mode 100644
index 0000000..016acd9
--- /dev/null
+++ b/sources/sokojs/level52.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level53.htm b/sources/sokojs/level53.htm
new file mode 100644
index 0000000..5282c77
--- /dev/null
+++ b/sources/sokojs/level53.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level54.htm b/sources/sokojs/level54.htm
new file mode 100644
index 0000000..a162a78
--- /dev/null
+++ b/sources/sokojs/level54.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level55.htm b/sources/sokojs/level55.htm
new file mode 100644
index 0000000..6583873
--- /dev/null
+++ b/sources/sokojs/level55.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level56.htm b/sources/sokojs/level56.htm
new file mode 100644
index 0000000..ec8072c
--- /dev/null
+++ b/sources/sokojs/level56.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level57.htm b/sources/sokojs/level57.htm
new file mode 100644
index 0000000..84f7b4c
--- /dev/null
+++ b/sources/sokojs/level57.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level58.htm b/sources/sokojs/level58.htm
new file mode 100644
index 0000000..7992e53
--- /dev/null
+++ b/sources/sokojs/level58.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level59.htm b/sources/sokojs/level59.htm
new file mode 100644
index 0000000..46d1453
--- /dev/null
+++ b/sources/sokojs/level59.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level6.htm b/sources/sokojs/level6.htm
new file mode 100644
index 0000000..1f8fcc3
--- /dev/null
+++ b/sources/sokojs/level6.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level60.htm b/sources/sokojs/level60.htm
new file mode 100644
index 0000000..e971b92
--- /dev/null
+++ b/sources/sokojs/level60.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level61.htm b/sources/sokojs/level61.htm
new file mode 100644
index 0000000..64264e6
--- /dev/null
+++ b/sources/sokojs/level61.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level62.htm b/sources/sokojs/level62.htm
new file mode 100644
index 0000000..56482e4
--- /dev/null
+++ b/sources/sokojs/level62.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level63.htm b/sources/sokojs/level63.htm
new file mode 100644
index 0000000..ad42453
--- /dev/null
+++ b/sources/sokojs/level63.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level64.htm b/sources/sokojs/level64.htm
new file mode 100644
index 0000000..193a6a8
--- /dev/null
+++ b/sources/sokojs/level64.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level65.htm b/sources/sokojs/level65.htm
new file mode 100644
index 0000000..07ce905
--- /dev/null
+++ b/sources/sokojs/level65.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level66.htm b/sources/sokojs/level66.htm
new file mode 100644
index 0000000..d8c51d2
--- /dev/null
+++ b/sources/sokojs/level66.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level67.htm b/sources/sokojs/level67.htm
new file mode 100644
index 0000000..d05dfa3
--- /dev/null
+++ b/sources/sokojs/level67.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level68.htm b/sources/sokojs/level68.htm
new file mode 100644
index 0000000..7d92356
--- /dev/null
+++ b/sources/sokojs/level68.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level69.htm b/sources/sokojs/level69.htm
new file mode 100644
index 0000000..7499f12
--- /dev/null
+++ b/sources/sokojs/level69.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level7.htm b/sources/sokojs/level7.htm
new file mode 100644
index 0000000..419e9f7
--- /dev/null
+++ b/sources/sokojs/level7.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level70.htm b/sources/sokojs/level70.htm
new file mode 100644
index 0000000..7d04199
--- /dev/null
+++ b/sources/sokojs/level70.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level71.htm b/sources/sokojs/level71.htm
new file mode 100644
index 0000000..cb50cd0
--- /dev/null
+++ b/sources/sokojs/level71.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level72.htm b/sources/sokojs/level72.htm
new file mode 100644
index 0000000..8af5103
--- /dev/null
+++ b/sources/sokojs/level72.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level73.htm b/sources/sokojs/level73.htm
new file mode 100644
index 0000000..ce4e52e
--- /dev/null
+++ b/sources/sokojs/level73.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level74.htm b/sources/sokojs/level74.htm
new file mode 100644
index 0000000..29bf873
--- /dev/null
+++ b/sources/sokojs/level74.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level75.htm b/sources/sokojs/level75.htm
new file mode 100644
index 0000000..572cce3
--- /dev/null
+++ b/sources/sokojs/level75.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level76.htm b/sources/sokojs/level76.htm
new file mode 100644
index 0000000..988c458
--- /dev/null
+++ b/sources/sokojs/level76.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level77.htm b/sources/sokojs/level77.htm
new file mode 100644
index 0000000..9fa83dc
--- /dev/null
+++ b/sources/sokojs/level77.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level78.htm b/sources/sokojs/level78.htm
new file mode 100644
index 0000000..3b5962e
--- /dev/null
+++ b/sources/sokojs/level78.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level79.htm b/sources/sokojs/level79.htm
new file mode 100644
index 0000000..0469a1a
--- /dev/null
+++ b/sources/sokojs/level79.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level8.htm b/sources/sokojs/level8.htm
new file mode 100644
index 0000000..c1bfe0f
--- /dev/null
+++ b/sources/sokojs/level8.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level80.htm b/sources/sokojs/level80.htm
new file mode 100644
index 0000000..3dbd90d
--- /dev/null
+++ b/sources/sokojs/level80.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level81.htm b/sources/sokojs/level81.htm
new file mode 100644
index 0000000..ce1f664
--- /dev/null
+++ b/sources/sokojs/level81.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level82.htm b/sources/sokojs/level82.htm
new file mode 100644
index 0000000..cde2b2d
--- /dev/null
+++ b/sources/sokojs/level82.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level83.htm b/sources/sokojs/level83.htm
new file mode 100644
index 0000000..441d6f9
--- /dev/null
+++ b/sources/sokojs/level83.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level84.htm b/sources/sokojs/level84.htm
new file mode 100644
index 0000000..b16d7b5
--- /dev/null
+++ b/sources/sokojs/level84.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level85.htm b/sources/sokojs/level85.htm
new file mode 100644
index 0000000..bf8c5cc
--- /dev/null
+++ b/sources/sokojs/level85.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level86.htm b/sources/sokojs/level86.htm
new file mode 100644
index 0000000..6d45fe8
--- /dev/null
+++ b/sources/sokojs/level86.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level87.htm b/sources/sokojs/level87.htm
new file mode 100644
index 0000000..b337667
--- /dev/null
+++ b/sources/sokojs/level87.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level88.htm b/sources/sokojs/level88.htm
new file mode 100644
index 0000000..a3d59f2
--- /dev/null
+++ b/sources/sokojs/level88.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level89.htm b/sources/sokojs/level89.htm
new file mode 100644
index 0000000..d807fd0
--- /dev/null
+++ b/sources/sokojs/level89.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level9.htm b/sources/sokojs/level9.htm
new file mode 100644
index 0000000..eb17a4b
--- /dev/null
+++ b/sources/sokojs/level9.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level90.htm b/sources/sokojs/level90.htm
new file mode 100644
index 0000000..8c2e2ca
--- /dev/null
+++ b/sources/sokojs/level90.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level91.htm b/sources/sokojs/level91.htm
new file mode 100644
index 0000000..5497446
--- /dev/null
+++ b/sources/sokojs/level91.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level92.htm b/sources/sokojs/level92.htm
new file mode 100644
index 0000000..76ef51b
--- /dev/null
+++ b/sources/sokojs/level92.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level93.htm b/sources/sokojs/level93.htm
new file mode 100644
index 0000000..e058f8a
--- /dev/null
+++ b/sources/sokojs/level93.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level94.htm b/sources/sokojs/level94.htm
new file mode 100644
index 0000000..9ac9602
--- /dev/null
+++ b/sources/sokojs/level94.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level95.htm b/sources/sokojs/level95.htm
new file mode 100644
index 0000000..4409745
--- /dev/null
+++ b/sources/sokojs/level95.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level96.htm b/sources/sokojs/level96.htm
new file mode 100644
index 0000000..51bfae9
--- /dev/null
+++ b/sources/sokojs/level96.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/level97.htm b/sources/sokojs/level97.htm
new file mode 100644
index 0000000..00483b9
--- /dev/null
+++ b/sources/sokojs/level97.htm
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
diff --git a/sources/sokojs/lisezmoi.txt b/sources/sokojs/lisezmoi.txt
new file mode 100644
index 0000000..703057d
--- /dev/null
+++ b/sources/sokojs/lisezmoi.txt
@@ -0,0 +1,82 @@
+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+Fichier lisezmoi.txt du jeu Boxworld (Sokoban) pour Javascript.
+Copyright (C) Michel BUZE 1998-2005
+e-mail : michbuze@club-internet.fr site web : http://michbuze.club.fr
+article sur Sokoban sur Wikipedia (Encyclopdie libre) :
+http://fr.wikipedia.org/wiki/Sokoban
+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+
+Pour jouer ce jeu, il vous faut un navigateur web, tel que Internet Explorer,
+(Mozilla) Firefox, Google Chrome, Opera, Apple Safari, ou autre, capable d'afficher des cadres (frames),
+d'interprter le Javascript, et (si possible) d'afficher des images GIF.
+
+Il n'est pas ncessaire d'tre connect Internet pour jouer.
+Si on est connect, il suffit d'ouvrir la page : http://michbuze.club.fr/Boxworld/sokojs.htm
+
+Sinon, pour lancer le jeu, il faut (la premire fois) extraire tous les fichiers du
+fichier archive sokojs.zip, puis ouvrir le fichier "sokojs.htm" avec votre navigateur.
+
+Les fichiers GIF sont les images utilises par le jeu, et les fichiers main.htm,
+level.htm et leveln.htm (n=0 97) sont ncessaires au jeu.
+Si on ouvre ces fichiers .htm, ils afficheront la place le fichier "sokojs.htm".
+
+Le fichier src.htm peut tre ouvert pour afficher plus d'informations,
+il n'est pas ncessaire pour le jeu, ni ce fichier lisezmoi.txt
+
+Remarque : En rsolution 800*600 avec Internet Explorer, il vaut mieux aller
+dans le menu "Affichage" et dcocher "Barre d'tat".
+
+Programmation Copyright (C) Michel BUZE (licence GPL)
+Graphismes et Niveaux Copyright (C) Jeng Long Jiang
+
+Ce programme est un logiciel libre :
+vous pouvez le redistribuer et/ou le modifier selon les termes de la GPL
+("GNU General Public License"), version 2 ou ( votre choix) toute version ultrieure.
+
+Voir (en anglais) : http://www.gnu.org/licenses/gpl.html
+Voir (en franais) : http://www.gnu.org/copyleft/copyleft.fr.html
+
+Vous pouvez distribuer l'archive qui vous voulez, sans tre oblig de m'en informer,
+conformment la licence GPL.
+(Par exemple, vous ne devez pas supprimer des fichiers et conserver la licence).
+Vous pouvez galement inclure ce jeu dans un autre site web,
+toujours sans tre oblig de m'en informer.
+Merci tout de mme de me contacter par email l'adresse michbuze@club-internet.fr
+si vous avez des critiques (bonnes ou mauvaises) formuler, si vous avez traduit,
+amlior, rcrit ce jeu dans un autre langage (ou que vous souhaiteriez le faire).
+
+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Rgles du Jeu @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+
+Vous dplacez (vers le haut, le bas, gauche ou droite) un personnage dans une
+pice divise en cases carres qui comportent des murs et des caisses que vous
+devez pousser vers des zones de rangement (reprsentes ici par des boules jaunes).
+Un dplacement n'est possible que si la case de destination est vide
+(cest--dire qu'il ne s'agit ni d'un mur, ni d'une caisse;
+en revanche, il peut s'agir d'une zone de rangement).
+Si cette case contient une caisse et que la suivante est vide,
+le mouvement est aussi autoris : vous poussez alors la caisse dans la case vide
+(qui peut tre une zone de rangement) et venez prendre sa place.
+Un niveau est rsolu ds que toutes les caisses sont ranges
+(ici, les caisses jaunes deviennent rouges quand elles sont ranges).
+Russir est un vrai casse-tte (les deux premiers niveaux sont hyper simples
+pour vous familiariser, partir du niveau 3, c'est moins vident...)
+L'idal est d'essayer de russir avec le moins de dplacements !
+
+Certaines pousses de caisses peuvent conduire une situation o il est impossible
+de russir le niveau, mais a le jeu ne vous le dit pas, c'est vous de vous en
+rendre compte, vous n'avez plus qu' recommencer.
+
+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+Remarques sur le fichier archive sokojs.zip
+contenant l'ensemble des fichiers qui constituent le jeu
+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+
+Pour l'utiliser, vous devez extraire TOUS les fichiers dans un rpertoire,
+plus ouvrir le fichier "sokojs.htm" avec votre navigateur.
+Il vous faut un logiciel de dcompression zip.
+Pour Windows, on trouvera sur le site http://izarc.free.fr
+le logiciel izarc pour le faire (il est gratuit et en franais).
+Vous pouvez aussi consulter ma page d'informations sur les formats d'archive :
+http://michbuze.club.fr/123/compress.htm (ou http://zip.c.la)
\ No newline at end of file
diff --git a/sources/sokojs/main.htm b/sources/sokojs/main.htm
new file mode 100644
index 0000000..884b695
--- /dev/null
+++ b/sources/sokojs/main.htm
@@ -0,0 +1,231 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sources/sokojs/sokojs.htm b/sources/sokojs/sokojs.htm
new file mode 100644
index 0000000..9268780
--- /dev/null
+++ b/sources/sokojs/sokojs.htm
@@ -0,0 +1,39 @@
+
+
+
+
+Sokoban Online Boxworld Jeu Gratuit Freeware Game DHTML ( HTML + Javascript ) (C) Michel Buze
+
+
+
+
+
+
+
+
+
+
+Dsol, votre navigateur doit supporter les cadres (frames)
+
+
+
+
diff --git a/sources/sokojs/src.htm b/sources/sokojs/src.htm
new file mode 100644
index 0000000..35610c0
--- /dev/null
+++ b/sources/sokojs/src.htm
@@ -0,0 +1,538 @@
+
+
+
+Sokoban Source Code Source Boxworld Javascript Jeu Video Gratuit Free Web Game
+Codes Sources GPL Freeware
+
+
+
+
+
+
+
+
+
+
+Rgles du Jeu :
+
+
+Vous tes Sokoban , enferm
+dans un entrepot (divis en cases carres),
+vous vous dplacez de case en case (vers le haut , le bas , la gauche
+ou la droite ;
+avec les flches du clavier ou la souris).
+Une case
+peut comporter un mur , une caisse , ou une zone de rangement pour caisses
+(boule jaune) .
+Un dplacement n'est possible que si la case de destination est vide
+(cest--dire qu'il ne s'agit ni d'un mur, ni d'une caisse;
+en revanche, il peut s'agir d'une zone de rangement).
+Si cette case contient une caisse et que la suivante (dans la mme direction)
+est vide (ou une zone de rangement), le mouvement est aussi autoris :
+vous poussez alors la caisse dans la case vide
+et venez prendre sa place.
+Avant :
+Aprs :
+
+
+Un niveau est rsolu ds que toutes les caisses sont ranges
+(une caisse jaune devient rouge quand elle est range).
+Russir est un vrai casse-tte (les deux premiers niveaux sont hyper simples
+pour vous familiariser, partir du niveau 3, c'est moins vident...)
+L'idal est d'essayer de russir avec le moins de dplacements et
+de pousses !
+
+
+(Remarque : les rgles ne permettent pas de tirer une caisse !).
+
+On ne tire pas : Avant : Aprs :
+Si on pouvait : Avant : Aprs :
+
+
+
+ : une case vide
+ : un mur
+ : une caisse
+ : une caisse range
+ : une zone de rangement
+ : le personnage Sokoban (profession : magasinier)
+
+
+
+Historique :
+
+Le Sokoban original a t crit par le japonais Hiroyuki Imabayashi
+en 1982
+pour l'ordinateur Nec PC-8801
+et comportait 50 niveaux.
+En 1988, il sera adapt pour PC.
+En 1991, Jeng Long Jiang propose Boxworld, une autre version pour PC,
+avec 100 niveaux diffrents de Sokoban, et qui a t trs populaire.
+Le code source n'est pas disponible, mais on trouve la description
+des niveaux ici (remarque : il manque les niveaux 61 et 62, apparemment impossibles) :
+
+
+http://games.knet.ca/modules/pnFlashGames/games/boxesLevels
+
+J'ai commenc crire cette version JAVASCRIPT en Janvier 1998.
+Elle a t jour en Janvier 2005 (utilisation du clavier,
+criture de cette page d'aide, 30 niveaux au lieu de 5...)
+puis mai 2006 (98 niveaux).
+
+
+L'encyclopdie wikipedia propose un article ce sujet : http://fr.wikipedia.org/wiki/Sokoban
+(vous pouvez le modifier !)
+
+
+Sources :
+[ sokojs.htm ]
+[ main.htm ]
+[ level.htm]
+[ level1.htm ]
+
+
+
+Remarques sur le fichier archive
+sokojs.zip
+contenant l'ensemble des fichiers qui constituent le jeu
+- Pour l'utiliser, vous devez extraire tous les fichiers dans un rpertoire,
+plus ouvrir le fichier "sokojs.htm" avec votre navigateur.
+Il vous faut un logiciel de dcompression zip.
+Pour Windows, on trouvera sur le site
+http://izarc.free.fr
+le logiciel izarc pour le faire (il est gratuit et en franais).
+Vous pouvez aussi consulter ma page d'informations sur les formats d'archive :
+
+http://michbuze.club-internet.fr/123/compress.htm (ou http://zip.c.la)
+- Il n'est pas ncessaire d'tre connect Internet pour jouer.
+- Les fichiers GIF sont les images utilises par le jeu, et les
+autres fichiers .htm utiliss par le
+fichier "sokojs.htm", mais ils ne sont prvus pour tre ouverts
+directement par un navigateur.
+- Vous pouvez distribuer l'archive qui vous voulez,
+sans tre oblig de m'en informer,
+conformment la licence GPL.
+(Par exemple, vous ne devez pas supprimer des fichiers et conserver
+la licence).
+Vous pouvez galement inclure ce jeu dans un autre site web,
+toujours sans tre oblig de m'en informer.
+- Merci tout de mme de
+
+me contacter par email l'adresse
+michbuze@club-internet.fr
+si vous avez des critiques (bonnes ou mauvaises)
+ formuler, si vous avez traduit, amlior, rcrit ce jeu dans un autre langage
+(ou que vous souhaiteriez le faire).
+
+
+Remarques sur le code :
+* Plutt que d'utiliser le cadre level.htm pour afficher le niveau,
+il suffirait d'utiliser le code HTML :
+<div id="level">n</div>
+et cette ligne de Javascript :
+document.getElementById("level").firstChild.nodeValue = level
+(mais a ne fonctionne pas avec les anciens navigateurs).
+
+
+Licence :
+Boxworld (Sokoban) - Puzzle Game
+Programmation Copyright (C) Michel BUZE (licence GPL)
+Graphismes et Niveaux Copyright (C) Jeng Long Jiang
+
+
+Ce programme est un logiciel libre: vous pouvez le redistribuer
+et/ou le modifier selon les termes de la "GNU General Public License",
+version 2 ou ( votre choix) toute version ultrieure.
+
+
+Voir (en anglais) : http://www.gnu.org/licenses/gpl.html
+
+
+Voir (en franais) : http://www.gnu.org/copyleft/copyleft.fr.html
+
+
+Liens vers d'autres jeux en Javascript :
+
+
+
+
+
+
+
+<html>
+<head>
+<TITLE>Sokoban Online Boxworld Jeu Gratuit Freeware Game DHTML ( HTML + Javascript )
+(C) Michel Buze</TITLE>
+<META HTTP-EQUIV="Keywords" CONTENT="boxworld,javascript,sokoban,jeu,jeux,game,buze,web">
+<META NAME="Keywords" CONTENT="boxworld,javascript,sokoban,jeu,jeux,game,buze,web">
+</head>
+
+<frameset noresize border="0" rows="0,*,70">
+<frame src="level1.htm">
+<frame>
+<frame>
+<noframes>
+<body>
+Dsol, votre navigateur doit supporter les cadres (frames)
+</body>
+</noframes>
+</frameset>
+</html>
+
+
+
+
+
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+<head>
+<title></title>
+
+<script type="text/javascript">
+<!--
+if (parent.frames[0] == null) { document.location = "sokojs.htm" }
+//-->
+</script>
+
+<script type="text/javascript">
+<!--
+
+var ie4= (navigator.appName == "Microsoft Internet Explorer")?1:0;
+var ns4= (navigator.appName=="Netscape")?1:0;
+function Nmajevent(evenement)
+{
+ if (evenement.which == 52 || evenement.which == 37) {
+ Move(eval(manpos) - 1)
+ } else if (evenement.which == 56 || evenement.which == 38) {
+ Move(eval(manpos) - 10)
+ } else if (evenement.which == 54 || evenement.which == 39) {
+ Move(eval(manpos) + 1)
+ } else if (evenement.which == 50 || evenement.which == 40) {
+ Move(eval(manpos) + 10)
+ }
+}
+
+function eventSetup() {
+ if (ie4){
+ document.onkeydown = Imajevent;
+ }
+ if(ns4){
+ document.captureEvents( Event.KEYDOWN );
+ document.onkeydown = Nmajevent;
+ }
+}
+
+eventSetup();
+
+function Imajevent(){
+ if (window.event.keyCode == 37) {
+ Move(eval(manpos) - 1)
+ } else if (window.event.keyCode == 38) {
+ Move(eval(manpos) - 10)
+ } else if (window.event.keyCode == 39) {
+ Move(eval(manpos) + 1)
+ } else if (window.event.keyCode == 40) {
+ Move(eval(manpos) + 10)
+ } else if (window.event.keyCode == 27) {
+ UndoMove()
+ }
+}
+//-->
+</script>
+
+</head>
+<body bgcolor="black" style="margin:0">
+
+<script type="text/javascript">
+<!--
+if (document.all) {
+ top.window.resizeTo(400, 600);
+} else if (document.layers || document.getElementById) {
+ top.window.outerWidth = 350;
+ top.window.outerHeight = 600;
+}
+
+Row = 10
+Col = 10
+
+land = 0
+floor = 1
+wall = 2
+boxin = 3
+boxout = 4
+dest = 5
+
+img0 = new Image(30, 30); img0.src = "0.gif";
+img1 = new Image(30, 30); img1.src = "1.gif";
+img2 = new Image(30, 30); img2.src = "2.gif";
+img3 = new Image(30, 30); img3.src = "3.gif";
+img4 = new Image(30, 30); img4.src = "4.gif";
+img5 = new Image(30, 30); img5.src = "5.gif";
+
+man9 = new Image(30, 30); man9.src = "6.gif"; // left
+man11 = new Image(30, 30); man11.src = "7.gif"; // right
+man0 = new Image(30, 30); man0.src = "8.gif"; // up
+man20 = new Image(30, 30); man20.src = "9.gif"; // down
+
+level = new Array()
+maxLevel = 30
+moves = 0
+
+
+function ReloadLevel() {
+ manpos = parent.frames[0].document.forms[0].elements[100].value
+ ua = -1
+ moves = 0
+ nbBoxin = 0
+ for (i = 0 ; i < Row * Col; i++) {
+ level[i] = parent.frames[0].document.forms[0].elements[i].value
+ if (level[i] == dest) nbBoxin++;
+ document.images[i].src = eval("img" + level[i] + ".src")
+ }
+ document.images[manpos].src = eval("man20.src")
+ window.status = "Your moves : 0"
+
+ usrc = man20.src
+}
+
+function GoLevel(n) {
+ if (n == nbLevel) ReloadLevel()
+ parent.frames[0].document.location = "level" + n + ".htm"
+}
+
+function UndoMove() {
+ if (ua != -1) {
+ document.images[manpos].src = eval("img" + level[manpos] + ".src")
+ document.images[ua].src = eval("img" + lua + ".src")
+ document.images[ub].src = eval("img" + lub + ".src")
+ level[ua] = lua
+ level[ub] = lub
+ level[um] = lum
+ document.images[manpos = um].src = usrc
+ nbBoxin = unb
+ window.status = "Your moves : " + --moves
+ ua = -1
+ }
+}
+
+function Move(a) {
+ d = a - manpos
+
+ if (d == 1 || d == -1 || d == Col || d == -Col) {
+ if (level[a] == boxin || level[a] == boxout) {
+ b = a + d
+ um = manpos
+ ua = a
+ ub = b
+ lum = level[manpos]
+ lua = level[a]
+ lub = level[b]
+ usrc = document.images[manpos].src
+ unb = nbBoxin
+ window.status = "Your moves : " + ++moves
+ if (level[b] == floor || level[b] == dest) {
+ level[a] == boxin ? (level[a] = dest, nbBoxin++) : level[a] = floor
+ level[b] == dest ? (level[b] = boxin, nbBoxin--) : level[b] = boxout
+ document.images[b].src = eval("img" + level[b] + ".src")
+ }
+ }
+
+ if (level[a] == floor || level[a] == dest) {
+ document.images[manpos].src = eval("img" + level[manpos] + ".src")
+ document.images[manpos = a].src = eval("man" + (d + 10) + ".src")
+ }
+
+ if (nbBoxin == 0) {
+ if (nbLevel < maxLevel) {
+ alert("You have done a good job !")
+ parent.frames[0].location = "level" + (++nbLevel) + ".htm"
+ GoLevel(nbLevel)
+ } else {
+ alert("Congratulations !")
+ GoLevel(1)
+ }
+ }
+ }
+}
+ window.focus()
+ window.status = ""
+
+ document.write("<TABLE cellspacing=\"0\" cellpadding=\"0\" border=0><TR><TD VALIGN=TOP>")
+ document.write("<TABLE cellspacing=\"0\" cellpadding=\"0\" border=0><TR>")
+
+ nbBoxin = 0
+
+ for (y = 0 ; y < Row; y++) {
+ document.write ("<TR>")
+ for (x = 0; x < Col; x++) {
+ level[x + Row * y] = parent.frames[0].document.forms[0].elements[x + Row * y].value
+ if (level[x + Row * y] == dest) nbBoxin++
+ if (level[x + Row * y] == land || level[x + Row * y] == wall)
+ document.write("<TD VALIGN=TOP>",
+ "<IMG align=middle width=\"30\" heigth=\"30\" border=0 src=\"", level[x + Row * y], ".gif\"<\/TD>")
+ else
+ document.write("<TD VALIGN=TOP><A HREF=\"JavaScript:Move(", x + Row * y, ")\">",
+ "<IMG align=middle width=\"30\" heigth=\"30\" border=0 src=\"", level[x + Row * y], ".gif\"</A><\/TD>")
+ }
+ document.write("<\/TR>")
+ }
+
+ document.write("<\/TABLE>")
+ manpos = parent.frames[0].document.forms[0].elements[100].value
+ nbLevel = parent.frames[0].document.forms[0].elements[101].value
+ ua = -1
+
+ document.write("<TABLE><TD><CENTER>")
+
+ document.write("<FORM>",
+ "<INPUT TYPE=button onClick=\"Javascript:ReloadLevel();\" value=\"Restart\">",
+ "<INPUT TYPE=button onClick=\"Javascript:UndoMove();\" value=\"Undo\">")
+ for (i = 1; i <= maxLevel; i++) {
+ if (i % 16 == 0) document.write("<br>")
+ document.write("<INPUT TYPE=\"button\" onClick=\"Javascript:GoLevel(", i, ");\" value=\"", i, "\">")
+ }
+
+ document.write("<\/FORM><\/TD><\/TR><\/TABLE><\/TD><\/TR><\/TABLE>")
+
+ document.images[manpos].src = eval("man20.src")
+//-->
+</script>
+
+</body>
+</html>
+
+
+
+
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+<head>
+<title></title>
+<script type="text/javascript">
+<!--
+if (parent.frames[0] == null) { document.location = "sokojs.htm" }
+
+document.write("<body margin=0 bgcolor=\"black\"><b><FONT FACE=\"Comic Sans MS\"
+ SIZE=5 COLOR=\"red\">LEVEL ",
+ parent.frames[0].document.forms[0].elements[101].value, "<\/font><\/b>");
+
+document.write(" <a style=\"color:#eeeeee;font-face:arial;\"
+href=\"http://michel.buze.perso.neuf.fr/sokojs.zip\">[zip]<\/a>",
+
+" <a target=\"src\" style=\"color:#eeeeee;font-face:arial;\"
+href=\"src.htm\">[info]<\/a>")
+
+//-->
+</script>
+</head>
+</html>
+
+
+
+
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<html>
+<head>
+<title></title>
+</head>
+<body>
+<form action="">
+<script type="text/javascript">
+<!--
+if (parent.frames[0] == null) { document.location = "sokojs.htm" }
+
+l = new Array(
+//123456789
+" ", // 0 # = wall
+" ### ", // 1 . = dest
+" #.# ", // 2 _ = floor
+" #_#### ", // 3 * = boxin
+" ###$_$.# ", // 4 $ = boxout
+" #._$_### ", // 5
+" ####$# ", // 6
+" #.# ", // 7
+" ### ", // 8
+" ") // 9
+//123456789
+
+for (x = 0; x < 10; x++)
+ for (y = 0; y < 10; y++)
+ document.write("<INPUT TYPE=\"button\" value=\"",
+ ' _#*$.'.indexOf(l[x].substring(y, y + 1)), "\">")
+
+document.write("<INPUT TYPE=\"button\" value=\"55\">",
+ "<INPUT TYPE=\"button\" value=\"1\"><\/FORM>")
+
+parent.frames[1].location = "main.htm"
+parent.frames[2].location = "level.htm"
+//-->
+</script></form>
+</body>
+</html>
+
+
+
\ No newline at end of file
diff --git a/sources/solitaire/custom.js b/sources/solitaire/custom.js
new file mode 100644
index 0000000..d5e9ae6
--- /dev/null
+++ b/sources/solitaire/custom.js
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2011 Emin KURA (http://eminkura.com)
+ *
+ * Licensed under the MIT (http://eminkura.com/license.html) license.
+ */
+var game = null;
+var gameSize = 500;
+
+window.onload = function(){
+ init();
+}
+
+window.onclick = function(event){
+ var x = event.pageX;
+ var y = event.pageY;
+ // alert(event.pageX + " "+event.pageY);
+ game.onclick(x,y);
+}
+
+window.onmousemove = function(event){
+ var x = event.pageX;
+ var y = event.pageY;
+ // alert(event.pageX + " "+event.pageY);
+ game.onmouseout(x,y);
+ game.onmouseover(x,y);
+}
+
+
+function init(){
+ game = new GameCanvas(gameSize,gameSize);
+ game.bgColor = "#fffa99";
+ game.drawBackground();
+ game.update();
+
+ initHtml();
+
+}
+
+function resetGame(){
+ game.clear();
+ game = new GameCanvas(gameSize,gameSize);
+ game.bgColor = "#fffa99";
+ game.drawBackground();
+ game.update();
+}
+
+function initHtml(){
+
+ var infoDiv = document.getElementById("info");
+ infoDiv.style.position ="fixed ";
+ infoDiv.style.top = "20px";
+ infoDiv.style.right = "20px";
+
+ document.body.appendChild(infoDiv);
+ var size = document.getElementById("size");
+ size.style.outline = "none";
+ size.onchange = function(){
+ if(size.value > 1000){
+ if(window.confirm("This size can cause to some performance issues. Do you want to continue?")){
+ gameSize = size.value;
+ resetGame();
+ }
+
+ }else{
+ gameSize = size.value;
+ resetGame();
+ }
+ }
+
+}
+
+
+
+
diff --git a/sources/solitaire/game.compressed.js b/sources/solitaire/game.compressed.js
new file mode 100644
index 0000000..74476c7
--- /dev/null
+++ b/sources/solitaire/game.compressed.js
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2011 Emin KURA (http://eminkura.com)
+ *
+ * Licensed under the MIT (http://eminkura.com/license.html) license.
+ */
+function GameCanvas(j,k){this.width=j;this.height=k;this.bgColor="#f00";this.canvas=new Raphael(0,0,this.width+100,this.height+100);this.gameArray=[[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[1,1,1,1,1,1,1],[1,1,1,2,1,1,1],[1,1,1,1,1,1,1],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0]];this.deckArray=null;GameCanvas.prototype.init=function(){this.deckArray=[];var b=this.width/14-2,d,e;d=b+20;e=b+20;for(var a=0;a=this.x-b&&a<=this.x+b&&c>=this.y-b&&c<=this.y+b)return!0;return!1}};
diff --git a/sources/solitaire/game.js b/sources/solitaire/game.js
new file mode 100644
index 0000000..ebf13e0
--- /dev/null
+++ b/sources/solitaire/game.js
@@ -0,0 +1,366 @@
+/*
+ * Copyright (c) 2011 Emin KURA (http://eminkura.com)
+ *
+ * Licensed under the MIT (http://eminkura.com/license.html) license.
+ */
+
+function GameCanvas (width, height) {
+
+ this.width = width ;
+ this.height = height ;
+ this.bgColor = "#f00";
+
+ this.canvas = new Raphael(0,0,this.width+100, this.height+100);
+ this.gameArray = [
+ [0,0,1,1,1,0,0],
+ [0,0,1,1,1,0,0],
+ [1,1,1,1,1,1,1],
+ [1,1,1,2,1,1,1],
+ [1,1,1,1,1,1,1],
+ [0,0,1,1,1,0,0],
+ [0,0,1,1,1,0,0]
+ ];
+
+ this.deckArray = null;
+
+ GameCanvas.prototype.init = function() {
+ this.deckArray = new Array;
+ var deckSize = this.width/14 - 2,xPos, yPos;
+ xPos = deckSize + 20;
+ yPos = deckSize + 20;
+ for(var i = 0; i < this.gameArray.length; i++) {
+ this.deckArray[i] = new Array;
+ for(var j = 0; j < this.gameArray[i].length; j++) {
+ this.deckArray[i][j] = new Deck(xPos,yPos,deckSize,this.gameArray[i][j],i,j,this.bgColor,this.canvas);
+ xPos += deckSize * 2 + 5;
+ }
+ xPos = deckSize + 20;
+ yPos += deckSize * 2 + 5 ;
+ }
+
+ }
+ GameCanvas.prototype.update = function() {
+ if(this.deckArray == null) {
+ this.init();
+ }
+ for(var i = 0; i < this.deckArray.length; i++) {
+ for(var j = 0; j < this.deckArray[i].length; j++) {
+ this.deckArray[i][j].draw();
+ }
+
+ }
+ }
+
+ GameCanvas.prototype.clear = function(){
+ this.canvas.clear();
+ }
+
+ GameCanvas.prototype.getSelected = function() {
+ for(var i = 0; i < this.deckArray.length; i++) {
+ for(var j = 0; j < this.deckArray[i].length; j++) {
+ if(this.deckArray[i][j].isSelected()) {
+ return this.deckArray[i][j];
+ }
+ }
+ }
+ return null;
+ }
+ GameCanvas.prototype.changeDecks = function(selectedI,selectedJ,removeI,removeJ,i,j) {
+ // setting array values
+ this.gameArray[selectedI][selectedJ] = 2;
+ this.gameArray[removeI][removeJ] = 2;
+ this.gameArray[i][j] = 1;
+ // setting selected state
+ this.deckArray[selectedI][selectedJ].setSelected(false);
+ this.deckArray[removeI][removeJ].setSelected(false);
+ this.deckArray[i][j].setSelected(false);
+ //setting values
+ this.deckArray[selectedI][selectedJ].setValue(2);
+ this.deckArray[removeI][removeJ].setValue(2);
+ this.deckArray[i][j].setValue(1);
+ //redraw
+ this.deckArray[selectedI][selectedJ].draw();
+ this.deckArray[removeI][removeJ].drawAnimated(this.width+150,this.width+150);
+ this.deckArray[i][j].drawAnimated(this.deckArray[selectedI][selectedJ].x,this.deckArray[selectedI][selectedJ].y);
+ }
+ GameCanvas.prototype.onmouseover = function(x,y) {
+ for(var i = 0; i < this.deckArray.length; i++) {
+ for(var j = 0; j < this.deckArray[i].length; j++) {
+ if(this.deckArray[i][j].collides(x,y)) {
+ this.deckArray[i][j].onmouseover();
+ }
+ }
+ }
+ }
+
+ GameCanvas.prototype.onmouseout = function(x,y) {
+ for(var i = 0; i < this.deckArray.length; i++) {
+ for(var j = 0; j < this.deckArray[i].length; j++) {
+ if(!this.deckArray[i][j].collides(x,y)) {
+ this.deckArray[i][j].onmouseout();
+ }
+ }
+ }
+ }
+
+ GameCanvas.prototype.onclick = function(x,y) {
+
+ var selectedDeck = this.getSelected();
+
+ for(var i = 0; i < this.deckArray.length; i++) {
+ for(var j = 0; j < this.deckArray[i].length; j++) {
+ if(this.deckArray[i][j].collides(x,y)) {
+ this.deckArray[i][j].onclick(x,y);
+ if(this.gameArray[i][j] == 2) {
+ if(selectedDeck != null) {
+ var selectedI = selectedDeck.i;
+ var selectedJ = selectedDeck.j;
+ if(selectedI == i) {
+ //vertical move
+ if((selectedJ == j - 2 || selectedJ == j + 2)) {
+
+ if(selectedJ == j-2){
+ if(this.gameArray[i][j-1] != 1){
+ return;
+ }
+ }else if(selectedJ == j + 2){
+ if(this.gameArray[i][j+1] != 1){
+ return;
+ }
+ }
+
+ //to remove deck
+ var removeI, removeJ;
+ if(selectedJ == j - 2) {
+ removeJ = j - 1;
+ removeI = i;
+ } else {
+ removeJ = j + 1;
+ removeI = i;
+ }
+ this.changeDecks(selectedI, selectedJ,removeI,removeJ,i,j);
+ }
+ } else if(selectedJ == j) {
+ //horizontal move
+ if((selectedI == i - 2 || selectedI == i + 2)){
+
+ if(selectedI == i-2){
+ if(this.gameArray[i-1][j] != 1){
+ return;
+ }
+ }else if(selectedI == i + 2){
+ if(this.gameArray[i+1][j] != 1){
+ return;
+ }
+ }
+
+ //to remove deck
+ var removeI, removeJ;
+ if(selectedI == i - 2) {
+ removeI = i - 1;
+ removeJ = j;
+ } else {
+ removeI = i + 1;
+ removeJ = j;
+ }
+ this.changeDecks(selectedI, selectedJ,removeI,removeJ,i,j);
+ }
+ }
+ }
+ }
+ } else {
+ this.deckArray[i][j].setSelected(false);
+ }
+ }
+
+ }
+ }
+ GameCanvas.prototype.drawBackground = function() {
+
+ var circle = this.canvas.circle(this.width/2 + 20, this.height/2 + 20, this.width/2 + 15);
+
+ circle.attr("fill", this.bgColor);
+
+ circle.attr("stroke", "#000000");
+ circle.attr("stroke-linecap","round");
+ circle.attr("stroke-width", 2);
+
+ }
+}
+function Deck(x,y,radius,value,i,j,bgColor,canvas) {
+ this.canvas = canvas;
+ this.x = x;
+ this.y = y;
+ this.i = i;
+ this.j = j;
+ this.bgColor = bgColor;
+ this.radius = radius;
+ this.value = value;
+ this.deckColor = "r#3C93C9-#126294";
+ this.deckColorH = "r#C46A6A-#A64444";
+ this.selected = false;
+ this.mouseover = false;
+ this.setValue = function(newValue) {
+ this.value = newValue;
+ }
+
+ this.setSelected = function(selected) {
+ if(this.value == 1 && selected != this.selected) {
+ this.selected = selected;
+ this.drawSelected();
+ }
+ }
+ this.isSelected = function() {
+ return this.selected ;
+ }
+ this.paintComponent = function(circle) {
+
+ if(this.value == 1) {
+
+ if(this.selected) {
+
+ circle.attr("stroke", "#19191A");
+ circle.attr("stroke-linecap","round");
+ circle.attr("stroke-width",2);
+ circle.attr("fill", this.deckColorH);
+
+ } else {
+ circle.attr("stroke", "#19191A");
+ circle.attr("fill", this.deckColor);
+ circle.attr("stroke-linecap","round");
+ circle.attr("stroke-width",2);
+
+ }
+ } else if (this.value == 2) {
+ var tempCircle = this.canvas.circle(this.x, this.y, this.radius);
+ tempCircle.attr("fill",this.bgColor);
+ circle = this.canvas.circle(this.x, this.y, this.radius);
+ circle.attr("stroke", "#000000");
+ circle.attr("stroke-linecap","round");
+ circle.attr("stroke-width",1);
+ circle.attr("fill", "#000000");
+ circle.attr("opacity",0.2);
+
+ }
+ }
+ this.draw = function() {
+ if(this.value != 0) {
+ var circle = this.canvas.circle(this.x, this.y, this.radius);
+
+ this.paintComponent(circle);
+ }
+ }
+
+ this.drawSelected = function() {
+ if(this.value != 0) {
+ var circle = this.canvas.circle(this.x, this.y, this.radius);
+
+ this.paintComponent(circle);
+
+ // if(this.selected) {
+ // circle.attr("fill",this.deckColor);
+ // circle.animate({
+ // fill: this.deckColorH,
+ // stroke: "#19191A"
+ // },500);
+ //
+ // } else {
+ // circle.attr("fill",this.deckColorH);
+ // circle.animate({
+ // fill: this.deckColor,
+ // stroke: "#19191A"
+ // },500);
+ // }
+ }
+ }
+
+ this.drawOver = function(over) {
+
+ if(this.value == 0)
+ return;
+
+ var circle = this.canvas.circle(this.x, this.y, this.radius);
+
+ this.paintComponent(circle);
+
+ if(this.value == 1) {
+
+ if(!this.selected) {
+ if(over) {
+ circle.animate({
+ stroke: "#FFFFFF"
+ },200);
+ } else {
+ circle.animate({
+ stroke: "#19191A"
+ },200);
+ }
+ }
+ }
+
+ }
+
+ this.drawAnimated = function(x,y) {
+ var circle = null;
+ if(this.value == 1) {
+ circle = this.canvas.circle(x, y, this.radius);
+ this.paintComponent(circle);
+
+ circle.toFront(); // draw on top of the screen
+
+ circle.animate({
+ cx: this.x ,
+ cy: this.y
+ }, 500);
+
+ circle.animate({
+ "50%" : {
+ scale : "1.2,1.2"
+ },
+ "100%" : {
+ scale: "1,1"
+ }
+ }, 500);
+
+ } else if (this.value == 2) {
+
+ circle = this.canvas.circle(this.x, this.y, this.radius);
+ this.paintComponent(circle);
+
+ var circle2 = this.canvas.circle(this.x, this.y, this.radius);
+
+ circle2.attr("stroke", "#fff");
+ circle2.attr("fill", this.deckColor);
+ circle2.animate({
+ scale: 0
+ }, 500, 'bounce',function() {
+ circle2.hide();
+ });
+ }
+
+ }
+ this.onmouseover = function() {
+ if(!this.mouseover) {
+ this.mouseover = true;
+ this.drawOver(true);
+ }
+ }
+ this.onmouseout = function() {
+ if(this.mouseover) {
+ this.mouseover = false;
+ this.drawOver(false);
+ }
+ }
+ this.onclick = function(x,y) {
+ this.setSelected(!this.selected);
+ }
+ this.collides = function(x,y) {
+
+ if(x >= this.x - radius && x <= this.x + radius) {
+ if(y >= this.y - radius && y <= this.y +radius) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/sources/solitaire/index.html b/sources/solitaire/index.html
new file mode 100644
index 0000000..5d8e85f
--- /dev/null
+++ b/sources/solitaire/index.html
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+ Puzzle Game with Javascript
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sources/solitaire/license.html b/sources/solitaire/license.html
new file mode 100644
index 0000000..df04dab
--- /dev/null
+++ b/sources/solitaire/license.html
@@ -0,0 +1,36 @@
+
+
+
+ MIT License
+
+
+
+
+
+
+The MIT License
+
+Copyright (c) 2011 Emin KURA (http://eminkura.com )
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
+
+
+
diff --git a/sources/solitaire/nbproject/.svn/all-wcprops b/sources/solitaire/nbproject/.svn/all-wcprops
new file mode 100644
index 0000000..8cf71c9
--- /dev/null
+++ b/sources/solitaire/nbproject/.svn/all-wcprops
@@ -0,0 +1,17 @@
+K 25
+svn:wc:ra_dav:version-url
+V 43
+/turkey/!svn/ver/282/SoloTestGame/nbproject
+END
+project.properties
+K 25
+svn:wc:ra_dav:version-url
+V 62
+/turkey/!svn/ver/282/SoloTestGame/nbproject/project.properties
+END
+project.xml
+K 25
+svn:wc:ra_dav:version-url
+V 55
+/turkey/!svn/ver/282/SoloTestGame/nbproject/project.xml
+END
diff --git a/sources/solitaire/nbproject/.svn/dir-prop-base b/sources/solitaire/nbproject/.svn/dir-prop-base
new file mode 100644
index 0000000..a7ce626
--- /dev/null
+++ b/sources/solitaire/nbproject/.svn/dir-prop-base
@@ -0,0 +1,6 @@
+K 10
+svn:ignore
+V 8
+private
+
+END
diff --git a/sources/solitaire/nbproject/.svn/entries b/sources/solitaire/nbproject/.svn/entries
new file mode 100644
index 0000000..d0151cd
--- /dev/null
+++ b/sources/solitaire/nbproject/.svn/entries
@@ -0,0 +1,96 @@
+10
+
+dir
+282
+http://svn.tristit.com/turkey/SoloTestGame/nbproject
+http://svn.tristit.com/turkey
+
+
+
+2011-05-09T23:45:30.283316Z
+282
+emin
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+a141d216-93ef-4c6a-8be0-4ea620981fc3
+
+project.properties
+file
+
+
+
+
+2011-05-09T18:35:10.000000Z
+01d7decd1ace98dc04979cc2d639b1ad
+2011-05-09T23:45:30.283316Z
+282
+emin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+132
+
+project.xml
+file
+
+
+
+
+2011-05-09T18:35:10.000000Z
+b3d84fe3f6f14e5a5bd1c91e6b9f048d
+2011-05-09T23:45:30.283316Z
+282
+emin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+314
+
diff --git a/sources/solitaire/nbproject/.svn/text-base/project.properties.svn-base b/sources/solitaire/nbproject/.svn/text-base/project.properties.svn-base
new file mode 100644
index 0000000..6ffde2f
--- /dev/null
+++ b/sources/solitaire/nbproject/.svn/text-base/project.properties.svn-base
@@ -0,0 +1,7 @@
+include.path=${php.global.include.path}
+php.version=PHP_5
+source.encoding=UTF-8
+src.dir=.
+tags.asp=false
+tags.short=true
+web.root=.
diff --git a/sources/solitaire/nbproject/.svn/text-base/project.xml.svn-base b/sources/solitaire/nbproject/.svn/text-base/project.xml.svn-base
new file mode 100644
index 0000000..34663e0
--- /dev/null
+++ b/sources/solitaire/nbproject/.svn/text-base/project.xml.svn-base
@@ -0,0 +1,9 @@
+
+
+ org.netbeans.modules.php.project
+
+
+ SoloTestGame
+
+
+
diff --git a/sources/solitaire/nbproject/private/private.properties b/sources/solitaire/nbproject/private/private.properties
new file mode 100644
index 0000000..d8554f8
--- /dev/null
+++ b/sources/solitaire/nbproject/private/private.properties
@@ -0,0 +1,5 @@
+copy.src.files=false
+copy.src.target=/Applications/MAMP/htdocs/PhpProject1
+index.file=index.php
+run.as=LOCAL
+url=http://localhost/SoloTestGame/
diff --git a/sources/solitaire/nbproject/project.properties b/sources/solitaire/nbproject/project.properties
new file mode 100644
index 0000000..6ffde2f
--- /dev/null
+++ b/sources/solitaire/nbproject/project.properties
@@ -0,0 +1,7 @@
+include.path=${php.global.include.path}
+php.version=PHP_5
+source.encoding=UTF-8
+src.dir=.
+tags.asp=false
+tags.short=true
+web.root=.
diff --git a/sources/solitaire/nbproject/project.xml b/sources/solitaire/nbproject/project.xml
new file mode 100644
index 0000000..34663e0
--- /dev/null
+++ b/sources/solitaire/nbproject/project.xml
@@ -0,0 +1,9 @@
+
+
+ org.netbeans.modules.php.project
+
+
+ SoloTestGame
+
+
+
diff --git a/sources/solitaire/raphael.compressed.js b/sources/solitaire/raphael.compressed.js
new file mode 100644
index 0000000..7eb543c
--- /dev/null
+++ b/sources/solitaire/raphael.compressed.js
@@ -0,0 +1,124 @@
+/*!
+ * 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 k(){if(k.is(arguments[0],N)){for(var a=arguments[0],b=sa[D](k,a.splice(0,3+k.is(a[0],G))),c=b.set(),e=0,f=a[o];e=1E3&&delete g[j.shift()];j[z](d);g[d]=a[D](b,f);return c?c(g[d]):g[d]}return e}function Ha(){return this.x+E+this.y}function Ia(a){return function(b,c,e,f){var d={back:a};k.is(e,"function")?f=e:d.rot=e;b&&b.constructor==y&&(b=b.attrs.path);b&&(d.along=b);return this.animate(d,c,f)}}function gb(a,b,c,e,f,d){function g(a,b){var c,d,e,f;e=a;for(d=0;d<8;d++){f=((i*e+h)*e+j)*e-a;if(F(f)d)return d;
+for(;cf?c=e:d=e;e=(d-c)/2+c}return e}var j=3*b,h=3*(e-b)-j,i=1-j-h,l=3*c,k=3*(f-c)-l,n=1-l-k;return function(a,b){var c=g(a,b);return((n*c+k)*c+l)*c}(a,1/(200*d))}k.version="1.5.2";var P=/[, ]+/,fb={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},hb=/\{(\d+)\}/g,u="prototype",q="hasOwnProperty",p=document,X=window,ta={was:Object[u][q].call(X,"Raphael"),is:X.Raphael},ha=function(){this.customAttributes={}},C,D="apply",ua="createTouch"in p,E=" ",t=String,
+$="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend orientationchange touchcancel gesturestart gesturechange gestureend".split(E),va={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},H="join",o="length",Z=t[u].toLowerCase,v=Math,M=v.max,T=v.min,F=v.abs,B=v.pow,K=v.PI,G="number",N="array",U="toString",ib=Object[u][U],z="push",Ja=/^url\(['"]?([^\)]+?)['"]?\)$/i,jb=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,
+kb={NaN:1,Infinity:1,"-Infinity":1},lb=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,J=v.round,w=parseFloat,W=parseInt,ia=t[u].toUpperCase,ja={blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/",opacity:1,path:"M0,0",r:0,rotation:0,rx:0,ry:0,scale:"1 1",src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt",
+"stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",translation:"0 0",width:0,x:0,y:0},wa={along:"along",blur:G,"clip-rect":"csv",cx:G,cy:G,fill:"colour","fill-opacity":G,"font-size":G,height:G,opacity:G,path:"path",r:G,rotation:"csv",rx:G,ry:G,scale:"csv",stroke:"colour","stroke-opacity":G,"stroke-width":G,translation:"csv",width:G,x:G,y:G},mb=/^(from|to|\d+%?)$/,xa=/\s*,\s*/,nb={hs:1,rg:1},ob=/,?([achlmqrstvxz]),?/gi,
+pb=/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,qb=/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,Ka=/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/,rb=function(a,b){return a.key-b.key};k.type=X.SVGAngle||p.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML";if(k.type=="VML"){var Q=p.createElement("div");Q.innerHTML=' ';Q=Q.firstChild;Q.style.behavior="url(#default#VML)";if(!(Q&&typeof Q.adj=="object"))return k.type=null;Q=null}k.svg=
+!(k.vml=k.type=="VML");ha[u]=k[u];C=ha[u];k._id=0;k._oid=0;k.fn={};k.is=function(a,b){b=Z.call(b);if(b=="finite")return!kb[q](+a);return b=="null"&&a===null||b==typeof a||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||ib.call(a).slice(8,-1).toLowerCase()==b};k.angle=function(a,b,c,e,f,d){if(f==null){a-=c;b-=e;if(!a&&!b)return 0;return((a<0)*180+v.atan(-b/-a)*180/K+360)%360}else return k.angle(a,b,f,d)-k.angle(c,e,f,d)};k.rad=function(a){return a%360*K/180};k.deg=function(a){return a*
+180/K%360};k.snapTo=function(a,b,c){c=k.is(c,"finite")?c:10;if(k.is(a,N))for(var e=a.length;e--;){if(F(a[e]-b)<=c)return a[e]}else{a=+a;e=b%a;if(ea-c)return b-e+a}return b};k.setWindow=function(a){X=a;p=X.document};var ka=function(a){if(k.vml){var b=/^\s+|\s+$/g,c;try{var e=new ActiveXObject("htmlfile");e.write("");e.close();c=e.body}catch(f){c=createPopup().document.body}var d=c.createTextRange();ka=V(function(a){try{c.style.color=t(a).replace(b,"");var e=d.queryCommandValue("ForeColor");
+return"#"+("000000"+((e&255)<<16|e&65280|(e&16711680)>>>16)[U](16)).slice(-6)}catch(f){return"none"}})}else{var g=p.createElement("i");g.title="Rapha\u00ebl Colour Picker";g.style.display="none";p.body.appendChild(g);ka=V(function(a){g.style.color=a;return p.defaultView.getComputedStyle(g,"").getPropertyValue("color")})}return ka(a)},La=function(){return"hsb("+[this.h,this.s,this.b]+")"},sb=function(){return"hsl("+[this.h,this.s,this.l]+")"},tb=function(){return this.hex};k.hsb2rgb=function(a,b,c,
+e){if(k.is(a,"object")&&"h"in a&&"s"in a&&"b"in a)c=a.b,b=a.s,a=a.h,e=a.o;return k.hsl2rgb(a,b,c/2,e)};k.hsl2rgb=function(a,b,c,e){if(k.is(a,"object")&&"h"in a&&"s"in a&&"l"in a)c=a.l,b=a.s,a=a.h;if(a>1||b>1||c>1)a/=360,b/=100,c/=100;var f={},d=["r","g","b"],g;if(b)for(var b=c<0.5?c*(1+b):c+b-c*b,c=2*c-b,j=0;j<3;j++)g=a+1/3*-(j-1),g<0&&g++,g>1&&g--,f[d[j]]=g*6<1?c+(b-c)*6*g:g*2<1?b:g*3<2?c+(b-c)*(2/3-g)*6:c;else f={r:c,g:c,b:c};f.r*=255;f.g*=255;f.b*=255;f.hex="#"+(16777216|f.b|f.g<<8|f.r<<16).toString(16).slice(1);
+k.is(e,"finite")&&(f.opacity=e);f.toString=tb;return f};k.rgb2hsb=function(a,b,c){if(b==null&&k.is(a,"object")&&"r"in a&&"g"in a&&"b"in a)c=a.b,b=a.g,a=a.r;if(b==null&&k.is(a,"string"))var e=k.getRGB(a),a=e.r,b=e.g,c=e.b;if(a>1||b>1||c>1)a/=255,b/=255,c/=255;var e=M(a,b,c),f=T(a,b,c);if(f==e)return{h:0,s:0,b:e,toString:La};else f=e-f,a=a==e?(b-c)/f:b==e?2+(c-a)/f:4+(a-b)/f,a/=6,a<0&&a++,a>1&&a--;return{h:a,s:f/e,b:e,toString:La}};k.rgb2hsl=function(a,b,c){if(b==null&&k.is(a,"object")&&"r"in a&&"g"in
+a&&"b"in a)c=a.b,b=a.g,a=a.r;if(b==null&&k.is(a,"string"))var e=k.getRGB(a),a=e.r,b=e.g,c=e.b;if(a>1||b>1||c>1)a/=255,b/=255,c/=255;var e=M(a,b,c),f=T(a,b,c),d=(e+f)/2;if(f==e)a={h:0,s:0,l:d};else{var g=e-f,a=a==e?(b-c)/g:b==e?2+(c-a)/g:4+(a-b)/g;a/=6;a<0&&a++;a>1&&a--;a={h:a,s:d<0.5?g/(e+f):g/(2-e-f),l:d}}a.toString=sb;return a};k._path2string=function(){return this.join(",").replace(ob,"$1")};k.getRGB=V(function(a){if(!a||(a=t(a)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1};if(a=="none")return{r:-1,
+g:-1,b:-1,hex:"none"};!(nb[q](a.toLowerCase().substring(0,2))||a.charAt()=="#")&&(a=ka(a));var b,c,e,f,d;if(a=a.match(jb)){a[2]&&(e=W(a[2].substring(5),16),c=W(a[2].substring(3,5),16),b=W(a[2].substring(1,3),16));a[3]&&(e=W((d=a[3].charAt(3))+d,16),c=W((d=a[3].charAt(2))+d,16),b=W((d=a[3].charAt(1))+d,16));a[4]&&(d=a[4].split(xa),b=w(d[0]),d[0].slice(-1)=="%"&&(b*=2.55),c=w(d[1]),d[1].slice(-1)=="%"&&(c*=2.55),e=w(d[2]),d[2].slice(-1)=="%"&&(e*=2.55),a[1].toLowerCase().slice(0,4)=="rgba"&&(f=w(d[3])),
+d[3]&&d[3].slice(-1)=="%"&&(f/=100));if(a[5])return d=a[5].split(xa),b=w(d[0]),d[0].slice(-1)=="%"&&(b*=2.55),c=w(d[1]),d[1].slice(-1)=="%"&&(c*=2.55),e=w(d[2]),d[2].slice(-1)=="%"&&(e*=2.55),(d[0].slice(-3)=="deg"||d[0].slice(-1)=="\u00b0")&&(b/=360),a[1].toLowerCase().slice(0,4)=="hsba"&&(f=w(d[3])),d[3]&&d[3].slice(-1)=="%"&&(f/=100),k.hsb2rgb(b,c,e,f);if(a[6])return d=a[6].split(xa),b=w(d[0]),d[0].slice(-1)=="%"&&(b*=2.55),c=w(d[1]),d[1].slice(-1)=="%"&&(c*=2.55),e=w(d[2]),d[2].slice(-1)=="%"&&
+(e*=2.55),(d[0].slice(-3)=="deg"||d[0].slice(-1)=="\u00b0")&&(b/=360),a[1].toLowerCase().slice(0,4)=="hsla"&&(f=w(d[3])),d[3]&&d[3].slice(-1)=="%"&&(f/=100),k.hsl2rgb(b,c,e,f);a={r:b,g:c,b:e};a.hex="#"+(16777216|e|c<<8|b<<16).toString(16).slice(1);k.is(f,"finite")&&(a.opacity=f);return a}return{r:-1,g:-1,b:-1,hex:"none",error:1}},k);k.getColor=function(a){var a=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||0.75},b=this.hsb2rgb(a.h,a.s,a.b);a.h+=0.075;if(a.h>1)a.h=0,a.s-=0.2,a.s<=0&&(this.getColor.start=
+{h:0,s:1,b:a.b});return b.hex};k.getColor.reset=function(){delete this.start};k.parsePathString=V(function(a){if(!a)return null;var b={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},c=[];k.is(a,N)&&k.is(a[0],N)&&(c=la(a));c[o]||t(a).replace(pb,function(a,f,d){var g=[],a=Z.call(f);d.replace(qb,function(a,b){b&&g[z](+b)});a=="m"&&g[o]>2&&(c[z]([f].concat(g.splice(0,2))),a="l",f=f=="m"?"l":"L");for(;g[o]>=b[a];)if(c[z]([f].concat(g.splice(0,b[a]))),!b[a])break});c[U]=k._path2string;return c});k.findDotsAtSegment=
+function(a,b,c,e,f,d,g,j,h){var i=1-h,l=B(i,3)*a+B(i,2)*3*h*c+i*3*h*h*f+B(h,3)*g,i=B(i,3)*b+B(i,2)*3*h*e+i*3*h*h*d+B(h,3)*j,k=a+2*h*(c-a)+h*h*(f-2*c+a),n=b+2*h*(e-b)+h*h*(d-2*e+b),o=c+2*h*(f-c)+h*h*(g-2*f+c),m=e+2*h*(d-e)+h*h*(j-2*d+e),a=(1-h)*a+h*c,b=(1-h)*b+h*e,f=(1-h)*f+h*g,d=(1-h)*d+h*j,j=90-v.atan((k-o)/(n-m))*180/K;(k>o||n1&&(I=v.sqrt(I),c*=I,e*=I);var I=c*c,ba=e*e,I=(d==g?-1:1)*v.sqrt(F((I*ba-I*x*x-ba*r*r)/(I*x*x+ba*r*r))),d=I*c*x/e+(a+j)/2,I=
+I*-e*r/c+(b+h)/2,x=v.asin(((b-I)/e).toFixed(9));r=v.asin(((h-I)/e).toFixed(9));x=ar&&(x-=K*2);!g&&r>x&&(r-=K*2)}if(F(r-x)>l){var n=r,ba=j,q=h;r=x+l*(g&&r>x?1:-1);j=d+c*v.cos(r);h=I+e*v.sin(r);n=Na(j,h,c,e,f,0,g,ba,q,[r,n,d,I])}d=r-x;f=v.cos(x);l=v.sin(x);g=v.cos(r);r=v.sin(r);d=v.tan(d/4);c=4/3*c*d;d*=4/3*e;e=[a,b];a=[a+c*l,b-d*f];b=[j+c*r,h-d*g];j=[j,h];a[0]=2*e[0]-a[0];a[1]=2*e[1]-a[1];if(i)return[a,b,j].concat(n);else{n=[a,b,j].concat(n)[H]().split(",");
+i=[];j=0;for(h=n[o];j"1e12"&&(k=0.5);F(h)>"1e12"&&(h=0.5);k>0&&k<1&&(k=oa(a,b,c,e,f,d,g,j,k),o[z](k.x),n[z](k.y));h>0&&h<1&&(k=oa(a,b,c,e,f,d,
+g,j,h),o[z](k.x),n[z](k.y));h=d-2*e+b-(j-2*d+e);i=2*(e-b)-2*(d-e);l=b-e;k=(-i+v.sqrt(i*i-4*h*l))/2/h;h=(-i-v.sqrt(i*i-4*h*l))/2/h;F(k)>"1e12"&&(k=0.5);F(h)>"1e12"&&(h=0.5);k>0&&k<1&&(k=oa(a,b,c,e,f,d,g,j,k),o[z](k.x),n[z](k.y));h>0&&h<1&&(k=oa(a,b,c,e,f,d,g,j,h),o[z](k.x),n[z](k.y));return{min:{x:T[D](0,o),y:T[D](0,n)},max:{x:M[D](0,o),y:M[D](0,n)}}}),ma=V(function(a,b){var c=ca(a),e=b&&ca(b),f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},d={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"].concat(Na[D](0,[b.x,b.y].concat(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].concat(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"].concat(Ma(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"].concat(Ma(b.x,b.y,a[1],a[2],a[3],a[4]));break;case "L":a=
+["C"].concat([b.x,b.y,a[1],a[2],a[1],a[2]]);break;case "H":a=["C"].concat([b.x,b.y,a[1],b.y,a[1],b.y]);break;case "V":a=["C"].concat([b.x,b.y,b.x,a[1],b.x,a[1]]);break;case "Z":a=["C"].concat([b.x,b.y,b.X,b.Y,b.X,b.Y])}return a},j=function(a,b){if(a[b][o]>7){a[b].shift();for(var d=a[b];d[o];)a.splice(b++,0,["C"].concat(d.splice(0,6)));a.splice(b,1);k=M(c[o],e&&e[o]||0)}},h=function(a,b,d,f,g){if(a&&b&&a[g][0]=="M"&&b[g][0]!="M")b.splice(g,0,["M",f.x,f.y]),d.bx=0,d.by=0,d.x=a[g][1],d.y=a[g][2],k=M(c[o],
+e&&e[o]||0)},i=0,k=M(c[o],e&&e[o]||0);for(;i0.5)*2-1,B(f-0.5,2)+B(d-0.5,2)>0.25&&(d=v.sqrt(0.25-B(f-0.5,2))*a+0.5)&&d!=0.5&&(d=d.toFixed(5)-1.0E-5*a));return""}),b=b.split(/\s*\-\s*/);if(e=="linear"){var j=b.shift(),j=-w(j);if(isNaN(j))return null;var j=[0,0,v.cos(j*K/180),v.sin(j*K/180)],h=1/(M(F(j[2]),F(j[3]))||1);j[2]*=h;j[3]*=h;j[2]<0&&(j[0]=-j[2],j[2]=0);j[3]<0&&(j[1]=-j[3],j[3]=0)}b=Oa(b);if(!b)return null;h=a.getAttribute("fill");
+(h=h.match(/^url\(#(.*)\)$/))&&c.defs.removeChild(p.getElementById(h[1]));h=m(e+"Gradient");h.id=ga();m(h,e=="radial"?{fx:f,fy:d}:{x1:j[0],y1:j[1],x2:j[2],y2:j[3]});c.defs.appendChild(h);c=0;for(j=b[o];c
+1?l.opacity/100:l.opacity});case "stroke":l=k.getRGB(i);e.setAttribute(h,l.hex);h=="stroke"&&l[q]("opacity")&&m(e,{"stroke-opacity":l.opacity>1?l.opacity/100:l.opacity});break;case "gradient":(({circle:1,ellipse:1})[q](a.type)||t(i).charAt()!="r")&&da(e,i,a.paper);break;case "opacity":f.gradient&&!f[q]("stroke-opacity")&&m(e,{"stroke-opacity":i>1?i/100:i});case "fill-opacity":if(f.gradient){if(l=p.getElementById(e.getAttribute("fill").replace(/^url\(#|\)$/g,"")))l=l.getElementsByTagName("stop"),l[l[o]-
+1].setAttribute("stop-opacity",i);break}default:h=="font-size"&&(i=W(i,10)+"px"),l=h.replace(/(\-.)/g,function(a){return ia.call(a.substring(1))}),e.style[l]=i,e.setAttribute(h,i)}}vb(a,b);j?a.rotate(j.join(E)):w(d)&&a.rotate(d,!0)},vb=function(a,b){if(!(a.type!="text"||!b[q]("text")&&!b[q]("font")&&!b[q]("font-size")&&!b[q]("x")&&!b[q]("y"))){var c=a.attrs,e=a.node,f=e.firstChild?W(p.defaultView.getComputedStyle(e.firstChild,"").getPropertyValue("font-size"),10):10;if(b[q]("text")){for(c.text=b.text;e.firstChild;)e.removeChild(e.firstChild);
+for(var d=t(b.text).split("\n"),g=0,j=d[o];gb.height&&(b.height=d.y+d.height-b.y);d.x+d.width-b.x>b.width&&(b.width=d.x+d.width-b.x)}a&&this.hide();return b};y[u].attr=function(a,b){if(this.removed)return this;if(a==null){var c={},e;for(e in this.attrs)this.attrs[q](e)&&(c[e]=this.attrs[e]);this._.rt.deg&&(c.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(c.scale=this.scale());c.gradient&&c.fill=="none"&&(c.fill=c.gradient)&&delete c.gradient;return c}if(b==null&&k.is(a,"string")){if(a=="translation")return pa.call(this);if(a=="rotation")return this.rotate();
+if(a=="scale")return this.scale();if(a=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;return this.attrs[a]}if(b==null&&k.is(a,N)){e={};for(var c=0,f=a.length;c")),a.W=e.w=a.paper.span.offsetWidth,a.H=e.h=a.paper.span.offsetHeight,a.X=e.x,a.Y=e.y+J(a.H/2),e["text-anchor"]){case "start":a.node.style["v-text-align"]=
+"left";a.bbx=J(a.W/2);break;case "end":a.node.style["v-text-align"]="right";a.bbx=-J(a.W/2);break;default:a.node.style["v-text-align"]="center"}};da=function(a,b){a.attrs=a.attrs||{};var c,e="linear",f=".5 .5";a.attrs.gradient=b;b=t(b).replace(Ka,function(a,b,c){e="radial";b&&c&&(b=w(b),c=w(c),B(b-0.5,2)+B(c-0.5,2)>0.25&&(c=v.sqrt(0.25-B(b-0.5,2))*((c>0.5)*2-1)+0.5),f=b+E+c);return""});b=b.split(/\s*\-\s*/);if(e=="linear"){var d=b.shift(),d=-w(d);if(isNaN(d))return null}var g=Oa(b);if(!g)return null;
+a=a.shape||a.node;c=a.getElementsByTagName("fill")[0]||L("fill");!c.parentNode&&a.appendChild(c);if(g[o]){c.on=!0;c.method="none";c.color=g[0].color;c.color2=g[g[o]-1].color;for(var j=[],h=0,i=g[o];h')}}catch(Gb){L=function(a){return p.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}sa=function(){var a=Pa[D](0,arguments),b=a.container,c=a.height,e=a.width,f=a.x,a=a.y;if(!b)throw Error("VML container not found.");var d=new ha,g=d.canvas=p.createElement("div"),j=g.style,f=f||0,a=a||0,e=e||512,c=
+c||342;e==+e&&(e+="px");c==+c&&(c+="px");d.width=1E3;d.height=1E3;d.coordsize=1E4+E+1E4;d.coordorigin="0 0";d.span=p.createElement("span");d.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";g.appendChild(d.span);j.cssText=k.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",e,c);b==1?(p.body.appendChild(g),j.left=f+"px",j.top=a+"px",j.position="absolute"):b.firstChild?
+b.insertBefore(g,b.firstChild):b.appendChild(g);za.call(d,d,k.fn);return d};C.clear=function(){this.canvas.innerHTML="";this.span=p.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas.appendChild(this.span);this.bottom=this.top=null};C.remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=Ua(a);return!0}}Q=navigator.userAgent.match(/Version\/(.*?)\s/);C.safari=
+navigator.vendor=="Apple Computer, Inc."&&(Q&&Q[1]<4||navigator.platform.slice(0,2)=="iP")?function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});X.setTimeout(function(){a.remove()})}:function(){};for(var Ab=function(){this.returnValue=!1},Bb=function(){return this.originalEvent.preventDefault()},Cb=function(){this.cancelBubble=!0},Db=function(){return this.originalEvent.stopPropagation()},Eb=function(){if(p.addEventListener)return function(a,b,c,e){var f=ua&&va[b]?
+va[b]:b,d=function(d){if(ua&&va[q](b))for(var f=0,h=d.targetTouches&&d.targetTouches.length;f1&&(a=Array[u].splice.call(arguments,0,arguments[o]));return new O(a)};C.setSize=ab;C.top=C.bottom=null;C.raphael=k;s.resetScale=function(){if(this.removed)return this;this._.sx=1;this._.sy=1;this.attrs.scale="1 1"};s.scale=function(a,
+b,c,e){if(this.removed)return this;if(a==null&&b==null)return{x:this._.sx,y:this._.sy,toString:Ha};b=b||a;!+b&&(b=a);var f,d,g=this.attrs;if(a!=0){var j=this.getBBox(),h=j.x+j.width/2,i=j.y+j.height/2;f=F(a/this._.sx);d=F(b/this._.sy);var c=+c||c==0?c:h,e=+e||e==0?e:i,k=this._.sx>0,A=this._.sy>0,j=~~(a/F(a)),n=~~(b/F(b)),r=f*j,m=d*n,q=this.node.style,h=c+F(h-c)*r*(h>c==k?1:-1),i=e+F(i-e)*m*(i>e==A?1:-1),p=a*j>b*n?d:f;switch(this.type){case "rect":case "image":var x=g.width*f,w=g.height*d;this.attr({height:w,
+r:g.r*p,width:x,x:h-x/2,y:i-w/2});break;case "circle":case "ellipse":this.attr({rx:g.rx*f,ry:g.ry*d,r:g.r*p,cx:h,cy:i});break;case "text":this.attr({x:h,y:i});break;case "path":for(var p=ya(g.path),v=!0,k=k?r:f,A=A?m:d,m=0,r=p[o];mp?q=n.data[p*l]:(q=k.findDotsAtSegment(a,b,c,e,f,d,g,j,p/l),n.data[p]=q);p&&(i+=B(B(m.x-q.x,2)+B(m.y-q.y,2),0.5));if(h!=null&&i>=h)return q;m=q}if(h==null)return i},$=function(a,b){return function(c,e,f){for(var c=ma(c),d,g,j,h,i="",l={},o=
+0,n=0,m=c.length;ne){if(b&&!l.start){d=qa(d,g,j[1],j[2],j[3],j[4],j[5],j[6],e-o);i+=["C",d.start.x,d.start.y,d.m.x,d.m.y,d.x,d.y];if(f)return i;l.start=i;i=["M",d.x,d.y+"C",d.n.x,d.n.y,d.end.x,d.end.y,j[5],j[6]][H]();o+=h;d=+j[5];g=+j[6];continue}if(!a&&!b)return d=qa(d,g,j[1],j[2],j[3],j[4],j[5],j[6],e-o),{x:d.x,y:d.y,alpha:d.alpha}}o+=h;d=+j[5];g=+j[6]}i+=j}l.end=i;d=a?o:b?l:k.findDotsAtSegment(d,g,j[1],
+j[2],j[3],j[4],j[5],j[6],1);d.alpha&&(d={x:d.x,y:d.y,alpha:d.alpha});return d}},db=$(1),ra=$(),Ea=$(0,1);s.getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return db(this.attrs.path)}};s.getPointAtLength=function(a){if(this.type=="path")return ra(this.attrs.path,a)};s.getSubpath=function(a,b){if(this.type=="path"){if(F(this.getTotalLength()-b)<"1e-6")return Ea(this.attrs.path,a).end;var c=Ea(this.attrs.path,b,1);return a?Ea(c,a).end:c}};
+k.easing_formulas={linear:function(a){return a},"<":function(a){return B(a,3)},">":function(a){return B(a-1,3)+1},"<>":function(a){a*=2;if(a<1)return B(a,3)/2;a-=2;return(B(a,3)+2)/2},backIn:function(a){return a*a*(2.70158*a-1.70158)},backOut:function(a){a-=1;return a*a*(2.70158*a+1.70158)+1},elastic:function(a){if(a==0||a==1)return a;return B(2,-10*a)*v.sin((a-0.075)*2*K/0.3)+1},bounce:function(a){a<1/2.75?a*=7.5625*a:a<2/2.75?(a-=1.5/2.75,a=7.5625*a*a+0.75):a<2.5/2.75?(a-=2.25/2.75,a=7.5625*a*a+
+0.9375):(a-=2.625/2.75,a=7.5625*a*a+0.984375);return a}};var S=[],eb=function(){for(var a=+new Date,b=0;b values - tolerance) {
+ return value - rem + values;
+ }
+ }
+ return value;
+ };
+ function createUUID() {
+ // http://www.ietf.org/rfc/rfc4122.txt
+ var s = [],
+ i = 0;
+ for (; i < 32; i++) {
+ s[i] = (~~(math.random() * 16))[toString](16);
+ }
+ s[12] = 4; // bits 12-15 of the time_hi_and_version field to 0010
+ s[16] = ((s[16] & 3) | 8)[toString](16); // bits 6-7 of the clock_seq_hi_and_reserved to 01
+ return "r-" + s[join]("");
+ }
+
+ R.setWindow = function (newwin) {
+ win = newwin;
+ doc = win.document;
+ };
+ // colour utilities
+ var toHex = function (color) {
+ if (R.vml) {
+ // http://dean.edwards.name/weblog/2009/10/convert-any-colour-value-to-hex-in-msie/
+ var trim = /^\s+|\s+$/g;
+ var bod;
+ try {
+ var docum = new ActiveXObject("htmlfile");
+ docum.write("");
+ docum.close();
+ bod = docum.body;
+ } catch(e) {
+ bod = createPopup().document.body;
+ }
+ var range = bod.createTextRange();
+ toHex = cacher(function (color) {
+ try {
+ bod.style.color = Str(color)[rp](trim, E);
+ var value = range.queryCommandValue("ForeColor");
+ value = ((value & 255) << 16) | (value & 65280) | ((value & 16711680) >>> 16);
+ return "#" + ("000000" + value[toString](16)).slice(-6);
+ } catch(e) {
+ return "none";
+ }
+ });
+ } else {
+ var i = doc.createElement("i");
+ i.title = "Rapha\xebl Colour Picker";
+ i.style.display = "none";
+ doc.body[appendChild](i);
+ toHex = cacher(function (color) {
+ i.style.color = color;
+ return doc.defaultView.getComputedStyle(i, E).getPropertyValue("color");
+ });
+ }
+ return toHex(color);
+ },
+ hsbtoString = function () {
+ return "hsb(" + [this.h, this.s, this.b] + ")";
+ },
+ hsltoString = function () {
+ return "hsl(" + [this.h, this.s, this.l] + ")";
+ },
+ rgbtoString = function () {
+ return this.hex;
+ };
+ R.hsb2rgb = function (h, s, b, o) {
+ if (R.is(h, "object") && "h" in h && "s" in h && "b" in h) {
+ b = h.b;
+ s = h.s;
+ h = h.h;
+ o = h.o;
+ }
+ return R.hsl2rgb(h, s, b / 2, o);
+ };
+ R.hsl2rgb = function (h, s, l, o) {
+ if (R.is(h, "object") && "h" in h && "s" in h && "l" in h) {
+ l = h.l;
+ s = h.s;
+ h = h.h;
+ }
+ if (h > 1 || s > 1 || l > 1) {
+ h /= 360;
+ s /= 100;
+ l /= 100;
+ }
+ var rgb = {},
+ channels = ["r", "g", "b"],
+ t2, t1, t3, r, g, b;
+ if (!s) {
+ rgb = {
+ r: l,
+ g: l,
+ b: l
+ };
+ } else {
+ if (l < .5) {
+ t2 = l * (1 + s);
+ } else {
+ t2 = l + s - l * s;
+ }
+ t1 = 2 * l - t2;
+ for (var i = 0; i < 3; i++) {
+ t3 = h + 1 / 3 * -(i - 1);
+ t3 < 0 && t3++;
+ t3 > 1 && t3--;
+ if (t3 * 6 < 1) {
+ rgb[channels[i]] = t1 + (t2 - t1) * 6 * t3;
+ } else if (t3 * 2 < 1) {
+ rgb[channels[i]] = t2;
+ } else if (t3 * 3 < 2) {
+ rgb[channels[i]] = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
+ } else {
+ rgb[channels[i]] = t1;
+ }
+ }
+ }
+ rgb.r *= 255;
+ rgb.g *= 255;
+ rgb.b *= 255;
+ rgb.hex = "#" + (16777216 | rgb.b | (rgb.g << 8) | (rgb.r << 16)).toString(16).slice(1);
+ R.is(o, "finite") && (rgb.opacity = o);
+ rgb.toString = rgbtoString;
+ return rgb;
+ };
+ R.rgb2hsb = function (red, green, blue) {
+ if (green == null && R.is(red, "object") && "r" in red && "g" in red && "b" in red) {
+ blue = red.b;
+ green = red.g;
+ red = red.r;
+ }
+ if (green == null && R.is(red, string)) {
+ var clr = R.getRGB(red);
+ red = clr.r;
+ green = clr.g;
+ blue = clr.b;
+ }
+ if (red > 1 || green > 1 || blue > 1) {
+ red /= 255;
+ green /= 255;
+ blue /= 255;
+ }
+ var max = mmax(red, green, blue),
+ min = mmin(red, green, blue),
+ hue,
+ saturation,
+ brightness = max;
+ if (min == max) {
+ return {h: 0, s: 0, b: max, toString: hsbtoString};
+ } else {
+ var delta = (max - min);
+ saturation = delta / max;
+ if (red == max) {
+ hue = (green - blue) / delta;
+ } else if (green == max) {
+ hue = 2 + ((blue - red) / delta);
+ } else {
+ hue = 4 + ((red - green) / delta);
+ }
+ hue /= 6;
+ hue < 0 && hue++;
+ hue > 1 && hue--;
+ }
+ return {h: hue, s: saturation, b: brightness, toString: hsbtoString};
+ };
+ R.rgb2hsl = function (red, green, blue) {
+ if (green == null && R.is(red, "object") && "r" in red && "g" in red && "b" in red) {
+ blue = red.b;
+ green = red.g;
+ red = red.r;
+ }
+ if (green == null && R.is(red, string)) {
+ var clr = R.getRGB(red);
+ red = clr.r;
+ green = clr.g;
+ blue = clr.b;
+ }
+ if (red > 1 || green > 1 || blue > 1) {
+ red /= 255;
+ green /= 255;
+ blue /= 255;
+ }
+ var max = mmax(red, green, blue),
+ min = mmin(red, green, blue),
+ h,
+ s,
+ l = (max + min) / 2,
+ hsl;
+ if (min == max) {
+ hsl = {h: 0, s: 0, l: l};
+ } else {
+ var delta = max - min;
+ s = l < .5 ? delta / (max + min) : delta / (2 - max - min);
+ if (red == max) {
+ h = (green - blue) / delta;
+ } else if (green == max) {
+ h = 2 + (blue - red) / delta;
+ } else {
+ h = 4 + (red - green) / delta;
+ }
+ h /= 6;
+ h < 0 && h++;
+ h > 1 && h--;
+ hsl = {h: h, s: s, l: l};
+ }
+ hsl.toString = hsltoString;
+ return hsl;
+ };
+ R._path2string = function () {
+ return this.join(",")[rp](p2s, "$1");
+ };
+ function cacher(f, scope, postprocessor) {
+ function newf() {
+ var arg = Array[proto].slice.call(arguments, 0),
+ args = arg[join]("\u25ba"),
+ cache = newf.cache = newf.cache || {},
+ count = newf.count = newf.count || [];
+ if (cache[has](args)) {
+ return postprocessor ? postprocessor(cache[args]) : cache[args];
+ }
+ count[length] >= 1e3 && delete cache[count.shift()];
+ count[push](args);
+ cache[args] = f[apply](scope, arg);
+ return postprocessor ? postprocessor(cache[args]) : cache[args];
+ }
+ return newf;
+ }
+
+ R.getRGB = cacher(function (colour) {
+ if (!colour || !!((colour = Str(colour)).indexOf("-") + 1)) {
+ return {r: -1, g: -1, b: -1, hex: "none", error: 1};
+ }
+ if (colour == "none") {
+ return {r: -1, g: -1, b: -1, hex: "none"};
+ }
+ !(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == "#") && (colour = toHex(colour));
+ var res,
+ red,
+ green,
+ blue,
+ opacity,
+ t,
+ values,
+ rgb = colour.match(colourRegExp);
+ if (rgb) {
+ if (rgb[2]) {
+ blue = toInt(rgb[2].substring(5), 16);
+ green = toInt(rgb[2].substring(3, 5), 16);
+ red = toInt(rgb[2].substring(1, 3), 16);
+ }
+ if (rgb[3]) {
+ blue = toInt((t = rgb[3].charAt(3)) + t, 16);
+ green = toInt((t = rgb[3].charAt(2)) + t, 16);
+ red = toInt((t = rgb[3].charAt(1)) + t, 16);
+ }
+ if (rgb[4]) {
+ values = rgb[4][split](commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red *= 2.55);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green *= 2.55);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue *= 2.55);
+ rgb[1].toLowerCase().slice(0, 4) == "rgba" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ }
+ if (rgb[5]) {
+ values = rgb[5][split](commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red *= 2.55);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green *= 2.55);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue *= 2.55);
+ (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
+ rgb[1].toLowerCase().slice(0, 4) == "hsba" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ return R.hsb2rgb(red, green, blue, opacity);
+ }
+ if (rgb[6]) {
+ values = rgb[6][split](commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red *= 2.55);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green *= 2.55);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue *= 2.55);
+ (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
+ rgb[1].toLowerCase().slice(0, 4) == "hsla" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ return R.hsl2rgb(red, green, blue, opacity);
+ }
+ rgb = {r: red, g: green, b: blue};
+ rgb.hex = "#" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);
+ R.is(opacity, "finite") && (rgb.opacity = opacity);
+ return rgb;
+ }
+ return {r: -1, g: -1, b: -1, hex: "none", error: 1};
+ }, R);
+ R.getColor = function (value) {
+ var start = this.getColor.start = this.getColor.start || {h: 0, s: 1, b: value || .75},
+ rgb = this.hsb2rgb(start.h, start.s, start.b);
+ start.h += .075;
+ if (start.h > 1) {
+ start.h = 0;
+ start.s -= .2;
+ start.s <= 0 && (this.getColor.start = {h: 0, s: 1, b: start.b});
+ }
+ return rgb.hex;
+ };
+ R.getColor.reset = function () {
+ delete this.start;
+ };
+ // path utilities
+ R.parsePathString = cacher(function (pathString) {
+ if (!pathString) {
+ return null;
+ }
+ var paramCounts = {a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0},
+ data = [];
+ if (R.is(pathString, array) && R.is(pathString[0], array)) { // rough assumption
+ data = pathClone(pathString);
+ }
+ if (!data[length]) {
+ Str(pathString)[rp](pathCommand, function (a, b, c) {
+ var params = [],
+ name = lowerCase.call(b);
+ c[rp](pathValues, function (a, b) {
+ b && params[push](+b);
+ });
+ if (name == "m" && params[length] > 2) {
+ data[push]([b][concat](params.splice(0, 2)));
+ name = "l";
+ b = b == "m" ? "l" : "L";
+ }
+ while (params[length] >= paramCounts[name]) {
+ data[push]([b][concat](params.splice(0, paramCounts[name])));
+ if (!paramCounts[name]) {
+ break;
+ }
+ }
+ });
+ }
+ data[toString] = R._path2string;
+ return data;
+ });
+ R.findDotsAtSegment = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
+ var t1 = 1 - t,
+ x = pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,
+ y = pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y,
+ mx = p1x + 2 * t * (c1x - p1x) + t * t * (c2x - 2 * c1x + p1x),
+ my = p1y + 2 * t * (c1y - p1y) + t * t * (c2y - 2 * c1y + p1y),
+ nx = c1x + 2 * t * (c2x - c1x) + t * t * (p2x - 2 * c2x + c1x),
+ ny = c1y + 2 * t * (c2y - c1y) + t * t * (p2y - 2 * c2y + c1y),
+ ax = (1 - t) * p1x + t * c1x,
+ ay = (1 - t) * p1y + t * c1y,
+ cx = (1 - t) * c2x + t * p2x,
+ cy = (1 - t) * c2y + t * p2y,
+ alpha = (90 - math.atan((mx - nx) / (my - ny)) * 180 / PI);
+ (mx > nx || my < ny) && (alpha += 180);
+ return {x: x, y: y, m: {x: mx, y: my}, n: {x: nx, y: ny}, start: {x: ax, y: ay}, end: {x: cx, y: cy}, alpha: alpha};
+ };
+ var pathDimensions = cacher(function (path) {
+ if (!path) {
+ return {x: 0, y: 0, width: 0, height: 0};
+ }
+ path = path2curve(path);
+ var x = 0,
+ y = 0,
+ X = [],
+ Y = [],
+ p;
+ for (var i = 0, ii = path[length]; i < ii; i++) {
+ p = path[i];
+ if (p[0] == "M") {
+ x = p[1];
+ y = p[2];
+ X[push](x);
+ Y[push](y);
+ } else {
+ var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
+ X = X[concat](dim.min.x, dim.max.x);
+ Y = Y[concat](dim.min.y, dim.max.y);
+ x = p[5];
+ y = p[6];
+ }
+ }
+ var xmin = mmin[apply](0, X),
+ ymin = mmin[apply](0, Y);
+ return {
+ x: xmin,
+ y: ymin,
+ width: mmax[apply](0, X) - xmin,
+ height: mmax[apply](0, Y) - ymin
+ };
+ }),
+ pathClone = function (pathArray) {
+ var res = [];
+ if (!R.is(pathArray, array) || !R.is(pathArray && pathArray[0], array)) { // rough assumption
+ pathArray = R.parsePathString(pathArray);
+ }
+ for (var i = 0, ii = pathArray[length]; i < ii; i++) {
+ res[i] = [];
+ for (var j = 0, jj = pathArray[i][length]; j < jj; j++) {
+ res[i][j] = pathArray[i][j];
+ }
+ }
+ res[toString] = R._path2string;
+ return res;
+ },
+ pathToRelative = cacher(function (pathArray) {
+ if (!R.is(pathArray, array) || !R.is(pathArray && pathArray[0], array)) { // rough assumption
+ pathArray = R.parsePathString(pathArray);
+ }
+ var res = [],
+ x = 0,
+ y = 0,
+ mx = 0,
+ my = 0,
+ start = 0;
+ if (pathArray[0][0] == "M") {
+ x = pathArray[0][1];
+ y = pathArray[0][2];
+ mx = x;
+ my = y;
+ start++;
+ res[push](["M", x, y]);
+ }
+ for (var i = start, ii = pathArray[length]; i < ii; i++) {
+ var r = res[i] = [],
+ pa = pathArray[i];
+ if (pa[0] != lowerCase.call(pa[0])) {
+ r[0] = lowerCase.call(pa[0]);
+ switch (r[0]) {
+ case "a":
+ r[1] = pa[1];
+ r[2] = pa[2];
+ r[3] = pa[3];
+ r[4] = pa[4];
+ r[5] = pa[5];
+ r[6] = +(pa[6] - x).toFixed(3);
+ r[7] = +(pa[7] - y).toFixed(3);
+ break;
+ case "v":
+ r[1] = +(pa[1] - y).toFixed(3);
+ break;
+ case "m":
+ mx = pa[1];
+ my = pa[2];
+ default:
+ for (var j = 1, jj = pa[length]; j < jj; j++) {
+ r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);
+ }
+ }
+ } else {
+ r = res[i] = [];
+ if (pa[0] == "m") {
+ mx = pa[1] + x;
+ my = pa[2] + y;
+ }
+ for (var k = 0, kk = pa[length]; k < kk; k++) {
+ res[i][k] = pa[k];
+ }
+ }
+ var len = res[i][length];
+ switch (res[i][0]) {
+ case "z":
+ x = mx;
+ y = my;
+ break;
+ case "h":
+ x += +res[i][len - 1];
+ break;
+ case "v":
+ y += +res[i][len - 1];
+ break;
+ default:
+ x += +res[i][len - 2];
+ y += +res[i][len - 1];
+ }
+ }
+ res[toString] = R._path2string;
+ return res;
+ }, 0, pathClone),
+ pathToAbsolute = cacher(function (pathArray) {
+ if (!R.is(pathArray, array) || !R.is(pathArray && pathArray[0], array)) { // rough assumption
+ pathArray = R.parsePathString(pathArray);
+ }
+ var res = [],
+ x = 0,
+ y = 0,
+ mx = 0,
+ my = 0,
+ start = 0;
+ if (pathArray[0][0] == "M") {
+ x = +pathArray[0][1];
+ y = +pathArray[0][2];
+ mx = x;
+ my = y;
+ start++;
+ res[0] = ["M", x, y];
+ }
+ for (var i = start, ii = pathArray[length]; i < ii; i++) {
+ var r = res[i] = [],
+ pa = pathArray[i];
+ if (pa[0] != upperCase.call(pa[0])) {
+ r[0] = upperCase.call(pa[0]);
+ switch (r[0]) {
+ case "A":
+ r[1] = pa[1];
+ r[2] = pa[2];
+ r[3] = pa[3];
+ r[4] = pa[4];
+ r[5] = pa[5];
+ r[6] = +(pa[6] + x);
+ r[7] = +(pa[7] + y);
+ break;
+ case "V":
+ r[1] = +pa[1] + y;
+ break;
+ case "H":
+ r[1] = +pa[1] + x;
+ break;
+ case "M":
+ mx = +pa[1] + x;
+ my = +pa[2] + y;
+ default:
+ for (var j = 1, jj = pa[length]; j < jj; j++) {
+ r[j] = +pa[j] + ((j % 2) ? x : y);
+ }
+ }
+ } else {
+ for (var k = 0, kk = pa[length]; k < kk; k++) {
+ res[i][k] = pa[k];
+ }
+ }
+ switch (r[0]) {
+ case "Z":
+ x = mx;
+ y = my;
+ break;
+ case "H":
+ x = r[1];
+ break;
+ case "V":
+ y = r[1];
+ break;
+ case "M":
+ mx = res[i][res[i][length] - 2];
+ my = res[i][res[i][length] - 1];
+ default:
+ x = res[i][res[i][length] - 2];
+ y = res[i][res[i][length] - 1];
+ }
+ }
+ res[toString] = R._path2string;
+ return res;
+ }, null, pathClone),
+ l2c = function (x1, y1, x2, y2) {
+ return [x1, y1, x2, y2, x2, y2];
+ },
+ q2c = function (x1, y1, ax, ay, x2, y2) {
+ var _13 = 1 / 3,
+ _23 = 2 / 3;
+ return [
+ _13 * x1 + _23 * ax,
+ _13 * y1 + _23 * ay,
+ _13 * x2 + _23 * ax,
+ _13 * y2 + _23 * ay,
+ x2,
+ y2
+ ];
+ },
+ a2c = function (x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
+ // for more information of where this math came from visit:
+ // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
+ var _120 = PI * 120 / 180,
+ rad = PI / 180 * (+angle || 0),
+ res = [],
+ xy,
+ rotate = cacher(function (x, y, rad) {
+ var X = x * math.cos(rad) - y * math.sin(rad),
+ Y = x * math.sin(rad) + y * math.cos(rad);
+ return {x: X, y: Y};
+ });
+ if (!recursive) {
+ xy = rotate(x1, y1, -rad);
+ x1 = xy.x;
+ y1 = xy.y;
+ xy = rotate(x2, y2, -rad);
+ x2 = xy.x;
+ y2 = xy.y;
+ var cos = math.cos(PI / 180 * angle),
+ sin = math.sin(PI / 180 * angle),
+ x = (x1 - x2) / 2,
+ y = (y1 - y2) / 2;
+ var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);
+ if (h > 1) {
+ h = math.sqrt(h);
+ rx = h * rx;
+ ry = h * ry;
+ }
+ var rx2 = rx * rx,
+ ry2 = ry * ry,
+ k = (large_arc_flag == sweep_flag ? -1 : 1) *
+ math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),
+ cx = k * rx * y / ry + (x1 + x2) / 2,
+ cy = k * -ry * x / rx + (y1 + y2) / 2,
+ f1 = math.asin(((y1 - cy) / ry).toFixed(9)),
+ f2 = math.asin(((y2 - cy) / ry).toFixed(9));
+
+ f1 = x1 < cx ? PI - f1 : f1;
+ f2 = x2 < cx ? PI - f2 : f2;
+ f1 < 0 && (f1 = PI * 2 + f1);
+ f2 < 0 && (f2 = PI * 2 + f2);
+ if (sweep_flag && f1 > f2) {
+ f1 = f1 - PI * 2;
+ }
+ if (!sweep_flag && f2 > f1) {
+ f2 = f2 - PI * 2;
+ }
+ } else {
+ f1 = recursive[0];
+ f2 = recursive[1];
+ cx = recursive[2];
+ cy = recursive[3];
+ }
+ var df = f2 - f1;
+ if (abs(df) > _120) {
+ var f2old = f2,
+ x2old = x2,
+ y2old = y2;
+ f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
+ x2 = cx + rx * math.cos(f2);
+ y2 = cy + ry * math.sin(f2);
+ res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
+ }
+ df = f2 - f1;
+ var c1 = math.cos(f1),
+ s1 = math.sin(f1),
+ c2 = math.cos(f2),
+ s2 = math.sin(f2),
+ t = math.tan(df / 4),
+ hx = 4 / 3 * rx * t,
+ hy = 4 / 3 * ry * t,
+ m1 = [x1, y1],
+ m2 = [x1 + hx * s1, y1 - hy * c1],
+ m3 = [x2 + hx * s2, y2 - hy * c2],
+ m4 = [x2, y2];
+ m2[0] = 2 * m1[0] - m2[0];
+ m2[1] = 2 * m1[1] - m2[1];
+ if (recursive) {
+ return [m2, m3, m4][concat](res);
+ } else {
+ res = [m2, m3, m4][concat](res)[join]()[split](",");
+ var newres = [];
+ for (var i = 0, ii = res[length]; i < ii; i++) {
+ newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
+ }
+ return newres;
+ }
+ },
+ findDotAtSegment = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
+ var t1 = 1 - t;
+ return {
+ x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,
+ y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y
+ };
+ },
+ curveDim = cacher(function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
+ var a = (c2x - 2 * c1x + p1x) - (p2x - 2 * c2x + c1x),
+ b = 2 * (c1x - p1x) - 2 * (c2x - c1x),
+ c = p1x - c1x,
+ t1 = (-b + math.sqrt(b * b - 4 * a * c)) / 2 / a,
+ t2 = (-b - math.sqrt(b * b - 4 * a * c)) / 2 / a,
+ y = [p1y, p2y],
+ x = [p1x, p2x],
+ dot;
+ abs(t1) > "1e12" && (t1 = .5);
+ abs(t2) > "1e12" && (t2 = .5);
+ if (t1 > 0 && t1 < 1) {
+ dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t1);
+ x[push](dot.x);
+ y[push](dot.y);
+ }
+ if (t2 > 0 && t2 < 1) {
+ dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t2);
+ x[push](dot.x);
+ y[push](dot.y);
+ }
+ a = (c2y - 2 * c1y + p1y) - (p2y - 2 * c2y + c1y);
+ b = 2 * (c1y - p1y) - 2 * (c2y - c1y);
+ c = p1y - c1y;
+ t1 = (-b + math.sqrt(b * b - 4 * a * c)) / 2 / a;
+ t2 = (-b - math.sqrt(b * b - 4 * a * c)) / 2 / a;
+ abs(t1) > "1e12" && (t1 = .5);
+ abs(t2) > "1e12" && (t2 = .5);
+ if (t1 > 0 && t1 < 1) {
+ dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t1);
+ x[push](dot.x);
+ y[push](dot.y);
+ }
+ if (t2 > 0 && t2 < 1) {
+ dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t2);
+ x[push](dot.x);
+ y[push](dot.y);
+ }
+ return {
+ min: {x: mmin[apply](0, x), y: mmin[apply](0, y)},
+ max: {x: mmax[apply](0, x), y: mmax[apply](0, y)}
+ };
+ }),
+ path2curve = cacher(function (path, path2) {
+ var p = pathToAbsolute(path),
+ p2 = path2 && pathToAbsolute(path2),
+ attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
+ attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
+ processPath = function (path, d) {
+ var nx, ny;
+ if (!path) {
+ return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
+ }
+ !(path[0] in {T:1, Q:1}) && (d.qx = d.qy = null);
+ switch (path[0]) {
+ case "M":
+ d.X = path[1];
+ d.Y = path[2];
+ break;
+ case "A":
+ path = ["C"][concat](a2c[apply](0, [d.x, d.y][concat](path.slice(1))));
+ break;
+ case "S":
+ nx = d.x + (d.x - (d.bx || d.x));
+ ny = d.y + (d.y - (d.by || d.y));
+ path = ["C", nx, ny][concat](path.slice(1));
+ break;
+ case "T":
+ d.qx = d.x + (d.x - (d.qx || d.x));
+ d.qy = d.y + (d.y - (d.qy || d.y));
+ path = ["C"][concat](q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));
+ break;
+ case "Q":
+ d.qx = path[1];
+ d.qy = path[2];
+ path = ["C"][concat](q2c(d.x, d.y, path[1], path[2], path[3], path[4]));
+ break;
+ case "L":
+ path = ["C"][concat](l2c(d.x, d.y, path[1], path[2]));
+ break;
+ case "H":
+ path = ["C"][concat](l2c(d.x, d.y, path[1], d.y));
+ break;
+ case "V":
+ path = ["C"][concat](l2c(d.x, d.y, d.x, path[1]));
+ break;
+ case "Z":
+ path = ["C"][concat](l2c(d.x, d.y, d.X, d.Y));
+ break;
+ }
+ return path;
+ },
+ fixArc = function (pp, i) {
+ if (pp[i][length] > 7) {
+ pp[i].shift();
+ var pi = pp[i];
+ while (pi[length]) {
+ pp.splice(i++, 0, ["C"][concat](pi.splice(0, 6)));
+ }
+ pp.splice(i, 1);
+ ii = mmax(p[length], p2 && p2[length] || 0);
+ }
+ },
+ fixM = function (path1, path2, a1, a2, i) {
+ if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") {
+ path2.splice(i, 0, ["M", a2.x, a2.y]);
+ a1.bx = 0;
+ a1.by = 0;
+ a1.x = path1[i][1];
+ a1.y = path1[i][2];
+ ii = mmax(p[length], p2 && p2[length] || 0);
+ }
+ };
+ for (var i = 0, ii = mmax(p[length], p2 && p2[length] || 0); i < ii; i++) {
+ p[i] = processPath(p[i], attrs);
+ fixArc(p, i);
+ p2 && (p2[i] = processPath(p2[i], attrs2));
+ p2 && fixArc(p2, i);
+ fixM(p, p2, attrs, attrs2, i);
+ fixM(p2, p, attrs2, attrs, i);
+ var seg = p[i],
+ seg2 = p2 && p2[i],
+ seglen = seg[length],
+ seg2len = p2 && seg2[length];
+ attrs.x = seg[seglen - 2];
+ attrs.y = seg[seglen - 1];
+ attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;
+ attrs.by = toFloat(seg[seglen - 3]) || attrs.y;
+ attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);
+ attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);
+ attrs2.x = p2 && seg2[seg2len - 2];
+ attrs2.y = p2 && seg2[seg2len - 1];
+ }
+ return p2 ? [p, p2] : p;
+ }, null, pathClone),
+ parseDots = cacher(function (gradient) {
+ var dots = [];
+ for (var i = 0, ii = gradient[length]; i < ii; i++) {
+ var dot = {},
+ par = gradient[i].match(/^([^:]*):?([\d\.]*)/);
+ dot.color = R.getRGB(par[1]);
+ if (dot.color.error) {
+ return null;
+ }
+ dot.color = dot.color.hex;
+ par[2] && (dot.offset = par[2] + "%");
+ dots[push](dot);
+ }
+ for (i = 1, ii = dots[length] - 1; i < ii; i++) {
+ if (!dots[i].offset) {
+ var start = toFloat(dots[i - 1].offset || 0),
+ end = 0;
+ for (var j = i + 1; j < ii; j++) {
+ if (dots[j].offset) {
+ end = dots[j].offset;
+ break;
+ }
+ }
+ if (!end) {
+ end = 100;
+ j = ii;
+ }
+ end = toFloat(end);
+ var d = (end - start) / (j - i + 1);
+ for (; i < j; i++) {
+ start += d;
+ dots[i].offset = start + "%";
+ }
+ }
+ }
+ return dots;
+ }),
+ getContainer = function (x, y, w, h) {
+ var container;
+ if (R.is(x, string) || R.is(x, "object")) {
+ container = R.is(x, string) ? doc.getElementById(x) : x;
+ if (container.tagName) {
+ if (y == null) {
+ return {
+ container: container,
+ width: container.style.pixelWidth || container.offsetWidth,
+ height: container.style.pixelHeight || container.offsetHeight
+ };
+ } else {
+ return {container: container, width: y, height: w};
+ }
+ }
+ } else {
+ return {container: 1, x: x, y: y, width: w, height: h};
+ }
+ },
+ plugins = function (con, add) {
+ var that = this;
+ for (var prop in add) {
+ if (add[has](prop) && !(prop in con)) {
+ switch (typeof add[prop]) {
+ case "function":
+ (function (f) {
+ con[prop] = con === that ? f : function () { return f[apply](that, arguments); };
+ })(add[prop]);
+ break;
+ case "object":
+ con[prop] = con[prop] || {};
+ plugins.call(this, con[prop], add[prop]);
+ break;
+ default:
+ con[prop] = add[prop];
+ break;
+ }
+ }
+ }
+ },
+ tear = function (el, paper) {
+ el == paper.top && (paper.top = el.prev);
+ el == paper.bottom && (paper.bottom = el.next);
+ el.next && (el.next.prev = el.prev);
+ el.prev && (el.prev.next = el.next);
+ },
+ tofront = function (el, paper) {
+ if (paper.top === el) {
+ return;
+ }
+ tear(el, paper);
+ el.next = null;
+ el.prev = paper.top;
+ paper.top.next = el;
+ paper.top = el;
+ },
+ toback = function (el, paper) {
+ if (paper.bottom === el) {
+ return;
+ }
+ tear(el, paper);
+ el.next = paper.bottom;
+ el.prev = null;
+ paper.bottom.prev = el;
+ paper.bottom = el;
+ },
+ insertafter = function (el, el2, paper) {
+ tear(el, paper);
+ el2 == paper.top && (paper.top = el);
+ el2.next && (el2.next.prev = el);
+ el.next = el2.next;
+ el.prev = el2;
+ el2.next = el;
+ },
+ insertbefore = function (el, el2, paper) {
+ tear(el, paper);
+ el2 == paper.bottom && (paper.bottom = el);
+ el2.prev && (el2.prev.next = el);
+ el.prev = el2.prev;
+ el2.prev = el;
+ el.next = el2;
+ },
+ removed = function (methodname) {
+ return function () {
+ throw new Error("Rapha\xebl: you are calling to method \u201c" + methodname + "\u201d of removed object");
+ };
+ };
+ R.pathToRelative = pathToRelative;
+ // SVG
+ if (R.svg) {
+ paperproto.svgns = "http://www.w3.org/2000/svg";
+ paperproto.xlink = "http://www.w3.org/1999/xlink";
+ round = function (num) {
+ return +num + (~~num === num) * .5;
+ };
+ var $ = function (el, attr) {
+ if (attr) {
+ for (var key in attr) {
+ if (attr[has](key)) {
+ el[setAttribute](key, Str(attr[key]));
+ }
+ }
+ } else {
+ el = doc.createElementNS(paperproto.svgns, el);
+ el.style.webkitTapHighlightColor = "rgba(0,0,0,0)";
+ return el;
+ }
+ };
+ R[toString] = function () {
+ return "Your browser supports SVG.\nYou are running Rapha\xebl " + this.version;
+ };
+ var thePath = function (pathString, SVG) {
+ var el = $("path");
+ SVG.canvas && SVG.canvas[appendChild](el);
+ var p = new Element(el, SVG);
+ p.type = "path";
+ setFillAndStroke(p, {fill: "none", stroke: "#000", path: pathString});
+ return p;
+ };
+ var addGradientFill = function (o, gradient, SVG) {
+ var type = "linear",
+ fx = .5, fy = .5,
+ s = o.style;
+ gradient = Str(gradient)[rp](radial_gradient, function (all, _fx, _fy) {
+ type = "radial";
+ if (_fx && _fy) {
+ fx = toFloat(_fx);
+ fy = toFloat(_fy);
+ var dir = ((fy > .5) * 2 - 1);
+ pow(fx - .5, 2) + pow(fy - .5, 2) > .25 &&
+ (fy = math.sqrt(.25 - pow(fx - .5, 2)) * dir + .5) &&
+ fy != .5 &&
+ (fy = fy.toFixed(5) - 1e-5 * dir);
+ }
+ return E;
+ });
+ gradient = gradient[split](/\s*\-\s*/);
+ if (type == "linear") {
+ var angle = gradient.shift();
+ angle = -toFloat(angle);
+ if (isNaN(angle)) {
+ return null;
+ }
+ var vector = [0, 0, math.cos(angle * PI / 180), math.sin(angle * PI / 180)],
+ max = 1 / (mmax(abs(vector[2]), abs(vector[3])) || 1);
+ vector[2] *= max;
+ vector[3] *= max;
+ if (vector[2] < 0) {
+ vector[0] = -vector[2];
+ vector[2] = 0;
+ }
+ if (vector[3] < 0) {
+ vector[1] = -vector[3];
+ vector[3] = 0;
+ }
+ }
+ var dots = parseDots(gradient);
+ if (!dots) {
+ return null;
+ }
+ var id = o.getAttribute(fillString);
+ id = id.match(/^url\(#(.*)\)$/);
+ id && SVG.defs.removeChild(doc.getElementById(id[1]));
+
+ var el = $(type + "Gradient");
+ el.id = createUUID();
+ $(el, type == "radial" ? {fx: fx, fy: fy} : {x1: vector[0], y1: vector[1], x2: vector[2], y2: vector[3]});
+ SVG.defs[appendChild](el);
+ for (var i = 0, ii = dots[length]; i < ii; i++) {
+ var stop = $("stop");
+ $(stop, {
+ offset: dots[i].offset ? dots[i].offset : !i ? "0%" : "100%",
+ "stop-color": dots[i].color || "#fff"
+ });
+ el[appendChild](stop);
+ }
+ $(o, {
+ fill: "url(#" + el.id + ")",
+ opacity: 1,
+ "fill-opacity": 1
+ });
+ s.fill = E;
+ s.opacity = 1;
+ s.fillOpacity = 1;
+ return 1;
+ };
+ var updatePosition = function (o) {
+ var bbox = o.getBBox();
+ $(o.pattern, {patternTransform: R.format("translate({0},{1})", bbox.x, bbox.y)});
+ };
+ var setFillAndStroke = function (o, params) {
+ var dasharray = {
+ "": [0],
+ "none": [0],
+ "-": [3, 1],
+ ".": [1, 1],
+ "-.": [3, 1, 1, 1],
+ "-..": [3, 1, 1, 1, 1, 1],
+ ". ": [1, 3],
+ "- ": [4, 3],
+ "--": [8, 3],
+ "- .": [4, 3, 1, 3],
+ "--.": [8, 3, 1, 3],
+ "--..": [8, 3, 1, 3, 1, 3]
+ },
+ node = o.node,
+ attrs = o.attrs,
+ rot = o.rotate(),
+ addDashes = function (o, value) {
+ value = dasharray[lowerCase.call(value)];
+ if (value) {
+ var width = o.attrs["stroke-width"] || "1",
+ butt = {round: width, square: width, butt: 0}[o.attrs["stroke-linecap"] || params["stroke-linecap"]] || 0,
+ dashes = [];
+ var i = value[length];
+ while (i--) {
+ dashes[i] = value[i] * width + ((i % 2) ? 1 : -1) * butt;
+ }
+ $(node, {"stroke-dasharray": dashes[join](",")});
+ }
+ };
+ params[has]("rotation") && (rot = params.rotation);
+ var rotxy = Str(rot)[split](separator);
+ if (!(rotxy.length - 1)) {
+ rotxy = null;
+ } else {
+ rotxy[1] = +rotxy[1];
+ rotxy[2] = +rotxy[2];
+ }
+ toFloat(rot) && o.rotate(0, true);
+ for (var att in params) {
+ if (params[has](att)) {
+ if (!availableAttrs[has](att)) {
+ continue;
+ }
+ var value = params[att];
+ attrs[att] = value;
+ switch (att) {
+ case "blur":
+ o.blur(value);
+ break;
+ case "rotation":
+ o.rotate(value, true);
+ break;
+ case "href":
+ case "title":
+ case "target":
+ var pn = node.parentNode;
+ if (lowerCase.call(pn.tagName) != "a") {
+ var hl = $("a");
+ pn.insertBefore(hl, node);
+ hl[appendChild](node);
+ pn = hl;
+ }
+ if (att == "target" && value == "blank") {
+ pn.setAttributeNS(o.paper.xlink, "show", "new");
+ } else {
+ pn.setAttributeNS(o.paper.xlink, att, value);
+ }
+ break;
+ case "cursor":
+ node.style.cursor = value;
+ break;
+ case "clip-rect":
+ var rect = Str(value)[split](separator);
+ if (rect[length] == 4) {
+ o.clip && o.clip.parentNode.parentNode.removeChild(o.clip.parentNode);
+ var el = $("clipPath"),
+ rc = $("rect");
+ el.id = createUUID();
+ $(rc, {
+ x: rect[0],
+ y: rect[1],
+ width: rect[2],
+ height: rect[3]
+ });
+ el[appendChild](rc);
+ o.paper.defs[appendChild](el);
+ $(node, {"clip-path": "url(#" + el.id + ")"});
+ o.clip = rc;
+ }
+ if (!value) {
+ var clip = doc.getElementById(node.getAttribute("clip-path")[rp](/(^url\(#|\)$)/g, E));
+ clip && clip.parentNode.removeChild(clip);
+ $(node, {"clip-path": E});
+ delete o.clip;
+ }
+ break;
+ case "path":
+ if (o.type == "path") {
+ $(node, {d: value ? attrs.path = pathToAbsolute(value) : "M0,0"});
+ }
+ break;
+ case "width":
+ node[setAttribute](att, value);
+ if (attrs.fx) {
+ att = "x";
+ value = attrs.x;
+ } else {
+ break;
+ }
+ case "x":
+ if (attrs.fx) {
+ value = -attrs.x - (attrs.width || 0);
+ }
+ case "rx":
+ if (att == "rx" && o.type == "rect") {
+ break;
+ }
+ case "cx":
+ rotxy && (att == "x" || att == "cx") && (rotxy[1] += value - attrs[att]);
+ node[setAttribute](att, value);
+ o.pattern && updatePosition(o);
+ break;
+ case "height":
+ node[setAttribute](att, value);
+ if (attrs.fy) {
+ att = "y";
+ value = attrs.y;
+ } else {
+ break;
+ }
+ case "y":
+ if (attrs.fy) {
+ value = -attrs.y - (attrs.height || 0);
+ }
+ case "ry":
+ if (att == "ry" && o.type == "rect") {
+ break;
+ }
+ case "cy":
+ rotxy && (att == "y" || att == "cy") && (rotxy[2] += value - attrs[att]);
+ node[setAttribute](att, value);
+ o.pattern && updatePosition(o);
+ break;
+ case "r":
+ if (o.type == "rect") {
+ $(node, {rx: value, ry: value});
+ } else {
+ node[setAttribute](att, value);
+ }
+ break;
+ case "src":
+ if (o.type == "image") {
+ node.setAttributeNS(o.paper.xlink, "href", value);
+ }
+ break;
+ case "stroke-width":
+ node.style.strokeWidth = value;
+ // Need following line for Firefox
+ node[setAttribute](att, value);
+ if (attrs["stroke-dasharray"]) {
+ addDashes(o, attrs["stroke-dasharray"]);
+ }
+ break;
+ case "stroke-dasharray":
+ addDashes(o, value);
+ break;
+ case "translation":
+ var xy = Str(value)[split](separator);
+ xy[0] = +xy[0] || 0;
+ xy[1] = +xy[1] || 0;
+ if (rotxy) {
+ rotxy[1] += xy[0];
+ rotxy[2] += xy[1];
+ }
+ translate.call(o, xy[0], xy[1]);
+ break;
+ case "scale":
+ xy = Str(value)[split](separator);
+ o.scale(+xy[0] || 1, +xy[1] || +xy[0] || 1, isNaN(toFloat(xy[2])) ? null : +xy[2], isNaN(toFloat(xy[3])) ? null : +xy[3]);
+ break;
+ case fillString:
+ var isURL = Str(value).match(ISURL);
+ if (isURL) {
+ el = $("pattern");
+ var ig = $("image");
+ el.id = createUUID();
+ $(el, {x: 0, y: 0, patternUnits: "userSpaceOnUse", height: 1, width: 1});
+ $(ig, {x: 0, y: 0});
+ ig.setAttributeNS(o.paper.xlink, "href", isURL[1]);
+ el[appendChild](ig);
+
+ var img = doc.createElement("img");
+ img.style.cssText = "position:absolute;left:-9999em;top-9999em";
+ img.onload = function () {
+ $(el, {width: this.offsetWidth, height: this.offsetHeight});
+ $(ig, {width: this.offsetWidth, height: this.offsetHeight});
+ doc.body.removeChild(this);
+ o.paper.safari();
+ };
+ doc.body[appendChild](img);
+ img.src = isURL[1];
+ o.paper.defs[appendChild](el);
+ node.style.fill = "url(#" + el.id + ")";
+ $(node, {fill: "url(#" + el.id + ")"});
+ o.pattern = el;
+ o.pattern && updatePosition(o);
+ break;
+ }
+ var clr = R.getRGB(value);
+ if (!clr.error) {
+ delete params.gradient;
+ delete attrs.gradient;
+ !R.is(attrs.opacity, "undefined") &&
+ R.is(params.opacity, "undefined") &&
+ $(node, {opacity: attrs.opacity});
+ !R.is(attrs["fill-opacity"], "undefined") &&
+ R.is(params["fill-opacity"], "undefined") &&
+ $(node, {"fill-opacity": attrs["fill-opacity"]});
+ } else if ((({circle: 1, ellipse: 1})[has](o.type) || Str(value).charAt() != "r") && addGradientFill(node, value, o.paper)) {
+ attrs.gradient = value;
+ attrs.fill = "none";
+ break;
+ }
+ clr[has]("opacity") && $(node, {"fill-opacity": clr.opacity > 1 ? clr.opacity / 100 : clr.opacity});
+ case "stroke":
+ clr = R.getRGB(value);
+ node[setAttribute](att, clr.hex);
+ att == "stroke" && clr[has]("opacity") && $(node, {"stroke-opacity": clr.opacity > 1 ? clr.opacity / 100 : clr.opacity});
+ break;
+ case "gradient":
+ (({circle: 1, ellipse: 1})[has](o.type) || Str(value).charAt() != "r") && addGradientFill(node, value, o.paper);
+ break;
+ case "opacity":
+ if (attrs.gradient && !attrs[has]("stroke-opacity")) {
+ $(node, {"stroke-opacity": value > 1 ? value / 100 : value});
+ }
+ // fall
+ case "fill-opacity":
+ if (attrs.gradient) {
+ var gradient = doc.getElementById(node.getAttribute(fillString)[rp](/^url\(#|\)$/g, E));
+ if (gradient) {
+ var stops = gradient.getElementsByTagName("stop");
+ stops[stops[length] - 1][setAttribute]("stop-opacity", value);
+ }
+ break;
+ }
+ default:
+ att == "font-size" && (value = toInt(value, 10) + "px");
+ var cssrule = att[rp](/(\-.)/g, function (w) {
+ return upperCase.call(w.substring(1));
+ });
+ node.style[cssrule] = value;
+ // Need following line for Firefox
+ node[setAttribute](att, value);
+ break;
+ }
+ }
+ }
+
+ tuneText(o, params);
+ if (rotxy) {
+ o.rotate(rotxy.join(S));
+ } else {
+ toFloat(rot) && o.rotate(rot, true);
+ }
+ };
+ var leading = 1.2,
+ tuneText = function (el, params) {
+ if (el.type != "text" || !(params[has]("text") || params[has]("font") || params[has]("font-size") || params[has]("x") || params[has]("y"))) {
+ return;
+ }
+ var a = el.attrs,
+ node = el.node,
+ fontSize = node.firstChild ? toInt(doc.defaultView.getComputedStyle(node.firstChild, E).getPropertyValue("font-size"), 10) : 10;
+
+ if (params[has]("text")) {
+ a.text = params.text;
+ while (node.firstChild) {
+ node.removeChild(node.firstChild);
+ }
+ var texts = Str(params.text)[split]("\n");
+ for (var i = 0, ii = texts[length]; i < ii; i++) if (texts[i]) {
+ var tspan = $("tspan");
+ i && $(tspan, {dy: fontSize * leading, x: a.x});
+ tspan[appendChild](doc.createTextNode(texts[i]));
+ node[appendChild](tspan);
+ }
+ } else {
+ texts = node.getElementsByTagName("tspan");
+ for (i = 0, ii = texts[length]; i < ii; i++) {
+ i && $(texts[i], {dy: fontSize * leading, x: a.x});
+ }
+ }
+ $(node, {y: a.y});
+ var bb = el.getBBox(),
+ dif = a.y - (bb.y + bb.height / 2);
+ dif && R.is(dif, "finite") && $(node, {y: a.y + dif});
+ },
+ Element = function (node, svg) {
+ var X = 0,
+ Y = 0;
+ this[0] = node;
+ this.id = R._oid++;
+ this.node = node;
+ node.raphael = this;
+ this.paper = svg;
+ this.attrs = this.attrs || {};
+ this.transformations = []; // rotate, translate, scale
+ this._ = {
+ tx: 0,
+ ty: 0,
+ rt: {deg: 0, cx: 0, cy: 0},
+ sx: 1,
+ sy: 1
+ };
+ !svg.bottom && (svg.bottom = this);
+ this.prev = svg.top;
+ svg.top && (svg.top.next = this);
+ svg.top = this;
+ this.next = null;
+ };
+ var elproto = Element[proto];
+ Element[proto].rotate = function (deg, cx, cy) {
+ if (this.removed) {
+ return this;
+ }
+ if (deg == null) {
+ if (this._.rt.cx) {
+ return [this._.rt.deg, this._.rt.cx, this._.rt.cy][join](S);
+ }
+ return this._.rt.deg;
+ }
+ var bbox = this.getBBox();
+ deg = Str(deg)[split](separator);
+ if (deg[length] - 1) {
+ cx = toFloat(deg[1]);
+ cy = toFloat(deg[2]);
+ }
+ deg = toFloat(deg[0]);
+ if (cx != null && cx !== false) {
+ this._.rt.deg = deg;
+ } else {
+ this._.rt.deg += deg;
+ }
+ (cy == null) && (cx = null);
+ this._.rt.cx = cx;
+ this._.rt.cy = cy;
+ cx = cx == null ? bbox.x + bbox.width / 2 : cx;
+ cy = cy == null ? bbox.y + bbox.height / 2 : cy;
+ if (this._.rt.deg) {
+ this.transformations[0] = R.format("rotate({0} {1} {2})", this._.rt.deg, cx, cy);
+ this.clip && $(this.clip, {transform: R.format("rotate({0} {1} {2})", -this._.rt.deg, cx, cy)});
+ } else {
+ this.transformations[0] = E;
+ this.clip && $(this.clip, {transform: E});
+ }
+ $(this.node, {transform: this.transformations[join](S)});
+ return this;
+ };
+ Element[proto].hide = function () {
+ !this.removed && (this.node.style.display = "none");
+ return this;
+ };
+ Element[proto].show = function () {
+ !this.removed && (this.node.style.display = "");
+ return this;
+ };
+ Element[proto].remove = function () {
+ if (this.removed) {
+ return;
+ }
+ tear(this, this.paper);
+ this.node.parentNode.removeChild(this.node);
+ for (var i in this) {
+ delete this[i];
+ }
+ this.removed = true;
+ };
+ Element[proto].getBBox = function () {
+ if (this.removed) {
+ return this;
+ }
+ if (this.type == "path") {
+ return pathDimensions(this.attrs.path);
+ }
+ if (this.node.style.display == "none") {
+ this.show();
+ var hide = true;
+ }
+ var bbox = {};
+ try {
+ bbox = this.node.getBBox();
+ } catch(e) {
+ // Firefox 3.0.x plays badly here
+ } finally {
+ bbox = bbox || {};
+ }
+ if (this.type == "text") {
+ bbox = {x: bbox.x, y: Infinity, width: 0, height: 0};
+ for (var i = 0, ii = this.node.getNumberOfChars(); i < ii; i++) {
+ var bb = this.node.getExtentOfChar(i);
+ (bb.y < bbox.y) && (bbox.y = bb.y);
+ (bb.y + bb.height - bbox.y > bbox.height) && (bbox.height = bb.y + bb.height - bbox.y);
+ (bb.x + bb.width - bbox.x > bbox.width) && (bbox.width = bb.x + bb.width - bbox.x);
+ }
+ }
+ hide && this.hide();
+ return bbox;
+ };
+ Element[proto].attr = function (name, value) {
+ if (this.removed) {
+ return this;
+ }
+ if (name == null) {
+ var res = {};
+ for (var i in this.attrs) if (this.attrs[has](i)) {
+ res[i] = this.attrs[i];
+ }
+ this._.rt.deg && (res.rotation = this.rotate());
+ (this._.sx != 1 || this._.sy != 1) && (res.scale = this.scale());
+ res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient;
+ return res;
+ }
+ if (value == null && R.is(name, string)) {
+ if (name == "translation") {
+ return translate.call(this);
+ }
+ if (name == "rotation") {
+ return this.rotate();
+ }
+ if (name == "scale") {
+ return this.scale();
+ }
+ if (name == fillString && this.attrs.fill == "none" && this.attrs.gradient) {
+ return this.attrs.gradient;
+ }
+ return this.attrs[name];
+ }
+ if (value == null && R.is(name, array)) {
+ var values = {};
+ for (var j = 0, jj = name.length; j < jj; j++) {
+ values[name[j]] = this.attr(name[j]);
+ }
+ return values;
+ }
+ if (value != null) {
+ var params = {};
+ params[name] = value;
+ } else if (name != null && R.is(name, "object")) {
+ params = name;
+ }
+ for (var key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
+ var par = this.paper.customAttributes[key].apply(this, [][concat](params[key]));
+ this.attrs[key] = params[key];
+ for (var subkey in par) if (par[has](subkey)) {
+ params[subkey] = par[subkey];
+ }
+ }
+ setFillAndStroke(this, params);
+ return this;
+ };
+ Element[proto].toFront = function () {
+ if (this.removed) {
+ return this;
+ }
+ this.node.parentNode[appendChild](this.node);
+ var svg = this.paper;
+ svg.top != this && tofront(this, svg);
+ return this;
+ };
+ Element[proto].toBack = function () {
+ if (this.removed) {
+ return this;
+ }
+ if (this.node.parentNode.firstChild != this.node) {
+ this.node.parentNode.insertBefore(this.node, this.node.parentNode.firstChild);
+ toback(this, this.paper);
+ var svg = this.paper;
+ }
+ return this;
+ };
+ Element[proto].insertAfter = function (element) {
+ if (this.removed) {
+ return this;
+ }
+ var node = element.node || element[element.length - 1].node;
+ if (node.nextSibling) {
+ node.parentNode.insertBefore(this.node, node.nextSibling);
+ } else {
+ node.parentNode[appendChild](this.node);
+ }
+ insertafter(this, element, this.paper);
+ return this;
+ };
+ Element[proto].insertBefore = function (element) {
+ if (this.removed) {
+ return this;
+ }
+ var node = element.node || element[0].node;
+ node.parentNode.insertBefore(this.node, node);
+ insertbefore(this, element, this.paper);
+ return this;
+ };
+ Element[proto].blur = function (size) {
+ // Experimental. No Safari support. Use it on your own risk.
+ var t = this;
+ if (+size !== 0) {
+ var fltr = $("filter"),
+ blur = $("feGaussianBlur");
+ t.attrs.blur = size;
+ fltr.id = createUUID();
+ $(blur, {stdDeviation: +size || 1.5});
+ fltr.appendChild(blur);
+ t.paper.defs.appendChild(fltr);
+ t._blur = fltr;
+ $(t.node, {filter: "url(#" + fltr.id + ")"});
+ } else {
+ if (t._blur) {
+ t._blur.parentNode.removeChild(t._blur);
+ delete t._blur;
+ delete t.attrs.blur;
+ }
+ t.node.removeAttribute("filter");
+ }
+ };
+ var theCircle = function (svg, x, y, r) {
+ var el = $("circle");
+ svg.canvas && svg.canvas[appendChild](el);
+ var res = new Element(el, svg);
+ res.attrs = {cx: x, cy: y, r: r, fill: "none", stroke: "#000"};
+ res.type = "circle";
+ $(el, res.attrs);
+ return res;
+ },
+ theRect = function (svg, x, y, w, h, r) {
+ var el = $("rect");
+ svg.canvas && svg.canvas[appendChild](el);
+ var res = new Element(el, svg);
+ res.attrs = {x: x, y: y, width: w, height: h, r: r || 0, rx: r || 0, ry: r || 0, fill: "none", stroke: "#000"};
+ res.type = "rect";
+ $(el, res.attrs);
+ return res;
+ },
+ theEllipse = function (svg, x, y, rx, ry) {
+ var el = $("ellipse");
+ svg.canvas && svg.canvas[appendChild](el);
+ var res = new Element(el, svg);
+ res.attrs = {cx: x, cy: y, rx: rx, ry: ry, fill: "none", stroke: "#000"};
+ res.type = "ellipse";
+ $(el, res.attrs);
+ return res;
+ },
+ theImage = function (svg, src, x, y, w, h) {
+ var el = $("image");
+ $(el, {x: x, y: y, width: w, height: h, preserveAspectRatio: "none"});
+ el.setAttributeNS(svg.xlink, "href", src);
+ svg.canvas && svg.canvas[appendChild](el);
+ var res = new Element(el, svg);
+ res.attrs = {x: x, y: y, width: w, height: h, src: src};
+ res.type = "image";
+ return res;
+ },
+ theText = function (svg, x, y, text) {
+ var el = $("text");
+ $(el, {x: x, y: y, "text-anchor": "middle"});
+ svg.canvas && svg.canvas[appendChild](el);
+ var res = new Element(el, svg);
+ res.attrs = {x: x, y: y, "text-anchor": "middle", text: text, font: availableAttrs.font, stroke: "none", fill: "#000"};
+ res.type = "text";
+ setFillAndStroke(res, res.attrs);
+ return res;
+ },
+ setSize = function (width, height) {
+ this.width = width || this.width;
+ this.height = height || this.height;
+ this.canvas[setAttribute]("width", this.width);
+ this.canvas[setAttribute]("height", this.height);
+ return this;
+ },
+ create = function () {
+ var con = getContainer[apply](0, arguments),
+ container = con && con.container,
+ x = con.x,
+ y = con.y,
+ width = con.width,
+ height = con.height;
+ if (!container) {
+ throw new Error("SVG container not found.");
+ }
+ var cnvs = $("svg");
+ x = x || 0;
+ y = y || 0;
+ width = width || 512;
+ height = height || 342;
+ $(cnvs, {
+ xmlns: "http://www.w3.org/2000/svg",
+ version: 1.1,
+ width: width,
+ height: height
+ });
+ if (container == 1) {
+ cnvs.style.cssText = "left:" + x + "px;top:" + y + "px";
+ doc.body[appendChild](cnvs);
+ } else {
+ if (container.firstChild) {
+ container.insertBefore(cnvs, container.firstChild);
+ } else {
+ container[appendChild](cnvs);
+ }
+ }
+ container = new Paper;
+ container.width = width;
+ container.height = height;
+ container.canvas = cnvs;
+ plugins.call(container, container, R.fn);
+ container.clear();
+ return container;
+ };
+ paperproto.clear = function () {
+ var c = this.canvas;
+ while (c.firstChild) {
+ c.removeChild(c.firstChild);
+ }
+ this.bottom = this.top = null;
+ (this.desc = $("desc"))[appendChild](doc.createTextNode("Created with Rapha\xebl"));
+ c[appendChild](this.desc);
+ c[appendChild](this.defs = $("defs"));
+ };
+ paperproto.remove = function () {
+ this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas);
+ for (var i in this) {
+ this[i] = removed(i);
+ }
+ };
+ }
+
+ // VML
+ if (R.vml) {
+ var map = {M: "m", L: "l", C: "c", Z: "x", m: "t", l: "r", c: "v", z: "x"},
+ bites = /([clmz]),?([^clmz]*)/gi,
+ blurregexp = / progid:\S+Blur\([^\)]+\)/g,
+ val = /-?[^,\s-]+/g,
+ coordsize = 1e3 + S + 1e3,
+ zoom = 10,
+ pathlike = {path: 1, rect: 1},
+ path2vml = function (path) {
+ var total = /[ahqstv]/ig,
+ command = pathToAbsolute;
+ Str(path).match(total) && (command = path2curve);
+ total = /[clmz]/g;
+ if (command == pathToAbsolute && !Str(path).match(total)) {
+ var res = Str(path)[rp](bites, function (all, command, args) {
+ var vals = [],
+ isMove = lowerCase.call(command) == "m",
+ res = map[command];
+ args[rp](val, function (value) {
+ if (isMove && vals[length] == 2) {
+ res += vals + map[command == "m" ? "l" : "L"];
+ vals = [];
+ }
+ vals[push](round(value * zoom));
+ });
+ return res + vals;
+ });
+ return res;
+ }
+ var pa = command(path), p, r;
+ res = [];
+ for (var i = 0, ii = pa[length]; i < ii; i++) {
+ p = pa[i];
+ r = lowerCase.call(pa[i][0]);
+ r == "z" && (r = "x");
+ for (var j = 1, jj = p[length]; j < jj; j++) {
+ r += round(p[j] * zoom) + (j != jj - 1 ? "," : E);
+ }
+ res[push](r);
+ }
+ return res[join](S);
+ };
+
+ R[toString] = function () {
+ return "Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\xebl " + this.version;
+ };
+ thePath = function (pathString, vml) {
+ var g = createNode("group");
+ g.style.cssText = "position:absolute;left:0;top:0;width:" + vml.width + "px;height:" + vml.height + "px";
+ g.coordsize = vml.coordsize;
+ g.coordorigin = vml.coordorigin;
+ var el = createNode("shape"), ol = el.style;
+ ol.width = vml.width + "px";
+ ol.height = vml.height + "px";
+ el.coordsize = coordsize;
+ el.coordorigin = vml.coordorigin;
+ g[appendChild](el);
+ var p = new Element(el, g, vml),
+ attr = {fill: "none", stroke: "#000"};
+ pathString && (attr.path = pathString);
+ p.type = "path";
+ p.path = [];
+ p.Path = E;
+ setFillAndStroke(p, attr);
+ vml.canvas[appendChild](g);
+ return p;
+ };
+ setFillAndStroke = function (o, params) {
+ o.attrs = o.attrs || {};
+ var node = o.node,
+ a = o.attrs,
+ s = node.style,
+ xy,
+ newpath = (params.x != a.x || params.y != a.y || params.width != a.width || params.height != a.height || params.r != a.r) && o.type == "rect",
+ res = o;
+
+ for (var par in params) if (params[has](par)) {
+ a[par] = params[par];
+ }
+ if (newpath) {
+ a.path = rectPath(a.x, a.y, a.width, a.height, a.r);
+ o.X = a.x;
+ o.Y = a.y;
+ o.W = a.width;
+ o.H = a.height;
+ }
+ params.href && (node.href = params.href);
+ params.title && (node.title = params.title);
+ params.target && (node.target = params.target);
+ params.cursor && (s.cursor = params.cursor);
+ "blur" in params && o.blur(params.blur);
+ if (params.path && o.type == "path" || newpath) {
+ node.path = path2vml(a.path);
+ }
+ if (params.rotation != null) {
+ o.rotate(params.rotation, true);
+ }
+ if (params.translation) {
+ xy = Str(params.translation)[split](separator);
+ translate.call(o, xy[0], xy[1]);
+ if (o._.rt.cx != null) {
+ o._.rt.cx +=+ xy[0];
+ o._.rt.cy +=+ xy[1];
+ o.setBox(o.attrs, xy[0], xy[1]);
+ }
+ }
+ if (params.scale) {
+ xy = Str(params.scale)[split](separator);
+ o.scale(+xy[0] || 1, +xy[1] || +xy[0] || 1, +xy[2] || null, +xy[3] || null);
+ }
+ if ("clip-rect" in params) {
+ var rect = Str(params["clip-rect"])[split](separator);
+ if (rect[length] == 4) {
+ rect[2] = +rect[2] + (+rect[0]);
+ rect[3] = +rect[3] + (+rect[1]);
+ var div = node.clipRect || doc.createElement("div"),
+ dstyle = div.style,
+ group = node.parentNode;
+ dstyle.clip = R.format("rect({1}px {2}px {3}px {0}px)", rect);
+ if (!node.clipRect) {
+ dstyle.position = "absolute";
+ dstyle.top = 0;
+ dstyle.left = 0;
+ dstyle.width = o.paper.width + "px";
+ dstyle.height = o.paper.height + "px";
+ group.parentNode.insertBefore(div, group);
+ div[appendChild](group);
+ node.clipRect = div;
+ }
+ }
+ if (!params["clip-rect"]) {
+ node.clipRect && (node.clipRect.style.clip = E);
+ }
+ }
+ if (o.type == "image" && params.src) {
+ node.src = params.src;
+ }
+ if (o.type == "image" && params.opacity) {
+ node.filterOpacity = ms + ".Alpha(opacity=" + (params.opacity * 100) + ")";
+ s.filter = (node.filterMatrix || E) + (node.filterOpacity || E);
+ }
+ params.font && (s.font = params.font);
+ params["font-family"] && (s.fontFamily = '"' + params["font-family"][split](",")[0][rp](/^['"]+|['"]+$/g, E) + '"');
+ params["font-size"] && (s.fontSize = params["font-size"]);
+ params["font-weight"] && (s.fontWeight = params["font-weight"]);
+ params["font-style"] && (s.fontStyle = params["font-style"]);
+ if (params.opacity != null ||
+ params["stroke-width"] != null ||
+ params.fill != null ||
+ params.stroke != null ||
+ params["stroke-width"] != null ||
+ params["stroke-opacity"] != null ||
+ params["fill-opacity"] != null ||
+ params["stroke-dasharray"] != null ||
+ params["stroke-miterlimit"] != null ||
+ params["stroke-linejoin"] != null ||
+ params["stroke-linecap"] != null) {
+ node = o.shape || node;
+ var fill = (node.getElementsByTagName(fillString) && node.getElementsByTagName(fillString)[0]),
+ newfill = false;
+ !fill && (newfill = fill = createNode(fillString));
+ if ("fill-opacity" in params || "opacity" in params) {
+ var opacity = ((+a["fill-opacity"] + 1 || 2) - 1) * ((+a.opacity + 1 || 2) - 1) * ((+R.getRGB(params.fill).o + 1 || 2) - 1);
+ opacity = mmin(mmax(opacity, 0), 1);
+ fill.opacity = opacity;
+ }
+ params.fill && (fill.on = true);
+ if (fill.on == null || params.fill == "none") {
+ fill.on = false;
+ }
+ if (fill.on && params.fill) {
+ var isURL = params.fill.match(ISURL);
+ if (isURL) {
+ fill.src = isURL[1];
+ fill.type = "tile";
+ } else {
+ fill.color = R.getRGB(params.fill).hex;
+ fill.src = E;
+ fill.type = "solid";
+ if (R.getRGB(params.fill).error && (res.type in {circle: 1, ellipse: 1} || Str(params.fill).charAt() != "r") && addGradientFill(res, params.fill)) {
+ a.fill = "none";
+ a.gradient = params.fill;
+ }
+ }
+ }
+ newfill && node[appendChild](fill);
+ var stroke = (node.getElementsByTagName("stroke") && node.getElementsByTagName("stroke")[0]),
+ newstroke = false;
+ !stroke && (newstroke = stroke = createNode("stroke"));
+ if ((params.stroke && params.stroke != "none") ||
+ params["stroke-width"] ||
+ params["stroke-opacity"] != null ||
+ params["stroke-dasharray"] ||
+ params["stroke-miterlimit"] ||
+ params["stroke-linejoin"] ||
+ params["stroke-linecap"]) {
+ stroke.on = true;
+ }
+ (params.stroke == "none" || stroke.on == null || params.stroke == 0 || params["stroke-width"] == 0) && (stroke.on = false);
+ var strokeColor = R.getRGB(params.stroke);
+ stroke.on && params.stroke && (stroke.color = strokeColor.hex);
+ opacity = ((+a["stroke-opacity"] + 1 || 2) - 1) * ((+a.opacity + 1 || 2) - 1) * ((+strokeColor.o + 1 || 2) - 1);
+ var width = (toFloat(params["stroke-width"]) || 1) * .75;
+ opacity = mmin(mmax(opacity, 0), 1);
+ params["stroke-width"] == null && (width = a["stroke-width"]);
+ params["stroke-width"] && (stroke.weight = width);
+ width && width < 1 && (opacity *= width) && (stroke.weight = 1);
+ stroke.opacity = opacity;
+
+ params["stroke-linejoin"] && (stroke.joinstyle = params["stroke-linejoin"] || "miter");
+ stroke.miterlimit = params["stroke-miterlimit"] || 8;
+ params["stroke-linecap"] && (stroke.endcap = params["stroke-linecap"] == "butt" ? "flat" : params["stroke-linecap"] == "square" ? "square" : "round");
+ if (params["stroke-dasharray"]) {
+ var dasharray = {
+ "-": "shortdash",
+ ".": "shortdot",
+ "-.": "shortdashdot",
+ "-..": "shortdashdotdot",
+ ". ": "dot",
+ "- ": "dash",
+ "--": "longdash",
+ "- .": "dashdot",
+ "--.": "longdashdot",
+ "--..": "longdashdotdot"
+ };
+ stroke.dashstyle = dasharray[has](params["stroke-dasharray"]) ? dasharray[params["stroke-dasharray"]] : E;
+ }
+ newstroke && node[appendChild](stroke);
+ }
+ if (res.type == "text") {
+ s = res.paper.span.style;
+ a.font && (s.font = a.font);
+ a["font-family"] && (s.fontFamily = a["font-family"]);
+ a["font-size"] && (s.fontSize = a["font-size"]);
+ a["font-weight"] && (s.fontWeight = a["font-weight"]);
+ a["font-style"] && (s.fontStyle = a["font-style"]);
+ res.node.string && (res.paper.span.innerHTML = Str(res.node.string)[rp](/"));
+ res.W = a.w = res.paper.span.offsetWidth;
+ res.H = a.h = res.paper.span.offsetHeight;
+ res.X = a.x;
+ res.Y = a.y + round(res.H / 2);
+
+ // text-anchor emulationm
+ switch (a["text-anchor"]) {
+ case "start":
+ res.node.style["v-text-align"] = "left";
+ res.bbx = round(res.W / 2);
+ break;
+ case "end":
+ res.node.style["v-text-align"] = "right";
+ res.bbx = -round(res.W / 2);
+ break;
+ default:
+ res.node.style["v-text-align"] = "center";
+ break;
+ }
+ }
+ };
+ addGradientFill = function (o, gradient) {
+ o.attrs = o.attrs || {};
+ var attrs = o.attrs,
+ fill,
+ type = "linear",
+ fxfy = ".5 .5";
+ o.attrs.gradient = gradient;
+ gradient = Str(gradient)[rp](radial_gradient, function (all, fx, fy) {
+ type = "radial";
+ if (fx && fy) {
+ fx = toFloat(fx);
+ fy = toFloat(fy);
+ pow(fx - .5, 2) + pow(fy - .5, 2) > .25 && (fy = math.sqrt(.25 - pow(fx - .5, 2)) * ((fy > .5) * 2 - 1) + .5);
+ fxfy = fx + S + fy;
+ }
+ return E;
+ });
+ gradient = gradient[split](/\s*\-\s*/);
+ if (type == "linear") {
+ var angle = gradient.shift();
+ angle = -toFloat(angle);
+ if (isNaN(angle)) {
+ return null;
+ }
+ }
+ var dots = parseDots(gradient);
+ if (!dots) {
+ return null;
+ }
+ o = o.shape || o.node;
+ fill = o.getElementsByTagName(fillString)[0] || createNode(fillString);
+ !fill.parentNode && o.appendChild(fill);
+ if (dots[length]) {
+ fill.on = true;
+ fill.method = "none";
+ fill.color = dots[0].color;
+ fill.color2 = dots[dots[length] - 1].color;
+ var clrs = [];
+ for (var i = 0, ii = dots[length]; i < ii; i++) {
+ dots[i].offset && clrs[push](dots[i].offset + S + dots[i].color);
+ }
+ fill.colors && (fill.colors.value = clrs[length] ? clrs[join]() : "0% " + fill.color);
+ if (type == "radial") {
+ fill.type = "gradientradial";
+ fill.focus = "100%";
+ fill.focussize = fxfy;
+ fill.focusposition = fxfy;
+ } else {
+ fill.type = "gradient";
+ fill.angle = (270 - angle) % 360;
+ }
+ }
+ return 1;
+ };
+ Element = function (node, group, vml) {
+ var Rotation = 0,
+ RotX = 0,
+ RotY = 0,
+ Scale = 1;
+ this[0] = node;
+ this.id = R._oid++;
+ this.node = node;
+ node.raphael = this;
+ this.X = 0;
+ this.Y = 0;
+ this.attrs = {};
+ this.Group = group;
+ this.paper = vml;
+ this._ = {
+ tx: 0,
+ ty: 0,
+ rt: {deg:0},
+ sx: 1,
+ sy: 1
+ };
+ !vml.bottom && (vml.bottom = this);
+ this.prev = vml.top;
+ vml.top && (vml.top.next = this);
+ vml.top = this;
+ this.next = null;
+ };
+ elproto = Element[proto];
+ elproto.rotate = function (deg, cx, cy) {
+ if (this.removed) {
+ return this;
+ }
+ if (deg == null) {
+ if (this._.rt.cx) {
+ return [this._.rt.deg, this._.rt.cx, this._.rt.cy][join](S);
+ }
+ return this._.rt.deg;
+ }
+ deg = Str(deg)[split](separator);
+ if (deg[length] - 1) {
+ cx = toFloat(deg[1]);
+ cy = toFloat(deg[2]);
+ }
+ deg = toFloat(deg[0]);
+ if (cx != null) {
+ this._.rt.deg = deg;
+ } else {
+ this._.rt.deg += deg;
+ }
+ cy == null && (cx = null);
+ this._.rt.cx = cx;
+ this._.rt.cy = cy;
+ this.setBox(this.attrs, cx, cy);
+ this.Group.style.rotation = this._.rt.deg;
+ // gradient fix for rotation. TODO
+ // var fill = (this.shape || this.node).getElementsByTagName(fillString);
+ // fill = fill[0] || {};
+ // var b = ((360 - this._.rt.deg) - 270) % 360;
+ // !R.is(fill.angle, "undefined") && (fill.angle = b);
+ return this;
+ };
+ elproto.setBox = function (params, cx, cy) {
+ if (this.removed) {
+ return this;
+ }
+ var gs = this.Group.style,
+ os = (this.shape && this.shape.style) || this.node.style;
+ params = params || {};
+ for (var i in params) if (params[has](i)) {
+ this.attrs[i] = params[i];
+ }
+ cx = cx || this._.rt.cx;
+ cy = cy || this._.rt.cy;
+ var attr = this.attrs,
+ x,
+ y,
+ w,
+ h;
+ switch (this.type) {
+ case "circle":
+ x = attr.cx - attr.r;
+ y = attr.cy - attr.r;
+ w = h = attr.r * 2;
+ break;
+ case "ellipse":
+ x = attr.cx - attr.rx;
+ y = attr.cy - attr.ry;
+ w = attr.rx * 2;
+ h = attr.ry * 2;
+ break;
+ case "image":
+ x = +attr.x;
+ y = +attr.y;
+ w = attr.width || 0;
+ h = attr.height || 0;
+ break;
+ case "text":
+ this.textpath.v = ["m", round(attr.x), ", ", round(attr.y - 2), "l", round(attr.x) + 1, ", ", round(attr.y - 2)][join](E);
+ x = attr.x - round(this.W / 2);
+ y = attr.y - this.H / 2;
+ w = this.W;
+ h = this.H;
+ break;
+ case "rect":
+ case "path":
+ if (!this.attrs.path) {
+ x = 0;
+ y = 0;
+ w = this.paper.width;
+ h = this.paper.height;
+ } else {
+ var dim = pathDimensions(this.attrs.path);
+ x = dim.x;
+ y = dim.y;
+ w = dim.width;
+ h = dim.height;
+ }
+ break;
+ default:
+ x = 0;
+ y = 0;
+ w = this.paper.width;
+ h = this.paper.height;
+ break;
+ }
+ cx = (cx == null) ? x + w / 2 : cx;
+ cy = (cy == null) ? y + h / 2 : cy;
+ var left = cx - this.paper.width / 2,
+ top = cy - this.paper.height / 2, t;
+ gs.left != (t = left + "px") && (gs.left = t);
+ gs.top != (t = top + "px") && (gs.top = t);
+ this.X = pathlike[has](this.type) ? -left : x;
+ this.Y = pathlike[has](this.type) ? -top : y;
+ this.W = w;
+ this.H = h;
+ if (pathlike[has](this.type)) {
+ os.left != (t = -left * zoom + "px") && (os.left = t);
+ os.top != (t = -top * zoom + "px") && (os.top = t);
+ } else if (this.type == "text") {
+ os.left != (t = -left + "px") && (os.left = t);
+ os.top != (t = -top + "px") && (os.top = t);
+ } else {
+ gs.width != (t = this.paper.width + "px") && (gs.width = t);
+ gs.height != (t = this.paper.height + "px") && (gs.height = t);
+ os.left != (t = x - left + "px") && (os.left = t);
+ os.top != (t = y - top + "px") && (os.top = t);
+ os.width != (t = w + "px") && (os.width = t);
+ os.height != (t = h + "px") && (os.height = t);
+ }
+ };
+ elproto.hide = function () {
+ !this.removed && (this.Group.style.display = "none");
+ return this;
+ };
+ elproto.show = function () {
+ !this.removed && (this.Group.style.display = "block");
+ return this;
+ };
+ elproto.getBBox = function () {
+ if (this.removed) {
+ return this;
+ }
+ if (pathlike[has](this.type)) {
+ return pathDimensions(this.attrs.path);
+ }
+ return {
+ x: this.X + (this.bbx || 0),
+ y: this.Y,
+ width: this.W,
+ height: this.H
+ };
+ };
+ elproto.remove = function () {
+ if (this.removed) {
+ return;
+ }
+ tear(this, this.paper);
+ this.node.parentNode.removeChild(this.node);
+ this.Group.parentNode.removeChild(this.Group);
+ this.shape && this.shape.parentNode.removeChild(this.shape);
+ for (var i in this) {
+ delete this[i];
+ }
+ this.removed = true;
+ };
+ elproto.attr = function (name, value) {
+ if (this.removed) {
+ return this;
+ }
+ if (name == null) {
+ var res = {};
+ for (var i in this.attrs) if (this.attrs[has](i)) {
+ res[i] = this.attrs[i];
+ }
+ this._.rt.deg && (res.rotation = this.rotate());
+ (this._.sx != 1 || this._.sy != 1) && (res.scale = this.scale());
+ res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient;
+ return res;
+ }
+ if (value == null && R.is(name, "string")) {
+ if (name == "translation") {
+ return translate.call(this);
+ }
+ if (name == "rotation") {
+ return this.rotate();
+ }
+ if (name == "scale") {
+ return this.scale();
+ }
+ if (name == fillString && this.attrs.fill == "none" && this.attrs.gradient) {
+ return this.attrs.gradient;
+ }
+ return this.attrs[name];
+ }
+ if (this.attrs && value == null && R.is(name, array)) {
+ var ii, values = {};
+ for (i = 0, ii = name[length]; i < ii; i++) {
+ values[name[i]] = this.attr(name[i]);
+ }
+ return values;
+ }
+ var params;
+ if (value != null) {
+ params = {};
+ params[name] = value;
+ }
+ value == null && R.is(name, "object") && (params = name);
+ if (params) {
+ for (var key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
+ var par = this.paper.customAttributes[key].apply(this, [][concat](params[key]));
+ this.attrs[key] = params[key];
+ for (var subkey in par) if (par[has](subkey)) {
+ params[subkey] = par[subkey];
+ }
+ }
+ if (params.text && this.type == "text") {
+ this.node.string = params.text;
+ }
+ setFillAndStroke(this, params);
+ if (params.gradient && (({circle: 1, ellipse: 1})[has](this.type) || Str(params.gradient).charAt() != "r")) {
+ addGradientFill(this, params.gradient);
+ }
+ (!pathlike[has](this.type) || this._.rt.deg) && this.setBox(this.attrs);
+ }
+ return this;
+ };
+ elproto.toFront = function () {
+ !this.removed && this.Group.parentNode[appendChild](this.Group);
+ this.paper.top != this && tofront(this, this.paper);
+ return this;
+ };
+ elproto.toBack = function () {
+ if (this.removed) {
+ return this;
+ }
+ if (this.Group.parentNode.firstChild != this.Group) {
+ this.Group.parentNode.insertBefore(this.Group, this.Group.parentNode.firstChild);
+ toback(this, this.paper);
+ }
+ return this;
+ };
+ elproto.insertAfter = function (element) {
+ if (this.removed) {
+ return this;
+ }
+ if (element.constructor == Set) {
+ element = element[element.length - 1];
+ }
+ if (element.Group.nextSibling) {
+ element.Group.parentNode.insertBefore(this.Group, element.Group.nextSibling);
+ } else {
+ element.Group.parentNode[appendChild](this.Group);
+ }
+ insertafter(this, element, this.paper);
+ return this;
+ };
+ elproto.insertBefore = function (element) {
+ if (this.removed) {
+ return this;
+ }
+ if (element.constructor == Set) {
+ element = element[0];
+ }
+ element.Group.parentNode.insertBefore(this.Group, element.Group);
+ insertbefore(this, element, this.paper);
+ return this;
+ };
+ elproto.blur = function (size) {
+ var s = this.node.runtimeStyle,
+ f = s.filter;
+ f = f.replace(blurregexp, E);
+ if (+size !== 0) {
+ this.attrs.blur = size;
+ s.filter = f + S + ms + ".Blur(pixelradius=" + (+size || 1.5) + ")";
+ s.margin = R.format("-{0}px 0 0 -{0}px", round(+size || 1.5));
+ } else {
+ s.filter = f;
+ s.margin = 0;
+ delete this.attrs.blur;
+ }
+ };
+
+ theCircle = function (vml, x, y, r) {
+ var g = createNode("group"),
+ o = createNode("oval"),
+ ol = o.style;
+ g.style.cssText = "position:absolute;left:0;top:0;width:" + vml.width + "px;height:" + vml.height + "px";
+ g.coordsize = coordsize;
+ g.coordorigin = vml.coordorigin;
+ g[appendChild](o);
+ var res = new Element(o, g, vml);
+ res.type = "circle";
+ setFillAndStroke(res, {stroke: "#000", fill: "none"});
+ res.attrs.cx = x;
+ res.attrs.cy = y;
+ res.attrs.r = r;
+ res.setBox({x: x - r, y: y - r, width: r * 2, height: r * 2});
+ vml.canvas[appendChild](g);
+ return res;
+ };
+ function rectPath(x, y, w, h, r) {
+ if (r) {
+ return R.format("M{0},{1}l{2},0a{3},{3},0,0,1,{3},{3}l0,{5}a{3},{3},0,0,1,{4},{3}l{6},0a{3},{3},0,0,1,{4},{4}l0,{7}a{3},{3},0,0,1,{3},{4}z", x + r, y, w - r * 2, r, -r, h - r * 2, r * 2 - w, r * 2 - h);
+ } else {
+ return R.format("M{0},{1}l{2},0,0,{3},{4},0z", x, y, w, h, -w);
+ }
+ }
+ theRect = function (vml, x, y, w, h, r) {
+ var path = rectPath(x, y, w, h, r),
+ res = vml.path(path),
+ a = res.attrs;
+ res.X = a.x = x;
+ res.Y = a.y = y;
+ res.W = a.width = w;
+ res.H = a.height = h;
+ a.r = r;
+ a.path = path;
+ res.type = "rect";
+ return res;
+ };
+ theEllipse = function (vml, x, y, rx, ry) {
+ var g = createNode("group"),
+ o = createNode("oval"),
+ ol = o.style;
+ g.style.cssText = "position:absolute;left:0;top:0;width:" + vml.width + "px;height:" + vml.height + "px";
+ g.coordsize = coordsize;
+ g.coordorigin = vml.coordorigin;
+ g[appendChild](o);
+ var res = new Element(o, g, vml);
+ res.type = "ellipse";
+ setFillAndStroke(res, {stroke: "#000"});
+ res.attrs.cx = x;
+ res.attrs.cy = y;
+ res.attrs.rx = rx;
+ res.attrs.ry = ry;
+ res.setBox({x: x - rx, y: y - ry, width: rx * 2, height: ry * 2});
+ vml.canvas[appendChild](g);
+ return res;
+ };
+ theImage = function (vml, src, x, y, w, h) {
+ var g = createNode("group"),
+ o = createNode("image");
+ g.style.cssText = "position:absolute;left:0;top:0;width:" + vml.width + "px;height:" + vml.height + "px";
+ g.coordsize = coordsize;
+ g.coordorigin = vml.coordorigin;
+ o.src = src;
+ g[appendChild](o);
+ var res = new Element(o, g, vml);
+ res.type = "image";
+ res.attrs.src = src;
+ res.attrs.x = x;
+ res.attrs.y = y;
+ res.attrs.w = w;
+ res.attrs.h = h;
+ res.setBox({x: x, y: y, width: w, height: h});
+ vml.canvas[appendChild](g);
+ return res;
+ };
+ theText = function (vml, x, y, text) {
+ var g = createNode("group"),
+ el = createNode("shape"),
+ ol = el.style,
+ path = createNode("path"),
+ ps = path.style,
+ o = createNode("textpath");
+ g.style.cssText = "position:absolute;left:0;top:0;width:" + vml.width + "px;height:" + vml.height + "px";
+ g.coordsize = coordsize;
+ g.coordorigin = vml.coordorigin;
+ path.v = R.format("m{0},{1}l{2},{1}", round(x * 10), round(y * 10), round(x * 10) + 1);
+ path.textpathok = true;
+ ol.width = vml.width;
+ ol.height = vml.height;
+ o.string = Str(text);
+ o.on = true;
+ el[appendChild](o);
+ el[appendChild](path);
+ g[appendChild](el);
+ var res = new Element(o, g, vml);
+ res.shape = el;
+ res.textpath = path;
+ res.type = "text";
+ res.attrs.text = text;
+ res.attrs.x = x;
+ res.attrs.y = y;
+ res.attrs.w = 1;
+ res.attrs.h = 1;
+ setFillAndStroke(res, {font: availableAttrs.font, stroke: "none", fill: "#000"});
+ res.setBox();
+ vml.canvas[appendChild](g);
+ return res;
+ };
+ setSize = function (width, height) {
+ var cs = this.canvas.style;
+ width == +width && (width += "px");
+ height == +height && (height += "px");
+ cs.width = width;
+ cs.height = height;
+ cs.clip = "rect(0 " + width + " " + height + " 0)";
+ return this;
+ };
+ var createNode;
+ doc.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
+ try {
+ !doc.namespaces.rvml && doc.namespaces.add("rvml", "urn:schemas-microsoft-com:vml");
+ createNode = function (tagName) {
+ return doc.createElement('');
+ };
+ } catch (e) {
+ createNode = function (tagName) {
+ return doc.createElement('<' + tagName + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');
+ };
+ }
+ create = function () {
+ var con = getContainer[apply](0, arguments),
+ container = con.container,
+ height = con.height,
+ s,
+ width = con.width,
+ x = con.x,
+ y = con.y;
+ if (!container) {
+ throw new Error("VML container not found.");
+ }
+ var res = new Paper,
+ c = res.canvas = doc.createElement("div"),
+ cs = c.style;
+ x = x || 0;
+ y = y || 0;
+ width = width || 512;
+ height = height || 342;
+ width == +width && (width += "px");
+ height == +height && (height += "px");
+ res.width = 1e3;
+ res.height = 1e3;
+ res.coordsize = zoom * 1e3 + S + zoom * 1e3;
+ res.coordorigin = "0 0";
+ res.span = doc.createElement("span");
+ res.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";
+ c[appendChild](res.span);
+ cs.cssText = R.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden", width, height);
+ if (container == 1) {
+ doc.body[appendChild](c);
+ cs.left = x + "px";
+ cs.top = y + "px";
+ cs.position = "absolute";
+ } else {
+ if (container.firstChild) {
+ container.insertBefore(c, container.firstChild);
+ } else {
+ container[appendChild](c);
+ }
+ }
+ plugins.call(res, res, R.fn);
+ return res;
+ };
+ paperproto.clear = function () {
+ this.canvas.innerHTML = E;
+ this.span = doc.createElement("span");
+ this.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";
+ this.canvas[appendChild](this.span);
+ this.bottom = this.top = null;
+ };
+ paperproto.remove = function () {
+ this.canvas.parentNode.removeChild(this.canvas);
+ for (var i in this) {
+ this[i] = removed(i);
+ }
+ return true;
+ };
+ }
+
+ // rest
+ // WebKit rendering bug workaround method
+ var version = navigator.userAgent.match(/Version\/(.*?)\s/);
+ if ((navigator.vendor == "Apple Computer, Inc.") && (version && version[1] < 4 || navigator.platform.slice(0, 2) == "iP")) {
+ paperproto.safari = function () {
+ var rect = this.rect(-99, -99, this.width + 99, this.height + 99).attr({stroke: "none"});
+ win.setTimeout(function () {rect.remove();});
+ };
+ } else {
+ paperproto.safari = function () {};
+ }
+
+ // Events
+ var preventDefault = function () {
+ this.returnValue = false;
+ },
+ preventTouch = function () {
+ return this.originalEvent.preventDefault();
+ },
+ stopPropagation = function () {
+ this.cancelBubble = true;
+ },
+ stopTouch = function () {
+ return this.originalEvent.stopPropagation();
+ },
+ addEvent = (function () {
+ if (doc.addEventListener) {
+ return function (obj, type, fn, element) {
+ var realName = supportsTouch && touchMap[type] ? touchMap[type] : type;
+ var f = function (e) {
+ if (supportsTouch && touchMap[has](type)) {
+ for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {
+ if (e.targetTouches[i].target == obj) {
+ var olde = e;
+ e = e.targetTouches[i];
+ e.originalEvent = olde;
+ e.preventDefault = preventTouch;
+ e.stopPropagation = stopTouch;
+ break;
+ }
+ }
+ }
+ return fn.call(element, e);
+ };
+ obj.addEventListener(realName, f, false);
+ return function () {
+ obj.removeEventListener(realName, f, false);
+ return true;
+ };
+ };
+ } else if (doc.attachEvent) {
+ return function (obj, type, fn, element) {
+ var f = function (e) {
+ e = e || win.event;
+ e.preventDefault = e.preventDefault || preventDefault;
+ e.stopPropagation = e.stopPropagation || stopPropagation;
+ return fn.call(element, e);
+ };
+ obj.attachEvent("on" + type, f);
+ var detacher = function () {
+ obj.detachEvent("on" + type, f);
+ return true;
+ };
+ return detacher;
+ };
+ }
+ })(),
+ drag = [],
+ dragMove = function (e) {
+ var x = e.clientX,
+ y = e.clientY,
+ scrollY = doc.documentElement.scrollTop || doc.body.scrollTop,
+ scrollX = doc.documentElement.scrollLeft || doc.body.scrollLeft,
+ dragi,
+ j = drag.length;
+ while (j--) {
+ dragi = drag[j];
+ if (supportsTouch) {
+ var i = e.touches.length,
+ touch;
+ while (i--) {
+ touch = e.touches[i];
+ if (touch.identifier == dragi.el._drag.id) {
+ x = touch.clientX;
+ y = touch.clientY;
+ (e.originalEvent ? e.originalEvent : e).preventDefault();
+ break;
+ }
+ }
+ } else {
+ e.preventDefault();
+ }
+ x += scrollX;
+ y += scrollY;
+ dragi.move && dragi.move.call(dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e);
+ }
+ },
+ dragUp = function (e) {
+ R.unmousemove(dragMove).unmouseup(dragUp);
+ var i = drag.length,
+ dragi;
+ while (i--) {
+ dragi = drag[i];
+ dragi.el._drag = {};
+ dragi.end && dragi.end.call(dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);
+ }
+ drag = [];
+ };
+ for (var i = events[length]; i--;) {
+ (function (eventName) {
+ R[eventName] = Element[proto][eventName] = function (fn, scope) {
+ if (R.is(fn, "function")) {
+ this.events = this.events || [];
+ this.events.push({name: eventName, f: fn, unbind: addEvent(this.shape || this.node || doc, eventName, fn, scope || this)});
+ }
+ return this;
+ };
+ R["un" + eventName] = Element[proto]["un" + eventName] = function (fn) {
+ var events = this.events,
+ l = events[length];
+ while (l--) if (events[l].name == eventName && events[l].f == fn) {
+ events[l].unbind();
+ events.splice(l, 1);
+ !events.length && delete this.events;
+ return this;
+ }
+ return this;
+ };
+ })(events[i]);
+ }
+ elproto.hover = function (f_in, f_out, scope_in, scope_out) {
+ return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);
+ };
+ elproto.unhover = function (f_in, f_out) {
+ return this.unmouseover(f_in).unmouseout(f_out);
+ };
+ elproto.drag = function (onmove, onstart, onend, move_scope, start_scope, end_scope) {
+ this._drag = {};
+ this.mousedown(function (e) {
+ (e.originalEvent || e).preventDefault();
+ var scrollY = doc.documentElement.scrollTop || doc.body.scrollTop,
+ scrollX = doc.documentElement.scrollLeft || doc.body.scrollLeft;
+ this._drag.x = e.clientX + scrollX;
+ this._drag.y = e.clientY + scrollY;
+ this._drag.id = e.identifier;
+ onstart && onstart.call(start_scope || move_scope || this, e.clientX + scrollX, e.clientY + scrollY, e);
+ !drag.length && R.mousemove(dragMove).mouseup(dragUp);
+ drag.push({el: this, move: onmove, end: onend, move_scope: move_scope, start_scope: start_scope, end_scope: end_scope});
+ });
+ return this;
+ };
+ elproto.undrag = function (onmove, onstart, onend) {
+ var i = drag.length;
+ while (i--) {
+ drag[i].el == this && (drag[i].move == onmove && drag[i].end == onend) && drag.splice(i++, 1);
+ }
+ !drag.length && R.unmousemove(dragMove).unmouseup(dragUp);
+ };
+ paperproto.circle = function (x, y, r) {
+ return theCircle(this, x || 0, y || 0, r || 0);
+ };
+ paperproto.rect = function (x, y, w, h, r) {
+ return theRect(this, x || 0, y || 0, w || 0, h || 0, r || 0);
+ };
+ paperproto.ellipse = function (x, y, rx, ry) {
+ return theEllipse(this, x || 0, y || 0, rx || 0, ry || 0);
+ };
+ paperproto.path = function (pathString) {
+ pathString && !R.is(pathString, string) && !R.is(pathString[0], array) && (pathString += E);
+ return thePath(R.format[apply](R, arguments), this);
+ };
+ paperproto.image = function (src, x, y, w, h) {
+ return theImage(this, src || "about:blank", x || 0, y || 0, w || 0, h || 0);
+ };
+ paperproto.text = function (x, y, text) {
+ return theText(this, x || 0, y || 0, Str(text));
+ };
+ paperproto.set = function (itemsArray) {
+ arguments[length] > 1 && (itemsArray = Array[proto].splice.call(arguments, 0, arguments[length]));
+ return new Set(itemsArray);
+ };
+ paperproto.setSize = setSize;
+ paperproto.top = paperproto.bottom = null;
+ paperproto.raphael = R;
+ function x_y() {
+ return this.x + S + this.y;
+ }
+ elproto.resetScale = function () {
+ if (this.removed) {
+ return this;
+ }
+ this._.sx = 1;
+ this._.sy = 1;
+ this.attrs.scale = "1 1";
+ };
+ elproto.scale = function (x, y, cx, cy) {
+ if (this.removed) {
+ return this;
+ }
+ if (x == null && y == null) {
+ return {
+ x: this._.sx,
+ y: this._.sy,
+ toString: x_y
+ };
+ }
+ y = y || x;
+ !+y && (y = x);
+ var dx,
+ dy,
+ dcx,
+ dcy,
+ a = this.attrs;
+ if (x != 0) {
+ var bb = this.getBBox(),
+ rcx = bb.x + bb.width / 2,
+ rcy = bb.y + bb.height / 2,
+ kx = abs(x / this._.sx),
+ ky = abs(y / this._.sy);
+ cx = (+cx || cx == 0) ? cx : rcx;
+ cy = (+cy || cy == 0) ? cy : rcy;
+ var posx = this._.sx > 0,
+ posy = this._.sy > 0,
+ dirx = ~~(x / abs(x)),
+ diry = ~~(y / abs(y)),
+ dkx = kx * dirx,
+ dky = ky * diry,
+ s = this.node.style,
+ ncx = cx + abs(rcx - cx) * dkx * (rcx > cx == posx ? 1 : -1),
+ ncy = cy + abs(rcy - cy) * dky * (rcy > cy == posy ? 1 : -1),
+ fr = (x * dirx > y * diry ? ky : kx);
+ switch (this.type) {
+ case "rect":
+ case "image":
+ var neww = a.width * kx,
+ newh = a.height * ky;
+ this.attr({
+ height: newh,
+ r: a.r * fr,
+ width: neww,
+ x: ncx - neww / 2,
+ y: ncy - newh / 2
+ });
+ break;
+ case "circle":
+ case "ellipse":
+ this.attr({
+ rx: a.rx * kx,
+ ry: a.ry * ky,
+ r: a.r * fr,
+ cx: ncx,
+ cy: ncy
+ });
+ break;
+ case "text":
+ this.attr({
+ x: ncx,
+ y: ncy
+ });
+ break;
+ case "path":
+ var path = pathToRelative(a.path),
+ skip = true,
+ fx = posx ? dkx : kx,
+ fy = posy ? dky : ky;
+ for (var i = 0, ii = path[length]; i < ii; i++) {
+ var p = path[i],
+ P0 = upperCase.call(p[0]);
+ if (P0 == "M" && skip) {
+ continue;
+ } else {
+ skip = false;
+ }
+ if (P0 == "A") {
+ p[path[i][length] - 2] *= fx;
+ p[path[i][length] - 1] *= fy;
+ p[1] *= kx;
+ p[2] *= ky;
+ p[5] = +(dirx + diry ? !!+p[5] : !+p[5]);
+ } else if (P0 == "H") {
+ for (var j = 1, jj = p[length]; j < jj; j++) {
+ p[j] *= fx;
+ }
+ } else if (P0 == "V") {
+ for (j = 1, jj = p[length]; j < jj; j++) {
+ p[j] *= fy;
+ }
+ } else {
+ for (j = 1, jj = p[length]; j < jj; j++) {
+ p[j] *= (j % 2) ? fx : fy;
+ }
+ }
+ }
+ var dim2 = pathDimensions(path);
+ dx = ncx - dim2.x - dim2.width / 2;
+ dy = ncy - dim2.y - dim2.height / 2;
+ path[0][1] += dx;
+ path[0][2] += dy;
+ this.attr({path: path});
+ break;
+ }
+ if (this.type in {text: 1, image:1} && (dirx != 1 || diry != 1)) {
+ if (this.transformations) {
+ this.transformations[2] = "scale("[concat](dirx, ",", diry, ")");
+ this.node[setAttribute]("transform", this.transformations[join](S));
+ dx = (dirx == -1) ? -a.x - (neww || 0) : a.x;
+ dy = (diry == -1) ? -a.y - (newh || 0) : a.y;
+ this.attr({x: dx, y: dy});
+ a.fx = dirx - 1;
+ a.fy = diry - 1;
+ } else {
+ this.node.filterMatrix = ms + ".Matrix(M11="[concat](dirx,
+ ", M12=0, M21=0, M22=", diry,
+ ", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')");
+ s.filter = (this.node.filterMatrix || E) + (this.node.filterOpacity || E);
+ }
+ } else {
+ if (this.transformations) {
+ this.transformations[2] = E;
+ this.node[setAttribute]("transform", this.transformations[join](S));
+ a.fx = 0;
+ a.fy = 0;
+ } else {
+ this.node.filterMatrix = E;
+ s.filter = (this.node.filterMatrix || E) + (this.node.filterOpacity || E);
+ }
+ }
+ a.scale = [x, y, cx, cy][join](S);
+ this._.sx = x;
+ this._.sy = y;
+ }
+ return this;
+ };
+ elproto.clone = function () {
+ if (this.removed) {
+ return null;
+ }
+ var attr = this.attr();
+ delete attr.scale;
+ delete attr.translation;
+ return this.paper[this.type]().attr(attr);
+ };
+ var curveslengths = {},
+ getPointAtSegmentLength = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {
+ var len = 0,
+ precision = 100,
+ name = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y].join(),
+ cache = curveslengths[name],
+ old, dot;
+ !cache && (curveslengths[name] = cache = {data: []});
+ cache.timer && clearTimeout(cache.timer);
+ cache.timer = setTimeout(function () {delete curveslengths[name];}, 2000);
+ if (length != null) {
+ var total = getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);
+ precision = ~~total * 10;
+ }
+ for (var i = 0; i < precision + 1; i++) {
+ if (cache.data[length] > i) {
+ dot = cache.data[i * precision];
+ } else {
+ dot = R.findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, i / precision);
+ cache.data[i] = dot;
+ }
+ i && (len += pow(pow(old.x - dot.x, 2) + pow(old.y - dot.y, 2), .5));
+ if (length != null && len >= length) {
+ return dot;
+ }
+ old = dot;
+ }
+ if (length == null) {
+ return len;
+ }
+ },
+ getLengthFactory = function (istotal, subpath) {
+ return function (path, length, onlystart) {
+ path = path2curve(path);
+ var x, y, p, l, sp = "", subpaths = {}, point,
+ len = 0;
+ for (var i = 0, ii = path.length; i < ii; i++) {
+ p = path[i];
+ if (p[0] == "M") {
+ x = +p[1];
+ y = +p[2];
+ } else {
+ l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
+ if (len + l > length) {
+ if (subpath && !subpaths.start) {
+ point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
+ sp += ["C", point.start.x, point.start.y, point.m.x, point.m.y, point.x, point.y];
+ if (onlystart) {return sp;}
+ subpaths.start = sp;
+ sp = ["M", point.x, point.y + "C", point.n.x, point.n.y, point.end.x, point.end.y, p[5], p[6]][join]();
+ len += l;
+ x = +p[5];
+ y = +p[6];
+ continue;
+ }
+ if (!istotal && !subpath) {
+ point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
+ return {x: point.x, y: point.y, alpha: point.alpha};
+ }
+ }
+ len += l;
+ x = +p[5];
+ y = +p[6];
+ }
+ sp += p;
+ }
+ subpaths.end = sp;
+ point = istotal ? len : subpath ? subpaths : R.findDotsAtSegment(x, y, p[1], p[2], p[3], p[4], p[5], p[6], 1);
+ point.alpha && (point = {x: point.x, y: point.y, alpha: point.alpha});
+ return point;
+ };
+ };
+ var getTotalLength = getLengthFactory(1),
+ getPointAtLength = getLengthFactory(),
+ getSubpathsAtLength = getLengthFactory(0, 1);
+ elproto.getTotalLength = function () {
+ if (this.type != "path") {return;}
+ if (this.node.getTotalLength) {
+ return this.node.getTotalLength();
+ }
+ return getTotalLength(this.attrs.path);
+ };
+ elproto.getPointAtLength = function (length) {
+ if (this.type != "path") {return;}
+ return getPointAtLength(this.attrs.path, length);
+ };
+ elproto.getSubpath = function (from, to) {
+ if (this.type != "path") {return;}
+ if (abs(this.getTotalLength() - to) < "1e-6") {
+ return getSubpathsAtLength(this.attrs.path, from).end;
+ }
+ var a = getSubpathsAtLength(this.attrs.path, to, 1);
+ return from ? getSubpathsAtLength(a, from).end : a;
+ };
+
+ // animation easing formulas
+ R.easing_formulas = {
+ linear: function (n) {
+ return n;
+ },
+ "<": function (n) {
+ return pow(n, 3);
+ },
+ ">": function (n) {
+ return pow(n - 1, 3) + 1;
+ },
+ "<>": function (n) {
+ n = n * 2;
+ if (n < 1) {
+ return pow(n, 3) / 2;
+ }
+ n -= 2;
+ return (pow(n, 3) + 2) / 2;
+ },
+ backIn: function (n) {
+ var s = 1.70158;
+ return n * n * ((s + 1) * n - s);
+ },
+ backOut: function (n) {
+ n = n - 1;
+ var s = 1.70158;
+ return n * n * ((s + 1) * n + s) + 1;
+ },
+ elastic: function (n) {
+ if (n == 0 || n == 1) {
+ return n;
+ }
+ var p = .3,
+ s = p / 4;
+ return pow(2, -10 * n) * math.sin((n - s) * (2 * PI) / p) + 1;
+ },
+ bounce: function (n) {
+ var s = 7.5625,
+ p = 2.75,
+ l;
+ if (n < (1 / p)) {
+ l = s * n * n;
+ } else {
+ if (n < (2 / p)) {
+ n -= (1.5 / p);
+ l = s * n * n + .75;
+ } else {
+ if (n < (2.5 / p)) {
+ n -= (2.25 / p);
+ l = s * n * n + .9375;
+ } else {
+ n -= (2.625 / p);
+ l = s * n * n + .984375;
+ }
+ }
+ }
+ return l;
+ }
+ };
+
+ var animationElements = [],
+ animation = function () {
+ var Now = +new Date;
+ for (var l = 0; l < animationElements[length]; l++) {
+ var e = animationElements[l];
+ if (e.stop || e.el.removed) {
+ continue;
+ }
+ var time = Now - e.start,
+ ms = e.ms,
+ easing = e.easing,
+ from = e.from,
+ diff = e.diff,
+ to = e.to,
+ t = e.t,
+ that = e.el,
+ set = {},
+ now;
+ if (time < ms) {
+ var pos = easing(time / ms);
+ for (var attr in from) if (from[has](attr)) {
+ switch (availableAnimAttrs[attr]) {
+ case "along":
+ now = pos * ms * diff[attr];
+ to.back && (now = to.len - now);
+ var point = getPointAtLength(to[attr], now);
+ that.translate(diff.sx - diff.x || 0, diff.sy - diff.y || 0);
+ diff.x = point.x;
+ diff.y = point.y;
+ that.translate(point.x - diff.sx, point.y - diff.sy);
+ to.rot && that.rotate(diff.r + point.alpha, point.x, point.y);
+ break;
+ case nu:
+ now = +from[attr] + pos * ms * diff[attr];
+ break;
+ case "colour":
+ now = "rgb(" + [
+ upto255(round(from[attr].r + pos * ms * diff[attr].r)),
+ upto255(round(from[attr].g + pos * ms * diff[attr].g)),
+ upto255(round(from[attr].b + pos * ms * diff[attr].b))
+ ][join](",") + ")";
+ break;
+ case "path":
+ now = [];
+ for (var i = 0, ii = from[attr][length]; i < ii; i++) {
+ now[i] = [from[attr][i][0]];
+ for (var j = 1, jj = from[attr][i][length]; j < jj; j++) {
+ now[i][j] = +from[attr][i][j] + pos * ms * diff[attr][i][j];
+ }
+ now[i] = now[i][join](S);
+ }
+ now = now[join](S);
+ break;
+ case "csv":
+ switch (attr) {
+ case "translation":
+ var x = pos * ms * diff[attr][0] - t.x,
+ y = pos * ms * diff[attr][1] - t.y;
+ t.x += x;
+ t.y += y;
+ now = x + S + y;
+ break;
+ case "rotation":
+ now = +from[attr][0] + pos * ms * diff[attr][0];
+ from[attr][1] && (now += "," + from[attr][1] + "," + from[attr][2]);
+ break;
+ case "scale":
+ now = [+from[attr][0] + pos * ms * diff[attr][0], +from[attr][1] + pos * ms * diff[attr][1], (2 in to[attr] ? to[attr][2] : E), (3 in to[attr] ? to[attr][3] : E)][join](S);
+ break;
+ case "clip-rect":
+ now = [];
+ i = 4;
+ while (i--) {
+ now[i] = +from[attr][i] + pos * ms * diff[attr][i];
+ }
+ break;
+ }
+ break;
+ default:
+ var from2 = [].concat(from[attr]);
+ now = [];
+ i = that.paper.customAttributes[attr].length;
+ while (i--) {
+ now[i] = +from2[i] + pos * ms * diff[attr][i];
+ }
+ break;
+ }
+ set[attr] = now;
+ }
+ that.attr(set);
+ that._run && that._run.call(that);
+ } else {
+ if (to.along) {
+ point = getPointAtLength(to.along, to.len * !to.back);
+ that.translate(diff.sx - (diff.x || 0) + point.x - diff.sx, diff.sy - (diff.y || 0) + point.y - diff.sy);
+ to.rot && that.rotate(diff.r + point.alpha, point.x, point.y);
+ }
+ (t.x || t.y) && that.translate(-t.x, -t.y);
+ to.scale && (to.scale += E);
+ that.attr(to);
+ animationElements.splice(l--, 1);
+ }
+ }
+ R.svg && that && that.paper && that.paper.safari();
+ animationElements[length] && setTimeout(animation);
+ },
+ keyframesRun = function (attr, element, time, prev, prevcallback) {
+ var dif = time - prev;
+ element.timeouts.push(setTimeout(function () {
+ R.is(prevcallback, "function") && prevcallback.call(element);
+ element.animate(attr, dif, attr.easing);
+ }, prev));
+ },
+ upto255 = function (color) {
+ return mmax(mmin(color, 255), 0);
+ },
+ translate = function (x, y) {
+ if (x == null) {
+ return {x: this._.tx, y: this._.ty, toString: x_y};
+ }
+ this._.tx += +x;
+ this._.ty += +y;
+ switch (this.type) {
+ case "circle":
+ case "ellipse":
+ this.attr({cx: +x + this.attrs.cx, cy: +y + this.attrs.cy});
+ break;
+ case "rect":
+ case "image":
+ case "text":
+ this.attr({x: +x + this.attrs.x, y: +y + this.attrs.y});
+ break;
+ case "path":
+ var path = pathToRelative(this.attrs.path);
+ path[0][1] += +x;
+ path[0][2] += +y;
+ this.attr({path: path});
+ break;
+ }
+ return this;
+ };
+ elproto.animateWith = function (element, params, ms, easing, callback) {
+ for (var i = 0, ii = animationElements.length; i < ii; i++) {
+ if (animationElements[i].el.id == element.id) {
+ params.start = animationElements[i].start;
+ }
+ }
+ return this.animate(params, ms, easing, callback);
+ };
+ elproto.animateAlong = along();
+ elproto.animateAlongBack = along(1);
+ function along(isBack) {
+ return function (path, ms, rotate, callback) {
+ var params = {back: isBack};
+ R.is(rotate, "function") ? (callback = rotate) : (params.rot = rotate);
+ path && path.constructor == Element && (path = path.attrs.path);
+ path && (params.along = path);
+ return this.animate(params, ms, callback);
+ };
+ }
+ function CubicBezierAtTime(t, p1x, p1y, p2x, p2y, duration) {
+ var cx = 3 * p1x,
+ bx = 3 * (p2x - p1x) - cx,
+ ax = 1 - cx - bx,
+ cy = 3 * p1y,
+ by = 3 * (p2y - p1y) - cy,
+ ay = 1 - cy - by;
+ function sampleCurveX(t) {
+ return ((ax * t + bx) * t + cx) * t;
+ }
+ function solve(x, epsilon) {
+ var t = solveCurveX(x, epsilon);
+ return ((ay * t + by) * t + cy) * t;
+ }
+ function solveCurveX(x, epsilon) {
+ var t0, t1, t2, x2, d2, i;
+ for(t2 = x, i = 0; i < 8; i++) {
+ x2 = sampleCurveX(t2) - x;
+ if (abs(x2) < epsilon) {
+ return t2;
+ }
+ d2 = (3 * ax * t2 + 2 * bx) * t2 + cx;
+ if (abs(d2) < 1e-6) {
+ break;
+ }
+ t2 = t2 - x2 / d2;
+ }
+ t0 = 0;
+ t1 = 1;
+ t2 = x;
+ if (t2 < t0) {
+ return t0;
+ }
+ if (t2 > t1) {
+ return t1;
+ }
+ while (t0 < t1) {
+ x2 = sampleCurveX(t2);
+ if (abs(x2 - x) < epsilon) {
+ return t2;
+ }
+ if (x > x2) {
+ t0 = t2;
+ } else {
+ t1 = t2;
+ }
+ t2 = (t1 - t0) / 2 + t0;
+ }
+ return t2;
+ }
+ return solve(t, 1 / (200 * duration));
+ }
+ elproto.onAnimation = function (f) {
+ this._run = f || 0;
+ return this;
+ };
+ elproto.animate = function (params, ms, easing, callback) {
+ var element = this;
+ element.timeouts = element.timeouts || [];
+ if (R.is(easing, "function") || !easing) {
+ callback = easing || null;
+ }
+ if (element.removed) {
+ callback && callback.call(element);
+ return element;
+ }
+ var from = {},
+ to = {},
+ animateable = false,
+ diff = {};
+ for (var attr in params) if (params[has](attr)) {
+ if (availableAnimAttrs[has](attr) || element.paper.customAttributes[has](attr)) {
+ animateable = true;
+ from[attr] = element.attr(attr);
+ (from[attr] == null) && (from[attr] = availableAttrs[attr]);
+ to[attr] = params[attr];
+ switch (availableAnimAttrs[attr]) {
+ case "along":
+ var len = getTotalLength(params[attr]);
+ var point = getPointAtLength(params[attr], len * !!params.back);
+ var bb = element.getBBox();
+ diff[attr] = len / ms;
+ diff.tx = bb.x;
+ diff.ty = bb.y;
+ diff.sx = point.x;
+ diff.sy = point.y;
+ to.rot = params.rot;
+ to.back = params.back;
+ to.len = len;
+ params.rot && (diff.r = toFloat(element.rotate()) || 0);
+ break;
+ case nu:
+ diff[attr] = (to[attr] - from[attr]) / ms;
+ break;
+ case "colour":
+ from[attr] = R.getRGB(from[attr]);
+ var toColour = R.getRGB(to[attr]);
+ diff[attr] = {
+ r: (toColour.r - from[attr].r) / ms,
+ g: (toColour.g - from[attr].g) / ms,
+ b: (toColour.b - from[attr].b) / ms
+ };
+ break;
+ case "path":
+ var pathes = path2curve(from[attr], to[attr]);
+ from[attr] = pathes[0];
+ var toPath = pathes[1];
+ diff[attr] = [];
+ for (var i = 0, ii = from[attr][length]; i < ii; i++) {
+ diff[attr][i] = [0];
+ for (var j = 1, jj = from[attr][i][length]; j < jj; j++) {
+ diff[attr][i][j] = (toPath[i][j] - from[attr][i][j]) / ms;
+ }
+ }
+ break;
+ case "csv":
+ var values = Str(params[attr])[split](separator),
+ from2 = Str(from[attr])[split](separator);
+ switch (attr) {
+ case "translation":
+ from[attr] = [0, 0];
+ diff[attr] = [values[0] / ms, values[1] / ms];
+ break;
+ case "rotation":
+ from[attr] = (from2[1] == values[1] && from2[2] == values[2]) ? from2 : [0, values[1], values[2]];
+ diff[attr] = [(values[0] - from[attr][0]) / ms, 0, 0];
+ break;
+ case "scale":
+ params[attr] = values;
+ from[attr] = Str(from[attr])[split](separator);
+ diff[attr] = [(values[0] - from[attr][0]) / ms, (values[1] - from[attr][1]) / ms, 0, 0];
+ break;
+ case "clip-rect":
+ from[attr] = Str(from[attr])[split](separator);
+ diff[attr] = [];
+ i = 4;
+ while (i--) {
+ diff[attr][i] = (values[i] - from[attr][i]) / ms;
+ }
+ break;
+ }
+ to[attr] = values;
+ break;
+ default:
+ values = [].concat(params[attr]);
+ from2 = [].concat(from[attr]);
+ diff[attr] = [];
+ i = element.paper.customAttributes[attr][length];
+ while (i--) {
+ diff[attr][i] = ((values[i] || 0) - (from2[i] || 0)) / ms;
+ }
+ break;
+ }
+ }
+ }
+ if (!animateable) {
+ var attrs = [],
+ lastcall;
+ for (var key in params) if (params[has](key) && animKeyFrames.test(key)) {
+ attr = {value: params[key]};
+ key == "from" && (key = 0);
+ key == "to" && (key = 100);
+ attr.key = toInt(key, 10);
+ attrs.push(attr);
+ }
+ attrs.sort(sortByKey);
+ if (attrs[0].key) {
+ attrs.unshift({key: 0, value: element.attr()});
+ }
+ for (i = 0, ii = attrs[length]; i < ii; i++) {
+ keyframesRun(attrs[i].value, element, ms / 100 * attrs[i].key, ms / 100 * (attrs[i - 1] && attrs[i - 1].key || 0), attrs[i - 1] && attrs[i - 1].value.callback);
+ }
+ lastcall = attrs[attrs[length] - 1].value.callback;
+ if (lastcall) {
+ element.timeouts.push(setTimeout(function () {lastcall.call(element);}, ms));
+ }
+ } else {
+ var easyeasy = R.easing_formulas[easing];
+ if (!easyeasy) {
+ easyeasy = Str(easing).match(bezierrg);
+ if (easyeasy && easyeasy[length] == 5) {
+ var curve = easyeasy;
+ easyeasy = function (t) {
+ return CubicBezierAtTime(t, +curve[1], +curve[2], +curve[3], +curve[4], ms);
+ };
+ } else {
+ easyeasy = function (t) {
+ return t;
+ };
+ }
+ }
+ animationElements.push({
+ start: params.start || +new Date,
+ ms: ms,
+ easing: easyeasy,
+ from: from,
+ diff: diff,
+ to: to,
+ el: element,
+ t: {x: 0, y: 0}
+ });
+ R.is(callback, "function") && (element._ac = setTimeout(function () {
+ callback.call(element);
+ }, ms));
+ animationElements[length] == 1 && setTimeout(animation);
+ }
+ return this;
+ };
+ elproto.stop = function () {
+ for (var i = 0; i < animationElements.length; i++) {
+ animationElements[i].el.id == this.id && animationElements.splice(i--, 1);
+ }
+ for (i = 0, ii = this.timeouts && this.timeouts.length; i < ii; i++) {
+ clearTimeout(this.timeouts[i]);
+ }
+ this.timeouts = [];
+ clearTimeout(this._ac);
+ delete this._ac;
+ return this;
+ };
+ elproto.translate = function (x, y) {
+ return this.attr({translation: x + " " + y});
+ };
+ elproto[toString] = function () {
+ return "Rapha\xebl\u2019s object";
+ };
+ R.ae = animationElements;
+
+ // Set
+ var Set = function (items) {
+ this.items = [];
+ this[length] = 0;
+ this.type = "set";
+ if (items) {
+ for (var i = 0, ii = items[length]; i < ii; i++) {
+ if (items[i] && (items[i].constructor == Element || items[i].constructor == Set)) {
+ this[this.items[length]] = this.items[this.items[length]] = items[i];
+ this[length]++;
+ }
+ }
+ }
+ };
+ Set[proto][push] = function () {
+ var item,
+ len;
+ for (var i = 0, ii = arguments[length]; i < ii; i++) {
+ item = arguments[i];
+ if (item && (item.constructor == Element || item.constructor == Set)) {
+ len = this.items[length];
+ this[len] = this.items[len] = item;
+ this[length]++;
+ }
+ }
+ return this;
+ };
+ Set[proto].pop = function () {
+ delete this[this[length]--];
+ return this.items.pop();
+ };
+ for (var method in elproto) if (elproto[has](method)) {
+ Set[proto][method] = (function (methodname) {
+ return function () {
+ for (var i = 0, ii = this.items[length]; i < ii; i++) {
+ this.items[i][methodname][apply](this.items[i], arguments);
+ }
+ return this;
+ };
+ })(method);
+ }
+ Set[proto].attr = function (name, value) {
+ if (name && R.is(name, array) && R.is(name[0], "object")) {
+ for (var j = 0, jj = name[length]; j < jj; j++) {
+ this.items[j].attr(name[j]);
+ }
+ } else {
+ for (var i = 0, ii = this.items[length]; i < ii; i++) {
+ this.items[i].attr(name, value);
+ }
+ }
+ return this;
+ };
+ Set[proto].animate = function (params, ms, easing, callback) {
+ (R.is(easing, "function") || !easing) && (callback = easing || null);
+ var len = this.items[length],
+ i = len,
+ item,
+ set = this,
+ collector;
+ callback && (collector = function () {
+ !--len && callback.call(set);
+ });
+ easing = R.is(easing, string) ? easing : collector;
+ item = this.items[--i].animate(params, ms, easing, collector);
+ while (i--) {
+ this.items[i] && !this.items[i].removed && this.items[i].animateWith(item, params, ms, easing, collector);
+ }
+ return this;
+ };
+ Set[proto].insertAfter = function (el) {
+ var i = this.items[length];
+ while (i--) {
+ this.items[i].insertAfter(el);
+ }
+ return this;
+ };
+ Set[proto].getBBox = function () {
+ var x = [],
+ y = [],
+ w = [],
+ h = [];
+ for (var i = this.items[length]; i--;) {
+ var box = this.items[i].getBBox();
+ x[push](box.x);
+ y[push](box.y);
+ w[push](box.x + box.width);
+ h[push](box.y + box.height);
+ }
+ x = mmin[apply](0, x);
+ y = mmin[apply](0, y);
+ return {
+ x: x,
+ y: y,
+ width: mmax[apply](0, w) - x,
+ height: mmax[apply](0, h) - y
+ };
+ };
+ Set[proto].clone = function (s) {
+ s = new Set;
+ for (var i = 0, ii = this.items[length]; i < ii; i++) {
+ s[push](this.items[i].clone());
+ }
+ return s;
+ };
+
+ R.registerFont = function (font) {
+ if (!font.face) {
+ return font;
+ }
+ this.fonts = this.fonts || {};
+ var fontcopy = {
+ w: font.w,
+ face: {},
+ glyphs: {}
+ },
+ family = font.face["font-family"];
+ for (var prop in font.face) if (font.face[has](prop)) {
+ fontcopy.face[prop] = font.face[prop];
+ }
+ if (this.fonts[family]) {
+ this.fonts[family][push](fontcopy);
+ } else {
+ this.fonts[family] = [fontcopy];
+ }
+ if (!font.svg) {
+ fontcopy.face["units-per-em"] = toInt(font.face["units-per-em"], 10);
+ for (var glyph in font.glyphs) if (font.glyphs[has](glyph)) {
+ var path = font.glyphs[glyph];
+ fontcopy.glyphs[glyph] = {
+ w: path.w,
+ k: {},
+ d: path.d && "M" + path.d[rp](/[mlcxtrv]/g, function (command) {
+ return {l: "L", c: "C", x: "z", t: "m", r: "l", v: "c"}[command] || "M";
+ }) + "z"
+ };
+ if (path.k) {
+ for (var k in path.k) if (path[has](k)) {
+ fontcopy.glyphs[glyph].k[k] = path.k[k];
+ }
+ }
+ }
+ }
+ return font;
+ };
+ paperproto.getFont = function (family, weight, style, stretch) {
+ stretch = stretch || "normal";
+ style = style || "normal";
+ weight = +weight || {normal: 400, bold: 700, lighter: 300, bolder: 800}[weight] || 400;
+ if (!R.fonts) {
+ return;
+ }
+ var font = R.fonts[family];
+ if (!font) {
+ var name = new RegExp("(^|\\s)" + family[rp](/[^\w\d\s+!~.:_-]/g, E) + "(\\s|$)", "i");
+ for (var fontName in R.fonts) if (R.fonts[has](fontName)) {
+ if (name.test(fontName)) {
+ font = R.fonts[fontName];
+ break;
+ }
+ }
+ }
+ var thefont;
+ if (font) {
+ for (var i = 0, ii = font[length]; i < ii; i++) {
+ thefont = font[i];
+ if (thefont.face["font-weight"] == weight && (thefont.face["font-style"] == style || !thefont.face["font-style"]) && thefont.face["font-stretch"] == stretch) {
+ break;
+ }
+ }
+ }
+ return thefont;
+ };
+ paperproto.print = function (x, y, string, font, size, origin, letter_spacing) {
+ origin = origin || "middle"; // baseline|middle
+ letter_spacing = mmax(mmin(letter_spacing || 0, 1), -1);
+ var out = this.set(),
+ letters = Str(string)[split](E),
+ shift = 0,
+ path = E,
+ scale;
+ R.is(font, string) && (font = this.getFont(font));
+ if (font) {
+ scale = (size || 16) / font.face["units-per-em"];
+ var bb = font.face.bbox.split(separator),
+ top = +bb[0],
+ height = +bb[1] + (origin == "baseline" ? bb[3] - bb[1] + (+font.face.descent) : (bb[3] - bb[1]) / 2);
+ for (var i = 0, ii = letters[length]; i < ii; i++) {
+ var prev = i && font.glyphs[letters[i - 1]] || {},
+ curr = font.glyphs[letters[i]];
+ shift += i ? (prev.w || font.w) + (prev.k && prev.k[letters[i]] || 0) + (font.w * letter_spacing) : 0;
+ curr && curr.d && out[push](this.path(curr.d).attr({fill: "#000", stroke: "none", translation: [shift, 0]}));
+ }
+ out.scale(scale, scale, top, height).translate(x - top, y - height);
+ }
+ return out;
+ };
+
+ R.format = function (token, params) {
+ var args = R.is(params, array) ? [0][concat](params) : arguments;
+ token && R.is(token, string) && args[length] - 1 && (token = token[rp](formatrg, function (str, i) {
+ return args[++i] == null ? E : args[i];
+ }));
+ return token || E;
+ };
+ R.ninja = function () {
+ oldRaphael.was ? (win.Raphael = oldRaphael.is) : delete Raphael;
+ return R;
+ };
+ R.el = elproto;
+ R.st = Set[proto];
+
+ oldRaphael.was ? (win.Raphael = R) : (Raphael = R);
+})();
diff --git a/sources/sudoku_js/gfx/sudoku_controller.png b/sources/sudoku_js/gfx/sudoku_controller.png
new file mode 100644
index 0000000..98feec1
Binary files /dev/null and b/sources/sudoku_js/gfx/sudoku_controller.png differ
diff --git a/sources/sudoku_js/gfx/sudoku_range.png b/sources/sudoku_js/gfx/sudoku_range.png
new file mode 100644
index 0000000..4e47ad7
Binary files /dev/null and b/sources/sudoku_js/gfx/sudoku_range.png differ
diff --git a/sources/sudoku_js/index.html b/sources/sudoku_js/index.html
new file mode 100644
index 0000000..b858f0d
--- /dev/null
+++ b/sources/sudoku_js/index.html
@@ -0,0 +1,16 @@
+
+
+
+ SUDOKU JavaScript || derletztekick.com
+
+
+
+
+
+
+
+
+ SUDOKU par derletztekick.com
+ [SUDOKU-Puzzle par derletztekick.com]
+
+
diff --git a/sources/sudoku_js/licence.txt b/sources/sudoku_js/licence.txt
new file mode 100644
index 0000000..dcfa4c2
--- /dev/null
+++ b/sources/sudoku_js/licence.txt
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/sources/sudoku_js/sudoku.css b/sources/sudoku_js/sudoku.css
new file mode 100644
index 0000000..a9a98b7
--- /dev/null
+++ b/sources/sudoku_js/sudoku.css
@@ -0,0 +1,83 @@
+ table#sudoku_panel {
+ border-collapse: collapse;
+ margin-left: auto;
+ margin-right: auto;
+ }
+ #sudoku_panel tbody td {
+ border: 1px solid black;
+ padding: 10px 10px;
+ margin: 0;
+ text-align:center;
+ vertical-align: middle;
+ width: 11%;
+ height: 20px;
+ background-color: #eee;
+ }
+
+ #sudoku_panel tbody td.topBorder{
+ border-top: 2px solid black;
+ }
+
+ #sudoku_panel tbody td.bottomBorder{
+ border-bottom: 2px solid black;
+ }
+
+ #sudoku_panel tbody td.leftBorder{
+ border-left: 2px solid black;
+ }
+
+ #sudoku_panel tbody td.rightBorder{
+ border-right: 2px solid black;
+ }
+
+ #sudoku_panel tbody td.notice {
+ padding: 4px;
+ vertical-align: bottom;
+ font-size: 0;
+ line-height: 0;
+ background-color: white;
+ }
+
+ #sudoku_panel tfoot td {
+ font-size: x-small;
+ }
+ #sudoku_panel tfoot td.leftFootInfo {
+ text-align:left;
+ }
+ #sudoku_panel tfoot td.centerFootInfo {
+ text-align:center;
+ }
+ #sudoku_panel tfoot td.rightFootInfo {
+ text-align:right;
+ }
+ #sudoku_panel input {
+ border: none;
+ text-align:center;
+ width: 20px;
+ height: 18px;
+ margin-bottom:0;
+ padding:0;
+ }
+
+ #sudoku_panel input.notice {
+ font-family: arial, sans-serif;
+ border: 1px solid #eee;
+ text-align:left;
+ width: 20px;
+ font-size: 8px;
+ height: 9px;
+ margin: 0 5px;
+ }
+
+ #slider01 {
+ margin: 0.5em auto;
+ position: relative;
+ width: 176px;
+ height: 20px;
+ background: url(./gfx/sudoku_range.png) 50% 50% no-repeat;
+ }
+ #slider01 img {
+ position: absolute;
+ top: 2px;
+ left: 0px;
+ }
\ No newline at end of file
diff --git a/sources/sudoku_js/sudoku_js.js b/sources/sudoku_js/sudoku_js.js
new file mode 100644
index 0000000..c394c70
--- /dev/null
+++ b/sources/sudoku_js/sudoku_js.js
@@ -0,0 +1,612 @@
+
+ /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ + Sudoku JS v1.05 by Michael Loesler +
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ + Copyright (C) 2006-11 by Michael Loesler, http//derletztekick.com +
+ + +
+ + +
+ + This program is free software; you can redistribute it and/or modify +
+ + it under the terms of the GNU General Public License as published by +
+ + the Free Software Foundation; either version 2 of the License, or +
+ + (at your option) any later version. +
+ + +
+ + This program is distributed in the hope that it will be useful, +
+ + but WITHOUT ANY WARRANTY; without even the implied warranty of +
+ + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
+ + GNU General Public License for more details. +
+ + +
+ + You should have received a copy of the GNU General Public License +
+ + along with this program; if not, write to the +
+ + Free Software Foundation, Inc., +
+ + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +
+ + +
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
+
+ Array.prototype.zeros = function(o,p) {
+ for (var i=0; imaxlen?1:number;
+ this.row = row;
+ this.col = col;
+ this.maxlen = maxlen;
+ this.canceledValues = new Array();
+ this.addCanceledValues = function(val){
+ val = val>this.maxlen?1:val;
+ this.canceledValues[this.canceledValues.length]=val;
+ }
+ this.isCanceledValues = function(val){
+ return this.canceledValues.inArray(val);
+ }
+ this.isEqual = function(T){
+ if (this.number == T.number && this.row == T.row && this.col == T.col)
+ return true;
+ return false;
+ }
+ }
+
+ var Sudoku = {
+ startTime : new Date(),
+ counter : 1,
+ highlightColor : "#ffffe0",
+ hoodedFields : 0,
+ SudokuType : 0,
+ //Range : new Object(),
+ Controller : null,
+ SD : new Array(),
+ solvingSD : new Array(),
+ lang : window.navigator.userLanguage || window.navigator.language, //window.navigator.language.toLowerCase().indexOf("de") > -1?"de":"en",
+ initSudoku : function(ST, Level){
+ this.lang = this.lang.toLowerCase().indexOf("de") > -1?"de":"en";
+ this.SudokuType = ST;
+ var ParentEl = document.getElementById("sudoku");
+ var Range = document.createElement("div");
+ this.Controller = document.createElement("img");
+ window.slider[1]=new Object();
+ window.slider[1].min=0;
+ window.slider[1].max=8;
+ window.slider[1].val=4;
+ window.slider[1].onchange=function() {
+ Sudoku.setLevel(Math.round(this.val));
+ }
+
+ this.startTime = new Date();
+
+ this.Controller.width = 9;
+ this.Controller.height = 16;
+ this.Controller.src = "gfx/sudoku_controller.png";
+ this.Controller.alt = this.lang == "de"?"Schwierigkeitsgrad":"Niveau";
+ this.Controller.title = this.lang == "de"?"Schwierigkeitsgrad":"Niveau";
+ this.Controller.style.cursor = "e-resize";
+
+ Range.id = "slider01";
+
+
+ if (Level == null) {
+ this.setLevel(4);
+ Range.appendChild( this.Controller );
+ ParentEl.appendChild(Range);
+ }
+
+ this.Table = this.createTable(this.SudokuType,this.SudokuType,0,"sudoku_panel");
+ ParentEl.replaceChild(this.Table, document.getElementById("sudoku").firstChild);
+
+
+ this.counter = 1;
+ this.SD.zeros(this.SudokuType,this.SudokuType);
+ this.solvingSD.zeros(this.SudokuType,this.SudokuType);
+ this.SD.isReady = false;
+ var T = new Token(Math.floor(Math.random()*this.SudokuType)+1,0,0,this.SudokuType);
+ //this.createSudoku(T, true);
+
+ do {
+ T = this.createSudokuStep(T);
+ } while (T != null && !this.SD.isReady);
+
+ this.setSudoku2Table();
+ },
+
+ setLevel : function(l){
+ this.hoodedFields = (l*this.SudokuType>0?l*this.SudokuType:1);
+ },
+
+ setSudoku2Table : function (){
+ function Numsort (a, b) {
+ return a - b;
+ }
+ if (this.SD.isReady){
+ var randomNumbers = new Array();
+
+ do {
+ var r = Math.floor(Math.random()*this.SudokuType*this.SudokuType)+1;
+ if (!randomNumbers.inArray(r))
+ randomNumbers.push(r);
+ }
+ while(randomNumbers.length0?hh+"h , ":"") + (hh>0||mm>0?mm+"m, ":"") + (hh>0||mm>0||ss>0?ss+"s":"")
+ var messageStart = this.lang == "de"?"!!!GRATULATION!!!\n\nDu hast das SUDOKU vollstndig gelst!\nBentigte Zeit: ":"!!!Filicitations!!!\n\nVous avez termin votre SUDOKU!\nVotre temps : ";
+ var messageEnd = ".";
+ window.alert( messageStart+time+messageEnd );
+ },
+
+ getSolution : function(randomNumbers){
+ var Rows = this.Table.getElementsByTagName("tbody")[0].rows;
+ for (var i=0; i=this.SD[0].length){
+ T.col=0;
+ T.row++;
+ }
+ else if (T.col<0){
+ T.col=this.SD.length-1;
+ T.row--;
+ }
+
+ if (!this.isStepForward){
+ T = this.SD[T.row][T.col];
+ this.SD[T.row][T.col] = new Token(0,T.row,T.col,this.SudokuType);
+ }
+
+ for (var l=0; lthis.SD.length?1:T.number;
+ }
+ }
+ this.SD[T.row][T.col] = new Token(0,T.row,T.col,this.SudokuType);
+ this.isStepForward = false;
+ return new Token(0, T.row, T.col-1,this.SudokuType);
+
+ },
+
+ createSudoku : function(T,isStepForward) {
+ this.counter++;
+
+ if (this.counter%5==0){
+ var thisObject = this;
+ window.setTimeout(function() { thisObject.createSudoku(T,isStepForward); } ,1);
+ }
+ else {
+ if (T.col == this.SD[0].length && T.row == this.SD.length-1){
+ this.SD.isReady = true;
+ return this.setSudoku2Table();
+ }
+
+ if (T.col>=this.SD[0].length){
+ T.col=0;
+ T.row++;
+ }
+ else if (T.col<0){
+ T.col=this.SD.length-1;
+ T.row--;
+ }
+
+ if (!isStepForward){
+ T = this.SD[T.row][T.col];
+ this.SD[T.row][T.col] = new Token(0,T.row,T.col,this.SudokuType);
+ }
+
+ for (var l=0; lthis.SD.length?1:T.number;
+ }
+ }
+ this.SD[T.row][T.col] = new Token(0,T.row,T.col,this.SudokuType);
+ return this.createSudoku(new Token(0, T.row, T.col-1,this.SudokuType), false);
+ }
+ },
+
+ // nach einer Idee von http://www.grand.lt/l/sudoku
+ highlightCell : function(cell, highlight){
+ var curRow = cell.parentNode;
+ var Rows = curRow.parentNode.rows;
+ for (var i=0; islider.max) slider.val=slider.max;
+ if (slider.val
+
+
+
+ Zlizer
+
+
+
+
+
+
+
+
+
+
diff --git a/sources/zlizer/zlizer.js b/sources/zlizer/zlizer.js
new file mode 100644
index 0000000..2d8ca50
--- /dev/null
+++ b/sources/zlizer/zlizer.js
@@ -0,0 +1,147 @@
+var h=void 0,m=!0,p=null,q=!1,s,t=this;function aa(){}
+function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
+else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function u(a){return a!==h}function v(a){return"array"==ba(a)}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function w(a){return"string"==typeof a}function x(a){return"number"==typeof a}function da(a){return"function"==ba(a)}function ea(a){var b=typeof a;return"object"==b&&a!=p||"function"==b}function fa(a){return a[ga]||(a[ga]=++ha)}var ga="closure_uid_"+(1E9*Math.random()>>>0),ha=0;
+function ia(a,b,c){return a.call.apply(a.bind,arguments)}function ja(a,b,c){if(!a)throw Error();if(2")&&(a=a.replace(wa,">"));-1!=a.indexOf('"')&&(a=a.replace(xa,"""));return a}var ua=/&/g,va=//g,xa=/\"/g,ta=/[&<>\"]/;Math.random();function ya(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})}
+function za(a){var b=w(h)?"undefined".replace(/([-()\[\]{}+?*.$\^|,:#c?Math.max(0,a.length+c):c;if(w(a))return!w(b)||1!=b.length?-1:a.indexOf(b,c);for(;c=arguments.length?A.slice.call(a,b):A.slice.call(a,b,c)};function B(a,b){this.x=u(a)?a:0;this.y=u(b)?b:0}s=B.prototype;s.e=function(){return new B(this.x,this.y)};function Ja(a){var b=new B(0,0),c=a.x-b.x;a=a.y-b.y;return Math.sqrt(c*c+a*a)}s.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};s.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};s.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};
+s.translate=function(a,b){a instanceof B?(this.x+=a.x,this.y+=a.y):(this.x+=a,x(b)&&(this.y+=b));return this};s.scale=function(a,b){var c=x(b)?b:a;this.x*=a;this.y*=c;return this};function Ka(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}s=Ka.prototype;s.e=function(){return new Ka(this.top,this.right,this.bottom,this.left)};s.contains=function(a){return!this||!a?q:a instanceof Ka?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom};
+s.expand=function(a,b,c,d){ea(a)?(this.top-=a.top,this.right+=a.right,this.bottom+=a.bottom,this.left-=a.left):(this.top-=a,this.right+=b,this.bottom+=c,this.left-=d);return this};s.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};s.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};
+s.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};s.translate=function(a,b){a instanceof B?(this.left+=a.x,this.right+=a.x,this.top+=a.y,this.bottom+=a.y):(this.left+=a,this.right+=a,x(b)&&(this.top+=b,this.bottom+=b));return this};s.scale=function(a,b){var c=x(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function C(a,b){this.width=a;this.height=b}s=C.prototype;s.e=function(){return new C(this.width,this.height)};function La(a){return a.width*a.height}s.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};s.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};s.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};
+s.scale=function(a,b){var c=x(b)?b:a;this.width*=a;this.height*=c;return this};Ka.prototype.size=function(){return new C(this.right-this.left,this.bottom-this.top)};function Ma(){}Ma.prototype.o=aa;function D(a){return a.Lc?a.Lc:a}function Na(a,b){Oa(b,a);b.Lc=D(a);return b};var E=new Ma;E.Ma=function(){};
+E.Gd=function(){var a=this.pa,b=this.Gb(),c=this.ba||1,d=c/a,e;if(this.b){this.vb&&this.vb.contains(b)&&(e=La(this.vb.size())/La(b.size()))&&1.6>e&&0.5parseFloat(sb)){rb=String(wb);break a}}rb=sb}var xb={};
+function yb(a){var b;if(!(b=xb[a])){b=0;for(var c=ra(String(rb)).split("."),d=ra(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f(0==y[1].length?0:parseInt(y[1],10))?1:0)||((0==n[2].length)<
+(0==y[2].length)?-1:(0==n[2].length)>(0==y[2].length)?1:0)||(n[2]y[2]?1:0)}while(0==b)}b=xb[a]=0<=b}return b}var zb=t.document,Ab=!zb||!M?h:qb()||("CSS1Compat"==zb.compatMode?parseInt(rb,10):5);function Bb(a,b){for(var c in a)b.call(h,a[c],c,a)}var Cb="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Oa(a,b){for(var c,d,e=1;e=a.keyCode)a.keyCode=-1}catch(b){}};var Hb={},O={},Ib={},Jb={};function P(a,b,c,d,e){if(v(b)){for(var f=0;fe.keyCode||e.returnValue!=h)return m;a:{var l=q;if(0==e.keyCode)try{e.keyCode=-1;break a}catch(r){l=m}if(l||e.returnValue==h)e.returnValue=m}}l=new Gb;l.Cb(e,this);e=m;try{if(g){for(var n=[],y=l.currentTarget;y;y=y.parentNode)n.push(y);f=d[m];f.J=f.V;for(var K=n.length-
+1;!l.oa&&0<=K&&f.J;K--)l.currentTarget=n[K],e&=Rb(f,n[K],c,m,l);if(k){f=d[q];f.J=f.V;for(K=0;!l.oa&&K");c=c.join("")}c=a.createElement(c);d&&(w(d)?c.className=d:v(d)?$b.apply(p,[c].concat(d)):ec(c,d));2a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return p}
+function vc(a,b,c){if(b instanceof C)c=b.height,b=b.width;else if(c==h)throw Error("missing height argument");a.style.width=wc(b);a.style.height=wc(c)}function wc(a){"number"==typeof a&&(a=Math.round(a)+"px");return a}function xc(a){if("none"!=sc(a,"display"))return yc(a);var b=a.style,c=b.display,d=b.visibility,e=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";a=yc(a);b.display=c;b.position=e;b.visibility=d;return a}
+function yc(a){var b=a.offsetWidth,c=a.offsetHeight,d=N&&!b&&!c;return(!u(b)||d)&&a.getBoundingClientRect?(a=tc(a),new C(a.right-a.left,a.bottom-a.top)):new C(b,c)}function zc(a){var b=bc(h),c=p;if(M)b=c=b.xa.createStyleSheet(),M?b.cssText=a:b.innerHTML=a;else{var d=qc(b,"head")[0];d||(c=qc(b,"body")[0],d=b.Tc("head"),c.parentNode.insertBefore(d,c));var e=c=b.Tc("style");M?e.cssText=a:e.innerHTML=a;b.appendChild(d,c)}return c};var Ac,Bc,Cc,Dc,Ec,Fc,Gc;(function(){var a=N?"Webkit":kb?"Moz":jb?"O":M?"ms":"",b=hc("div").style;Ac="-"+a.toLowerCase()+"-transform";Bc=function(a){return b[a]!==h?a:q};Cc=function(b){var d=b.charAt(0).toLowerCase()+b.substr(1),e=a+b;return Bc(b)?b:Bc(d)?d:Bc(e)?e:h}})();var Hc=function(){var a=Cc("BorderRadius");return function(b,c,d,e){e=e?"%":"px";d=u(d)?d:c;c=(v(c)?c.join(e+" "):c)+e+"/"+((v(d)?d.join(e+" "):d)+e);c!=b.Cd&&(b.style[a]=b.Cd=c)}}();
+function Ta(a){this.Rb=[];this.precision=1;this.zb=m;this.Ce&&Sa(this,a)}function Ic(a,b){a.zb=b;return a}Ta.prototype.scale=function(a,b){this.Rb.push("scale("+a+","+b+")");return this};Ta.prototype.rotate=function(a,b){var c;c=this.zb&&(Ub||Wb)?"rotate3d(0, 0, 1, "+a+(b?b:"deg")+")":"rotate("+a+(b?b:"deg")+")";0!=a&&this.Rb.push(c);return this};
+Ta.prototype.translate=function(a,b,c){var d=1/this.precision,e="translate";if(this.zb&&(Ub||Wb))e+="3d";e+="("+a*d+"px,"+b*d+"px";if(this.zb&&(Ub||Wb))e+=","+(c?c:0)*d+"px";this.Rb.push(e+")");return this};function Sa(a,b){if(1!=a.precision){var c=1/a.precision;a.scale(c,c);a.precision=1}1!=b&&(a.scale(b,b),a.precision=b);return a}Ta.prototype.toString=function(){1!=this.precision&&Sa(this,1);return this.Rb.join(" ")};
+var Ra=function(){var a=Cc("Transform");return function(b,c){var d=c.toString();d!=b.ne&&(b.style[a]=b.ne=d);oa=1}}(),Pa=function(){var a=Cc("TransformOrigin");return function(b,c,d,e){e=e?"%":"px";c=c+e+" "+d+e;c!=b.oe&&(b.style[a]=b.oe=c)}}();
+(function(){function a(a,b){if(!a.length)return a;for(var e=a.split("),"),f=0;fd;d++){for(;a[d].length;)c=a[d][0],c.update(d),c.s=0,c==a[d][0]&&a[d].shift();a[d]=[]}b=[[],[]]}})();var Nc=1,Kc=16,Lc=32,I=1,G=2,Qa=4,Jc=5;zc(".lime-director {position:absolute; -webkit-transform-origin: 0 0; -moz-transform-origin: 0 0; -o-transform-origin: 0 0; image-rendering: optimizeSpeed; overflow: hidden;}.lime-director div, .lime-director img, .lime-director canvas {-webkit-transform-origin: 0 0; -moz-transform-origin: 0 0; -o-transform-origin: 0 0; position: absolute; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -webkit-user-select: none; -webkit-user-drag: none;}.lime-scene {position:absolute; width:100%; height:100%; left: 0px; top: 0px; overflow: hidden; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;}.lime-fps {float: left; background: #333; color: #fff; position: absolute; top:0px; left: 0px; padding:2px 4px;}div.lime-layer {position: absolute; left: 0px; top: 0px; width:0px; height:0px; border: none !important;}.lime-cover {position: absolute; left: 0px; top: 0px;}.lime-button {cursor: pointer;}");function Q(){Wa.call(this);this.g=[];this.k=p;this.ka={};this.m={};this.T={};this.yc={};this.Ic=m;this.t=q;this.uc=this.Yb=p;this.G={};this.Ja(1);this.a(0,0);this.c(0,0);this.pa=1;this.D(0.5,0.5);this.K=0;this.m[Qa]||R(this,Nc);this.Kc=0;R(this,7);this.A=1;Oc(this,p);Pc(this,D(this.ra[0]));R(this,64)}z(Q,Tb);s=Q.prototype;s.ra=[J,E];function Pc(a,b){if(!a.q||D(a.q)!=b){for(var c=-1,d=0;dd[e]?-1:1}}s.Xb=q;
+function R(a,b,c,d){b&&!a.s&&pa(a,c,d);a.s|=b;if(64==b)for(c=0;d=a.g[c];c++)d instanceof Q&&R(d,64);if(!u(a.s)||!b)a.s=0;b&&a.Fa&&(a.Vd=q,R(a.Fa,-1));return a}s.Ja=function(a,b){this.C=1==arguments.length&&x(a)?new L(a,a):2==arguments.length?new L(arguments[0],arguments[1]):a;return this.m[G]?this:R(this,2)};s.a=function(a,b){this.d=2==arguments.length?new B(arguments[0],arguments[1]):a;return this.m[I]?this:R(this,Nc)};
+function Oc(a,b){if(b!=a.j){if(a.j){var c=a.j;delete c.xb;Vc(c,c.getParent());delete a.j.Fa}a.j=b;a.j&&(c=a.j,c.xb=m,c.t&&Wc(c,c.getParent()),a.j.Fa=a);R(a,4)}}s.D=function(a,b){this.Y=2==arguments.length?new L(arguments[0],arguments[1]):a;return R(this,Nc)};function Xc(a,b){a.Bb=b;R(a,Lc);a.Jc=0}s.f=function(){return this.z};
+s.c=function(a,b){var c=this.z,d,e;d=2==arguments.length?new C(arguments[0],arguments[1]):a;var f=this.Y;if(c&&this.g.length)for(var g=0;ga){var b=0<=a&&this.g.length>a?this.g[a]:p;b.Fa&&Oc(b.Fa,p);b instanceof Q?(this.t&&fd(b),Sc(b),b.k=p):nc(b);this.g.splice(a,1);a=R(this,64)}else a=this;return a};s.addEventListener=function(a){Xb&&"mouse"==a.substring(0,5)||(u(this.G[a])||(this.G[a]=[0,0]),this.t&&0==this.G[a][0]&&(this.G[a][0]=1,this.L().Qa.Lb(this,a)),this.G[a][1]++)};
+s.removeEventListener=function(a){Xb&&"mouse"==a.substring(0,5)||(this.t&&1==this.G[a][1]&&(this.G[a][0]=0,this.L().Qa.mb(this,a)),this.G[a][1]--,this.G[a][1]||delete this.G[a])};s.L=function(){return!this.t?p:this.Yb};s.Ab=function(){return!this.t?p:this.uc};function fd(a){var b;a.xb||Vc(a,a.getParent());for(var c=0;b=a.g[c];c++)b instanceof Q&&fd(b);for(var d in a.G){a.G[d][0]=0;if(!a.L())debugger;a.L().Qa.mb(a,d)}gd(a.L().Qa,a);a.t=q;a.Yb=p;a.uc=p}
+function ed(a){a.t=m;a.Yb=a.k.L();a.uc=a.k.Ab();for(var b=0,c;c=a.g[b];b++)c instanceof Q&&ed(c);for(var d in a.G)a.G[d][0]=1,a.L().Qa.Lb(a,d);a.xb&&(a.xb=m,a.t&&Wc(a,a.getParent()));gd(a.L().Qa,a)}function Wc(a,b){b.va||(b.va=[]);Ea(b.va,a);!b&&!(b.getParent()instanceof F)&&Wc(a,b.getParent())}function Vc(a,b){b&&b.va&&(Fa(b.va,a),Vc(a,b.getParent()))}function H(a){var b=a.f();a=a.Y;return new Ka(-b.height*a.y,b.width*(1-a.x),b.height*(1-a.y),-b.width*a.x)}
+function Yc(a,b){var c=b||H(a),d=new B(c.left,c.top),e=new B(c.right,c.top),f=new B(c.left,c.bottom),c=new B(c.right,c.bottom),d=Ua(a,d),e=Ua(a,e),f=Ua(a,f),c=Ua(a,c);return new Ka(Math.floor(Math.min(d.y,e.y,f.y,c.y)),Math.ceil(Math.max(d.x,e.x,f.x,c.x)),Math.ceil(Math.max(d.y,e.y,f.y,c.y)),Math.floor(Math.min(d.x,e.x,f.x,c.x)))}
+s.Gb=function(){var a=H(this);a.left==a.right&&this.g.length&&(a=Yc(this.g[0],this.g[0].Gb()));for(var b=0,c;c=this.g[b];b++)if(1!=c.gc){var d=a;c=Yc(c,c.Gb());d.left=Math.min(d.left,c.left);d.top=Math.min(d.top,c.top);d.right=Math.max(d.right,c.right);d.bottom=Math.max(d.bottom,c.bottom)}return a};s.Z=function(a){this.yc[a]=1};s.Ba=function(a){var b=this.ia(a.Va);return H(this).contains(b)?(a.position=b,m):q};function S(a,b){Ea(b.da,a);b.play()};function hd(){Q.call(this);this.hb="lime-layer"}z(hd,Q);hd.prototype.Ba=function(a){for(var b=0,c;c=this.g[b];b++)if(c.Ba(a))return a.position=this.ia(a.Va),m;return q};var T=new function(){this.X=[];this.Na=q;this.ed=0;this.$b=1E3/30;this.Ca=0};function id(a,b){this.n=this.ld=a;this.jc=u(b)?b:-1;this.ma=[]}id.prototype.Ya=function(a){if(this.ma.length)if(this.n>a)this.n-=a;else{var b=this.ld+a-this.n;this.n=this.ld-(a-this.n);0>this.n&&(this.n=0);var c;for(a=this.ma.length;0<=--a;)(c=this.ma[a])&&(c[0]&&da(c[1]))&&c[1].call(c[2],b);-1!=this.jc&&(this.jc--,0==this.jc&&T.tb(c[1],c[2]))}};T.X.push(new id(0));
+for(var jd=["webkit","moz"],kd=0;kdrb?(t.mozRequestAnimationFrame(),this.Mc=ka(T.Bd,this),t.addEventListener("MozBeforePaint",this.Mc,q)):(this.Ub=ka(T.zd,this),t.requestAnimationFrame(this.Ub)):this.ed=setInterval(ka(T.le,this),T.$b),this.Na=m)};
+T.Vc=function(){this.Na&&(T.Ec&&t.requestAnimationFrame?t.mozRequestAnimationFrame&&11>rb?t.removeEventListener("MozBeforePaint",this.Mc,q):t.cancelAnimationFrame(this.Ub):clearInterval(this.ed),this.Na=q)};T.zd=function(a){var b=t.performance,c;b&&(c=b.now||b.webkitNow)?a=b.timing.navigationStart+c.call(b):a||(a=ma());b=a-this.Ca;0>b&&(b=1);T.Zb(b);this.Ca=a;t.requestAnimationFrame(this.Ub)};T.Bd=function(a){T.Zb(a.timeStamp-this.Ca);this.Ca=a.timeStamp;t.mozRequestAnimationFrame()};
+T.le=function(){var a=ma(),b=a-this.Ca;0>b&&(b=1);T.Zb(b);this.Ca=a};T.Zb=function(a){for(var b=this.X.slice(),c=b.length;0<=--c;)b[c].Ya(a);1==oa&&(/Firefox\/18./.test(gb())&&!na.te)&&(T.od?(document.body.style.MozTransform="",T.od=0):(document.body.style.MozTransform="scale(1,1)",T.od=1),oa=0)};T.Ed=function(a){for(var b,c,d,e,f=this.X.length;0<=--f;){b=this.X[f];for(e=b.ma.length;0<=--e;)d=b.ma[e],c=d[2],da(c.L)&&(c=c.L(),c==a&&(d[0]=m))}};T.Dd=function(a,b){T.vc(a,b,100,1)};
+T.vc=function(a,b,c,d){T.Ob(a,b,new id(c,d))};var ld;function U(){Wa.call(this);this.da=[];this.fc=[];this.Qb={};this.Ae=q;this.u=1;this.Pa=md;this.F=0}z(U,Tb);s=U.prototype;s.scope="";s.r=function(a){this.u=a;return this};s.play=function(){this.sc=0;this.ad=this.F=1;T.Ob(this.Ya,this);this.dispatchEvent({type:"start"})};s.stop=function(){if(0!=this.F){var a=this.fc;if(nd(this)&&this.Z)for(var b=a.length;0<=--b;)this.Z(a[b]);this.fc=[];this.Qb={};this.F=0;T.tb(this.Ya,this);this.dispatchEvent({type:"stop"})}};s.Sa=function(){return{}};
+function od(a,b){var c=fa(b);u(a.Qb[c])||(a.ib(b),a.Qb[c]=a.Sa(b));return a.Qb[c]}s.ib=function(a){pd.Lb(this,a);this.F=1;Ea(this.fc,a);this.qb&&(!this.wc&&this.cb)&&this.cb()};s.L=function(){return this.da[0]?this.da[0].L():p};s.Ya=function(a){this.qb&&(!this.wc&&this.cb)&&this.cb();this.ad&&(delete this.ad,a=1);this.sc+=a;this.xe=a;a=this.sc/(1E3*this.u);if(isNaN(a)||1<=a)a=1;a=this.ta(a,this.da);1==a&&this.stop()};
+s.ta=function(a,b){a=this.Pa[0](a);isNaN(a)&&(a=1);for(var c=b.length;0<=--c;)this.update(a,b[c]);return a};function nd(a){return 0f;f++){y=((b*g+c)*g+d)*g-a;if(5E-5>(0<=y?y:0-y))return g;e=(3*b*g+2*c)*g+d;if(1E-6>(0<=e?e:0-e))break;g-=y/e}e=0;f=1;g=a;if(gf)return f;for(;e(0<=y-a?y-a:0-(y-a)))break;a>y?e=g:f=g;g=0.5*(f-e)+e}return g}var b=0,c=0,d=0,e=0,f=0,g=0;ld=function(k,l,r,n){return[function(y){d=3*k;c=3*(r-k)-d;b=1-d-c;g=3*l;f=3*(n-l)-g;e=1-g-f;return((e*a(y)+f)*a(y)+g)*a(y)},k,l,r,n]}})();
+var rd=ld(0,0,1,1),md=ld(0.42,0,0.58,1);var sd={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",
+darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",
+ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",
+lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",
+moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",
+seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function td(a){var b={};a=String(a);var c="#"==a.charAt(0)?a:"#"+a;if(ud.test(c))return b.dc=vd(c),b.type="hex",b;a:{var d=a.match(wd);if(d){var c=Number(d[1]),e=Number(d[2]),d=Number(d[3]);if(0<=c&&255>=c&&0<=e&&255>=e&&0<=d&&255>=d){c=[c,e,d];break a}}c=[]}if(c.length){e=c[0];a=c[1];c=c[2];e=Number(e);a=Number(a);c=Number(c);if(isNaN(e)||0>e||255a||255c||255c?c+=1:16*c?a+6*(b-a)*c:1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}var ud=/^#(?:[0-9a-f]{3}){1,2}$/i,wd=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;
+function xd(a){return 1==a.length?"0"+a:a};function Ad(){Wa.call(this)}z(Ad,Tb);Ad.prototype.ec=aa;function Bd(a){if(a[0]instanceof Ad)return a[0];v(a)||(a=Ga(arguments));return 2=n?(g-k)/(2*n):(g-k)/(2-2*n));d=[Math.round(l+360)%360,r,n];d[b]+=c;1c?c*(1+b):c+b-b*c,g=2*c-k,e=255*zd(g,k,d+1/3),f=255*zd(g,k,d),g=255*zd(g,k,d-1/3));d=[Math.round(e),Math.round(f),
+Math.round(g)];d.push(a.ua);return a.Wa(d)}s.Wa=function(a){var b=a;if(w(a))return this.ca=a,this;2=this.Xa?(c=1,d=1==this.Xa?1:(a-this.Xa)/(1-this.Xa)):(c=0,d=0!=this.Xa?a/this.Xa:1);-1==this.ha&&1==c&&(this.i[0].F=1,this.i[0].ta(1,b),this.i[0].stop());this.ha!=c&&(-1!=this.ha&&(this.i[this.ha].ta(1,b),this.i[this.ha].stop()),this.i[c].F=1);this.i[c].ta(d,b);this.ha=c;return a};function Md(a){U.call(this);var b=Ga(arguments);v(a)&&(b=a);2c?this.Za=new Ld(this.Za,d.r(b-c)):b"):pc(a,this.ja));this.s&8&&(b.lineHeight=Yd(this),b.padding=Da(this.I,function(a){return a*cd(this)},this).join("px ")+"px",b.color=this.bd,b.fontFamily=this.ac,b.fontSize=this.Aa*cd(this)+"px",b.fontWeight=this.cd,b.textAlign=this.Hc,b.textShadow=this.W||this.S.x||this.S.y?this.pb+" "+this.S.x+"px "+this.S.y+"px "+this.W+"px":"")};
+E.ab.o=function(a){E.v.o.call(this,a);var b=H(this),c=-b.left-this.I[3]+b.right-this.I[1]+Math.abs(this.S.x)+Math.abs(2*this.W),d=0;if(!this.zc){var d=[],e=this.ja.length,f=this.ja.match(kb?/[\s\.]+/g:/[\s-\.]+/g),g=0;if(f)for(var k=0;kc?(d.push(ra(e)),k--,e=f[g]):e+=f[g]);for(l=0;l-Math.PI/2?[d.right,d.bottom]:[d.left,d.bottom];d=(d[1]+1/n*d[0]-l+n*k)/(n+1/n);n=n*d+l-k*n;d-=k;n-=l;this.ee=Math.sqrt((f*f+g*g)/(d*d+n*n))}f=Da(this.eb,this.Jd,this);c=N?"-webkit-gradient(linear,"+100*this.w[0]+
+"% "+100*this.w[1]+"%,"+100*this.w[2]+"% "+100*this.w[3]+"%,"+f.join(",")+")":"linear-gradient("+100*this.w[0]+"% "+100*this.w[1]+"% "+Math.atan2((this.w[1]-this.w[3])*e,(this.w[2]-this.w[0])*c)+"rad,"+f.join(",")+")";kb&&(c="-moz-"+c);a.style.background=c};s.nb=function(a,b){for(var c=this.w,d=H(b),e=d.right-d.left,f=d.bottom-d.top,c=a.createLinearGradient(d.left+e*c[0],d.top+f*c[1],d.left+e*c[2],d.top+f*c[3]),d=0;da.Ga&&(a.Ga=0);var c=a.Ga/(2*a.Ea*a.Dc);1=c||1<=c)&&Ae(a)}
+s.start=function(){this.touches=[];S(this.Q,new $(1));this.bc=Zc();this.appendChild(this.bc);this.bc.o=ka(this.Zc,this);this.hc=q;P(this,["mousedown","touchstart","keydown"],this.Xc,q,this);T.Ob(function(){R(this.bc,4)},this)};
+s.Zc=function(a){var b=ma();this.ic||(this.ic=b);var c=(b-this.ic)/1E3,d=this.Bc,e=this.Cc,f=this.Bc-this.Cc,g,k,l;this.ic=b;lb?this.Uc.globalCompositeOperation="copy":a.clearRect(0,0,ad.f().width,ad.f().height);a.strokeStyle="rgba(0,0,0,0)";a.lineCap="round";a.lineWidth=17;a.shadowBlur=0;a.shadowColor="#fff";for(b=this.touches.length;0<=--b;){l=this.touches[b].Jb;g=l.length;for(a.beginPath();0<=--g;)k=l[g],a.moveTo(k.aa[0],k.aa[1]),a.lineTo(k.R[0],k.R[1]),k.Da>d&&l.splice(g,1);a.stroke();this.touches[b].remove&&
+!l.length&&this.touches.splice(b,1)}for(var b=[241,249,57],r=[255-b[0],255-b[1],255-b[2]],b=0;b(lb?300:0))0f*f+g*g){c.moveTo(d[0].aa[0],d[0].aa[1]);for(k=0;kf&&Ce(this,e[l],d[k].R[0]-
+d[k].aa[0],d[k].R[1]-d[k].aa[1]));c.closePath();for(k=0;kf)){Ee(this,e[l]);break}}};
+function ye(a){var b=Y((new X).h("Votre partie va commencer"),52).a(0,0);a.ea.appendChild(b);var c=(new le(0,200)).r(1.5);S(b,c);var d=oe();a.ea.appendChild(d);P(c,"stop",function(){re(d);var c=pe();se(d,function(){a.ea.removeChild(d);a.ea.appendChild(c);re(c);var f=qe(a);se(c,function(){a.ea.removeChild(c);a.ea.appendChild(f);re(f);se(f,function(){a.ea.removeChild(f);a.ea.removeChild(b);a.start()})})})})}
+function Ae(a){a.we=1;T.tb(a.reload,a);T.tb(a.Oc,a);for(var b=0;b=a.Ga?(c.h("Perdu !"),d.h("R\351essayer")):20==a.jb&&b.removeChild(d);P(d,Sd,function(){Fe(0>this.Ga?this.jb:this.jb+1)},q,a);d=(new ee).h("\311cran principal").c(300,
+90).a(0,320);b.appendChild(d);P(d,Sd,function(){we(m)});Ob(a,["mousedown","touchstart","keydown"],a.Xc,q,a);T.tb(a.Zc,a)}function Ee(a,b){a.Q.removeChild(b);ve(a,-b.value);var c=Xd(dd(Y(Z((new X).h("-"+b.value),"#c00"),40),1).a(b.d),700);a.appendChild(c);var d=new Md(new le(0,-60),new $(0),new me(2));S(c,d);P(d,"stop",function(){this.removeChild(c)},q,a);Fa(a.bubbles,b)}
+s.Oc=function(){for(var a=this.bubbles.length;0<=--a;)(840this.bubbles[a].d.x||768b.value)){Math.random();var e=Math.ceil(Math.random()*(b.value-1)),e=[e,b.value-e];Fa(a.bubbles,b);var f=b.d.e(),g=new $(0);P(g,"stop",function(){this.Q.removeChild(b)},q,a);S(b,g);c=(new L(-d,c)).normalize().scale(70);for(d=0;2>d;d++){var k=dd((new je(e[d])).a(f),0.5);a.Q.appendChild(k);d&&Va(c);var g=new Md(new le(c.x,c.y),new $(1)),l=a;P(g,"stop",function(){this.value==l.Ea?Ge(l,this):(l.bubbles.push(this),ke(k))},q,k);S(k,g)}}};function le(a,b){U.call(this);this.fb=2==arguments.length?new B(arguments[0],arguments[1]):a}z(le,U);s=le.prototype;s.scope="move";s.Sa=function(a){nd(this)&&(a.ka[I]=[new B(a.d.x+this.fb.x,a.d.y+this.fb.y),this.u,this.Pa,0],R(a,Nc));return{rb:a.d}};s.cb=function(){this.qb&&(this.r(this.qb*Ja(this.fb)/100),this.wc=1)};s.update=function(a,b){if(0!=this.F){var c=od(this,b);b.a(c.rb.x+this.fb.x*a,c.rb.y+this.fb.y*a)}};s.Z=function(a){nd(this)&&(a.Z(I),R(a,Nc))};function He(a,b){Wa.call(this);this.u=1;this.Ib=a;this.ga=b;this.Id=q}z(He,Tb);He.prototype.r=function(a){this.u=a;return this};He.prototype.start=function(){this.ga.a(new B(0,0));Xc(this.ga,q);this.finish()};He.prototype.finish=function(){this.dispatchEvent(new Ya("end"));this.Id=m};function Ie(a,b,c){He.call(this,a,b);this.oc=Je;this.$d=c||q}z(Ie,He);var Je=0;Ie.prototype.start=function(){var a=this.ga.f(),b=new B(0,0);switch(this.oc){case Je:this.ga.a(-a.width,0);b.x=a.width;break;case 1:this.ga.a(0,-a.height);b.y=a.height;break;case 2:this.ga.a(a.width,0);b.x=-a.width;break;case 4:this.ga.a(0,a.height),b.y=-a.height}Xc(this.ga,q);a=(new le(b)).r(this.u);this.Ib&&!this.$d&&Ea(a.da,this.Ib);Ea(a.da,this.ga);P(a,"stop",this.finish,q,this);a.play()};
+Ie.prototype.finish=function(){this.Ib&&this.Ib.a(0,0);He.prototype.finish.call(this)};function Ke(a,b,c){Ie.call(this,a,b,c);this.oc=1}z(Ke,Ie);function Le(a,b,c){Ie.call(this,a,b,c);this.oc=4}z(Le,Ie);function xe(a,b){Ke.call(this,a,b,m)}z(xe,Ke);function Me(a,b){Le.call(this,a,b,m)}z(Me,Le);function Ne(){F.call(this);this.b.style.cssText="background:rgba(255,255,255,.8)"}z(Ne,F);function Oe(a){this.gb=a;this.identifier=0}Oe.prototype.Ka=function(a,b,c){a=v(a)?a:[a];for(var d=0;d=a.ya.changedTouches.length&&(e=1)}else f.Va=new B(a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,a.clientY+document.body.scrollTop+document.documentElement.scrollTop),e=1;if(u(this.sa[f.identifier])){for(var g=
+this.sa[f.identifier],k=0;ka.width/a.height?a.width/b.width:a.height/b.height);var c=b.width/this.f().width;this.Ja(c);a.width/a.heightd.screenX||0>d.screenY);b=new B(0,0);var k;d=e?dc(e):document;if(k=M)if(k=!(M&&9<=Ab))k="CSS1Compat"!=bc(d).xa.compatMode;k=k?d.body:d.documentElement;if(c!=k)if(c.getBoundingClientRect)d=tc(c),e=bc(e).xa,c=!N&&"CSS1Compat"==e.compatMode?e.documentElement:e.body,e=e.parentWindow||e.defaultView,c=new B(e.pageXOffset||c.scrollLeft,e.pageYOffset||c.scrollTop),b.x=d.left+c.x,b.y=d.top+c.y;else if(e.getBoxObjectFor&&!g)d=e.getBoxObjectFor(c),c=e.getBoxObjectFor(k),b.x=d.screenX-
+c.screenX,b.y=d.screenY-c.screenY;else{d=c;do{b.x+=d.offsetLeft;b.y+=d.offsetTop;d!=c&&(b.x+=d.clientLeft||0,b.y+=d.clientTop||0);if(N&&"fixed"==sc(d,"position")){b.x+=e.body.scrollLeft;b.y+=e.body.scrollTop;break}d=d.offsetParent}while(d&&d!=c);if(jb||N&&"absolute"==f)b.y-=e.body.offsetTop;for(d=c;(d=uc(d))&&d!=e.body&&d!=k;)if(b.x-=d.scrollLeft,!jb||"TR"!=d.tagName)b.y-=d.scrollTop}this.yb=b;lb&&this.b.parentNode==document.body&&(this.pd&&(b=this.pd,nc(b.ownerNode||b.owningElement||b)),this.pd=
+zc("html{height:"+(a.height+120)+"px;overflow:hidden;}"))};s.Ba=function(a){a&&a.Va&&(a.position=this.ia(a.Va));return m};function we(a){var b=new F;Ve(b,a?Me:h);a=(new hd).a(384,0);b.appendChild(a);b=(new V).p("assets/main_title.png").a(0,250);a.appendChild(b);b=(new V).c(620,560).p("#c00").D(0.5,0).a(0,410);a.appendChild(b);var c=(new hd).a(0,280);a.appendChild(c);Oc(c,b);a=(new ee("JOUER")).a(0,330).c(250,100);c.appendChild(a);P(a,Sd,function(){Fe(1)});a=(new ee("Niveau ?")).a(0,480).c(250,100);c.appendChild(a);P(a,Sd,function(){S(c,qd(new ie(0,-255)))});b=(new hd).a(0,690);c.appendChild(b);/Chrome\/9\.0\.597/.test(gb())&&
+Pc(b,E);a=Z(Y((new X).h("Choix du niveau :"),30).D(0.5,0).a(0,0),"#fff");b.appendChild(a);a=(new hd).a(-250,110);b.appendChild(a);for(b=b=0;4>b;b++)for(var d=0;5>d;d++){var e=d+1+5*b,f=(new ee(""+e)).c(80,80).a(125*d,90*b);a.appendChild(f);P(f,Sd,function(){Fe(this)},q,e)}b=(new ee("Retour au menu")).c(400,80).a(250,90*b);a.appendChild(b);P(b,Sd,function(){S(c,qd(new ie(0,280)))},q,e)}function Fe(a){de=new te(a);Ve(de,xe)}
+function ze(a){var b=(new V).p("assets/lime.png"),c=Y(Z((new X).h("R\351alis\351 avec"),"#fff"),24).a(530,950),b=(new Nd(b)).Ja(0.3).a(670,950);P(b,"click",function(){t.location.href="http://www.limejs.com/"});a.appendChild(c);a.appendChild(b)}function Be(a,b,c,d){this.aa=[a,b];this.R=[c,d];this.Da=0}
+function We(){var a=ad=new Se(document.body,768,1004),b=document.createElement("meta");b.name="apple-mobile-web-app-capable";b.content="yes";document.getElementsByTagName("head").item(0).appendChild(b);b=document.createElement("meta");b.name="apple-mobile-web-app-status-bar-style";b.content="black";document.getElementsByTagName("head").item(0).appendChild(b);b=q;u(localStorage)&&(b=localStorage.getItem("_lime_visited"));/(ipod|iphone|ipad)/i.test(navigator.userAgent)&&(!window.navigator.je&&!b&&a.b.parentNode==
+document.body)&&(alert("Please install this page as a web app by clicking Share + Add to home screen."),u(localStorage)&&localStorage.setItem("_lime_visited",m));Vd="Impact";zc('@font-face{font-family: "Impact";src: url(assets/impact.ttf) format("truetype");})');we()}var Xe=["zlizer","start"],Ye=t;!(Xe[0]in Ye)&&Ye.execScript&&Ye.execScript("var "+Xe[0]);for(var Ze;Xe.length&&(Ze=Xe.shift());)!Xe.length&&u(We)?Ye[Ze]=We:Ye=Ye[Ze]?Ye[Ze]:Ye[Ze]={};
diff --git a/sources/zlizer/zlizer.manifest b/sources/zlizer/zlizer.manifest
new file mode 100644
index 0000000..f2e759b
--- /dev/null
+++ b/sources/zlizer/zlizer.manifest
@@ -0,0 +1,24 @@
+CACHE MANIFEST
+
+# If you use more files you need to manually list them here.
+# Don't remove next line
+# Updated on: 2013-04-16 12:54:49
+
+zlizer.js
+assets/startup.jpg
+assets/startup_ipad.jpg
+assets/icon.png
+
+assets/back.png
+assets/bubble_back.png
+assets/dialog_keyz.jpg
+assets/dialog_number.jpg
+assets/dialog_tutorial1.jpg
+assets/dialog_tutorial2.jpg
+assets/impact.ttf
+assets/main_title.png
+assets/lime.png
+
+
+NETWORK:
+*