(function($,window){
/*
   * The <code>pyte</code> object contains several service methods that are the
   * public methods <code>$.require</code> and <code>$.namespace</code> required.
   * JavaScript provide some OOP characteristics.
   * Pyte brings several enhancements, such as namespace support, the loading of
   * remote script files and embedding of style sheets files.
   *
   * @author <a href="dev@psykmedia.de">Christian Angermann</a>
   * @link Copyright (c) 2010 <a href="http://github.com/cange/jquery-pyte">jquery-pyte</a>.
   *
   * @link This script was inspired by the extension of
   * <a href="http://github.com/aemkei/pyte">pyte prototypejs</a> Martin Kleppe.
   *
   * @link Dual licensed under the MIT and GPL licenses
   * <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>
   * and <a href="http://www.gnu.org/licenses/gpl.html">GPL</a>.
   *
   * @version 2010 1.1.9 (Patched 20011-09-02)
   * @requires <a href="http.jquery.com">jQuery</a> v1.4.*
   * @requires <a href="http://code.google.com/p/jquery-inheritance/">
   * jquery.inherit</a> - Inheritance plugin by Filatov Dmitry
   * @class
   */
$.pyte={ignore:false,STYLESHEET:"css",JAVASCRIPT:"js",_basePath:"/javascripts/",_styleBasePath:"/stylesheets/",setBasePath:function(path,type){type=type||$.pyte.JAVASCRIPT;if(type==$.pyte.JAVASCRIPT){this._basePath=typeof path=="string"?path:this._basePath}else{this._styleBasePath=typeof path=="string"?path:this._styleBasePath}},flatten:function(args){var flatArgs=[];$.each(args,function(index,arg){if($.isArray(arg)){args=$.merge($.merge(index>0?$(args).slice(0,index):flatArgs,arg),$(args).slice(index+1,args.length))}});return args},_loadedUrls:[],includedUrls:(typeof pyte_preloaded!="undefined")?pyte_preloaded:[]};$.grep($('head script, head link[type="text/css"]'),function(elem){var uriAttr=!!elem.src?"src":"href";if(typeof elem[uriAttr]!="undefined"&&!!elem[uriAttr].length&&!!elem[uriAttr].match(document.location.host)){$.pyte._loadedUrls.push(elem[uriAttr])}else{return}});$.extend({require:function(sourcePath){$.each($.pyte.flatten(arguments),function(i,uri){if(!$.grep($.pyte.includedUrls,function(url){return url.match(uri)}).length){var isUri=new RegExp("/*.js$","gi").test(uri),isStyleSheet=new RegExp("/*.css$","gi").test(uri),script;if(!isUri&&!isStyleSheet){$.namespace(uri);$.pyte.includedUrls.push(uri);uri=uri.replace(/\./g,"/")+".js"}uri=(isStyleSheet?$.pyte._styleBasePath:$.pyte._basePath)+uri;if(!!$.grep($.pyte._loadedUrls,function(loadedUrl){return loadedUrl.match(uri)}).length){return false}if(isStyleSheet){$("head").first().append('<link rel="stylesheet" type="text/css" href="'+uri+'" />')}else{if(!$.pyte.ignore){script=$.ajax({url:uri,async:false}).responseText;if($.support.scriptEval){window.eval(script+"\r\n//@ sourceURL="+uri)}else{$.globalEval(script)}}}$.pyte._loadedUrls.push(uri)}})},namespace:function(namespaces){$.each($.pyte.flatten(arguments),function(i,namespace){var _window=window;$.each(namespace.split("."),function(i,part){_window=!!_window[part]?_window[part]:_window[part]={}})})}});$.each($.pyte.includedUrls,$.namespace);$.pyte._Module=$.inherit({__constructor:function(klass,options,callback){this.klass=klass;this.options=options;this.callback=callback;$.require(klass);$.pyte._Module._modules.push(this)}});$.pyte._Module._modules=[];$.pyte._Module._initialize=function(){$.each($.pyte._Module._modules,function(index,module){window.eval("var Klass = "+module.klass);var instance=new Klass(module.options);if(module.callback){module.callback.apply(instance)}})}})(jQuery,window);var Application=$.inherit({__constructor:function(a,b,c){if($.isFunction(b)){c=b;b={}}new $.pyte._Module(a,b,function(){window.application=this;if(c){c.apply(this)}})}});$(function(){$.pyte._Module._initialize()});
