<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -180,12 +180,10 @@ MyTimelineAssistant.prototype.activate = function(event) {
 			}
 			thisA.hideInlineSpinner('activity-spinner-my-timeline');
 		},
-		'data_failure': function(e, error_obj) {
+		'data_failure': function(e, error_array) {
 			dump('error_combined_timeline_data - response:');
-			dump(error_array);
 			thisA.hideInlineSpinner('activity-spinner-my-timeline');
-			// thisA.startRefresher();
-
+			
 			var err_msg = $L(&quot;There were errors retrieving your combined timeline&quot;);
 			thisA.displayErrorInfo(err_msg, error_array);
 		},</diff>
      <filename>app/assistants/my-timeline-assistant.js</filename>
    </modified>
    <modified>
      <diff>@@ -404,7 +404,7 @@ PostAssistant.prototype.loadImageUploaderEmail = function(api_label) {
  * Gets the meta value for the current user &amp; api's posting address
  */
 PostAssistant.prototype.getImageUploaderEmail = function(api_label) {
-	return this.Users.getMeta(sc.app.username, sc.app.type, api_label+'_posting_address');
+	return this.Users.getMeta(sc.app.userid, api_label+'_posting_address');
 };
 
 /**
@@ -418,7 +418,7 @@ PostAssistant.prototype.setImageUploaderEmail = function(api_label, email) {
 		email = this.imageUploaderEmailModel['image-uploader-email'];
 	}
 	
-	this.Users.setMeta(sc.app.username, sc.app.type, api_label+'_posting_address', email);
+	this.Users.setMeta(sc.app.userid, api_label+'_posting_address', email);
 };
 
 </diff>
      <filename>app/assistants/post-assistant.js</filename>
    </modified>
    <modified>
      <diff>@@ -40,7 +40,7 @@ StageAssistant.prototype.setup = function() {
 		load our prefs
 		default_preferences is from default_preferences.js, loaded in index.html
 	*/
-	sc.app.prefs = new scPrefs(default_preferences);
+	sc.app.prefs = new SpazPrefs(default_preferences);
 	sc.app.prefs.load();
 	Mojo.Log.info(&quot;loading prefs&#8230;&quot;);
 };</diff>
      <filename>app/assistants/stage-assistant.js</filename>
    </modified>
    <modified>
      <diff>@@ -20,13 +20,14 @@ function StartAssistant(argFromPusher) {
 			/*
 				get last user
 			*/
-			var last_user = sc.app.prefs.get('last_username');
-			var last_type = sc.app.prefs.get('last_type');
-			var last_user_obj = this.Users.getUser(last_user, last_type);
+			var last_userid = sc.app.prefs.get('last_userid');
+			var last_user_obj = this.Users.getUser(last_userid);
 			if (last_user_obj !== false) {
+				dump(last_user_obj);
 				sc.app.username = last_user_obj.username;
 				sc.app.password = last_user_obj.password;
 				sc.app.type     = last_user_obj.type;
+				sc.app.userid   = last_user_obj.id;
 				Mojo.Controller.stageController.pushScene('my-timeline');
 			} else {
 				dump(&quot;Tried to load last_user_object, but failed.&quot;);</diff>
      <filename>app/assistants/start-assistant.js</filename>
    </modified>
    <modified>
      <diff>@@ -72,9 +72,9 @@ StartloginAssistant.prototype.setup = function() {
 		sc.app.username = e.item.username;
 		sc.app.password = e.item.password;
 		sc.app.type     = e.item.type;
+		sc.app.userid	= e.item.id;
 		
-		sc.app.prefs.set('last_username', e.item.username);
-		sc.app.prefs.set('last_type', e.item.type);
+		sc.app.prefs.set('last_userid', sc.app.userid);
 				
 		Mojo.Controller.stageController.pushScene('my-timeline');
 	});</diff>
      <filename>app/assistants/startlogin-assistant.js</filename>
    </modified>
    <modified>
      <diff>@@ -301,15 +301,18 @@ scene_helpers.addCommonSceneMethods = function(assistant) {
 		});
 		this.twit.setSource(sc.app.prefs.get('twitter-source'));
 
-		if (sc.app.username &amp;&amp; sc.app.password) {
-			// alert('seetting credentials for '+sc.app.username);
-			if (sc.app.type === SPAZCORE_SERVICE_CUSTOM) {
-				var api_url = users.getMeta(sc.app.username, sc.app.type, 'api-url');
+		if (sc.app.userid) {
+			// alert('setting credentials for '+sc.app.username);
+			
+			var userobj = users.getUser(sc.app.userid);
+			
+			if (userobj.type === SPAZCORE_SERVICE_CUSTOM) {
+				var api_url = users.getMeta(sc.app.userid, 'api-url');
 				this.twit.setBaseURL(api_url);
 			} else {
-				this.twit.setBaseURLByService(sc.app.type);				
+				this.twit.setBaseURLByService(userobj.type);				
 			}
-			this.twit.setCredentials(sc.app.username, sc.app.password);
+			this.twit.setCredentials(userobj.username, userobj.password);
 			
 		} else {
 			// alert('NOT seetting credentials for!');
@@ -831,11 +834,14 @@ scene_helpers.addCommonSceneMethods = function(assistant) {
 			for (var i = 0; i &lt; errors.length; i++) {
 				error_info  = this.processAjaxError(errors[i]);
 				if (error_html.length&gt;0) {
-					error_html += '&lt;hr&gt;';
+					error_html += &quot;-------------------\n&quot;;
 				}
 				error_html += sc.app.tpl.parseTemplate(template, error_info);
 			}
 		}
+
+		var dialog_widget = Mojo.Controller.errorDialog(error_html);
+
 		
 		// /*
 		// 	We want to be able to pass html into the error dialogs, but escaping is on,</diff>
      <filename>app/helpers/scene.js</filename>
    </modified>
    <modified>
      <diff>@@ -169,6 +169,8 @@ Spaz.closeDashboard = function(name) {
 	Mojo.Controller.getAppController().closeStage(name);
 };
 
+
+
 /**
  * Initialize a temporary property we use to store 
  * cache data that only lives for the duration of the
@@ -179,47 +181,66 @@ Spaz.initTempCache = function() {
 };
 
 
-Spaz.initTempCacheUser = function(user) {
+/**
+ * Init the temp cache for a particular user 
+ */
+Spaz.initTempCacheUser = function(idkey) {
+	
+	if (!idkey) {
+		idkey = sc.app.userid;
+	}
+	
 	if (!window.spaztmpcache) {
 		Spaz.initTempCache();
 	}
-	if (!window.spaztmpcache[user]) {
-		window.spaztmpcache[user] = {};
+	if (!window.spaztmpcache[idkey]) {
+		window.spaztmpcache[idkey] = {};
 	}
 
 };
 
 
 /**
- * save a key:val pair to temp cache
+ * save a key:val pair to a idkey's temp cache
  */
-Spaz.saveTempCache = function(key, val, user) {
+Spaz.saveTempCache = function(key, val, idkey) {
+	
+	if (!idkey) {
+		idkey = sc.app.userid;
+	}
+	
+	
 	if (!window.spaztmpcache) {
 		Spaz.initTempCache();
 	}
-	if (!window.spaztmpcache[sc.app.username]) {
-		Spaz.initTempCacheUser(sc.app.username);
+	if (!window.spaztmpcache[idkey]) {
+		Spaz.initTempCacheUser(idkey);
 	}
 	
-	window.spaztmpcache[sc.app.username][key] = val;
+	window.spaztmpcache[idkey][key] = val;
 };
 
 /**
- * save a key:val pair to temp cache
+ * save a key:val pair to a idkey's temp cache
  */
-Spaz.loadTempCache = function(key, user) {
+Spaz.loadTempCache = function(key, idkey) {
+	
+	if (!idkey) {
+		idkey = sc.app.userid;
+	}
+	
 	if (!window.spaztmpcache) {
 		Spaz.initTempCache();
 		return null;
 	}
-	if (!window.spaztmpcache[sc.app.username]) {
-		Spaz.initTempCacheUser(sc.app.username);
+	if (!window.spaztmpcache[idkey]) {
+		Spaz.initTempCacheUser(idkey);
 		return null;
 	}
 
 	
-	if (window.spaztmpcache[sc.app.username][key]) {
-		return window.spaztmpcache[key];
+	if (window.spaztmpcache[idkey][key]) {
+		return window.spaztmpcache[idkey][key];
 	}
 	
 	return null;</diff>
      <filename>app/helpers/spaz.js</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ var Users = function(prefsObj) {
 	if (prefsObj) {
 		this.prefs = prefsObj;
 	} else {
-		this.prefs = new scPrefs(default_preferences);
+		this.prefs = new SpazPrefs(default_preferences);
 		this.prefs.load();
 	}
 	this._users = this.prefs.get('users');
@@ -22,9 +22,9 @@ Users.prototype.load	= function() {
 Users.prototype.fixIDs  = function() {
 	
 	for (i=0; i&lt;this._users.length; i++) {
-		if (this._users[i].id.toLowerCase() === this._users[i].username.toLowerCase()) {
-			dump('user '+this._users[i].username + ' has an old, identical id');
-			this._users[i].id = this.generateID(this._users[i].username, this._users[i].type);
+		if (! sc.helpers.isUUID(this._users[i].id)) {
+			dump('user '+this._users[i].username + ' has an old style id');
+			this._users[i].id = this.generateID();
 			this.save();
 		}
 	}
@@ -66,15 +66,16 @@ Users.prototype.initUsers	= function(onSuccess, onFailure) {
 
 Users.prototype.add			= function(username, password, type) {
 	var username = username.toLowerCase();
+	var id = this.generateID();
 	this._users.push = {
-		'id':this.generateID(username, type),
+		'id':id,
 		'username':username,
 		'password':password,
 		'type':type,
 		'meta':{}
 	};
 	this.save();
-	dump(&quot;Added new user:&quot;+this.generateID(username, type));
+	dump(&quot;Added new user:&quot;+id);
 };
 
 
@@ -87,12 +88,12 @@ Users.prototype.getByType	= function(type) {
 
 /**
  * retrives the user object by user and type
- * @param {string} username
+ * @param {string} id  the user id UUID
  * @param {string} type 
  */
-Users.prototype.getUser		= function(username, type) {
+Users.prototype.getUser		= function(id) {
 
-	var index = this._findUserIndex(username, type);
+	var index = this._findUserIndex(id);
 
 	if (index !== false) {
 		return this._users[i];		
@@ -103,15 +104,11 @@ Users.prototype.getUser		= function(username, type) {
 };
 
 
-Users.prototype._findUserIndex = function(username, type) {
-	var username = username.toLowerCase();
-	var type     = type.toLowerCase();
-	
-	var id = this.generateID(username, type);
+Users.prototype._findUserIndex = function(id) {
 	
 	for (i=0; i&lt;this._users.length; i++) {
 		
-		if (this._users[i].id.toLowerCase() === id) {
+		if (this._users[i].id === id) {
 			dump('Found matching user record to '+ id);
 			return i;
 		}
@@ -124,17 +121,21 @@ Users.prototype._findUserIndex = function(username, type) {
 
 
 
-Users.prototype.generateID = function(username, type) {
-	var id = username.toLowerCase()+&quot;_&quot;+type.toLowerCase();
+// Users.prototype.generateID = function(username, type) {
+// 	var id = username.toLowerCase()+&quot;_&quot;+type.toLowerCase();
+// 	return id;
+// };
+Users.prototype.generateID = function() {
+	var id = sc.helpers.UUID();
 	return id;
 };
 
 
-Users.prototype.getMeta = function(username, type, key) {
-	var user = null;
-	var id = this.generateID(username, type);
+
+
+Users.prototype.getMeta = function(id, key) {
 	
-	if ( user = this.getUser(username, type) ) {
+	if ( user = this.getUser(id) ) {
 		if (user.meta &amp;&amp; user.meta[key] !== null) {
 			return user.meta[key];
 		}
@@ -144,9 +145,9 @@ Users.prototype.getMeta = function(username, type, key) {
 	
 };
 
-Users.prototype.setMeta = function(username, type, key, value) {
+Users.prototype.setMeta = function(id, key, value) {
 	
-	var index = this._findUserIndex(username, type);
+	var index = this._findUserIndex(id);
 
 	if (index !== false) {		
 		if (!this._users[index].meta) {</diff>
      <filename>app/models/users.js</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,8 @@ var default_preferences = {
 	
 	'last_username':null,
 	'last_type':null,
+	'last_userid':null,
+	
 
 	'users':[], // an array of user objects with properties { 'id', 'username', 'password', 'type', 'meta' }	
 	'always-go-to-my-timeline':false,</diff>
      <filename>default_preferences.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 {
-&quot;logLevel&quot;: 99,
+&quot;logLevel&quot;: 0,
 &quot;timingEnabled&quot;: false,
 &quot;useNativeJSONParser&quot;:false,
 &quot;debuggingEnabled&quot;:false,</diff>
      <filename>framework_config.json</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,14 @@
+/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+regexp: false,
+undef: true,
+white: false,
+onevar: false 
+ */
+
 /**
  * SPAZCORE
  * version 0.1.1
@@ -103,152 +114,2180 @@ sc.events = {};
  * @depends spaztimeline.js
  * @depends spaztwit.js
  */
-/**
- * @version: 1.0 Alpha-1
- * @author: Coolite Inc. http://www.coolite.com/
- * @date: 2008-05-13
- * @copyright: Copyright (c) 2006-2008, Coolite Inc. (http://www.coolite.com/). All rights reserved.
- * @license: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/. 
- * @website: http://www.datejs.com/
- */
-Date.CultureInfo={name:&quot;en-US&quot;,englishName:&quot;English (United States)&quot;,nativeName:&quot;English (United States)&quot;,dayNames:[&quot;Sunday&quot;,&quot;Monday&quot;,&quot;Tuesday&quot;,&quot;Wednesday&quot;,&quot;Thursday&quot;,&quot;Friday&quot;,&quot;Saturday&quot;],abbreviatedDayNames:[&quot;Sun&quot;,&quot;Mon&quot;,&quot;Tue&quot;,&quot;Wed&quot;,&quot;Thu&quot;,&quot;Fri&quot;,&quot;Sat&quot;],shortestDayNames:[&quot;Su&quot;,&quot;Mo&quot;,&quot;Tu&quot;,&quot;We&quot;,&quot;Th&quot;,&quot;Fr&quot;,&quot;Sa&quot;],firstLetterDayNames:[&quot;S&quot;,&quot;M&quot;,&quot;T&quot;,&quot;W&quot;,&quot;T&quot;,&quot;F&quot;,&quot;S&quot;],monthNames:[&quot;January&quot;,&quot;February&quot;,&quot;March&quot;,&quot;April&quot;,&quot;May&quot;,&quot;June&quot;,&quot;July&quot;,&quot;August&quot;,&quot;September&quot;,&quot;October&quot;,&quot;November&quot;,&quot;December&quot;],abbreviatedMonthNames:[&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;,&quot;Jun&quot;,&quot;Jul&quot;,&quot;Aug&quot;,&quot;Sep&quot;,&quot;Oct&quot;,&quot;Nov&quot;,&quot;Dec&quot;],amDesignator:&quot;AM&quot;,pmDesignator:&quot;PM&quot;,firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:&quot;mdy&quot;,formatPatterns:{shortDate:&quot;M/d/yyyy&quot;,longDate:&quot;dddd, MMMM dd, yyyy&quot;,shortTime:&quot;h:mm tt&quot;,longTime:&quot;h:mm:ss tt&quot;,fullDateTime:&quot;dddd, MMMM dd, yyyy h:mm:ss tt&quot;,sortableDateTime:&quot;yyyy-MM-ddTHH:mm:ss&quot;,universalSortableDateTime:&quot;yyyy-MM-dd HH:mm:ssZ&quot;,rfc1123:&quot;ddd, dd MMM yyyy HH:mm:ss GMT&quot;,monthDay:&quot;MMMM dd&quot;,yearMonth:&quot;MMMM, yyyy&quot;},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|aft(er)?|from|hence)/i,subtract:/^(\-|bef(ore)?|ago)/i,yesterday:/^yes(terday)?/i,today:/^t(od(ay)?)?/i,tomorrow:/^tom(orrow)?/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^mn|min(ute)?s?/i,hour:/^h(our)?s?/i,week:/^w(eek)?s?/i,month:/^m(onth)?s?/i,day:/^d(ay)?s?/i,year:/^y(ear)?s?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a(?!u|p)|p)/i},timezones:[{name:&quot;UTC&quot;,offset:&quot;-000&quot;},{name:&quot;GMT&quot;,offset:&quot;-000&quot;},{name:&quot;EST&quot;,offset:&quot;-0500&quot;},{name:&quot;EDT&quot;,offset:&quot;-0400&quot;},{name:&quot;CST&quot;,offset:&quot;-0600&quot;},{name:&quot;CDT&quot;,offset:&quot;-0500&quot;},{name:&quot;MST&quot;,offset:&quot;-0700&quot;},{name:&quot;MDT&quot;,offset:&quot;-0600&quot;},{name:&quot;PST&quot;,offset:&quot;-0800&quot;},{name:&quot;PDT&quot;,offset:&quot;-0700&quot;}]};
-(function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo,p=function(s,l){if(!l){l=2;}
-return(&quot;000&quot;+s).slice(l*-1);};$P.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};$P.setTimeToNow=function(){var n=new Date();this.setHours(n.getHours());this.setMinutes(n.getMinutes());this.setSeconds(n.getSeconds());this.setMilliseconds(n.getMilliseconds());return this;};$D.today=function(){return new Date().clearTime();};$D.compare=function(date1,date2){if(isNaN(date1)||isNaN(date2)){throw new Error(date1+&quot; - &quot;+date2);}else if(date1 instanceof Date&amp;&amp;date2 instanceof Date){return(date1&lt;date2)?-1:(date1&gt;date2)?1:0;}else{throw new TypeError(date1+&quot; - &quot;+date2);}};$D.equals=function(date1,date2){return(date1.compareTo(date2)===0);};$D.getDayNumberFromName=function(name){var n=$C.dayNames,m=$C.abbreviatedDayNames,o=$C.shortestDayNames,s=name.toLowerCase();for(var i=0;i&lt;n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s||o[i].toLowerCase()==s){return i;}}
-return-1;};$D.getMonthNumberFromName=function(name){var n=$C.monthNames,m=$C.abbreviatedMonthNames,s=name.toLowerCase();for(var i=0;i&lt;n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i;}}
-return-1;};$D.isLeapYear=function(year){return((year%4===0&amp;&amp;year%100!==0)||year%400===0);};$D.getDaysInMonth=function(year,month){return[31,($D.isLeapYear(year)?29:28),31,30,31,30,31,31,30,31,30,31][month];};$D.getTimezoneAbbreviation=function(offset){var z=$C.timezones,p;for(var i=0;i&lt;z.length;i++){if(z[i].offset===offset){return z[i].name;}}
-return null;};$D.getTimezoneOffset=function(name){var z=$C.timezones,p;for(var i=0;i&lt;z.length;i++){if(z[i].name===name.toUpperCase()){return z[i].offset;}}
-return null;};$P.clone=function(){return new Date(this.getTime());};$P.compareTo=function(date){return Date.compare(this,date);};$P.equals=function(date){return Date.equals(this,date||new Date());};$P.between=function(start,end){return this.getTime()&gt;=start.getTime()&amp;&amp;this.getTime()&lt;=end.getTime();};$P.isAfter=function(date){return this.compareTo(date||new Date())===1;};$P.isBefore=function(date){return(this.compareTo(date||new Date())===-1);};$P.isToday=function(){return this.isSameDay(new Date());};$P.isSameDay=function(date){return this.clone().clearTime().equals(date.clone().clearTime());};$P.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};$P.addSeconds=function(value){return this.addMilliseconds(value*1000);};$P.addMinutes=function(value){return this.addMilliseconds(value*60000);};$P.addHours=function(value){return this.addMilliseconds(value*3600000);};$P.addDays=function(value){this.setDate(this.getDate()+value);return this;};$P.addWeeks=function(value){return this.addDays(value*7);};$P.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,$D.getDaysInMonth(this.getFullYear(),this.getMonth())));return this;};$P.addYears=function(value){return this.addMonths(value*12);};$P.add=function(config){if(typeof config==&quot;number&quot;){this._orient=config;return this;}
-var x=config;if(x.milliseconds){this.addMilliseconds(x.milliseconds);}
-if(x.seconds){this.addSeconds(x.seconds);}
-if(x.minutes){this.addMinutes(x.minutes);}
-if(x.hours){this.addHours(x.hours);}
-if(x.weeks){this.addWeeks(x.weeks);}
-if(x.months){this.addMonths(x.months);}
-if(x.years){this.addYears(x.years);}
-if(x.days){this.addDays(x.days);}
-return this;};var $y,$m,$d;$P.getWeek=function(){var a,b,c,d,e,f,g,n,s,w;$y=(!$y)?this.getFullYear():$y;$m=(!$m)?this.getMonth()+1:$m;$d=(!$d)?this.getDate():$d;if($m&lt;=2){a=$y-1;b=(a/4|0)-(a/100|0)+(a/400|0);c=((a-1)/4|0)-((a-1)/100|0)+((a-1)/400|0);s=b-c;e=0;f=$d-1+(31*($m-1));}else{a=$y;b=(a/4|0)-(a/100|0)+(a/400|0);c=((a-1)/4|0)-((a-1)/100|0)+((a-1)/400|0);s=b-c;e=s+1;f=$d+((153*($m-3)+2)/5)+58+s;}
-g=(a+b)%7;d=(f+g-e)%7;n=(f+3-d)|0;if(n&lt;0){w=53-((g-s)/5|0);}else if(n&gt;364+s){w=1;}else{w=(n/7|0)+1;}
-$y=$m=$d=null;return w;};$P.getISOWeek=function(){$y=this.getUTCFullYear();$m=this.getUTCMonth()+1;$d=this.getUTCDate();return p(this.getWeek());};$P.setWeek=function(n){return this.moveToDayOfWeek(1).addWeeks(n-this.getWeek());};$D._validate=function(n,min,max,name){if(typeof n==&quot;undefined&quot;){return false;}else if(typeof n!=&quot;number&quot;){throw new TypeError(n+&quot; is not a Number.&quot;);}else if(n&lt;min||n&gt;max){throw new RangeError(n+&quot; is not a valid value for &quot;+name+&quot;.&quot;);}
-return true;};$D.validateMillisecond=function(value){return $D._validate(value,0,999,&quot;millisecond&quot;);};$D.validateSecond=function(value){return $D._validate(value,0,59,&quot;second&quot;);};$D.validateMinute=function(value){return $D._validate(value,0,59,&quot;minute&quot;);};$D.validateHour=function(value){return $D._validate(value,0,23,&quot;hour&quot;);};$D.validateDay=function(value,year,month){return $D._validate(value,1,$D.getDaysInMonth(year,month),&quot;day&quot;);};$D.validateMonth=function(value){return $D._validate(value,0,11,&quot;month&quot;);};$D.validateYear=function(value){return $D._validate(value,0,9999,&quot;year&quot;);};$P.set=function(config){if($D.validateMillisecond(config.millisecond)){this.addMilliseconds(config.millisecond-this.getMilliseconds());}
-if($D.validateSecond(config.second)){this.addSeconds(config.second-this.getSeconds());}
-if($D.validateMinute(config.minute)){this.addMinutes(config.minute-this.getMinutes());}
-if($D.validateHour(config.hour)){this.addHours(config.hour-this.getHours());}
-if($D.validateMonth(config.month)){this.addMonths(config.month-this.getMonth());}
-if($D.validateYear(config.year)){this.addYears(config.year-this.getFullYear());}
-if($D.validateDay(config.day,this.getFullYear(),this.getMonth())){this.addDays(config.day-this.getDate());}
-if(config.timezone){this.setTimezone(config.timezone);}
-if(config.timezoneOffset){this.setTimezoneOffset(config.timezoneOffset);}
-if(config.week&amp;&amp;$D._validate(config.week,0,53,&quot;week&quot;)){this.setWeek(config.week);}
-return this;};$P.moveToFirstDayOfMonth=function(){return this.set({day:1});};$P.moveToLastDayOfMonth=function(){return this.set({day:$D.getDaysInMonth(this.getFullYear(),this.getMonth())});};$P.moveToNthOccurrence=function(dayOfWeek,occurrence){var shift=0;if(occurrence&gt;0){shift=occurrence-1;}
-else if(occurrence===-1){this.moveToLastDayOfMonth();if(this.getDay()!==dayOfWeek){this.moveToDayOfWeek(dayOfWeek,-1);}
-return this;}
-return this.moveToFirstDayOfMonth().addDays(-1).moveToDayOfWeek(dayOfWeek,+1).addWeeks(shift);};$P.moveToDayOfWeek=function(dayOfWeek,orient){var diff=(dayOfWeek-this.getDay()+7*(orient||+1))%7;return this.addDays((diff===0)?diff+=7*(orient||+1):diff);};$P.moveToMonth=function(month,orient){var diff=(month-this.getMonth()+12*(orient||+1))%12;return this.addMonths((diff===0)?diff+=12*(orient||+1):diff);};$P.getOrdinalNumber=function(){return Math.ceil((this.clone().clearTime()-new Date(this.getFullYear(),0,1))/86400000)+1;};$P.getTimezone=function(){return $D.getTimezoneAbbreviation(this.getUTCOffset());};$P.setTimezoneOffset=function(offset){var here=this.getTimezoneOffset(),there=Number(offset)*-6/10;return this.addMinutes(there-here);};$P.setTimezone=function(offset){return this.setTimezoneOffset($D.getTimezoneOffset(offset));};$P.hasDaylightSavingTime=function(){return(Date.today().set({month:0,day:1}).getTimezoneOffset()!==Date.today().set({month:6,day:1}).getTimezoneOffset());};$P.isDaylightSavingTime=function(){return(this.hasDaylightSavingTime()&amp;&amp;new Date().getTimezoneOffset()===Date.today().set({month:6,day:1}).getTimezoneOffset());};$P.getUTCOffset=function(){var n=this.getTimezoneOffset()*-10/6,r;if(n&lt;0){r=(n-10000).toString();return r.charAt(0)+r.substr(2);}else{r=(n+10000).toString();return&quot;+&quot;+r.substr(1);}};$P.getElapsed=function(date){return(date||new Date())-this;};if(!$P.toISOString){$P.toISOString=function(){function f(n){return n&lt;10?'0'+n:n;}
-return'&quot;'+this.getUTCFullYear()+'-'+
-f(this.getUTCMonth()+1)+'-'+
-f(this.getUTCDate())+'T'+
-f(this.getUTCHours())+':'+
-f(this.getUTCMinutes())+':'+
-f(this.getUTCSeconds())+'Z&quot;';};}
-$P._toString=$P.toString;$P.toString=function(format){var x=this;if(format&amp;&amp;format.length==1){var c=$C.formatPatterns;x.t=x.toString;switch(format){case&quot;d&quot;:return x.t(c.shortDate);case&quot;D&quot;:return x.t(c.longDate);case&quot;F&quot;:return x.t(c.fullDateTime);case&quot;m&quot;:return x.t(c.monthDay);case&quot;r&quot;:return x.t(c.rfc1123);case&quot;s&quot;:return x.t(c.sortableDateTime);case&quot;t&quot;:return x.t(c.shortTime);case&quot;T&quot;:return x.t(c.longTime);case&quot;u&quot;:return x.t(c.universalSortableDateTime);case&quot;y&quot;:return x.t(c.yearMonth);}}
-var ord=function(n){switch(n*1){case 1:case 21:case 31:return&quot;st&quot;;case 2:case 22:return&quot;nd&quot;;case 3:case 23:return&quot;rd&quot;;default:return&quot;th&quot;;}};return format?format.replace(/(\\)?(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)/g,function(m){if(m.charAt(0)===&quot;\\&quot;){return m.replace(&quot;\\&quot;,&quot;&quot;);}
-x.h=x.getHours;switch(m){case&quot;hh&quot;:return p(x.h()&lt;13?(x.h()===0?12:x.h()):(x.h()-12));case&quot;h&quot;:return x.h()&lt;13?(x.h()===0?12:x.h()):(x.h()-12);case&quot;HH&quot;:return p(x.h());case&quot;H&quot;:return x.h();case&quot;mm&quot;:return p(x.getMinutes());case&quot;m&quot;:return x.getMinutes();case&quot;ss&quot;:return p(x.getSeconds());case&quot;s&quot;:return x.getSeconds();case&quot;yyyy&quot;:return p(x.getFullYear(),4);case&quot;yy&quot;:return p(x.getFullYear());case&quot;dddd&quot;:return $C.dayNames[x.getDay()];case&quot;ddd&quot;:return $C.abbreviatedDayNames[x.getDay()];case&quot;dd&quot;:return p(x.getDate());case&quot;d&quot;:return x.getDate();case&quot;MMMM&quot;:return $C.monthNames[x.getMonth()];case&quot;MMM&quot;:return $C.abbreviatedMonthNames[x.getMonth()];case&quot;MM&quot;:return p((x.getMonth()+1));case&quot;M&quot;:return x.getMonth()+1;case&quot;t&quot;:return x.h()&lt;12?$C.amDesignator.substring(0,1):$C.pmDesignator.substring(0,1);case&quot;tt&quot;:return x.h()&lt;12?$C.amDesignator:$C.pmDesignator;case&quot;S&quot;:return ord(x.getDate());default:return m;}}):this._toString();};}());
-(function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo,$N=Number.prototype;$P._orient=+1;$P._nth=null;$P._is=false;$P._same=false;$P._isSecond=false;$N._dateElement=&quot;day&quot;;$P.next=function(){this._orient=+1;return this;};$D.next=function(){return $D.today().next();};$P.last=$P.prev=$P.previous=function(){this._orient=-1;return this;};$D.last=$D.prev=$D.previous=function(){return $D.today().last();};$P.is=function(){this._is=true;return this;};$P.same=function(){this._same=true;this._isSecond=false;return this;};$P.today=function(){return this.same().day();};$P.weekday=function(){if(this._is){this._is=false;return(!this.is().sat()&amp;&amp;!this.is().sun());}
-return false;};$P.at=function(time){return(typeof time===&quot;string&quot;)?$D.parse(this.toString(&quot;d&quot;)+&quot; &quot;+time):this.set(time);};$N.fromNow=$N.after=function(date){var c={};c[this._dateElement]=this;return((!date)?new Date():date.clone()).add(c);};$N.ago=$N.before=function(date){var c={};c[this._dateElement]=this*-1;return((!date)?new Date():date.clone()).add(c);};var dx=(&quot;sunday monday tuesday wednesday thursday friday saturday&quot;).split(/\s/),mx=(&quot;january february march april may june july august september october november december&quot;).split(/\s/),px=(&quot;Millisecond Second Minute Hour Day Week Month Year&quot;).split(/\s/),pxf=(&quot;Milliseconds Seconds Minutes Hours Date Week Month FullYear&quot;).split(/\s/),nth=(&quot;final first second third fourth fifth&quot;).split(/\s/),de;$P.toObject=function(){var o={};for(var i=0;i&lt;px.length;i++){o[px[i].toLowerCase()]=this[&quot;get&quot;+pxf[i]]();}
-return o;};$D.fromObject=function(config){config.week=null;return Date.today().set(config);};var df=function(n){return function(){if(this._is){this._is=false;return this.getDay()==n;}
-if(this._nth!==null){if(this._isSecond){this.addSeconds(this._orient*-1);}
-this._isSecond=false;var ntemp=this._nth;this._nth=null;var temp=this.clone().moveToLastDayOfMonth();this.moveToNthOccurrence(n,ntemp);if(this&gt;temp){throw new RangeError($D.getDayName(n)+&quot; does not occur &quot;+ntemp+&quot; times in the month of &quot;+$D.getMonthName(temp.getMonth())+&quot; &quot;+temp.getFullYear()+&quot;.&quot;);}
-return this;}
-return this.moveToDayOfWeek(n,this._orient);};};var sdf=function(n){return function(){var t=$D.today(),shift=n-t.getDay();if(n===0&amp;&amp;$C.firstDayOfWeek===1&amp;&amp;t.getDay()!==0){shift=shift+7;}
-return t.addDays(shift);};};for(var i=0;i&lt;dx.length;i++){$D[dx[i].toUpperCase()]=$D[dx[i].toUpperCase().substring(0,3)]=i;$D[dx[i]]=$D[dx[i].substring(0,3)]=sdf(i);$P[dx[i]]=$P[dx[i].substring(0,3)]=df(i);}
-var mf=function(n){return function(){if(this._is){this._is=false;return this.getMonth()===n;}
-return this.moveToMonth(n,this._orient);};};var smf=function(n){return function(){return $D.today().set({month:n,day:1});};};for(var j=0;j&lt;mx.length;j++){$D[mx[j].toUpperCase()]=$D[mx[j].toUpperCase().substring(0,3)]=j;$D[mx[j]]=$D[mx[j].substring(0,3)]=smf(j);$P[mx[j]]=$P[mx[j].substring(0,3)]=mf(j);}
-var ef=function(j){return function(){if(this._isSecond){this._isSecond=false;return this;}
-if(this._same){this._same=this._is=false;var o1=this.toObject(),o2=(arguments[0]||new Date()).toObject(),v=&quot;&quot;,k=j.toLowerCase();for(var m=(px.length-1);m&gt;-1;m--){v=px[m].toLowerCase();if(o1[v]!=o2[v]){return false;}
-if(k==v){break;}}
-return true;}
-if(j.substring(j.length-1)!=&quot;s&quot;){j+=&quot;s&quot;;}
-return this[&quot;add&quot;+j](this._orient);};};var nf=function(n){return function(){this._dateElement=n;return this;};};for(var k=0;k&lt;px.length;k++){de=px[k].toLowerCase();$P[de]=$P[de+&quot;s&quot;]=ef(px[k]);$N[de]=$N[de+&quot;s&quot;]=nf(de);}
-$P._ss=ef(&quot;Second&quot;);var nthfn=function(n){return function(dayOfWeek){if(this._same){return this._ss(arguments[0]);}
-if(dayOfWeek||dayOfWeek===0){return this.moveToNthOccurrence(dayOfWeek,n);}
-this._nth=n;if(n===2&amp;&amp;(dayOfWeek===undefined||dayOfWeek===null)){this._isSecond=true;return this.addSeconds(this._orient);}
-return this;};};for(var l=0;l&lt;nth.length;l++){$P[nth[l]]=(l===0)?nthfn(-1):nthfn(l);}}());
-(function(){Date.Parsing={Exception:function(s){this.message=&quot;Parse error at '&quot;+s.substring(0,10)+&quot; ...'&quot;;}};var $P=Date.Parsing;var _=$P.Operators={rtoken:function(r){return function(s){var mx=s.match(r);if(mx){return([mx[0],s.substring(mx[0].length)]);}else{throw new $P.Exception(s);}};},token:function(s){return function(s){return _.rtoken(new RegExp(&quot;^\s*&quot;+s+&quot;\s*&quot;))(s);};},stoken:function(s){return _.rtoken(new RegExp(&quot;^&quot;+s));},until:function(p){return function(s){var qx=[],rx=null;while(s.length){try{rx=p.call(this,s);}catch(e){qx.push(rx[0]);s=rx[1];continue;}
-break;}
-return[qx,s];};},many:function(p){return function(s){var rx=[],r=null;while(s.length){try{r=p.call(this,s);}catch(e){return[rx,s];}
-rx.push(r[0]);s=r[1];}
-return[rx,s];};},optional:function(p){return function(s){var r=null;try{r=p.call(this,s);}catch(e){return[null,s];}
-return[r[0],r[1]];};},not:function(p){return function(s){try{p.call(this,s);}catch(e){return[null,s];}
-throw new $P.Exception(s);};},ignore:function(p){return p?function(s){var r=null;r=p.call(this,s);return[null,r[1]];}:null;},product:function(){var px=arguments[0],qx=Array.prototype.slice.call(arguments,1),rx=[];for(var i=0;i&lt;px.length;i++){rx.push(_.each(px[i],qx));}
-return rx;},cache:function(rule){var cache={},r=null;return function(s){try{r=cache[s]=(cache[s]||rule.call(this,s));}catch(e){r=cache[s]=e;}
-if(r instanceof $P.Exception){throw r;}else{return r;}};},any:function(){var px=arguments;return function(s){var r=null;for(var i=0;i&lt;px.length;i++){if(px[i]==null){continue;}
-try{r=(px[i].call(this,s));}catch(e){r=null;}
-if(r){return r;}}
-throw new $P.Exception(s);};},each:function(){var px=arguments;return function(s){var rx=[],r=null;for(var i=0;i&lt;px.length;i++){if(px[i]==null){continue;}
-try{r=(px[i].call(this,s));}catch(e){throw new $P.Exception(s);}
-rx.push(r[0]);s=r[1];}
-return[rx,s];};},all:function(){var px=arguments,_=_;return _.each(_.optional(px));},sequence:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;if(px.length==1){return px[0];}
-return function(s){var r=null,q=null;var rx=[];for(var i=0;i&lt;px.length;i++){try{r=px[i].call(this,s);}catch(e){break;}
-rx.push(r[0]);try{q=d.call(this,r[1]);}catch(ex){q=null;break;}
-s=q[1];}
-if(!r){throw new $P.Exception(s);}
-if(q){throw new $P.Exception(q[1]);}
-if(c){try{r=c.call(this,r[1]);}catch(ey){throw new $P.Exception(r[1]);}}
-return[rx,(r?r[1]:s)];};},between:function(d1,p,d2){d2=d2||d1;var _fn=_.each(_.ignore(d1),p,_.ignore(d2));return function(s){var rx=_fn.call(this,s);return[[rx[0][0],r[0][2]],rx[1]];};},list:function(p,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return(p instanceof Array?_.each(_.product(p.slice(0,-1),_.ignore(d)),p.slice(-1),_.ignore(c)):_.each(_.many(_.each(p,_.ignore(d))),px,_.ignore(c)));},set:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return function(s){var r=null,p=null,q=null,rx=null,best=[[],s],last=false;for(var i=0;i&lt;px.length;i++){q=null;p=null;r=null;last=(px.length==1);try{r=px[i].call(this,s);}catch(e){continue;}
-rx=[[r[0]],r[1]];if(r[1].length&gt;0&amp;&amp;!last){try{q=d.call(this,r[1]);}catch(ex){last=true;}}else{last=true;}
-if(!last&amp;&amp;q[1].length===0){last=true;}
-if(!last){var qx=[];for(var j=0;j&lt;px.length;j++){if(i!=j){qx.push(px[j]);}}
-p=_.set(qx,d).call(this,q[1]);if(p[0].length&gt;0){rx[0]=rx[0].concat(p[0]);rx[1]=p[1];}}
-if(rx[1].length&lt;best[1].length){best=rx;}
-if(best[1].length===0){break;}}
-if(best[0].length===0){return best;}
-if(c){try{q=c.call(this,best[1]);}catch(ey){throw new $P.Exception(best[1]);}
-best[1]=q[1];}
-return best;};},forward:function(gr,fname){return function(s){return gr[fname].call(this,s);};},replace:function(rule,repl){return function(s){var r=rule.call(this,s);return[repl,r[1]];};},process:function(rule,fn){return function(s){var r=rule.call(this,s);return[fn.call(this,r[0]),r[1]];};},min:function(min,rule){return function(s){var rx=rule.call(this,s);if(rx[0].length&lt;min){throw new $P.Exception(s);}
-return rx;};}};var _generator=function(op){return function(){var args=null,rx=[];if(arguments.length&gt;1){args=Array.prototype.slice.call(arguments);}else if(arguments[0]instanceof Array){args=arguments[0];}
-if(args){for(var i=0,px=args.shift();i&lt;px.length;i++){args.unshift(px[i]);rx.push(op.apply(null,args));args.shift();return rx;}}else{return op.apply(null,arguments);}};};var gx=&quot;optional not ignore cache&quot;.split(/\s/);for(var i=0;i&lt;gx.length;i++){_[gx[i]]=_generator(_[gx[i]]);}
-var _vector=function(op){return function(){if(arguments[0]instanceof Array){return op.apply(null,arguments[0]);}else{return op.apply(null,arguments);}};};var vx=&quot;each any all&quot;.split(/\s/);for(var j=0;j&lt;vx.length;j++){_[vx[j]]=_vector(_[vx[j]]);}}());(function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo;var flattenAndCompact=function(ax){var rx=[];for(var i=0;i&lt;ax.length;i++){if(ax[i]instanceof Array){rx=rx.concat(flattenAndCompact(ax[i]));}else{if(ax[i]){rx.push(ax[i]);}}}
-return rx;};$D.Grammar={};$D.Translator={hour:function(s){return function(){this.hour=Number(s);};},minute:function(s){return function(){this.minute=Number(s);};},second:function(s){return function(){this.second=Number(s);};},meridian:function(s){return function(){this.meridian=s.slice(0,1).toLowerCase();};},timezone:function(s){return function(){var n=s.replace(/[^\d\+\-]/g,&quot;&quot;);if(n.length){this.timezoneOffset=Number(n);}else{this.timezone=s.toLowerCase();}};},day:function(x){var s=x[0];return function(){this.day=Number(s.match(/\d+/)[0]);};},month:function(s){return function(){this.month=(s.length==3)?&quot;jan feb mar apr may jun jul aug sep oct nov dec&quot;.indexOf(s)/4:Number(s)-1;};},year:function(s){return function(){var n=Number(s);this.year=((s.length&gt;2)?n:(n+(((n+2000)&lt;$C.twoDigitYearMax)?2000:1900)));};},rday:function(s){return function(){switch(s){case&quot;yesterday&quot;:this.days=-1;break;case&quot;tomorrow&quot;:this.days=1;break;case&quot;today&quot;:this.days=0;break;case&quot;now&quot;:this.days=0;this.now=true;break;}};},finishExact:function(x){x=(x instanceof Array)?x:[x];for(var i=0;i&lt;x.length;i++){if(x[i]){x[i].call(this);}}
-var now=new Date();if((this.hour||this.minute)&amp;&amp;(!this.month&amp;&amp;!this.year&amp;&amp;!this.day)){this.day=now.getDate();}
-if(!this.year){this.year=now.getFullYear();}
-if(!this.month&amp;&amp;this.month!==0){this.month=now.getMonth();}
-if(!this.day){this.day=1;}
-if(!this.hour){this.hour=0;}
-if(!this.minute){this.minute=0;}
-if(!this.second){this.second=0;}
-if(this.meridian&amp;&amp;this.hour){if(this.meridian==&quot;p&quot;&amp;&amp;this.hour&lt;12){this.hour=this.hour+12;}else if(this.meridian==&quot;a&quot;&amp;&amp;this.hour==12){this.hour=0;}}
-if(this.day&gt;$D.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+&quot; is not a valid value for days.&quot;);}
-var r=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){r.set({timezone:this.timezone});}else if(this.timezoneOffset){r.set({timezoneOffset:this.timezoneOffset});}
-return r;},finish:function(x){x=(x instanceof Array)?flattenAndCompact(x):[x];if(x.length===0){return null;}
-for(var i=0;i&lt;x.length;i++){if(typeof x[i]==&quot;function&quot;){x[i].call(this);}}
-var today=$D.today();if(this.now&amp;&amp;!this.unit&amp;&amp;!this.operator){return new Date();}else if(this.now){today=new Date();}
-var expression=!!(this.days&amp;&amp;this.days!==null||this.orient||this.operator);var gap,mod,orient;orient=((this.orient==&quot;past&quot;||this.operator==&quot;subtract&quot;)?-1:1);if(!this.now&amp;&amp;&quot;hour minute second&quot;.indexOf(this.unit)!=-1){today.setTimeToNow();}
-if(this.month||this.month===0){if(&quot;year day hour minute second&quot;.indexOf(this.unit)!=-1){this.value=this.month+1;this.month=null;expression=true;}}
-if(!expression&amp;&amp;this.weekday&amp;&amp;!this.day&amp;&amp;!this.days){var temp=Date[this.weekday]();this.day=temp.getDate();if(!this.month){this.month=temp.getMonth();}
-this.year=temp.getFullYear();}
-if(expression&amp;&amp;this.weekday&amp;&amp;this.unit!=&quot;month&quot;){this.unit=&quot;day&quot;;gap=($D.getDayNumberFromName(this.weekday)-today.getDay());mod=7;this.days=gap?((gap+(orient*mod))%mod):(orient*mod);}
-if(this.month&amp;&amp;this.unit==&quot;day&quot;&amp;&amp;this.operator){this.value=(this.month+1);this.month=null;}
-if(this.value!=null&amp;&amp;this.month!=null&amp;&amp;this.year!=null){this.day=this.value*1;}
-if(this.month&amp;&amp;!this.day&amp;&amp;this.value){today.set({day:this.value*1});if(!expression){this.day=this.value*1;}}
-if(!this.month&amp;&amp;this.value&amp;&amp;this.unit==&quot;month&quot;&amp;&amp;!this.now){this.month=this.value;expression=true;}
-if(expression&amp;&amp;(this.month||this.month===0)&amp;&amp;this.unit!=&quot;year&quot;){this.unit=&quot;month&quot;;gap=(this.month-today.getMonth());mod=12;this.months=gap?((gap+(orient*mod))%mod):(orient*mod);this.month=null;}
-if(!this.unit){this.unit=&quot;day&quot;;}
-if(!this.value&amp;&amp;this.operator&amp;&amp;this.operator!==null&amp;&amp;this[this.unit+&quot;s&quot;]&amp;&amp;this[this.unit+&quot;s&quot;]!==null){this[this.unit+&quot;s&quot;]=this[this.unit+&quot;s&quot;]+((this.operator==&quot;add&quot;)?1:-1)+(this.value||0)*orient;}else if(this[this.unit+&quot;s&quot;]==null||this.operator!=null){if(!this.value){this.value=1;}
-this[this.unit+&quot;s&quot;]=this.value*orient;}
-if(this.meridian&amp;&amp;this.hour){if(this.meridian==&quot;p&quot;&amp;&amp;this.hour&lt;12){this.hour=this.hour+12;}else if(this.meridian==&quot;a&quot;&amp;&amp;this.hour==12){this.hour=0;}}
-if(this.weekday&amp;&amp;!this.day&amp;&amp;!this.days){var temp=Date[this.weekday]();this.day=temp.getDate();if(temp.getMonth()!==today.getMonth()){this.month=temp.getMonth();}}
-if((this.month||this.month===0)&amp;&amp;!this.day){this.day=1;}
-if(!this.orient&amp;&amp;!this.operator&amp;&amp;this.unit==&quot;week&quot;&amp;&amp;this.value&amp;&amp;!this.day&amp;&amp;!this.month){return Date.today().setWeek(this.value);}
-if(expression&amp;&amp;this.timezone&amp;&amp;this.day&amp;&amp;this.days){this.day=this.days;}
-return(expression)?today.add(this):today.set(this);}};var _=$D.Parsing.Operators,g=$D.Grammar,t=$D.Translator,_fn;g.datePartDelimiter=_.rtoken(/^([\s\-\.\,\/\x27]+)/);g.timePartDelimiter=_.stoken(&quot;:&quot;);g.whiteSpace=_.rtoken(/^\s*/);g.generalDelimiter=_.rtoken(/^(([\s\,]|at|@|on)+)/);var _C={};g.ctoken=function(keys){var fn=_C[keys];if(!fn){var c=$C.regexPatterns;var kx=keys.split(/\s+/),px=[];for(var i=0;i&lt;kx.length;i++){px.push(_.replace(_.rtoken(c[kx[i]]),kx[i]));}
-fn=_C[keys]=_.any.apply(null,px);}
-return fn;};g.ctoken2=function(key){return _.rtoken($C.regexPatterns[key]);};g.h=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),t.hour));g.hh=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/),t.hour));g.H=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),t.hour));g.HH=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/),t.hour));g.m=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.minute));g.mm=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.minute));g.s=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.second));g.ss=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.second));g.hms=_.cache(_.sequence([g.H,g.m,g.s],g.timePartDelimiter));g.t=_.cache(_.process(g.ctoken2(&quot;shortMeridian&quot;),t.meridian));g.tt=_.cache(_.process(g.ctoken2(&quot;longMeridian&quot;),t.meridian));g.z=_.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),t.timezone));g.zz=_.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),t.timezone));g.zzz=_.cache(_.process(g.ctoken2(&quot;timezone&quot;),t.timezone));g.timeSuffix=_.each(_.ignore(g.whiteSpace),_.set([g.tt,g.zzz]));g.time=_.each(_.optional(_.ignore(_.stoken(&quot;T&quot;))),g.hms,g.timeSuffix);g.d=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/),_.optional(g.ctoken2(&quot;ordinalSuffix&quot;))),t.day));g.dd=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/),_.optional(g.ctoken2(&quot;ordinalSuffix&quot;))),t.day));g.ddd=g.dddd=_.cache(_.process(g.ctoken(&quot;sun mon tue wed thu fri sat&quot;),function(s){return function(){this.weekday=s;};}));g.M=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/),t.month));g.MM=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/),t.month));g.MMM=g.MMMM=_.cache(_.process(g.ctoken(&quot;jan feb mar apr may jun jul aug sep oct nov dec&quot;),t.month));g.y=_.cache(_.process(_.rtoken(/^(\d\d?)/),t.year));g.yy=_.cache(_.process(_.rtoken(/^(\d\d)/),t.year));g.yyy=_.cache(_.process(_.rtoken(/^(\d\d?\d?\d?)/),t.year));g.yyyy=_.cache(_.process(_.rtoken(/^(\d\d\d\d)/),t.year));_fn=function(){return _.each(_.any.apply(null,arguments),_.not(g.ctoken2(&quot;timeContext&quot;)));};g.day=_fn(g.d,g.dd);g.month=_fn(g.M,g.MMM);g.year=_fn(g.yyyy,g.yy);g.orientation=_.process(g.ctoken(&quot;past future&quot;),function(s){return function(){this.orient=s;};});g.operator=_.process(g.ctoken(&quot;add subtract&quot;),function(s){return function(){this.operator=s;};});g.rday=_.process(g.ctoken(&quot;yesterday tomorrow today now&quot;),t.rday);g.unit=_.process(g.ctoken(&quot;second minute hour day week month year&quot;),function(s){return function(){this.unit=s;};});g.value=_.process(_.rtoken(/^\d\d?(st|nd|rd|th)?/),function(s){return function(){this.value=s.replace(/\D/g,&quot;&quot;);};});g.expression=_.set([g.rday,g.operator,g.value,g.unit,g.orientation,g.ddd,g.MMM]);_fn=function(){return _.set(arguments,g.datePartDelimiter);};g.mdy=_fn(g.ddd,g.month,g.day,g.year);g.ymd=_fn(g.ddd,g.year,g.month,g.day);g.dmy=_fn(g.ddd,g.day,g.month,g.year);g.date=function(s){return((g[$C.dateElementOrder]||g.mdy).call(this,s));};g.format=_.process(_.many(_.any(_.process(_.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(fmt){if(g[fmt]){return g[fmt];}else{throw $D.Parsing.Exception(fmt);}}),_.process(_.rtoken(/^[^dMyhHmstz]+/),function(s){return _.ignore(_.stoken(s));}))),function(rules){return _.process(_.each.apply(null,rules),t.finishExact);});var _F={};var _get=function(f){return _F[f]=(_F[f]||g.format(f)[0]);};g.formats=function(fx){if(fx instanceof Array){var rx=[];for(var i=0;i&lt;fx.length;i++){rx.push(_get(fx[i]));}
-return _.any.apply(null,rx);}else{return _get(fx);}};g._formats=g.formats([&quot;\&quot;yyyy-MM-ddTHH:mm:ssZ\&quot;&quot;,&quot;yyyy-MM-ddTHH:mm:ssZ&quot;,&quot;yyyy-MM-ddTHH:mm:ssz&quot;,&quot;yyyy-MM-ddTHH:mm:ss&quot;,&quot;yyyy-MM-ddTHH:mmZ&quot;,&quot;yyyy-MM-ddTHH:mmz&quot;,&quot;yyyy-MM-ddTHH:mm&quot;,&quot;ddd, MMM dd, yyyy H:mm:ss tt&quot;,&quot;ddd MMM d yyyy HH:mm:ss zzz&quot;,&quot;MMddyyyy&quot;,&quot;ddMMyyyy&quot;,&quot;Mddyyyy&quot;,&quot;ddMyyyy&quot;,&quot;Mdyyyy&quot;,&quot;dMyyyy&quot;,&quot;yyyy&quot;,&quot;Mdyy&quot;,&quot;dMyy&quot;,&quot;d&quot;]);g._start=_.process(_.set([g.date,g.time,g.expression],g.generalDelimiter,g.whiteSpace),t.finish);g.start=function(s){try{var r=g._formats.call({},s);if(r[1].length===0){return r;}}catch(e){}
-return g._start.call({},s);};$D._parse=$D.parse;$D.parse=function(s){var r=null;if(!s){return null;}
-if(s instanceof Date){return s;}
-try{r=$D.Grammar.start.call({},s.replace(/^\s*(\S*(\s+\S+)*)\s*$/,&quot;$1&quot;));}catch(e){return null;}
-return((r[1].length===0)?r[0]:null);};$D.getParseFunction=function(fx){var fn=$D.Grammar.formats(fx);return function(s){var r=null;try{r=fn.call({},s);}catch(e){return null;}
-return((r[1].length===0)?r[0]:null);};};$D.parseExact=function(s,fx){return $D.getParseFunction(fx)(s);};}());
-/*
+Date.CultureInfo = {
+	/* Culture Name */
+    name: &quot;en-US&quot;,
+    englishName: &quot;English (United States)&quot;,
+    nativeName: &quot;English (United States)&quot;,
+    
+    /* Day Name Strings */
+    dayNames: [&quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;],
+    abbreviatedDayNames: [&quot;Sun&quot;, &quot;Mon&quot;, &quot;Tue&quot;, &quot;Wed&quot;, &quot;Thu&quot;, &quot;Fri&quot;, &quot;Sat&quot;],
+    shortestDayNames: [&quot;Su&quot;, &quot;Mo&quot;, &quot;Tu&quot;, &quot;We&quot;, &quot;Th&quot;, &quot;Fr&quot;, &quot;Sa&quot;],
+    firstLetterDayNames: [&quot;S&quot;, &quot;M&quot;, &quot;T&quot;, &quot;W&quot;, &quot;T&quot;, &quot;F&quot;, &quot;S&quot;],
+    
+    /* Month Name Strings */
+    monthNames: [&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot;, &quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;August&quot;, &quot;September&quot;, &quot;October&quot;, &quot;November&quot;, &quot;December&quot;],
+    abbreviatedMonthNames: [&quot;Jan&quot;, &quot;Feb&quot;, &quot;Mar&quot;, &quot;Apr&quot;, &quot;May&quot;, &quot;Jun&quot;, &quot;Jul&quot;, &quot;Aug&quot;, &quot;Sep&quot;, &quot;Oct&quot;, &quot;Nov&quot;, &quot;Dec&quot;],
+
+	/* AM/PM Designators */
+    amDesignator: &quot;AM&quot;,
+    pmDesignator: &quot;PM&quot;,
+
+    firstDayOfWeek: 0,
+    twoDigitYearMax: 2029,
+    
+    /**
+     * The dateElementOrder is based on the order of the 
+     * format specifiers in the formatPatterns.DatePattern. 
+     *
+     * Example:
+     &lt;pre&gt;
+     shortDatePattern    dateElementOrder
+     ------------------  ---------------- 
+     &quot;M/d/yyyy&quot;          &quot;mdy&quot;
+     &quot;dd/MM/yyyy&quot;        &quot;dmy&quot;
+     &quot;yyyy-MM-dd&quot;        &quot;ymd&quot;
+     &lt;/pre&gt;
+     *
+     * The correct dateElementOrder is required by the parser to
+     * determine the expected order of the date elements in the
+     * string being parsed.
+     */
+    dateElementOrder: &quot;mdy&quot;,
+    
+    /* Standard date and time format patterns */
+    formatPatterns: {
+        shortDate: &quot;M/d/yyyy&quot;,
+        longDate: &quot;dddd, MMMM dd, yyyy&quot;,
+        shortTime: &quot;h:mm tt&quot;,
+        longTime: &quot;h:mm:ss tt&quot;,
+        fullDateTime: &quot;dddd, MMMM dd, yyyy h:mm:ss tt&quot;,
+        sortableDateTime: &quot;yyyy-MM-ddTHH:mm:ss&quot;,
+        universalSortableDateTime: &quot;yyyy-MM-dd HH:mm:ssZ&quot;,
+        rfc1123: &quot;ddd, dd MMM yyyy HH:mm:ss GMT&quot;,
+        monthDay: &quot;MMMM dd&quot;,
+        yearMonth: &quot;MMMM, yyyy&quot;
+    },
+
+    /**
+     * NOTE: If a string format is not parsing correctly, but
+     * you would expect it parse, the problem likely lies below. 
+     * 
+     * The following regex patterns control most of the string matching
+     * within the parser.
+     * 
+     * The Month name and Day name patterns were automatically generated
+     * and in general should be (mostly) correct. 
+     *
+     * Beyond the month and day name patterns are natural language strings.
+     * Example: &quot;next&quot;, &quot;today&quot;, &quot;months&quot;
+     *
+     * These natural language string may NOT be correct for this culture. 
+     * If they are not correct, please translate and edit this file
+     * providing the correct regular expression pattern. 
+     *
+     * If you modify this file, please post your revised CultureInfo file
+     * to the Datejs Forum located at http://www.datejs.com/forums/.
+     *
+     * Please mark the subject of the post with [CultureInfo]. Example:
+     *    Subject: [CultureInfo] Translated &quot;da-DK&quot; Danish(Denmark)
+     * 
+     * We will add the modified patterns to the master source files.
+     *
+     * As well, please review the list of &quot;Future Strings&quot; section below. 
+     */	
+    regexPatterns: {
+        jan: /^jan(uary)?/i,
+        feb: /^feb(ruary)?/i,
+        mar: /^mar(ch)?/i,
+        apr: /^apr(il)?/i,
+        may: /^may/i,
+        jun: /^jun(e)?/i,
+        jul: /^jul(y)?/i,
+        aug: /^aug(ust)?/i,
+        sep: /^sep(t(ember)?)?/i,
+        oct: /^oct(ober)?/i,
+        nov: /^nov(ember)?/i,
+        dec: /^dec(ember)?/i,
+
+        sun: /^su(n(day)?)?/i,
+        mon: /^mo(n(day)?)?/i,
+        tue: /^tu(e(s(day)?)?)?/i,
+        wed: /^we(d(nesday)?)?/i,
+        thu: /^th(u(r(s(day)?)?)?)?/i,
+        fri: /^fr(i(day)?)?/i,
+        sat: /^sa(t(urday)?)?/i,
+
+        future: /^next/i,
+        past: /^last|past|prev(ious)?/i,
+        add: /^(\+|aft(er)?|from|hence)/i,
+        subtract: /^(\-|bef(ore)?|ago)/i,
+        
+        yesterday: /^yes(terday)?/i,
+        today: /^t(od(ay)?)?/i,
+        tomorrow: /^tom(orrow)?/i,
+        now: /^n(ow)?/i,
+        
+        millisecond: /^ms|milli(second)?s?/i,
+        second: /^sec(ond)?s?/i,
+        minute: /^mn|min(ute)?s?/i,
+		hour: /^h(our)?s?/i,
+		week: /^w(eek)?s?/i,
+        month: /^m(onth)?s?/i,
+        day: /^d(ay)?s?/i,
+        year: /^y(ear)?s?/i,
+		
+        shortMeridian: /^(a|p)/i,
+        longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i,
+        timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i,
+        ordinalSuffix: /^\s*(st|nd|rd|th)/i,
+        timeContext: /^\s*(\:|a(?!u|p)|p)/i
+    },
+
+	timezones: [{name:&quot;UTC&quot;, offset:&quot;-000&quot;}, {name:&quot;GMT&quot;, offset:&quot;-000&quot;}, {name:&quot;EST&quot;, offset:&quot;-0500&quot;}, {name:&quot;EDT&quot;, offset:&quot;-0400&quot;}, {name:&quot;CST&quot;, offset:&quot;-0600&quot;}, {name:&quot;CDT&quot;, offset:&quot;-0500&quot;}, {name:&quot;MST&quot;, offset:&quot;-0700&quot;}, {name:&quot;MDT&quot;, offset:&quot;-0600&quot;}, {name:&quot;PST&quot;, offset:&quot;-0800&quot;}, {name:&quot;PDT&quot;, offset:&quot;-0700&quot;}]
+};
+
+/********************
+ ** Future Strings **
+ ********************
+ * 
+ * The following list of strings may not be currently being used, but 
+ * may be incorporated into the Datejs library later. 
+ *
+ * We would appreciate any help translating the strings below.
+ * 
+ * If you modify this file, please post your revised CultureInfo file
+ * to the Datejs Forum located at http://www.datejs.com/forums/.
+ *
+ * Please mark the subject of the post with [CultureInfo]. Example:
+ *    Subject: [CultureInfo] Translated &quot;da-DK&quot; Danish(Denmark)b
+ *
+ * English Name        Translated
+ * ------------------  -----------------
+ * about               about
+ * ago                 ago
+ * date                date
+ * time                time
+ * calendar            calendar
+ * show                show
+ * hourly              hourly
+ * daily               daily
+ * weekly              weekly
+ * bi-weekly           bi-weekly
+ * fortnight           fortnight
+ * monthly             monthly
+ * bi-monthly          bi-monthly
+ * quarter             quarter
+ * quarterly           quarterly
+ * yearly              yearly
+ * annual              annual
+ * annually            annually
+ * annum               annum
+ * again               again
+ * between             between
+ * after               after
+ * from now            from now
+ * repeat              repeat
+ * times               times
+ * per                 per
+ * min (abbrev minute) min
+ * morning             morning
+ * noon                noon
+ * night               night
+ * midnight            midnight
+ * mid-night           mid-night
+ * evening             evening
+ * final               final
+ * future              future
+ * spring              spring
+ * summer              summer
+ * fall                fall
+ * winter              winter
+ * end of              end of
+ * end                 end
+ * long                long
+ * short               short
+ *//**
+ * @version: 1.0 Alpha-1
+ * @author: Coolite Inc. http://www.coolite.com/
+ * @date: 2008-04-13
+ * @copyright: Copyright (c) 2006-2008, Coolite Inc. (http://www.coolite.com/). All rights reserved.
+ * @license: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/. 
+ * @website: http://www.datejs.com/
+ */
+ 
+(function () {
+    var $D = Date, 
+        $P = $D.prototype, 
+        $C = $D.CultureInfo,
+        p = function (s, l) {
+            if (!l) {
+                l = 2;
+            }
+            return (&quot;000&quot; + s).slice(l * -1);
+        };
+            
+    /**
+     * Resets the time of this Date object to 12:00 AM (00:00), which is the start of the day.
+     * @param {Boolean}  .clone() this date instance before clearing Time
+     * @return {Date}    this
+     */
+    $P.clearTime = function () {
+        this.setHours(0);
+        this.setMinutes(0);
+        this.setSeconds(0);
+        this.setMilliseconds(0);
+        return this;
+    };
+
+    /**
+     * Resets the time of this Date object to the current time ('now').
+     * @return {Date}    this
+     */
+    $P.setTimeToNow = function () {
+        var n = new Date();
+        this.setHours(n.getHours());
+        this.setMinutes(n.getMinutes());
+        this.setSeconds(n.getSeconds());
+        this.setMilliseconds(n.getMilliseconds());
+        return this;
+    };
+
+    /** 
+     * Gets a date that is set to the current date. The time is set to the start of the day (00:00 or 12:00 AM).
+     * @return {Date}    The current date.
+     */
+    $D.today = function () {
+        return new Date().clearTime();
+    };
+
+    /**
+     * Compares the first date to the second date and returns an number indication of their relative values.  
+     * @param {Date}     First Date object to compare [Required].
+     * @param {Date}     Second Date object to compare to [Required].
+     * @return {Number}  -1 = date1 is lessthan date2. 0 = values are equal. 1 = date1 is greaterthan date2.
+     */
+    $D.compare = function (date1, date2) {
+        if (isNaN(date1) || isNaN(date2)) { 
+            throw new Error(date1 + &quot; - &quot; + date2); 
+        } else if (date1 instanceof Date &amp;&amp; date2 instanceof Date) {
+            return (date1 &lt; date2) ? -1 : (date1 &gt; date2) ? 1 : 0;
+        } else { 
+            throw new TypeError(date1 + &quot; - &quot; + date2); 
+        }
+    };
+    
+    /**
+     * Compares the first Date object to the second Date object and returns true if they are equal.  
+     * @param {Date}     First Date object to compare [Required]
+     * @param {Date}     Second Date object to compare to [Required]
+     * @return {Boolean} true if dates are equal. false if they are not equal.
+     */
+    $D.equals = function (date1, date2) { 
+        return (date1.compareTo(date2) === 0); 
+    };
+
+    /**
+     * Gets the day number (0-6) if given a CultureInfo specific string which is a valid dayName, abbreviatedDayName or shortestDayName (two char).
+     * @param {String}   The name of the day (eg. &quot;Monday, &quot;Mon&quot;, &quot;tuesday&quot;, &quot;tue&quot;, &quot;We&quot;, &quot;we&quot;).
+     * @return {Number}  The day number
+     */
+    $D.getDayNumberFromName = function (name) {
+        var n = $C.dayNames, m = $C.abbreviatedDayNames, o = $C.shortestDayNames, s = name.toLowerCase();
+        for (var i = 0; i &lt; n.length; i++) { 
+            if (n[i].toLowerCase() == s || m[i].toLowerCase() == s || o[i].toLowerCase() == s) { 
+                return i; 
+            }
+        }
+        return -1;  
+    };
+    
+    /**
+     * Gets the month number (0-11) if given a Culture Info specific string which is a valid monthName or abbreviatedMonthName.
+     * @param {String}   The name of the month (eg. &quot;February, &quot;Feb&quot;, &quot;october&quot;, &quot;oct&quot;).
+     * @return {Number}  The day number
+     */
+    $D.getMonthNumberFromName = function (name) {
+        var n = $C.monthNames, m = $C.abbreviatedMonthNames, s = name.toLowerCase();
+        for (var i = 0; i &lt; n.length; i++) {
+            if (n[i].toLowerCase() == s || m[i].toLowerCase() == s) { 
+                return i; 
+            }
+        }
+        return -1;
+    };
+
+    /**
+     * Determines if the current date instance is within a LeapYear.
+     * @param {Number}   The year.
+     * @return {Boolean} true if date is within a LeapYear, otherwise false.
+     */
+    $D.isLeapYear = function (year) { 
+        return ((year % 4 === 0 &amp;&amp; year % 100 !== 0) || year % 400 === 0); 
+    };
+
+    /**
+     * Gets the number of days in the month, given a year and month value. Automatically corrects for LeapYear.
+     * @param {Number}   The year.
+     * @param {Number}   The month (0-11).
+     * @return {Number}  The number of days in the month.
+     */
+    $D.getDaysInMonth = function (year, month) {
+        return [31, ($D.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
+    };
+ 
+    $D.getTimezoneAbbreviation = function (offset) {
+        var z = $C.timezones, p;
+        for (var i = 0; i &lt; z.length; i++) {
+            if (z[i].offset === offset) {
+                return z[i].name;
+            }
+        }
+        return null;
+    };
+    
+    $D.getTimezoneOffset = function (name) {
+        var z = $C.timezones, p;
+        for (var i = 0; i &lt; z.length; i++) {
+            if (z[i].name === name.toUpperCase()) {
+                return z[i].offset;
+            }
+        }
+        return null;
+    };
+
+    /**
+     * Returns a new Date object that is an exact date and time copy of the original instance.
+     * @return {Date}    A new Date instance
+     */
+    $P.clone = function () {
+        return new Date(this.getTime()); 
+    };
+
+    /**
+     * Compares this instance to a Date object and returns an number indication of their relative values.  
+     * @param {Date}     Date object to compare [Required]
+     * @return {Number}  -1 = this is lessthan date. 0 = values are equal. 1 = this is greaterthan date.
+     */
+    $P.compareTo = function (date) {
+        return Date.compare(this, date);
+    };
+
+    /**
+     * Compares this instance to another Date object and returns true if they are equal.  
+     * @param {Date}     Date object to compare. If no date to compare, new Date() [now] is used.
+     * @return {Boolean} true if dates are equal. false if they are not equal.
+     */
+    $P.equals = function (date) {
+        return Date.equals(this, date || new Date());
+    };
+
+    /**
+     * Determines if this instance is between a range of two dates or equal to either the start or end dates.
+     * @param {Date}     Start of range [Required]
+     * @param {Date}     End of range [Required]
+     * @return {Boolean} true is this is between or equal to the start and end dates, else false
+     */
+    $P.between = function (start, end) {
+        return this.getTime() &gt;= start.getTime() &amp;&amp; this.getTime() &lt;= end.getTime();
+    };
+
+    /**
+     * Determines if this date occurs after the date to compare to.
+     * @param {Date}     Date object to compare. If no date to compare, new Date() (&quot;now&quot;) is used.
+     * @return {Boolean} true if this date instance is greater than the date to compare to (or &quot;now&quot;), otherwise false.
+     */
+    $P.isAfter = function (date) {
+        return this.compareTo(date || new Date()) === 1;
+    };
+
+    /**
+     * Determines if this date occurs before the date to compare to.
+     * @param {Date}     Date object to compare. If no date to compare, new Date() (&quot;now&quot;) is used.
+     * @return {Boolean} true if this date instance is less than the date to compare to (or &quot;now&quot;).
+     */
+    $P.isBefore = function (date) {
+        return (this.compareTo(date || new Date()) === -1);
+    };
+
+    /**
+     * Determines if the current Date instance occurs today.
+     * @return {Boolean} true if this date instance is 'today', otherwise false.
+     */
+    
+    /**
+     * Determines if the current Date instance occurs on the same Date as the supplied 'date'. 
+     * If no 'date' to compare to is provided, the current Date instance is compared to 'today'. 
+     * @param {date}     Date object to compare. If no date to compare, the current Date (&quot;now&quot;) is used.
+     * @return {Boolean} true if this Date instance occurs on the same Day as the supplied 'date'.
+     */
+    $P.isToday = $P.isSameDay = function (date) {
+        return this.clone().clearTime().equals((date || new Date()).clone().clearTime());
+    };
+    
+    /**
+     * Adds the specified number of milliseconds to this instance. 
+     * @param {Number}   The number of milliseconds to add. The number can be positive or negative [Required]
+     * @return {Date}    this
+     */
+    $P.addMilliseconds = function (value) {
+        this.setMilliseconds(this.getMilliseconds() + value * 1);
+        return this;
+    };
+
+    /**
+     * Adds the specified number of seconds to this instance. 
+     * @param {Number}   The number of seconds to add. The number can be positive or negative [Required]
+     * @return {Date}    this
+     */
+    $P.addSeconds = function (value) { 
+        return this.addMilliseconds(value * 1000); 
+    };
+
+    /**
+     * Adds the specified number of seconds to this instance. 
+     * @param {Number}   The number of seconds to add. The number can be positive or negative [Required]
+     * @return {Date}    this
+     */
+    $P.addMinutes = function (value) { 
+        return this.addMilliseconds(value * 60000); /* 60*1000 */
+    };
+
+    /**
+     * Adds the specified number of hours to this instance. 
+     * @param {Number}   The number of hours to add. The number can be positive or negative [Required]
+     * @return {Date}    this
+     */
+    $P.addHours = function (value) { 
+        return this.addMilliseconds(value * 3600000); /* 60*60*1000 */
+    };
+
+    /**
+     * Adds the specified number of days to this instance. 
+     * @param {Number}   The number of days to add. The number can be positive or negative [Required]
+     * @return {Date}    this
+     */
+    $P.addDays = function (value) {
+        this.setDate(this.getDate() + value * 1);
+        return this;
+    };
+
+    /**
+     * Adds the specified number of weeks to this instance. 
+     * @param {Number}   The number of weeks to add. The number can be positive or negative [Required]
+     * @return {Date}    this
+     */
+    $P.addWeeks = function (value) { 
+        return this.addDays(value * 7);
+    };
+
+    /**
+     * Adds the specified number of months to this instance. 
+     * @param {Number}   The number of months to add. The number can be positive or negative [Required]
+     * @return {Date}    this
+     */
+    $P.addMonths = function (value) {
+        var n = this.getDate();
+        this.setDate(1);
+        this.setMonth(this.getMonth() + value * 1);
+        this.setDate(Math.min(n, $D.getDaysInMonth(this.getFullYear(), this.getMonth())));
+        return this;
+    };
+
+    /**
+     * Adds the specified number of years to this instance. 
+     * @param {Number}   The number of years to add. The number can be positive or negative [Required]
+     * @return {Date}    this
+     */
+    $P.addYears = function (value) {
+        return this.addMonths(value * 12);
+    };
+
+    /**
+     * Adds (or subtracts) to the value of the years, months, weeks, days, hours, minutes, seconds, milliseconds of the date instance using given configuration object. Positive and Negative values allowed.
+     * Example
+    &lt;pre&gt;&lt;code&gt;
+    Date.today().add( { days: 1, months: 1 } )
+     
+    new Date().add( { years: -1 } )
+    &lt;/code&gt;&lt;/pre&gt; 
+     * @param {Object}   Configuration object containing attributes (months, days, etc.)
+     * @return {Date}    this
+     */
+    $P.add = function (config) {
+        if (typeof config == &quot;number&quot;) {
+            this._orient = config;
+            return this;    
+        }
+        
+        var x = config;
+        
+        if (x.milliseconds) { 
+            this.addMilliseconds(x.milliseconds); 
+        }
+        if (x.seconds) { 
+            this.addSeconds(x.seconds); 
+        }
+        if (x.minutes) { 
+            this.addMinutes(x.minutes); 
+        }
+        if (x.hours) { 
+            this.addHours(x.hours); 
+        }
+        if (x.weeks) { 
+            this.addWeeks(x.weeks); 
+        }    
+        if (x.months) { 
+            this.addMonths(x.months); 
+        }
+        if (x.years) { 
+            this.addYears(x.years); 
+        }
+        if (x.days) {
+            this.addDays(x.days); 
+        }
+        return this;
+    };
+    
+    var $y, $m, $d;
+    
+    /**
+     * Get the week number. Week one (1) is the week which contains the first Thursday of the year. Monday is considered the first day of the week.
+     * This algorithm is a JavaScript port of the work presented by Claus T&#248;ndering at http://www.tondering.dk/claus/cal/node8.html#SECTION00880000000000000000
+     * .getWeek() Algorithm Copyright (c) 2008 Claus Tondering.
+     * The .getWeek() function does NOT convert the date to UTC. The local datetime is used. Please use .getISOWeek() to get the week of the UTC converted date.
+     * @return {Number}  1 to 53
+     */
+    $P.getWeek = function () {
+        var a, b, c, d, e, f, g, n, s, w;
+        
+        $y = (!$y) ? this.getFullYear() : $y;
+        $m = (!$m) ? this.getMonth() + 1 : $m;
+        $d = (!$d) ? this.getDate() : $d;
+
+        if ($m &lt;= 2) {
+            a = $y - 1;
+            b = (a / 4 | 0) - (a / 100 | 0) + (a / 400 | 0);
+            c = ((a - 1) / 4 | 0) - ((a - 1) / 100 | 0) + ((a - 1) / 400 | 0);
+            s = b - c;
+            e = 0;
+            f = $d - 1 + (31 * ($m - 1));
+        } else {
+            a = $y;
+            b = (a / 4 | 0) - (a / 100 | 0) + (a / 400 | 0);
+            c = ((a - 1) / 4 | 0) - ((a - 1) / 100 | 0) + ((a - 1) / 400 | 0);
+            s = b - c;
+            e = s + 1;
+            f = $d + ((153 * ($m - 3) + 2) / 5) + 58 + s;
+        }
+        
+        g = (a + b) % 7;
+        d = (f + g - e) % 7;
+        n = (f + 3 - d) | 0;
+
+        if (n &lt; 0) {
+            w = 53 - ((g - s) / 5 | 0);
+        } else if (n &gt; 364 + s) {
+            w = 1;
+        } else {
+            w = (n / 7 | 0) + 1;
+        }
+        
+        $y = $m = $d = null;
+        
+        return w;
+    };
+    
+    /**
+     * Get the ISO 8601 week number. Week one (&quot;01&quot;) is the week which contains the first Thursday of the year. Monday is considered the first day of the week.
+     * The .getISOWeek() function does convert the date to it's UTC value. Please use .getWeek() to get the week of the local date.
+     * @return {String}  &quot;01&quot; to &quot;53&quot;
+     */
+    $P.getISOWeek = function () {
+        $y = this.getUTCFullYear();
+        $m = this.getUTCMonth() + 1;
+        $d = this.getUTCDate();
+        return p(this.getWeek());
+    };
+
+    /**
+     * Moves the date to Monday of the week set. Week one (1) is the week which contains the first Thursday of the year.
+     * @param {Number}   A Number (1 to 53) that represents the week of the year.
+     * @return {Date}    this
+     */    
+    $P.setWeek = function (n) {
+        return this.moveToDayOfWeek(1).addWeeks(n - this.getWeek());
+    };
+
+    // private
+    var validate = function (n, min, max, name) {
+        if (typeof n == &quot;undefined&quot;) {
+            return false;
+        } else if (typeof n != &quot;number&quot;) {
+            throw new TypeError(n + &quot; is not a Number.&quot;); 
+        } else if (n &lt; min || n &gt; max) {
+            throw new RangeError(n + &quot; is not a valid value for &quot; + name + &quot;.&quot;); 
+        }
+        return true;
+    };
+
+    /**
+     * Validates the number is within an acceptable range for milliseconds [0-999].
+     * @param {Number}   The number to check if within range.
+     * @return {Boolean} true if within range, otherwise false.
+     */
+    $D.validateMillisecond = function (value) {
+        return validate(value, 0, 999, &quot;millisecond&quot;);
+    };
+
+    /**
+     * Validates the number is within an acceptable range for seconds [0-59].
+     * @param {Number}   The number to check if within range.
+     * @return {Boolean} true if within range, otherwise false.
+     */
+    $D.validateSecond = function (value) {
+        return validate(value, 0, 59, &quot;second&quot;);
+    };
+
+    /**
+     * Validates the number is within an acceptable range for minutes [0-59].
+     * @param {Number}   The number to check if within range.
+     * @return {Boolean} true if within range, otherwise false.
+     */
+    $D.validateMinute = function (value) {
+        return validate(value, 0, 59, &quot;minute&quot;);
+    };
+
+    /**
+     * Validates the number is within an acceptable range for hours [0-23].
+     * @param {Number}   The number to check if within range.
+     * @return {Boolean} true if within range, otherwise false.
+     */
+    $D.validateHour = function (value) {
+        return validate(value, 0, 23, &quot;hour&quot;);
+    };
+
+    /**
+     * Validates the number is within an acceptable range for the days in a month [0-MaxDaysInMonth].
+     * @param {Number}   The number to check if within range.
+     * @return {Boolean} true if within range, otherwise false.
+     */
+    $D.validateDay = function (value, year, month) {
+        return validate(value, 1, $D.getDaysInMonth(year, month), &quot;day&quot;);
+    };
+
+    /**
+     * Validates the number is within an acceptable range for months [0-11].
+     * @param {Number}   The number to check if within range.
+     * @return {Boolean} true if within range, otherwise false.
+     */
+    $D.validateMonth = function (value) {
+        return validate(value, 0, 11, &quot;month&quot;);
+    };
+
+    /**
+     * Validates the number is within an acceptable range for years.
+     * @param {Number}   The number to check if within range.
+     * @return {Boolean} true if within range, otherwise false.
+     */
+    $D.validateYear = function (value) {
+        return validate(value, 0, 9999, &quot;year&quot;);
+    };
+
+    /**
+     * Set the value of year, month, day, hour, minute, second, millisecond of date instance using given configuration object.
+     * Example
+    &lt;pre&gt;&lt;code&gt;
+    Date.today().set( { day: 20, month: 1 } )
+
+    new Date().set( { millisecond: 0 } )
+    &lt;/code&gt;&lt;/pre&gt;
+     * 
+     * @param {Object}   Configuration object containing attributes (month, day, etc.)
+     * @return {Date}    this
+     */
+    $P.set = function (config) {
+        if ($D.validateMillisecond(config.millisecond)) {
+            this.addMilliseconds(config.millisecond - this.getMilliseconds()); 
+        }
+        
+        if ($D.validateSecond(config.second)) {
+            this.addSeconds(config.second - this.getSeconds()); 
+        }
+        
+        if ($D.validateMinute(config.minute)) {
+            this.addMinutes(config.minute - this.getMinutes()); 
+        }
+        
+        if ($D.validateHour(config.hour)) {
+            this.addHours(config.hour - this.getHours()); 
+        }
+        
+        if ($D.validateMonth(config.month)) {
+            this.addMonths(config.month - this.getMonth()); 
+        }
+
+        if ($D.validateYear(config.year)) {
+            this.addYears(config.year - this.getFullYear()); 
+        }
+        
+	    /* day has to go last because you can't validate the day without first knowing the month */
+        if ($D.validateDay(config.day, this.getFullYear(), this.getMonth())) {
+            this.addDays(config.day - this.getDate()); 
+        }
+        
+        if (config.timezone) { 
+            this.setTimezone(config.timezone); 
+        }
+        
+        if (config.timezoneOffset) { 
+            this.setTimezoneOffset(config.timezoneOffset); 
+        }
+
+        if (config.week &amp;&amp; validate(config.week, 0, 53, &quot;week&quot;)) {
+            this.setWeek(config.week);
+        }
+        
+        return this;   
+    };
+
+    /**
+     * Moves the date to the first day of the month.
+     * @return {Date}    this
+     */
+    $P.moveToFirstDayOfMonth = function () {
+        return this.set({ day: 1 });
+    };
+
+    /**
+     * Moves the date to the last day of the month.
+     * @return {Date}    this
+     */
+    $P.moveToLastDayOfMonth = function () { 
+        return this.set({ day: $D.getDaysInMonth(this.getFullYear(), this.getMonth())});
+    };
+
+    /**
+     * Moves the date to the next n'th occurrence of the dayOfWeek starting from the beginning of the month. The number (-1) is a magic number and will return the last occurrence of the dayOfWeek in the month.
+     * @param {Number}   The dayOfWeek to move to
+     * @param {Number}   The n'th occurrence to move to. Use (-1) to return the last occurrence in the month
+     * @return {Date}    this
+     */
+    $P.moveToNthOccurrence = function (dayOfWeek, occurrence) {
+        var shift = 0;
+        if (occurrence &gt; 0) {
+            shift = occurrence - 1;
+        }
+        else if (occurrence === -1) {
+            this.moveToLastDayOfMonth();
+            if (this.getDay() !== dayOfWeek) {
+                this.moveToDayOfWeek(dayOfWeek, -1);
+            }
+            return this;
+        }
+        return this.moveToFirstDayOfMonth().addDays(-1).moveToDayOfWeek(dayOfWeek, +1).addWeeks(shift);
+    };
+
+    /**
+     * Move to the next or last dayOfWeek based on the orient value.
+     * @param {Number}   The dayOfWeek to move to
+     * @param {Number}   Forward (+1) or Back (-1). Defaults to +1. [Optional]
+     * @return {Date}    this
+     */
+    $P.moveToDayOfWeek = function (dayOfWeek, orient) {
+        var diff = (dayOfWeek - this.getDay() + 7 * (orient || +1)) % 7;
+        return this.addDays((diff === 0) ? diff += 7 * (orient || +1) : diff);
+    };
+
+    /**
+     * Move to the next or last month based on the orient value.
+     * @param {Number}   The month to move to. 0 = January, 11 = December
+     * @param {Number}   Forward (+1) or Back (-1). Defaults to +1. [Optional]
+     * @return {Date}    this
+     */
+    $P.moveToMonth = function (month, orient) {
+        var diff = (month - this.getMonth() + 12 * (orient || +1)) % 12;
+        return this.addMonths((diff === 0) ? diff += 12 * (orient || +1) : diff);
+    };
+
+    /**
+     * Get the Ordinal day (numeric day number) of the year, adjusted for leap year.
+     * @return {Number} 1 through 365 (366 in leap years)
+     */
+    $P.getOrdinalNumber = function () {
+        return Math.ceil((this.clone().clearTime() - new Date(this.getFullYear(), 0, 1)) / 86400000) + 1;
+    };
+
+    /**
+     * Get the time zone abbreviation of the current date.
+     * @return {String} The abbreviated time zone name (e.g. &quot;EST&quot;)
+     */
+    $P.getTimezone = function () {
+        return $D.getTimezoneAbbreviation(this.getUTCOffset());
+    };
+
+    $P.setTimezoneOffset = function (offset) {
+        var here = this.getTimezoneOffset(), there = Number(offset) * -6 / 10;
+        return this.addMinutes(there - here); 
+    };
+
+    $P.setTimezone = function (offset) { 
+        return this.setTimezoneOffset($D.getTimezoneOffset(offset)); 
+    };
+
+    /**
+     * Indicates whether Daylight Saving Time is observed in the current time zone.
+     * @return {Boolean} true|false
+     */
+    $P.hasDaylightSavingTime = function () { 
+        return (Date.today().set({month: 0, day: 1}).getTimezoneOffset() !== Date.today().set({month: 6, day: 1}).getTimezoneOffset());
+    };
+    
+    /**
+     * Indicates whether this Date instance is within the Daylight Saving Time range for the current time zone.
+     * @return {Boolean} true|false
+     */
+    $P.isDaylightSavingTime = function () {
+        return Date.today().set({month: 0, day: 1}).getTimezoneOffset() != this.getTimezoneOffset();
+    };
+
+    /**
+     * Get the offset from UTC of the current date.
+     * @return {String} The 4-character offset string prefixed with + or - (e.g. &quot;-0500&quot;)
+     */
+    $P.getUTCOffset = function () {
+        var n = this.getTimezoneOffset() * -10 / 6, r;
+        if (n &lt; 0) { 
+            r = (n - 10000).toString(); 
+            return r.charAt(0) + r.substr(2); 
+        } else { 
+            r = (n + 10000).toString();  
+            return &quot;+&quot; + r.substr(1); 
+        }
+    };
+
+    /**
+     * Returns the number of milliseconds between this date and date.
+     * @param {Date} Defaults to now
+     * @return {Number} The diff in milliseconds
+     */
+    $P.getElapsed = function (date) {
+        return (date || new Date()) - this;
+    };
+
+    if (!$P.toISOString) {
+        /**
+         * Converts the current date instance into a string with an ISO 8601 format. The date is converted to it's UTC value.
+         * @return {String}  ISO 8601 string of date
+         */
+        $P.toISOString = function () {
+            // From http://www.json.org/json.js. Public Domain. 
+            function f(n) {
+                return n &lt; 10 ? '0' + n : n;
+            }
+
+            return '&quot;' + this.getUTCFullYear()   + '-' +
+                f(this.getUTCMonth() + 1) + '-' +
+                f(this.getUTCDate())      + 'T' +
+                f(this.getUTCHours())     + ':' +
+                f(this.getUTCMinutes())   + ':' +
+                f(this.getUTCSeconds())   + 'Z&quot;';
+        };
+    }
+    
+    // private
+    $P._toString = $P.toString;
+
+    /**
+     * Converts the value of the current Date object to its equivalent string representation.
+     * Format Specifiers
+    &lt;pre&gt;
+    CUSTOM DATE AND TIME FORMAT STRINGS
+    Format  Description                                                                  Example
+    ------  ---------------------------------------------------------------------------  -----------------------
+     s      The seconds of the minute between 0-59.                                      &quot;0&quot; to &quot;59&quot;
+     ss     The seconds of the minute with leading zero if required.                     &quot;00&quot; to &quot;59&quot;
+     
+     m      The minute of the hour between 0-59.                                         &quot;0&quot;  or &quot;59&quot;
+     mm     The minute of the hour with leading zero if required.                        &quot;00&quot; or &quot;59&quot;
+     
+     h      The hour of the day between 1-12.                                            &quot;1&quot;  to &quot;12&quot;
+     hh     The hour of the day with leading zero if required.                           &quot;01&quot; to &quot;12&quot;
+     
+     H      The hour of the day between 0-23.                                            &quot;0&quot;  to &quot;23&quot;
+     HH     The hour of the day with leading zero if required.                           &quot;00&quot; to &quot;23&quot;
+     
+     d      The day of the month between 1 and 31.                                       &quot;1&quot;  to &quot;31&quot;
+     dd     The day of the month with leading zero if required.                          &quot;01&quot; to &quot;31&quot;
+     ddd    Abbreviated day name. $C.abbreviatedDayNames.                                &quot;Mon&quot; to &quot;Sun&quot; 
+     dddd   The full day name. $C.dayNames.                                              &quot;Monday&quot; to &quot;Sunday&quot;
+     
+     M      The month of the year between 1-12.                                          &quot;1&quot; to &quot;12&quot;
+     MM     The month of the year with leading zero if required.                         &quot;01&quot; to &quot;12&quot;
+     MMM    Abbreviated month name. $C.abbreviatedMonthNames.                            &quot;Jan&quot; to &quot;Dec&quot;
+     MMMM   The full month name. $C.monthNames.                                          &quot;January&quot; to &quot;December&quot;
+
+     yy     The year as a two-digit number.                                              &quot;99&quot; or &quot;08&quot;
+     yyyy   The full four digit year.                                                    &quot;1999&quot; or &quot;2008&quot;
+     
+     t      Displays the first character of the A.M./P.M. designator.                    &quot;A&quot; or &quot;P&quot;
+            $C.amDesignator or $C.pmDesignator
+     tt     Displays the A.M./P.M. designator.                                           &quot;AM&quot; or &quot;PM&quot;
+            $C.amDesignator or $C.pmDesignator
+     
+     S      The ordinal suffix (&quot;st, &quot;nd&quot;, &quot;rd&quot; or &quot;th&quot;) of the current day.            &quot;st, &quot;nd&quot;, &quot;rd&quot; or &quot;th&quot;
+
+|| *Format* || *Description* || *Example* ||
+|| d      || The CultureInfo shortDate Format Pattern                                     || &quot;M/d/yyyy&quot; ||
+|| D      || The CultureInfo longDate Format Pattern                                      || &quot;dddd, MMMM dd, yyyy&quot; ||
+|| F      || The CultureInfo fullDateTime Format Pattern                                  || &quot;dddd, MMMM dd, yyyy h:mm:ss tt&quot; ||
+|| m      || The CultureInfo monthDay Format Pattern                                      || &quot;MMMM dd&quot; ||
+|| r      || The CultureInfo rfc1123 Format Pattern                                       || &quot;ddd, dd MMM yyyy HH:mm:ss GMT&quot; ||
+|| s      || The CultureInfo sortableDateTime Format Pattern                              || &quot;yyyy-MM-ddTHH:mm:ss&quot; ||
+|| t      || The CultureInfo shortTime Format Pattern                                     || &quot;h:mm tt&quot; ||
+|| T      || The CultureInfo longTime Format Pattern                                      || &quot;h:mm:ss tt&quot; ||
+|| u      || The CultureInfo universalSortableDateTime Format Pattern                     || &quot;yyyy-MM-dd HH:mm:ssZ&quot; ||
+|| y      || The CultureInfo yearMonth Format Pattern                                     || &quot;MMMM, yyyy&quot; ||
+     
+
+    STANDARD DATE AND TIME FORMAT STRINGS
+    Format  Description                                                                  Example (&quot;en-US&quot;)
+    ------  ---------------------------------------------------------------------------  -----------------------
+     d      The CultureInfo shortDate Format Pattern                                     &quot;M/d/yyyy&quot;
+     D      The CultureInfo longDate Format Pattern                                      &quot;dddd, MMMM dd, yyyy&quot;
+     F      The CultureInfo fullDateTime Format Pattern                                  &quot;dddd, MMMM dd, yyyy h:mm:ss tt&quot;
+     m      The CultureInfo monthDay Format Pattern                                      &quot;MMMM dd&quot;
+     r      The CultureInfo rfc1123 Format Pattern                                       &quot;ddd, dd MMM yyyy HH:mm:ss GMT&quot;
+     s      The CultureInfo sortableDateTime Format Pattern                              &quot;yyyy-MM-ddTHH:mm:ss&quot;
+     t      The CultureInfo shortTime Format Pattern                                     &quot;h:mm tt&quot;
+     T      The CultureInfo longTime Format Pattern                                      &quot;h:mm:ss tt&quot;
+     u      The CultureInfo universalSortableDateTime Format Pattern                     &quot;yyyy-MM-dd HH:mm:ssZ&quot;
+     y      The CultureInfo yearMonth Format Pattern                                     &quot;MMMM, yyyy&quot;
+    &lt;/pre&gt;
+     * @param {String}   A format string consisting of one or more format spcifiers [Optional].
+     * @return {String}  A string representation of the current Date object.
+     */
+    $P.toString = function (format) {
+        var x = this;
+        
+        // Standard Date and Time Format Strings. Formats pulled from CultureInfo file and
+        // may vary by culture. 
+        if (format &amp;&amp; format.length == 1) {
+            var c = $C.formatPatterns;
+            x.t = x.toString;
+            switch (format) {
+            case &quot;d&quot;: 
+                return x.t(c.shortDate);
+            case &quot;D&quot;:
+                return x.t(c.longDate);
+            case &quot;F&quot;:
+                return x.t(c.fullDateTime);
+            case &quot;m&quot;:
+                return x.t(c.monthDay);
+            case &quot;r&quot;:
+                return x.t(c.rfc1123);
+            case &quot;s&quot;:
+                return x.t(c.sortableDateTime);
+            case &quot;t&quot;:
+                return x.t(c.shortTime);
+            case &quot;T&quot;:
+                return x.t(c.longTime);
+            case &quot;u&quot;:
+                return x.t(c.universalSortableDateTime);
+            case &quot;y&quot;:
+                return x.t(c.yearMonth);
+            }    
+        }
+        
+        var ord = function (n) {
+                switch (n * 1) {
+                case 1: 
+                case 21: 
+                case 31: 
+                    return &quot;st&quot;;
+                case 2: 
+                case 22: 
+                    return &quot;nd&quot;;
+                case 3: 
+                case 23: 
+                    return &quot;rd&quot;;
+                default: 
+                    return &quot;th&quot;;
+                }
+            };
+        
+        return format ? format.replace(/(\\)?(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)/g, 
+        function (m) {
+            if (m.charAt(0) === &quot;\\&quot;) {
+                return m.replace(&quot;\\&quot;, &quot;&quot;);
+            }
+            x.h = x.getHours;
+            switch (m) {
+            case &quot;hh&quot;:
+                return p(x.h() &lt; 13 ? (x.h() === 0 ? 12 : x.h()) : (x.h() - 12));
+            case &quot;h&quot;:
+                return x.h() &lt; 13 ? (x.h() === 0 ? 12 : x.h()) : (x.h() - 12);
+            case &quot;HH&quot;:
+                return p(x.h());
+            case &quot;H&quot;:
+                return x.h();
+            case &quot;mm&quot;:
+                return p(x.getMinutes());
+            case &quot;m&quot;:
+                return x.getMinutes();
+            case &quot;ss&quot;:
+                return p(x.getSeconds());
+            case &quot;s&quot;:
+                return x.getSeconds();
+            case &quot;yyyy&quot;:
+                return p(x.getFullYear(), 4);
+            case &quot;yy&quot;:
+                return p(x.getFullYear());
+            case &quot;dddd&quot;:
+                return $C.dayNames[x.getDay()];
+            case &quot;ddd&quot;:
+                return $C.abbreviatedDayNames[x.getDay()];
+            case &quot;dd&quot;:
+                return p(x.getDate());
+            case &quot;d&quot;:
+                return x.getDate();
+            case &quot;MMMM&quot;:
+                return $C.monthNames[x.getMonth()];
+            case &quot;MMM&quot;:
+                return $C.abbreviatedMonthNames[x.getMonth()];
+            case &quot;MM&quot;:
+                return p((x.getMonth() + 1));
+            case &quot;M&quot;:
+                return x.getMonth() + 1;
+            case &quot;t&quot;:
+                return x.h() &lt; 12 ? $C.amDesignator.substring(0, 1) : $C.pmDesignator.substring(0, 1);
+            case &quot;tt&quot;:
+                return x.h() &lt; 12 ? $C.amDesignator : $C.pmDesignator;
+            case &quot;S&quot;:
+                return ord(x.getDate());
+            default: 
+                return m;
+            }
+        }
+        ) : this._toString();
+    };
+}());    /**
+ * @version: 1.0 Alpha-1
+ * @author: Coolite Inc. http://www.coolite.com/
+ * @date: 2008-04-13
+ * @copyright: Copyright (c) 2006-2008, Coolite Inc. (http://www.coolite.com/). All rights reserved.
+ * @license: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/. 
+ * @website: http://www.datejs.com/
+ */
+ 
+(function () {
+    Date.Parsing = {
+        Exception: function (s) {
+            this.message = &quot;Parse error at '&quot; + s.substring(0, 10) + &quot; ...'&quot;; 
+        }
+    };
+    
+    var $P = Date.Parsing; 
+    var _ = $P.Operators = {
+        //
+        // Tokenizers
+        //
+        rtoken: function (r) { // regex token
+            return function (s) {
+                var mx = s.match(r);
+                if (mx) { 
+                    return ([ mx[0], s.substring(mx[0].length) ]); 
+                } else { 
+                    throw new $P.Exception(s); 
+                }
+            };
+        },
+        token: function (s) { // whitespace-eating token
+            return function (s) {
+                return _.rtoken(new RegExp(&quot;^\s*&quot; + s + &quot;\s*&quot;))(s);
+                // Removed .strip()
+                // return _.rtoken(new RegExp(&quot;^\s*&quot; + s + &quot;\s*&quot;))(s).strip();
+            };
+        },
+        stoken: function (s) { // string token
+            return _.rtoken(new RegExp(&quot;^&quot; + s)); 
+        },
+
+        //
+        // Atomic Operators
+        // 
+
+        until: function (p) {
+            return function (s) {
+                var qx = [], rx = null;
+                while (s.length) { 
+                    try { 
+                        rx = p.call(this, s); 
+                    } catch (e) { 
+                        qx.push(rx[0]); 
+                        s = rx[1]; 
+                        continue; 
+                    }
+                    break;
+                }
+                return [ qx, s ];
+            };
+        },
+        many: function (p) {
+            return function (s) {
+                var rx = [], r = null; 
+                while (s.length) { 
+                    try { 
+                        r = p.call(this, s); 
+                    } catch (e) { 
+                        return [ rx, s ]; 
+                    }
+                    rx.push(r[0]); 
+                    s = r[1];
+                }
+                return [ rx, s ];
+            };
+        },
+
+        // generator operators -- see below
+        optional: function (p) {
+            return function (s) {
+                var r = null; 
+                try { 
+                    r = p.call(this, s); 
+                } catch (e) { 
+                    return [ null, s ]; 
+                }
+                return [ r[0], r[1] ];
+            };
+        },
+        not: function (p) {
+            return function (s) {
+                try { 
+                    p.call(this, s); 
+                } catch (e) { 
+                    return [null, s]; 
+                }
+                throw new $P.Exception(s);
+            };
+        },
+        ignore: function (p) {
+            return p ? 
+            function (s) { 
+                var r = null; 
+                r = p.call(this, s); 
+                return [null, r[1]]; 
+            } : null;
+        },
+        product: function () {
+            var px = arguments[0], 
+            qx = Array.prototype.slice.call(arguments, 1), rx = [];
+            for (var i = 0 ; i &lt; px.length ; i++) {
+                rx.push(_.each(px[i], qx));
+            }
+            return rx;
+        },
+        cache: function (rule) { 
+            var cache = {}, r = null; 
+            return function (s) {
+                try { 
+                    r = cache[s] = (cache[s] || rule.call(this, s)); 
+                } catch (e) { 
+                    r = cache[s] = e; 
+                }
+                if (r instanceof $P.Exception) { 
+                    throw r; 
+                } else { 
+                    return r; 
+                }
+            };
+        },
+    	  
+        // vector operators -- see below
+        any: function () {
+            var px = arguments;
+            return function (s) { 
+                var r = null;
+                for (var i = 0; i &lt; px.length; i++) { 
+                    if (px[i] == null) { 
+                        continue; 
+                    }
+                    try { 
+                        r = (px[i].call(this, s)); 
+                    } catch (e) { 
+                        r = null; 
+                    }
+                    if (r) { 
+                        return r; 
+                    }
+                } 
+                throw new $P.Exception(s);
+            };
+        },
+        each: function () { 
+            var px = arguments;
+            return function (s) { 
+                var rx = [], r = null;
+                for (var i = 0; i &lt; px.length ; i++) { 
+                    if (px[i] == null) { 
+                        continue; 
+                    }
+                    try { 
+                        r = (px[i].call(this, s)); 
+                    } catch (e) { 
+                        throw new $P.Exception(s); 
+                    }
+                    rx.push(r[0]); 
+                    s = r[1];
+                }
+                return [ rx, s]; 
+            };
+        },
+        all: function () { 
+            var px = arguments, _ = _; 
+            return _.each(_.optional(px)); 
+        },
+
+        // delimited operators
+        sequence: function (px, d, c) {
+            d = d || _.rtoken(/^\s*/);  
+            c = c || null;
+            
+            if (px.length == 1) { 
+                return px[0]; 
+            }
+            return function (s) {
+                var r = null, q = null;
+                var rx = []; 
+                for (var i = 0; i &lt; px.length ; i++) {
+                    try { 
+                        r = px[i].call(this, s); 
+                    } catch (e) { 
+                        break; 
+                    }
+                    rx.push(r[0]);
+                    try { 
+                        q = d.call(this, r[1]); 
+                    } catch (ex) { 
+                        q = null; 
+                        break; 
+                    }
+                    s = q[1];
+                }
+                if (!r) { 
+                    throw new $P.Exception(s); 
+                }
+                if (q) { 
+                    throw new $P.Exception(q[1]); 
+                }
+                if (c) {
+                    try { 
+                        r = c.call(this, r[1]);
+                    } catch (ey) { 
+                        throw new $P.Exception(r[1]); 
+                    }
+                }
+                return [ rx, (r?r[1]:s) ];
+            };
+        },
+    		
+	    //
+	    // Composite Operators
+	    //
+    		
+        between: function (d1, p, d2) { 
+            d2 = d2 || d1; 
+            var _fn = _.each(_.ignore(d1), p, _.ignore(d2));
+            return function (s) { 
+                var rx = _fn.call(this, s); 
+                return [[rx[0][0], r[0][2]], rx[1]]; 
+            };
+        },
+        list: function (p, d, c) {
+            d = d || _.rtoken(/^\s*/);  
+            c = c || null;
+            return (p instanceof Array ?
+                _.each(_.product(p.slice(0, -1), _.ignore(d)), p.slice(-1), _.ignore(c)) :
+                _.each(_.many(_.each(p, _.ignore(d))), px, _.ignore(c)));
+        },
+        set: function (px, d, c) {
+            d = d || _.rtoken(/^\s*/); 
+            c = c || null;
+            return function (s) {
+                // r is the current match, best the current 'best' match
+                // which means it parsed the most amount of input
+                var r = null, p = null, q = null, rx = null, best = [[], s], last = false;
+
+                // go through the rules in the given set
+                for (var i = 0; i &lt; px.length ; i++) {
+
+                    // last is a flag indicating whether this must be the last element
+                    // if there is only 1 element, then it MUST be the last one
+                    q = null; 
+                    p = null; 
+                    r = null; 
+                    last = (px.length == 1); 
+
+                    // first, we try simply to match the current pattern
+                    // if not, try the next pattern
+                    try { 
+                        r = px[i].call(this, s);
+                    } catch (e) { 
+                        continue; 
+                    }
+
+                    // since we are matching against a set of elements, the first
+                    // thing to do is to add r[0] to matched elements
+                    rx = [[r[0]], r[1]];
+
+                    // if we matched and there is still input to parse and 
+                    // we don't already know this is the last element,
+                    // we're going to next check for the delimiter ...
+                    // if there's none, or if there's no input left to parse
+                    // than this must be the last element after all ...
+                    if (r[1].length &gt; 0 &amp;&amp; ! last) {
+                        try { 
+                            q = d.call(this, r[1]); 
+                        } catch (ex) { 
+                            last = true; 
+                        }
+                    } else { 
+                        last = true; 
+                    }
+
+				    // if we parsed the delimiter and now there's no more input,
+				    // that means we shouldn't have parsed the delimiter at all
+				    // so don't update r and mark this as the last element ...
+                    if (!last &amp;&amp; q[1].length === 0) { 
+                        last = true; 
+                    }
+
+
+				    // so, if this isn't the last element, we're going to see if
+				    // we can get any more matches from the remaining (unmatched)
+				    // elements ...
+                    if (!last) {
+
+                        // build a list of the remaining rules we can match against,
+                        // i.e., all but the one we just matched against
+                        var qx = []; 
+                        for (var j = 0; j &lt; px.length ; j++) { 
+                            if (i != j) { 
+                                qx.push(px[j]); 
+                            }
+                        }
+
+                        // now invoke recursively set with the remaining input
+                        // note that we don't include the closing delimiter ...
+                        // we'll check for that ourselves at the end
+                        p = _.set(qx, d).call(this, q[1]);
+
+                        // if we got a non-empty set as a result ...
+                        // (otw rx already contains everything we want to match)
+                        if (p[0].length &gt; 0) {
+                            // update current result, which is stored in rx ...
+                            // basically, pick up the remaining text from p[1]
+                            // and concat the result from p[0] so that we don't
+                            // get endless nesting ...
+                            rx[0] = rx[0].concat(p[0]); 
+                            rx[1] = p[1]; 
+                        }
+                    }
+
+				    // at this point, rx either contains the last matched element
+				    // or the entire matched set that starts with this element.
+
+				    // now we just check to see if this variation is better than
+				    // our best so far, in terms of how much of the input is parsed
+                    if (rx[1].length &lt; best[1].length) { 
+                        best = rx; 
+                    }
+
+				    // if we've parsed all the input, then we're finished
+                    if (best[1].length === 0) { 
+                        break; 
+                    }
+                }
+
+			    // so now we've either gone through all the patterns trying them
+			    // as the initial match; or we found one that parsed the entire
+			    // input string ...
+
+			    // if best has no matches, just return empty set ...
+                if (best[0].length === 0) { 
+                    return best; 
+                }
+
+			    // if a closing delimiter is provided, then we have to check it also
+                if (c) {
+                    // we try this even if there is no remaining input because the pattern
+                    // may well be optional or match empty input ...
+                    try { 
+                        q = c.call(this, best[1]); 
+                    } catch (ey) { 
+                        throw new $P.Exception(best[1]); 
+                    }
+
+                    // it parsed ... be sure to update the best match remaining input
+                    best[1] = q[1];
+                }
+
+			    // if we're here, either there was no closing delimiter or we parsed it
+			    // so now we have the best match; just return it!
+                return best;
+            };
+        },
+        forward: function (gr, fname) {
+            return function (s) { 
+                return gr[fname].call(this, s); 
+            };
+        },
+
+        //
+        // Translation Operators
+        //
+        replace: function (rule, repl) {
+            return function (s) { 
+                var r = rule.call(this, s); 
+                return [repl, r[1]]; 
+            };
+        },
+        process: function (rule, fn) {
+            return function (s) {  
+                var r = rule.call(this, s); 
+                return [fn.call(this, r[0]), r[1]]; 
+            };
+        },
+        min: function (min, rule) {
+            return function (s) {
+                var rx = rule.call(this, s); 
+                if (rx[0].length &lt; min) { 
+                    throw new $P.Exception(s); 
+                }
+                return rx;
+            };
+        }
+    };
+	
+
+	// Generator Operators And Vector Operators
+
+	// Generators are operators that have a signature of F(R) =&gt; R,
+	// taking a given rule and returning another rule, such as 
+	// ignore, which parses a given rule and throws away the result.
+
+	// Vector operators are those that have a signature of F(R1,R2,...) =&gt; R,
+	// take a list of rules and returning a new rule, such as each.
+
+	// Generator operators are converted (via the following _generator
+	// function) into functions that can also take a list or array of rules
+	// and return an array of new rules as though the function had been
+	// called on each rule in turn (which is what actually happens).
+
+	// This allows generators to be used with vector operators more easily.
+	// Example:
+	// each(ignore(foo, bar)) instead of each(ignore(foo), ignore(bar))
+
+	// This also turns generators into vector operators, which allows
+	// constructs like:
+	// not(cache(foo, bar))
+	
+    var _generator = function (op) {
+        return function () {
+            var args = null, rx = [];
+            if (arguments.length &gt; 1) {
+                args = Array.prototype.slice.call(arguments);
+            } else if (arguments[0] instanceof Array) {
+                args = arguments[0];
+            }
+            if (args) { 
+                for (var i = 0, px = args.shift() ; i &lt; px.length ; i++) {
+                    args.unshift(px[i]); 
+                    rx.push(op.apply(null, args)); 
+                    args.shift();
+                    return rx;
+                } 
+            } else { 
+                return op.apply(null, arguments); 
+            }
+        };
+    };
+    
+    var gx = &quot;optional not ignore cache&quot;.split(/\s/);
+    
+    for (var i = 0 ; i &lt; gx.length ; i++) { 
+        _[gx[i]] = _generator(_[gx[i]]); 
+    }
+
+    var _vector = function (op) {
+        return function () {
+            if (arguments[0] instanceof Array) { 
+                return op.apply(null, arguments[0]); 
+            } else { 
+                return op.apply(null, arguments); 
+            }
+        };
+    };
+    
+    var vx = &quot;each any all&quot;.split(/\s/);
+    
+    for (var j = 0 ; j &lt; vx.length ; j++) { 
+        _[vx[j]] = _vector(_[vx[j]]); 
+    }
+	
+}());
+
+(function () {
+    var $D = Date, $P = $D.prototype, $C = $D.CultureInfo;
+
+    var flattenAndCompact = function (ax) { 
+        var rx = []; 
+        for (var i = 0; i &lt; ax.length; i++) {
+            if (ax[i] instanceof Array) {
+                rx = rx.concat(flattenAndCompact(ax[i]));
+            } else { 
+                if (ax[i]) { 
+                    rx.push(ax[i]); 
+                }
+            }
+        }
+        return rx;
+    };
+    
+    $D.Grammar = {};
+	
+    $D.Translator = {
+        hour: function (s) { 
+            return function () { 
+                this.hour = Number(s); 
+            }; 
+        },
+        minute: function (s) { 
+            return function () { 
+                this.minute = Number(s); 
+            }; 
+        },
+        second: function (s) { 
+            return function () { 
+                this.second = Number(s); 
+            }; 
+        },
+        meridian: function (s) { 
+            return function () { 
+                this.meridian = s.slice(0, 1).toLowerCase(); 
+            }; 
+        },
+        timezone: function (s) {
+            return function () {
+                var n = s.replace(/[^\d\+\-]/g, &quot;&quot;);
+                if (n.length) { 
+                    this.timezoneOffset = Number(n); 
+                } else { 
+                    this.timezone = s.toLowerCase(); 
+                }
+            };
+        },
+        day: function (x) { 
+            var s = x[0];
+            return function () { 
+                this.day = Number(s.match(/\d+/)[0]); 
+            };
+        }, 
+        month: function (s) {
+            return function () {
+                this.month = (s.length == 3) ? &quot;jan feb mar apr may jun jul aug sep oct nov dec&quot;.indexOf(s)/4 : Number(s) - 1;
+            };
+        },
+        year: function (s) {
+            return function () {
+                var n = Number(s);
+                this.year = ((s.length &gt; 2) ? n : 
+                    (n + (((n + 2000) &lt; $C.twoDigitYearMax) ? 2000 : 1900))); 
+            };
+        },
+        rday: function (s) { 
+            return function () {
+                switch (s) {
+                case &quot;yesterday&quot;: 
+                    this.days = -1;
+                    break;
+                case &quot;tomorrow&quot;:  
+                    this.days = 1;
+                    break;
+                case &quot;today&quot;: 
+                    this.days = 0;
+                    break;
+                case &quot;now&quot;: 
+                    this.days = 0; 
+                    this.now = true; 
+                    break;
+                }
+            };
+        },
+        finishExact: function (x) {  
+            x = (x instanceof Array) ? x : [ x ]; 
+
+            for (var i = 0 ; i &lt; x.length ; i++) { 
+                if (x[i]) { 
+                    x[i].call(this); 
+                }
+            }
+            
+            var now = new Date();
+            
+            if ((this.hour || this.minute) &amp;&amp; (!this.month &amp;&amp; !this.year &amp;&amp; !this.day)) {
+                this.day = now.getDate();
+            }
+
+            if (!this.year) {
+                this.year = now.getFullYear();
+            }
+            
+            if (!this.month &amp;&amp; this.month !== 0) {
+                this.month = now.getMonth();
+            }
+            
+            if (!this.day) {
+                this.day = 1;
+            }
+            
+            if (!this.hour) {
+                this.hour = 0;
+            }
+            
+            if (!this.minute) {
+                this.minute = 0;
+            }
+
+            if (!this.second) {
+                this.second = 0;
+            }
+
+            if (this.meridian &amp;&amp; this.hour) {
+                if (this.meridian == &quot;p&quot; &amp;&amp; this.hour &lt; 12) {
+                    this.hour = this.hour + 12;
+                } else if (this.meridian == &quot;a&quot; &amp;&amp; this.hour == 12) {
+                    this.hour = 0;
+                }
+            }
+            
+            if (this.day &gt; $D.getDaysInMonth(this.year, this.month)) {
+                throw new RangeError(this.day + &quot; is not a valid value for days.&quot;);
+            }
+
+            var r = new Date(this.year, this.month, this.day, this.hour, this.minute, this.second);
+
+            if (this.timezone) { 
+                r.set({ timezone: this.timezone }); 
+            } else if (this.timezoneOffset) { 
+                r.set({ timezoneOffset: this.timezoneOffset }); 
+            }
+            
+            return r;
+        },			
+        finish: function (x) {
+            x = (x instanceof Array) ? flattenAndCompact(x) : [ x ];
+
+            if (x.length === 0) { 
+                return null; 
+            }
+
+            for (var i = 0 ; i &lt; x.length ; i++) { 
+                if (typeof x[i] == &quot;function&quot;) {
+                    x[i].call(this); 
+                }
+            }
+            
+            var today = $D.today();
+            
+            if (this.now &amp;&amp; !this.unit &amp;&amp; !this.operator) { 
+                return new Date(); 
+            } else if (this.now) {
+                today = new Date();
+            }
+            
+            var expression = !!(this.days &amp;&amp; this.days !== null || this.orient || this.operator);
+            
+            var gap, mod, orient;
+            orient = ((this.orient == &quot;past&quot; || this.operator == &quot;subtract&quot;) ? -1 : 1);
+            
+            if(!this.now &amp;&amp; &quot;hour minute second&quot;.indexOf(this.unit) != -1) {
+                today.setTimeToNow();
+            }
+
+            if (this.month || this.month === 0) {
+                if (&quot;year day hour minute second&quot;.indexOf(this.unit) != -1) {
+                    this.value = this.month + 1;
+                    this.month = null;
+                    expression = true;
+                }
+            }
+            
+            if (!expression &amp;&amp; this.weekday &amp;&amp; !this.day &amp;&amp; !this.days) {
+                var temp = Date[this.weekday]();
+                this.day = temp.getDate();
+                if (!this.month) {
+                    this.month = temp.getMonth();
+                }
+                this.year = temp.getFullYear();
+            }
+            
+            if (expression &amp;&amp; this.weekday &amp;&amp; this.unit != &quot;month&quot;) {
+                this.unit = &quot;day&quot;;
+                gap = ($D.getDayNumberFromName(this.weekday) - today.getDay());
+                mod = 7;
+                this.days = gap ? ((gap + (orient * mod)) % mod) : (orient * mod);
+            }
+            
+            if (this.month &amp;&amp; this.unit == &quot;day&quot; &amp;&amp; this.operator) {
+                this.value = (this.month + 1);
+                this.month = null;
+            }
+       
+            if (this.value != null &amp;&amp; this.month != null &amp;&amp; this.year != null) {
+                this.day = this.value * 1;
+            }
+     
+            if (this.month &amp;&amp; !this.day &amp;&amp; this.value) {
+                today.set({ day: this.value * 1 });
+                if (!expression) {
+                    this.day = this.value * 1;
+                }
+            }
+
+            if (!this.month &amp;&amp; this.value &amp;&amp; this.unit == &quot;month&quot; &amp;&amp; !this.now) {
+                this.month = this.value;
+                expression = true;
+            }
+
+            if (expression &amp;&amp; (this.month || this.month === 0) &amp;&amp; this.unit != &quot;year&quot;) {
+                this.unit = &quot;month&quot;;
+                gap = (this.month - today.getMonth());
+                mod = 12;
+                this.months = gap ? ((gap + (orient * mod)) % mod) : (orient * mod);
+                this.month = null;
+            }
+
+            if (!this.unit) { 
+                this.unit = &quot;day&quot;; 
+            }
+            
+            if (!this.value &amp;&amp; this.operator &amp;&amp; this.operator !== null &amp;&amp; this[this.unit + &quot;s&quot;] &amp;&amp; this[this.unit + &quot;s&quot;] !== null) {
+                this[this.unit + &quot;s&quot;] = this[this.unit + &quot;s&quot;] + ((this.operator == &quot;add&quot;) ? 1 : -1) + (this.value||0) * orient;
+            } else if (this[this.unit + &quot;s&quot;] == null || this.operator != null) {
+                if (!this.value) {
+                    this.value = 1;
+                }
+                this[this.unit + &quot;s&quot;] = this.value * orient;
+            }
+
+            if (this.meridian &amp;&amp; this.hour) {
+                if (this.meridian == &quot;p&quot; &amp;&amp; this.hour &lt; 12) {
+                    this.hour = this.hour + 12;
+                } else if (this.meridian == &quot;a&quot; &amp;&amp; this.hour == 12) {
+                    this.hour = 0;
+                }
+            }
+            
+            if (this.weekday &amp;&amp; !this.day &amp;&amp; !this.days) {
+                var temp = Date[this.weekday]();
+                this.day = temp.getDate();
+                if (temp.getMonth() !== today.getMonth()) {
+                    this.month = temp.getMonth();
+                }
+            }
+            
+            if ((this.month || this.month === 0) &amp;&amp; !this.day) { 
+                this.day = 1; 
+            }
+            
+            if (!this.orient &amp;&amp; !this.operator &amp;&amp; this.unit == &quot;week&quot; &amp;&amp; this.value &amp;&amp; !this.day &amp;&amp; !this.month) {
+                return Date.today().setWeek(this.value);
+            }
+
+            if (expression &amp;&amp; this.timezone &amp;&amp; this.day &amp;&amp; this.days) {
+                this.day = this.days;
+            }
+            
+            return (expression) ? today.add(this) : today.set(this);
+        }
+    };
+
+    var _ = $D.Parsing.Operators, g = $D.Grammar, t = $D.Translator, _fn;
+
+    g.datePartDelimiter = _.rtoken(/^([\s\-\.\,\/\x27]+)/); 
+    g.timePartDelimiter = _.stoken(&quot;:&quot;);
+    g.whiteSpace = _.rtoken(/^\s*/);
+    g.generalDelimiter = _.rtoken(/^(([\s\,]|at|@|on)+)/);
+  
+    var _C = {};
+    g.ctoken = function (keys) {
+        var fn = _C[keys];
+        if (! fn) {
+            var c = $C.regexPatterns;
+            var kx = keys.split(/\s+/), px = []; 
+            for (var i = 0; i &lt; kx.length ; i++) {
+                px.push(_.replace(_.rtoken(c[kx[i]]), kx[i]));
+            }
+            fn = _C[keys] = _.any.apply(null, px);
+        }
+        return fn;
+    };
+    g.ctoken2 = function (key) { 
+        return _.rtoken($C.regexPatterns[key]);
+    };
+
+    // hour, minute, second, meridian, timezone
+    g.h = _.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/), t.hour));
+    g.hh = _.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/), t.hour));
+    g.H = _.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/), t.hour));
+    g.HH = _.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/), t.hour));
+    g.m = _.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/), t.minute));
+    g.mm = _.cache(_.process(_.rtoken(/^[0-5][0-9]/), t.minute));
+    g.s = _.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/), t.second));
+    g.ss = _.cache(_.process(_.rtoken(/^[0-5][0-9]/), t.second));
+    g.hms = _.cache(_.sequence([g.H, g.m, g.s], g.timePartDelimiter));
+  
+    // _.min(1, _.set([ g.H, g.m, g.s ], g._t));
+    g.t = _.cache(_.process(g.ctoken2(&quot;shortMeridian&quot;), t.meridian));
+    g.tt = _.cache(_.process(g.ctoken2(&quot;longMeridian&quot;), t.meridian));
+    g.z = _.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/), t.timezone));
+    g.zz = _.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/), t.timezone));
+    
+    g.zzz = _.cache(_.process(g.ctoken2(&quot;timezone&quot;), t.timezone));
+    g.timeSuffix = _.each(_.ignore(g.whiteSpace), _.set([ g.tt, g.zzz ]));
+    g.time = _.each(_.optional(_.ignore(_.stoken(&quot;T&quot;))), g.hms, g.timeSuffix);
+    	  
+    // days, months, years
+    g.d = _.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/), 
+        _.optional(g.ctoken2(&quot;ordinalSuffix&quot;))), t.day));
+    g.dd = _.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/), 
+        _.optional(g.ctoken2(&quot;ordinalSuffix&quot;))), t.day));
+    g.ddd = g.dddd = _.cache(_.process(g.ctoken(&quot;sun mon tue wed thu fri sat&quot;), 
+        function (s) { 
+            return function () { 
+                this.weekday = s; 
+            }; 
+        }
+    ));
+    g.M = _.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/), t.month));
+    g.MM = _.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/), t.month));
+    g.MMM = g.MMMM = _.cache(_.process(
+        g.ctoken(&quot;jan feb mar apr may jun jul aug sep oct nov dec&quot;), t.month));
+    g.y = _.cache(_.process(_.rtoken(/^(\d\d?)/), t.year));
+    g.yy = _.cache(_.process(_.rtoken(/^(\d\d)/), t.year));
+    g.yyy = _.cache(_.process(_.rtoken(/^(\d\d?\d?\d?)/), t.year));
+    g.yyyy = _.cache(_.process(_.rtoken(/^(\d\d\d\d)/), t.year));
+	
+	// rolling these up into general purpose rules
+    _fn = function () { 
+        return _.each(_.any.apply(null, arguments), _.not(g.ctoken2(&quot;timeContext&quot;)));
+    };
+    
+    g.day = _fn(g.d, g.dd); 
+    g.month = _fn(g.M, g.MMM); 
+    g.year = _fn(g.yyyy, g.yy);
+
+    // relative date / time expressions
+    g.orientation = _.process(g.ctoken(&quot;past future&quot;), 
+        function (s) { 
+            return function () { 
+                this.orient = s; 
+            }; 
+        }
+    );
+    g.operator = _.process(g.ctoken(&quot;add subtract&quot;), 
+        function (s) { 
+            return function () { 
+                this.operator = s; 
+            }; 
+        }
+    );  
+    g.rday = _.process(g.ctoken(&quot;yesterday tomorrow today now&quot;), t.rday);
+    g.unit = _.process(g.ctoken(&quot;second minute hour day week month year&quot;), 
+        function (s) { 
+            return function () { 
+                this.unit = s; 
+            }; 
+        }
+    );
+    g.value = _.process(_.rtoken(/^\d\d?(st|nd|rd|th)?/), 
+        function (s) { 
+            return function () { 
+                this.value = s.replace(/\D/g, &quot;&quot;); 
+            }; 
+        }
+    );
+    g.expression = _.set([ g.rday, g.operator, g.value, g.unit, g.orientation, g.ddd, g.MMM ]);
+
+    // pre-loaded rules for different date part order preferences
+    _fn = function () { 
+        return  _.set(arguments, g.datePartDelimiter); 
+    };
+    g.mdy = _fn(g.ddd, g.month, g.day, g.year);
+    g.ymd = _fn(g.ddd, g.year, g.month, g.day);
+    g.dmy = _fn(g.ddd, g.day, g.month, g.year);
+    g.date = function (s) { 
+        return ((g[$C.dateElementOrder] || g.mdy).call(this, s));
+    }; 
+
+    // parsing date format specifiers - ex: &quot;h:m:s tt&quot; 
+    // this little guy will generate a custom parser based
+    // on the format string, ex: g.format(&quot;h:m:s tt&quot;)
+    g.format = _.process(_.many(
+        _.any(
+        // translate format specifiers into grammar rules
+        _.process(
+        _.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/), 
+        function (fmt) { 
+        if (g[fmt]) { 
+            return g[fmt]; 
+        } else { 
+            throw $D.Parsing.Exception(fmt); 
+        }
+    }
+    ),
+    // translate separator tokens into token rules
+    _.process(
+    _.rtoken(/^[^dMyhHmstz]+/), // all legal separators 
+        function (s) { 
+            return _.ignore(_.stoken(s)); 
+        } 
+    )
+    )), 
+        // construct the parser ...
+        function (rules) { 
+            return _.process(_.each.apply(null, rules), t.finishExact); 
+        }
+    );
+    
+    var _F = {
+		//&quot;M/d/yyyy&quot;: function (s) { 
+		//	var m = s.match(/^([0-2]\d|3[0-1]|\d)\/(1[0-2]|0\d|\d)\/(\d\d\d\d)/);
+		//	if (m!=null) { 
+		//		var r =  [ t.month.call(this,m[1]), t.day.call(this,m[2]), t.year.call(this,m[3]) ];
+		//		r = t.finishExact.call(this,r);
+		//		return [ r, &quot;&quot; ];
+		//	} else {
+		//		throw new Date.Parsing.Exception(s);
+		//	}
+		//}
+		//&quot;M/d/yyyy&quot;: function (s) { return [ new Date(Date._parse(s)), &quot;&quot;]; }
+	}; 
+    var _get = function (f) { 
+        return _F[f] = (_F[f] || g.format(f)[0]);      
+    };
+  
+    g.formats = function (fx) {
+        if (fx instanceof Array) {
+            var rx = []; 
+            for (var i = 0 ; i &lt; fx.length ; i++) {
+                rx.push(_get(fx[i])); 
+            }
+            return _.any.apply(null, rx);
+        } else { 
+            return _get(fx); 
+        }
+    };
+
+	// check for these formats first
+    g._formats = g.formats([
+        &quot;\&quot;yyyy-MM-ddTHH:mm:ssZ\&quot;&quot;,
+        &quot;yyyy-MM-ddTHH:mm:ssZ&quot;,
+        &quot;yyyy-MM-ddTHH:mm:ssz&quot;,
+        &quot;yyyy-MM-ddTHH:mm:ss&quot;,
+        &quot;yyyy-MM-ddTHH:mmZ&quot;,
+        &quot;yyyy-MM-ddTHH:mmz&quot;,
+        &quot;yyyy-MM-ddTHH:mm&quot;,
+        &quot;ddd, MMM dd, yyyy H:mm:ss tt&quot;,
+        &quot;ddd MMM d yyyy HH:mm:ss zzz&quot;,
+        &quot;MMddyyyy&quot;,
+        &quot;ddMMyyyy&quot;,
+        &quot;Mddyyyy&quot;,
+        &quot;ddMyyyy&quot;,
+        &quot;Mdyyyy&quot;,
+        &quot;dMyyyy&quot;,
+        &quot;yyyy&quot;,
+        &quot;Mdyy&quot;,
+        &quot;dMyy&quot;,
+        &quot;d&quot;
+    ]);
+
+	// starting rule for general purpose grammar
+    g._start = _.process(_.set([ g.date, g.time, g.expression ], 
+        g.generalDelimiter, g.whiteSpace), t.finish);
+	
+	// real starting rule: tries selected formats first, 
+	// then general purpose rule
+    g.start = function (s) {
+        try { 
+            var r = g._formats.call({}, s); 
+            if (r[1].length === 0) {
+                return r; 
+            }
+        } catch (e) {}
+        return g._start.call({}, s);
+    };
+	
+	$D._parse = $D.parse;
+
+    /**
+     * Converts the specified string value into its JavaScript Date equivalent using CultureInfo specific format information.
+     * 
+     * Example
+    &lt;pre&gt;&lt;code&gt;
+    ///////////
+    // Dates //
+    ///////////
+
+    // 15-Oct-2004
+    var d1 = Date.parse(&quot;10/15/2004&quot;);
+
+    // 15-Oct-2004
+    var d1 = Date.parse(&quot;15-Oct-2004&quot;);
+
+    // 15-Oct-2004
+    var d1 = Date.parse(&quot;2004.10.15&quot;);
+
+    //Fri Oct 15, 2004
+    var d1 = Date.parse(&quot;Fri Oct 15, 2004&quot;);
+
+    ///////////
+    // Times //
+    ///////////
+
+    // Today at 10 PM.
+    var d1 = Date.parse(&quot;10 PM&quot;);
+
+    // Today at 10:30 PM.
+    var d1 = Date.parse(&quot;10:30 P.M.&quot;);
+
+    // Today at 6 AM.
+    var d1 = Date.parse(&quot;06am&quot;);
+
+    /////////////////////
+    // Dates and Times //
+    /////////////////////
+
+    // 8-July-2004 @ 10:30 PM
+    var d1 = Date.parse(&quot;July 8th, 2004, 10:30 PM&quot;);
+
+    // 1-July-2004 @ 10:30 PM
+    var d1 = Date.parse(&quot;2004-07-01T22:30:00&quot;);
+
+    ////////////////////
+    // Relative Dates //
+    ////////////////////
+
+    // Returns today's date. The string &quot;today&quot; is culture specific.
+    var d1 = Date.parse(&quot;today&quot;);
+
+    // Returns yesterday's date. The string &quot;yesterday&quot; is culture specific.
+    var d1 = Date.parse(&quot;yesterday&quot;);
+
+    // Returns the date of the next thursday.
+    var d1 = Date.parse(&quot;Next thursday&quot;);
+
+    // Returns the date of the most previous monday.
+    var d1 = Date.parse(&quot;last monday&quot;);
+
+    // Returns today's day + one year.
+    var d1 = Date.parse(&quot;next year&quot;);
+
+    ///////////////
+    // Date Math //
+    ///////////////
+
+    // Today + 2 days
+    var d1 = Date.parse(&quot;t+2&quot;);
+
+    // Today + 2 days
+    var d1 = Date.parse(&quot;today + 2 days&quot;);
+
+    // Today + 3 months
+    var d1 = Date.parse(&quot;t+3m&quot;);
+
+    // Today - 1 year
+    var d1 = Date.parse(&quot;today - 1 year&quot;);
+
+    // Today - 1 year
+    var d1 = Date.parse(&quot;t-1y&quot;); 
+
+
+    /////////////////////////////
+    // Partial Dates and Times //
+    /////////////////////////////
+
+    // July 15th of this year.
+    var d1 = Date.parse(&quot;July 15&quot;);
+
+    // 15th day of current day and year.
+    var d1 = Date.parse(&quot;15&quot;);
+
+    // July 1st of current year at 10pm.
+    var d1 = Date.parse(&quot;7/1 10pm&quot;);
+    &lt;/code&gt;&lt;/pre&gt;
+     *
+     * @param {String}   The string value to convert into a Date object [Required]
+     * @return {Date}    A Date object or null if the string cannot be converted into a Date.
+     */
+    $D.parse = function (s) {
+        var r = null; 
+        if (!s) { 
+            return null; 
+        }
+        if (s instanceof Date) {
+            return s;
+        }
+        try { 
+            r = $D.Grammar.start.call({}, s.replace(/^\s*(\S*(\s+\S+)*)\s*$/, &quot;$1&quot;)); 
+        } catch (e) { 
+            return null; 
+        }
+        return ((r[1].length === 0) ? r[0] : null);
+    };
+
+    $D.getParseFunction = function (fx) {
+        var fn = $D.Grammar.formats(fx);
+        return function (s) {
+            var r = null;
+            try { 
+                r = fn.call({}, s); 
+            } catch (e) { 
+                return null; 
+            }
+            return ((r[1].length === 0) ? r[0] : null);
+        };
+    };
+    
+    /**
+     * Converts the specified string value into its JavaScript Date equivalent using the specified format {String} or formats {Array} and the CultureInfo specific format information.
+     * The format of the string value must match one of the supplied formats exactly.
+     * 
+     * Example
+    &lt;pre&gt;&lt;code&gt;
+    // 15-Oct-2004
+    var d1 = Date.parseExact(&quot;10/15/2004&quot;, &quot;M/d/yyyy&quot;);
+
+    // 15-Oct-2004
+    var d1 = Date.parse(&quot;15-Oct-2004&quot;, &quot;M-ddd-yyyy&quot;);
+
+    // 15-Oct-2004
+    var d1 = Date.parse(&quot;2004.10.15&quot;, &quot;yyyy.MM.dd&quot;);
+
+    // Multiple formats
+    var d1 = Date.parseExact(&quot;10/15/2004&quot;, [&quot;M/d/yyyy&quot;, &quot;MMMM d, yyyy&quot;]);
+    &lt;/code&gt;&lt;/pre&gt;
+     *
+     * @param {String}   The string value to convert into a Date object [Required].
+     * @param {Object}   The expected format {String} or an array of expected formats {Array} of the date string [Required].
+     * @return {Date}    A Date object or null if the string cannot be converted into a Date.
+     */
+    $D.parseExact = function (s, fx) { 
+        return $D.getParseFunction(fx)(s); 
+    };	
+}());/*
     http://www.JSON.org/json2.js
     2008-11-19
 
@@ -726,6 +2765,17 @@ replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
         };
     }
 })();
+/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc;
+ 
 /*
 * makes relative time out of &quot;Sun Jul 08 19:01:12 +0000 2007&quot; type string
 * Borrowed from Mike Demers (slightly altered)
@@ -736,14 +2786,16 @@ replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
 */
 sc.helpers.getRelativeTime = function(time_value, use_dateparse) {	
 	
+	var parsed_date;
+	
 	if (use_dateparse === true) {
-		var parsed_date = new Date.parse(time_value);
+		parsed_date = new Date.parse(time_value);
 	} else {
-		var parsed_date = new Date(time_value);
+		parsed_date = new Date(time_value);
 	}
 	
-	var now = new Date;
-	var delta = parseInt( (now.getTime() - parsed_date.getTime()) / 1000);
+	var now = new Date();
+	var delta = parseInt( (now.getTime() - parsed_date.getTime()) / 1000, 10);
 	
 	if (delta &lt; 10) {
 		return 'Just now';
@@ -752,11 +2804,11 @@ sc.helpers.getRelativeTime = function(time_value, use_dateparse) {
 	} else if(delta &lt; 120) {
 		return '1 min ago';
 	} else if(delta &lt; (45*60)) {
-		return Math.round(parseInt(delta / 60)).toString() + ' min ago';
+		return Math.round(parseInt(delta / 60, 10)).toString() + ' min ago';
 	} else if(delta &lt; (90*60)) {
 		return '1 hr ago';
 	} else if(delta &lt; (24*60*60)) {
-		if (Math.round(delta / 3600) == 1) {
+		if (Math.round(delta / 3600) === 1) {
 			return '2 hr ago';
 		} else {
 			return Math.round(delta / 3600).toString() + ' hr ago';
@@ -766,23 +2818,49 @@ sc.helpers.getRelativeTime = function(time_value, use_dateparse) {
 	} else {
 		return Math.round(delta / 86400).toString() + ' days ago';
 	}
-}
+};
 
 
-sc.helpers.httpTimeToInt = function(entryDate) {
-	var parsedDate = new Date;
-	parsedDate.setTime(Date.parse(entryDate));
+sc.helpers.httpTimeToInt = function(entry_date, use_dateparse) {
+	return sc.helpers.dateToInt(entry_date, use_dateparse)
+};
+
+/**
+ * this returns milliseconds, not seconds! 
+ */
+sc.helpers.dateToInt = function(entry_date, use_dateparse) {
+	var parsedDate = new Date();
+	
+	if (use_dateparse === true) {
+		entry_date = new Date.parse(entry_date);
+	} else {
+		entry_date = new Date(entry_date);
+	}
+	
+	parsedDate.setTime(entry_date);
 	return parsedDate.getTime();
-}
+};
 
 
 sc.helpers.getTimeAsInt = function() {
-	var now = new Date;
+	var now = new Date();
 	return now.getTime();
-}/**
+};
+/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc;
+ 
+/**
  * a constant that defines the attribute where we'll store extra data in the event 
  */
-const SPAZCORE_EVENTDATA_ATTRIBUTE = 'sc_data';
+var SPAZCORE_EVENTDATA_ATTRIBUTE = 'sc_data';
 
 
 /**
@@ -795,22 +2873,19 @@ const SPAZCORE_EVENTDATA_ATTRIBUTE = 'sc_data';
  * @function
  */
 sc.helpers.addListener = function(target, event_type, handler, scope, use_capture) {
+
+	function scope_perserver(e) {
+		handler.call(scope, e);
+	}
+	
 	if (use_capture !== true) {
 		use_capture = false;
 	}
 	
 	if (scope) {
-		
-		function scope_perserver(e) {
-			handler.call(scope, e);
-		}
-		
 		target.addEventListener(event_type, scope_perserver, use_capture);
-
 	} else {
-		
 		target.addEventListener(event_type, handler, use_capture);
-
 	}
 	
 	
@@ -829,18 +2904,17 @@ sc.helpers.addListener = function(target, event_type, handler, scope, use_captur
  * @function
  */
 sc.helpers.removeListener = function(target, event_type, handler, scope, use_capture) {
+
+	function scope_perserver(e) {
+		handler.call(scope, e);
+	}
+
 	if (use_capture !== true) {
 		use_capture = false;
 	}
 	
 	if (scope) {
-		
-		function scope_perserver(e) {
-			handler.call(scope, e);
-		}
-		
 		target.removeEventListener(event_type, scope_perserver, use_capture);
-
 	} else {
 		target.removeEventListener(event_type, handler, use_capture);
 	}
@@ -878,7 +2952,7 @@ sc.helpers.triggerCustomEvent = function(event_type, target, data, bubble) {
  */
 sc.helpers.getEventData = function(event_obj) {
 	return event_obj[SPAZCORE_EVENTDATA_ATTRIBUTE];
-}
+};
 
 /**
  * Alias for sc.helpers.addListener 
@@ -896,7 +2970,27 @@ sc.helpers.unlisten = sc.helpers.removeListener;
  * Alias for sc.helpers.triggerCustomEvent 
  * @function
  */
-sc.helpers.trigger  = sc.helpers.triggerCustomEvent;/**
+sc.helpers.trigger  = sc.helpers.triggerCustomEvent;/*jslint 
+bitwise: false,
+browser: true,
+nomen: false,
+debug: true,
+eqeqeq: false,
+forin: true,
+laxbreak: true,
+plusplus: false,
+newcap: false,
+undef: false,
+white: false,
+onevar: false 
+ */
+var sc;
+ 
+/*
+	We're more lax with JSLint here because this is almost all not our code
+*/
+
+/**
  * Licence
  * As long as you leave the copyright notice of the original script, or link
  * back to this website, you can use any of the content published on this
@@ -1019,7 +3113,7 @@ sc.helpers.Base64 = {
 	_utf8_decode : function (utftext) {
 		var string = &quot;&quot;;
 		var i = 0;
-		var c = c1 = c2 = 0;
+		var c = 0, c1 = 0, c2 = 0, c3 = 0;
 
 		while ( i &lt; utftext.length ) {
 
@@ -1046,7 +3140,7 @@ sc.helpers.Base64 = {
 		return string;
 	}
 
-}
+};
 
 
 
@@ -1083,7 +3177,7 @@ sc.helpers.crc32 = function (str) {
 		}
  
 		return utftext;
-	};
+	}
  
 	str = Utf8Encode(str);
  
@@ -1147,22 +3241,22 @@ sc.helpers.MD5 = function (string) {
 	function FF(a,b,c,d,x,s,ac) {
 		a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
 		return AddUnsigned(RotateLeft(a, s), b);
-	};
+	}
  
 	function GG(a,b,c,d,x,s,ac) {
 		a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
 		return AddUnsigned(RotateLeft(a, s), b);
-	};
+	}
  
 	function HH(a,b,c,d,x,s,ac) {
 		a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
 		return AddUnsigned(RotateLeft(a, s), b);
-	};
+	}
  
 	function II(a,b,c,d,x,s,ac) {
 		a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
 		return AddUnsigned(RotateLeft(a, s), b);
-	};
+	}
  
 	function ConvertToWordArray(string) {
 		var lWordCount;
@@ -1185,7 +3279,7 @@ sc.helpers.MD5 = function (string) {
 		lWordArray[lNumberOfWords-2] = lMessageLength&lt;&lt;3;
 		lWordArray[lNumberOfWords-1] = lMessageLength&gt;&gt;&gt;29;
 		return lWordArray;
-	};
+	}
  
 	function WordToHex(lValue) {
 		var WordToHexValue=&quot;&quot;,WordToHexValue_temp=&quot;&quot;,lByte,lCount;
@@ -1195,7 +3289,7 @@ sc.helpers.MD5 = function (string) {
 			WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
 		}
 		return WordToHexValue;
-	};
+	}
  
 	function Utf8Encode(string) {
 		string = string.replace(/\r\n/g,&quot;\n&quot;);
@@ -1221,7 +3315,7 @@ sc.helpers.MD5 = function (string) {
 		}
  
 		return utftext;
-	};
+	}
  
 	var x=Array();
 	var k,AA,BB,CC,DD,a,b,c,d;
@@ -1311,7 +3405,7 @@ sc.helpers.MD5 = function (string) {
 	var temp = WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);
  
 	return temp.toLowerCase();
-}
+};
 
 /**
 *
@@ -1325,7 +3419,7 @@ sc.helpers.SHA1 = function (msg) {
 	function rotate_left(n,s) {
 		var t4 = ( n&lt;&lt;s ) | (n&gt;&gt;&gt;(32-s));
 		return t4;
-	};
+	}
  
 	function lsb_hex(val) {
 		var str=&quot;&quot;;
@@ -1339,7 +3433,7 @@ sc.helpers.SHA1 = function (msg) {
 			str += vh.toString(16) + vl.toString(16);
 		}
 		return str;
-	};
+	}
  
 	function cvt_hex(val) {
 		var str=&quot;&quot;;
@@ -1351,7 +3445,7 @@ sc.helpers.SHA1 = function (msg) {
 			str += v.toString(16);
 		}
 		return str;
-	};
+	}
  
  
 	function Utf8Encode(string) {
@@ -1378,7 +3472,7 @@ sc.helpers.SHA1 = function (msg) {
 		}
  
 		return utftext;
-	};
+	}
  
 	var blockstart;
 	var i, j;
@@ -1395,7 +3489,7 @@ sc.helpers.SHA1 = function (msg) {
  
 	var msg_len = msg.length;
  
-	var word_array = new Array();
+	var word_array = [];
 	for( i=0; i&lt;msg_len-3; i+=4 ) {
 		j = msg.charCodeAt(i)&lt;&lt;24 | msg.charCodeAt(i+1)&lt;&lt;16 |
 		msg.charCodeAt(i+2)&lt;&lt;8 | msg.charCodeAt(i+3);
@@ -1421,7 +3515,7 @@ sc.helpers.SHA1 = function (msg) {
  
 	word_array.push( i );
  
-	while( (word_array.length % 16) != 14 ) word_array.push( 0 );
+	while( (word_array.length % 16) != 14 ) {word_array.push( 0 );}
  
 	word_array.push( msg_len&gt;&gt;&gt;29 );
 	word_array.push( (msg_len&lt;&lt;3)&amp;0x0ffffffff );
@@ -1429,8 +3523,8 @@ sc.helpers.SHA1 = function (msg) {
  
 	for ( blockstart=0; blockstart&lt;word_array.length; blockstart+=16 ) {
  
-		for( i=0; i&lt;16; i++ ) W[i] = word_array[blockstart+i];
-		for( i=16; i&lt;=79; i++ ) W[i] = rotate_left(W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16], 1);
+		for( i=0; i&lt;16; i++ ) {W[i] = word_array[blockstart+i];}
+		for( i=16; i&lt;=79; i++ ) {W[i] = rotate_left(W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16], 1);}
  
 		A = H0;
 		B = H1;
@@ -1482,11 +3576,11 @@ sc.helpers.SHA1 = function (msg) {
  
 	}
  
-	var temp = cvt_hex(H0) + cvt_hex(H1) + cvt_hex(H2) + cvt_hex(H3) + cvt_hex(H4);
+	temp = cvt_hex(H0) + cvt_hex(H1) + cvt_hex(H2) + cvt_hex(H3) + cvt_hex(H4);
  
 	return temp.toLowerCase();
  
-}
+};
 
 
 
@@ -1520,16 +3614,16 @@ sc.helpers.SHA256 = function (s){
 	function Gamma1256(x) { return (S(x, 17) ^ S(x, 19) ^ R(x, 10)); }
  
 	function core_sha256 (m, l) {
-		var K = new Array(0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, 0xE49B69C1, 0xEFBE4786, 0xFC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x6CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2);
-		var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);
-		var W = new Array(64);
+		var K = [0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, 0xE49B69C1, 0xEFBE4786, 0xFC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x6CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2];
+		var HASH = [0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19];
+		var W = [64];
 		var a, b, c, d, e, f, g, h, i, j;
 		var T1, T2;
  
 		m[l &gt;&gt; 5] |= 0x80 &lt;&lt; (24 - l % 32);
 		m[((l + 64 &gt;&gt; 9) &lt;&lt; 4) + 15] = l;
  
-		for ( var i = 0; i&lt;m.length; i+=16 ) {
+		for ( i = 0; i&lt;m.length; i+=16 ) {
 			a = HASH[0];
 			b = HASH[1];
 			c = HASH[2];
@@ -1539,9 +3633,9 @@ sc.helpers.SHA256 = function (s){
 			g = HASH[6];
 			h = HASH[7];
  
-			for ( var j = 0; j&lt;64; j++) {
-				if (j &lt; 16) W[j] = m[j + i];
-				else W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);
+			for ( j = 0; j&lt;64; j++) {
+				if (j &lt; 16) {W[j] = m[j + i];}
+				else {W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);}
  
 				T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);
 				T2 = safe_add(Sigma0256(a), Maj(a, b, c));
@@ -1616,10 +3710,110 @@ sc.helpers.SHA256 = function (s){
 	s = Utf8Encode(s);
 	return binb2hex(core_sha256(str2binb(s), s.length * chrsz));
  
-}
+};
+
+
+
+/*
+File: Math.uuid.js
+Version: 1.3
+Change History:
+  v1.0 - first release
+  v1.1 - less code and 2x performance boost (by minimizing calls to Math.random())
+  v1.2 - Add support for generating non-standard uuids of arbitrary length
+  v1.3 - Fixed IE7 bug (can't use []'s to access string chars.  Thanks, Brian R.)
+  v1.4 - Changed method to be &quot;Math.uuid&quot;. Added support for radix argument.  Use module pattern for better encapsulation.
+
+Latest version:   http://www.broofa.com/Tools/Math.uuid.js
+Information:      http://www.broofa.com/blog/?p=151
+Contact:          robert@broofa.com
+----
+Copyright (c) 2008, Robert Kieffer
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+    * Neither the name of Robert Kieffer nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
 
+/*
+ * Generate a random uuid.
+ *
+ * USAGE: Math.uuid(length, radix)
+ *   length - the desired number of characters
+ *   radix  - the number of allowable values for each character.
+ *
+ * EXAMPLES:
+ *   // No arguments  - returns RFC4122, version 4 ID
+ *   &gt;&gt;&gt; Math.uuid()
+ *   &quot;92329D39-6F5C-4520-ABFC-AAB64544E172&quot;
+ * 
+ *   // One argument - returns ID of the specified length
+ *   &gt;&gt;&gt; Math.uuid(15)     // 15 character ID (default base=62)
+ *   &quot;VcydxgltxrVZSTV&quot;
+ *
+ *   // Two arguments - returns ID of the specified length, and radix. (Radix must be &lt;= 62)
+ *   &gt;&gt;&gt; Math.uuid(8, 2)  // 8 character ID (base=2)
+ *   &quot;01001010&quot;
+ *   &gt;&gt;&gt; Math.uuid(8, 10) // 8 character ID (base=10)
+ *   &quot;47473046&quot;
+ *   &gt;&gt;&gt; Math.uuid(8, 16) // 8 character ID (base=16)
+ *   &quot;098F4D35&quot;
+ */
+sc.helpers.UUID = (function() {
+  // Private array of chars to use
+  var CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); 
+
+  return function (len, radix) {
+    var chars = CHARS, uuid = [], rnd = Math.random;
+    radix = radix || chars.length;
+
+    if (len) {
+      // Compact form
+      for (var i = 0; i &lt; len; i++) uuid[i] = chars[0 | rnd()*radix];
+    } else {
+      // rfc4122, version 4 form
+      var r;
+
+      // rfc4122 requires these characters
+      uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
+      uuid[14] = '4';
+
+      // Fill in random data.  At i==19 set the high bits of clock sequence as
+      // per rfc4122, sec. 4.1.5
+      for (var i = 0; i &lt; 36; i++) {
+        if (!uuid[i]) {
+          r = 0 | rnd()*16;
+          uuid[i] = chars[(i == 19) ? (r &amp; 0x3) | 0x8 : r &amp; 0xf];
+        }
+      }
+    }
 
+    return uuid.join('');
+  };
+})();
 
+/**
+ * Checks if the given value is an RFC 4122 UUID 
+ */
+sc.helpers.isUUID = function(val) {
+	return val.match(/^[0-9A-Z]{8}-[0-9A-Z]{4}-[0-9A-Z]{4}-[0-9A-Z]{4}-[0-9A-Z]{12}$/);
+}
+/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc, jQuery;
+ 
 /*
 	Helpers for fundamental javascript stuff
 */
@@ -1629,17 +3823,17 @@ sc.helpers.SHA256 = function (s){
 	the first argument is a string.
 */
 sc.helpers.isString = function(thing) {
-	if (typeof thing == 'string') return true;
-    if (typeof thing == 'object' &amp;&amp; thing !== null) {
+	if (typeof thing === 'string') {return true;}
+    if (typeof thing === 'object' &amp;&amp; thing !== null) {
         var criterion = thing.constructor.toString().match(/string/i);
-        return (criterion != null);
+        return (criterion !== null);
     }
     return false;
-}
+};
 
 
 sc.helpers.isNumber = function(chk) {
-	return typeof chk == 'number';
+	return typeof chk === 'number';
 };
 
 
@@ -1648,18 +3842,23 @@ sc.helpers.isNumber = function(chk) {
 	http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256C720080D723
 */
 sc.helpers.isArray = function(obj) {
-   if (obj.constructor.toString().indexOf(&quot;Array&quot;) == -1)
-	  return false;
-   else
-	  return true;
-}
+	if (obj.constructor.toString().indexOf(&quot;Array&quot;) === -1) {
+		return false;
+	} else {
+		return true;
+	}
+};
 
 /*
 	Returns a copy of the object using the jQuery.extend() method
 */
 sc.helpers.clone = function(oldObj) {
 	return jQuery.extend({}/* clone */, oldObj);
-}
+};
+
+sc.helpers.each = function(arr, f) {
+	
+};
 
 /**
  * We use this to do a form of inheritance, where the child inherits
@@ -1673,7 +3872,18 @@ sc.helpers.clone = function(oldObj) {
 sc.helpers.extend = function(child, supertype)
 {
    child.prototype.__proto__ = supertype.prototype;
-}
+};
+/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc;
+ 
 /* A wrapper for JSON.parse() that correct Twitter issues and perform logging if JSON data could not be parsed
  * which will help to find out what is wrong
  * @param {String} text 
@@ -1685,7 +3895,7 @@ sc.helpers.deJSON = function(json)
 	var re = new RegExp(&quot;Couldn\\'t\\ find\\ Status\\ with\\ ID\\=[0-9]+\\,&quot;, &quot;g&quot;);
 	json = json.replace(re, &quot;&quot;);
 
-	var done = false
+	var done = false;
 	try {
 		var obj = JSON.parse(json);
 		done = true;
@@ -1696,7 +3906,7 @@ sc.helpers.deJSON = function(json)
 	}
 
 	return obj;
-}
+};
 
 /**
  * really just a simple wrapper for JSON.stringify	
@@ -1704,14 +3914,220 @@ sc.helpers.deJSON = function(json)
  */
 sc.helpers.enJSON = function(jsobj) {
 	return JSON.stringify(jsobj);
-}
+};
+
+
+/*
+ * Based on jQuery XML to JSON Plugin
+ * 
+ *	### jQuery XML to JSON Plugin v1.0 - 2008-07-01 ###
+ * http://www.fyneworks.com/ - diego@fyneworks.com
+ * Dual licensed under the MIT and GPL licenses:
+ *	 http://www.opensource.org/licenses/mit-license.php
+ *	 http://www.gnu.org/licenses/gpl.html
+ ###
+ Website: http://www.fyneworks.com/jquery/xml-to-json/
+*/
+/*
+ # INSPIRED BY: http://www.terracoder.com/
+		   AND: http://www.thomasfrank.se/xml_to_json.html
+											AND: http://www.kawa.net/works/js/xml/objtree-e.html
+*/
+/*
+ This simple script converts XML (document of code) into a JSON object. It is the combination of 2
+ 'xml to json' great parsers (see below) which allows for both 'simple' and 'extended' parsing modes.
+*/
+sc.helpers.xml2json = function(xml, extended) {
+	if (!xml) return {};
+	// quick fail
+	//### PARSER LIBRARY
+	// Core function
+	function parseXML(node, simple) {
+		if (!node) return null;
+		var txt = '',
+		obj = null,
+		att = null;
+		var nt = node.nodeType,
+		nn = jsVar(node.localName || node.nodeName);
+		var nv = node.text || node.nodeValue || '';
+		/*DBG*/
+		//if(window.console) console.log(['x2j',nn,nt,nv.length+' bytes']);
+		if (node.childNodes) {
+			if (node.childNodes.length &gt; 0) {
+				/*DBG*/
+				//if(window.console) console.log(['x2j',nn,'CHILDREN',node.childNodes]);
+				jQuery.each(node.childNodes,
+				function(n, cn) {
+					var cnt = cn.nodeType,
+					cnn = jsVar(cn.localName || cn.nodeName);
+					var cnv = cn.text || cn.nodeValue || '';
+					/*DBG*/
+					//if(window.console) console.log(['x2j',nn,'node&gt;a',cnn,cnt,cnv]);
+					if (cnt == 8) {
+						/*DBG*/
+						//if(window.console) console.log(['x2j',nn,'node&gt;b',cnn,'COMMENT (ignore)']);
+						return;
+						// ignore comment node
+					}
+					else if (cnt == 3 || cnt == 4 || !cnn) {
+						// ignore white-space in between tags
+						if (cnv.match(/^\s+$/)) {
+							/*DBG*/
+							//if(window.console) console.log(['x2j',nn,'node&gt;c',cnn,'WHITE-SPACE (ignore)']);
+							return;
+						};
+						/*DBG*/
+						//if(window.console) console.log(['x2j',nn,'node&gt;d',cnn,'TEXT']);
+						txt += cnv.replace(/^\s+/, '').replace(/\s+$/, '');
+						// make sure we ditch trailing spaces from markup
+					}
+					else {
+						/*DBG*/
+						//if(window.console) console.log(['x2j',nn,'node&gt;e',cnn,'OBJECT']);
+						obj = obj || {};
+						if (obj[cnn]) {
+							/*DBG*/
+							//if(window.console) console.log(['x2j',nn,'node&gt;f',cnn,'ARRAY']);
+							if (!obj[cnn].length) obj[cnn] = myArr(obj[cnn]);
+							obj[cnn][obj[cnn].length] = parseXML(cn, true
+							/* simple */
+							);
+							obj[cnn].length = obj[cnn].length;
+						}
+						else {
+							/*DBG*/
+							//if(window.console) console.log(['x2j',nn,'node&gt;g',cnn,'dig deeper...']);
+							obj[cnn] = parseXML(cn);
+						};
+					};
+				});
+			};
+			//node.childNodes.length&gt;0
+		};
+		//node.childNodes
+		if (node.attributes) {
+			if (node.attributes.length &gt; 0) {
+				/*DBG*/
+				//if(window.console) console.log(['x2j',nn,'ATTRIBUTES',node.attributes])
+				att = {};
+				obj = obj || {};
+				jQuery.each(node.attributes, function(a, at) {
+					var atn = jsVar(at.name),
+					atv = at.value;
+					att[atn] = atv;
+					if (obj[atn]) {
+						/*DBG*/
+						//if(window.console) console.log(['x2j',nn,'attr&gt;',atn,'ARRAY']);
+						if (!obj[atn].length) obj[atn] = myArr(obj[atn]);
+						//[ obj[ atn ] ];
+						obj[atn][obj[atn].length] = atv;
+						obj[atn].length = obj[atn].length;
+					}
+					else {
+						/*DBG*/
+						//if(window.console) console.log(['x2j',nn,'attr&gt;',atn,'TEXT']);
+						obj[atn] = atv;
+					};
+				});
+				//obj['attributes'] = att;
+			};
+			//node.attributes.length&gt;0
+		};
+		//node.attributes
+		if (obj) {
+			obj = jQuery.extend((txt != '' ? new String(txt) : {}),
+			/* {text:txt},*/
+			obj || {}
+			/*, att || {}*/
+			);
+			txt = (obj.text) ? (typeof(obj.text) == 'object' ? obj.text: [obj.text || '']).concat([txt]) : txt;
+			if (txt) obj.text = txt;
+			txt = '';
+		};
+		var out = obj || txt;
+		//console.log([extended, simple, out]);
+		if (extended) {
+			if (txt) out = {};
+			//new String(out);
+			txt = out.text || txt || '';
+			if (txt) out.text = txt;
+			if (!simple) out = myArr(out);
+		};
+		return out;
+	};
+	// parseXML
+	// Core Function End
+	// Utility functions
+	var jsVar = function(s) {
+		return String(s || '').replace(/-/g, &quot;_&quot;);
+	};
+	var isNum = function(s) {
+		return (typeof s == &quot;number&quot;) || String((s &amp;&amp; typeof s == &quot;string&quot;) ? s: '').test(/^((-)?([0-9]*)((\.{0,1})([0-9]+))?$)/);
+	};
+	var myArr = function(o) {
+		if (!o.length) o = [o];
+		o.length = o.length;
+		// here is where you can attach additional functionality, such as searching and sorting...
+		return o;
+	};
+	// Utility functions End
+	//### PARSER LIBRARY END
+	// Convert plain text to xml
+	if (typeof xml == 'string') {xml = sc.helpers.createXMLFromString(xml);}
+
+	// Quick fail if not xml (or if this is a node)
+	if (!xml.nodeType) {return;}
+	if (xml.nodeType == 3 || xml.nodeType == 4) {return xml.nodeValue;}
+
+	// Find xml root node
+	var root = (xml.nodeType == 9) ? xml.documentElement: xml;
+
+	// Convert xml to json
+	var out = parseXML(root, true
+	/* simple */
+	);
+
+	// Clean-up memory
+	xml = null;
+	root = null;
+
+	// Send output
+	return out;
+};
+
+
+/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc;
+ 
 
 /**
  * Stub 
  */
 function getCurrentLocation() {
 	
-}/**
+}/*jslint 
+bitwise: false,
+browser: true,
+newcap: false,
+nomen: false,
+debug: true,
+forin: true,
+plusplus: false,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc;
+ 
+/**
  * determines if a string contains the given screen name prefixed with a @
  * this is mainly used for determining if a message should be considered a 'mention'
  * @param {string} str  the string to check
@@ -1720,7 +4136,7 @@ function getCurrentLocation() {
  */
 sc.helpers.containsScreenName = function(str, sn) {
 	
-	var re = new RegExp('(?:\s|\b|^[[:alnum:]]|^)@('+sn+')(?:\s|\b|$)', 'gi');
+	var re = new RegExp('(?:\\s|\\b|^[[:alnum:]]|^)@('+sn+')(?:\\s|\\b|$)', 'gi');
 	if ( re.test(str) ) {
 		return true;
 	}
@@ -1735,7 +4151,7 @@ sc.helpers.extractURLs = function(str) {
 	var wwwlinks = /(^|\s|\(|:)(((http(s?):\/\/)|(www\.))(\w+[^\s\)&lt;]+))/gi;
 	var match = [];
 	var URLs = [];
-	while ( (match = wwwlinks.exec(str)) != null ) {
+	while ( (match = wwwlinks.exec(str)) !== null ) {
 		URLs.push(match[2]);
 	}
 	return URLs;
@@ -1778,11 +4194,13 @@ sc.helpers.autolink = function(str, type, extra_code, maxlen) {
 
 	var re_noemail = /(^|\s|\(|:)((http(s?):\/\/)|(www\.))(\w+[^\s\)&lt;]+)/gi;
 	var re_nourl   = /(^|\s|\()([a-zA-Z0-9_\.\-\+]+)@([a-zA-Z0-9\-]+)\.([a-zA-Z0-9\-\.]*)([^\s\)&lt;]+)/gi;
+	
+	var x, ms, period = '';
 
-	if (type != 'email')
+	if (type !== 'email')
 	{
-		while (ms = re_noemail.exec(str)) {
-			var period = ''
+		while ((ms = re_noemail.exec(str))) {
+
 			if ( /\.$/.test(ms[6]) ) {
 				period = '.';
 				ms[6] = ms[6].slice(0, -1);
@@ -1792,7 +4210,7 @@ sc.helpers.autolink = function(str, type, extra_code, maxlen) {
 				sometimes we can end up with a null instead of a blank string,
 				so we need to force the issue in javascript.
 			*/
-			for (var x=0; x&lt;ms.length; x++) {
+			for (x=0; x&lt;ms.length; x++) {
 				if (!ms[x]) {
 					ms[x] = '';
 				}
@@ -1801,7 +4219,7 @@ sc.helpers.autolink = function(str, type, extra_code, maxlen) {
 			if (extra_code) {
 				extra_code = ' '+extra_code;
 			} else {
-				extra_code = ''
+				extra_code = '';
 			}
 			
 			var desc = ms[5]+ms[6];
@@ -1815,11 +4233,11 @@ sc.helpers.autolink = function(str, type, extra_code, maxlen) {
 		}
 	}
 
-	if (type != 'url')
+	if (type !== 'url')
 	{
-		while (ms = re_nourl.exec(str))
+		while ((ms = re_nourl.exec(str)))
 		{
-			var period = ''
+			period = '';
 			if ( /\./.test(ms[5]) ) {
 				period = '.';
 				ms[5] = ms[5].slice(0, -1);
@@ -1829,20 +4247,19 @@ sc.helpers.autolink = function(str, type, extra_code, maxlen) {
 				sometimes we can end up with a null instead of a blank string,
 				so we need to force the issue in javascript.
 			*/
-			for (var x=0; x&lt;ms.length; x++) {
+			for (x=0; x&lt;ms.length; x++) {
 				if (!ms[x]) {
 					ms[x] = '';
 				}
 			}
 			str = str.replace(ms[0], ms[1]+'&lt;a href=&quot;mailto:'+ms[2]+'@'+ms[3]+'.'+ms[4]+ms[5]+'&quot;&gt;'+ms[2]+'@'+ms[3]+'.'+ms[4]+ms[5]+'&lt;/a&gt;'+period);
-			//air.trace(str);
 		}
 	}
 
 	return str;
 
 
-}
+};
 
 /**
  * turns twitter style username refs ('@username') into links
@@ -1858,7 +4275,7 @@ sc.helpers.autolinkTwitterScreenname = function(str, tpl) {
 		tpl = '&lt;a href=&quot;http://twitter.com/#username#&quot;&gt;@#username#&lt;/a&gt;';
 	}
 	
-	var re_uname = /(^|\s|\(\[|,|\()@([a-zA-Z0-9_]+)([^a-zA-Z0-9_]|$)/gi
+	var re_uname = /(^|\s|\(\[|,|\()@([a-zA-Z0-9_]+)([^a-zA-Z0-9_]|$)/gi;
 	
 	var ms = [];
 	while (ms = re_uname.exec(str))
@@ -1879,7 +4296,7 @@ sc.helpers.autolinkTwitterScreenname = function(str, tpl) {
 
 	}
 	return str;
-}
+};
 
 
 
@@ -1897,7 +4314,7 @@ sc.helpers.autolinkTwitterHashtag = function(str, tpl) {
 		tpl = '&lt;a href=&quot;http://search.twitter.com/search?q=#hashtag_enc#&quot;&gt;##hashtag#&lt;/a&gt;';
 	}
 	
-	var re_hashtag = /(^|\s|\()#([a-zA-Z0-9\-_\.+:=]{1,}\w)([^a-zA-Z0-9\-_+]|$)/gi
+	var re_hashtag = /(^|\s|\()#([a-zA-Z0-9\-_\.+:=]{1,}\w)([^a-zA-Z0-9\-_+]|$)/gi;
 	
 	var ms = [];
 	while (ms = re_hashtag.exec(str))
@@ -1919,7 +4336,7 @@ sc.helpers.autolinkTwitterHashtag = function(str, tpl) {
 
 	}
 	return str;
-}
+};
 
 
 
@@ -1946,7 +4363,7 @@ sc.helpers.stripTags = function(str) {
 
 
 /**
- * Converts the following entities into regulat chars: &amp;lt; &amp;gt; &amp;quot; &amp;apos;
+ * Converts the following entities into regular chars: &amp;lt; &amp;gt; &amp;quot; &amp;apos;
  */
 sc.helpers.fromHTMLSpecialChars = function(str) {
 	str = str.replace(/&amp;lt;/gi, '&lt;');
@@ -1957,8 +4374,10 @@ sc.helpers.fromHTMLSpecialChars = function(str) {
 	sc.helpers.dump(str);
 	str = str.replace(/&amp;apos;/gi, '\'');
 	sc.helpers.dump(str);
+	str = str.replace(/&amp;amp;/gi, '&amp;');
+	sc.helpers.dump(str);
 	return str;
-}
+};
 
 
 
@@ -1989,7 +4408,7 @@ sc.helpers.htmlentities = function(string, quote_style) {
     }
     
     return tmp_str;
-}
+};
 
 sc.helpers._get_html_translation_table = function(table, quote_style) {
     // http://kevin.vanzonneveld.net
@@ -2029,24 +4448,24 @@ sc.helpers._get_html_translation_table = function(table, quote_style) {
         useQuoteStyle = constMappingQuoteStyle[useQuoteStyle];
     }
  
-    if (useTable == 'HTML_SPECIALCHARS') {
+    if (useTable === 'HTML_SPECIALCHARS') {
         // ascii decimals for better compatibility
         entities['38'] = '&amp;amp;';
-        if (useQuoteStyle != 'ENT_NOQUOTES') {
+        if (useQuoteStyle !== 'ENT_NOQUOTES') {
             entities['34'] = '&amp;quot;';
         }
-        if (useQuoteStyle == 'ENT_QUOTES') {
+        if (useQuoteStyle === 'ENT_QUOTES') {
             entities['39'] = '&amp;#039;';
         }
         entities['60'] = '&amp;lt;';
         entities['62'] = '&amp;gt;';
-    } else if (useTable == 'HTML_ENTITIES') {
+    } else if (useTable === 'HTML_ENTITIES') {
         // ascii decimals for better compatibility
       entities['38']  = '&amp;amp;';
-        if (useQuoteStyle != 'ENT_NOQUOTES') {
+        if (useQuoteStyle !== 'ENT_NOQUOTES') {
             entities['34'] = '&amp;quot;';
         }
-        if (useQuoteStyle == 'ENT_QUOTES') {
+        if (useQuoteStyle === 'ENT_QUOTES') {
             entities['39'] = '&amp;#039;';
         }
       entities['60']  = '&amp;lt;';
@@ -2149,7 +4568,6 @@ sc.helpers._get_html_translation_table = function(table, quote_style) {
       entities['255'] = '&amp;yuml;';
     } else {
         throw Error(&quot;Table: &quot;+useTable+' not supported');
-        return false;
     }
     
     // ascii decimals to real symbols
@@ -2159,7 +4577,7 @@ sc.helpers._get_html_translation_table = function(table, quote_style) {
     }
     
     return histogram;
-}
+};
 
 
 
@@ -2204,7 +4622,7 @@ sc.helpers.Utf8 = {
 	decode : function (utftext) {
 		var string = &quot;&quot;;
 		var i = 0;
-		var c = c1 = c2 = 0;
+		var c = 0, c1 = 0, c2 = 0, c3 = 0;
  
 		while ( i &lt; utftext.length ) {
  
@@ -2231,7 +4649,7 @@ sc.helpers.Utf8 = {
 		return string;
 	}
  
-}
+};
 
 
 
@@ -2246,17 +4664,28 @@ sc.helpers.Utf8 = {
  
 sc.helpers.trim = function (str, chars) {
 	return sc.helpers.ltrim(sc.helpers.rtrim(str, chars), chars);
-}
+};
  
 sc.helpers.ltrim = function (str, chars) {
 	chars = chars || &quot;\\s&quot;;
 	return str.replace(new RegExp(&quot;^[&quot; + chars + &quot;]+&quot;, &quot;g&quot;), &quot;&quot;);
-}
+};
  
 sc.helpers.rtrim = function (str, chars) {
 	chars = chars || &quot;\\s&quot;;
 	return str.replace(new RegExp(&quot;[&quot; + chars + &quot;]+$&quot;, &quot;g&quot;), &quot;&quot;);
-}/**
+};/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc, window;
+ 
+/**
  * These are system-oriented functions, mostly utilizing AIR apis
  * to interact with the OS
  * 
@@ -2264,10 +4693,10 @@ sc.helpers.rtrim = function (str, chars) {
  */
 
 
-const SPAZCORE_PLATFORM_AIR			= 'AIR';
-const SPAZCORE_PLATFORM_WEBOS		= 'webOS';
-const SPAZCORE_PLATFORM_TITANIUM	= 'Titanium';
-const SPAZCORE_PLATFORM_UNKNOWN		= '__UNKNOWN';
+var SPAZCORE_PLATFORM_AIR			= 'AIR';
+var SPAZCORE_PLATFORM_WEBOS		= 'webOS';
+var SPAZCORE_PLATFORM_TITANIUM	= 'Titanium';
+var SPAZCORE_PLATFORM_UNKNOWN		= '__UNKNOWN';
 
 
 /**
@@ -2285,10 +4714,10 @@ sc.helpers.getPlatform = function() {
 		return SPAZCORE_PLATFORM_WEBOS;
 	}
 	if (window.Titanium) {
-		return SPAZCORE_PLATFORM_TITANIUM
+		return SPAZCORE_PLATFORM_TITANIUM;
 	}
 	return SPAZCORE_PLATFORM_UNKNOWN;
-}
+};
 
 /**
 * checks to see if current platform is the one passed in
@@ -2300,25 +4729,25 @@ sc.helpers.getPlatform = function() {
 */
 sc.helpers.isPlatform = function(str) {
 	var pform = sc.helpers.getPlatform();
-	if ( pform.toLowerCase() == str.toLowerCase() ) {
+	if ( pform.toLowerCase() === str.toLowerCase() ) {
 		return true;
 	} else {
 		return false;
 	}
-}
+};
 
 
 sc.helpers.isAIR = function() {
 	return sc.helpers.isPlatform(SPAZCORE_PLATFORM_AIR);
-}
+};
 
 sc.helpers.iswebOS = function() {
 	return sc.helpers.isPlatform(SPAZCORE_PLATFORM_WEBOS);
-}
+};
 
 sc.helpers.isTitanium = function() {
 	return sc.helpers.isPlatform(SPAZCORE_PLATFORM_TITANIUM);
-}
+};
 
 
 /**
@@ -2327,7 +4756,7 @@ sc.helpers.isTitanium = function() {
  */
 sc.helpers.dump = function(obj) {
 	// stub
-}
+};
 
 /**
  * Open a URL in the default system web browser
@@ -2335,7 +4764,7 @@ sc.helpers.dump = function(obj) {
  */
 sc.helpers.openInBrowser = function(url) {
 	// stub
-}
+};
 
 /**
  * Gets the contents of a file
@@ -2343,7 +4772,7 @@ sc.helpers.openInBrowser = function(url) {
  */
 sc.helpers.getFileContents = function(path) {
 	// stub
-}
+};
 
 /**
  * Saves the contents to a specified path. Serializes a passed object if 
@@ -2386,7 +4815,7 @@ sc.helpers.setUserAgent = function(uastring) {
  */
 sc.helpers.getClipboardText = function() {
 	// stub
-}
+};
 
 /**
  * Sets clipboard text
@@ -2394,7 +4823,7 @@ sc.helpers.getClipboardText = function() {
  */
 sc.helpers.setClipboardText = function(text) {
 	// stub
-}
+};
 
 
 /**
@@ -2403,7 +4832,7 @@ sc.helpers.setClipboardText = function(text) {
  */
 sc.helpers.getEncryptedValue = function(key) {
 	// stub
-}
+};
 
 /**
  * Sets a value in the EncryptedLocalStore of AIR
@@ -2411,7 +4840,7 @@ sc.helpers.getEncryptedValue = function(key) {
  */
 sc.helpers.setEncyrptedValue = function(key, val) {
 	// stub
-}
+};
 
 
 /**
@@ -2421,7 +4850,7 @@ sc.helpers.setEncyrptedValue = function(key, val) {
  */
 sc.helpers.getAppStoreDir = function() {
 	// stub
-}
+};
 
 /**
  * Get the preferences file
@@ -2429,7 +4858,7 @@ sc.helpers.getAppStoreDir = function() {
  */
 sc.helpers.getPreferencesFile = function(name, create) {
 	// stub
-}
+};
 
 /**
  * initializes a file at the given location. set overwrite to true
@@ -2439,7 +4868,18 @@ sc.helpers.getPreferencesFile = function(name, create) {
 */
 sc.helpers.init_file = function(path, overwrite) {
 	// stub
-}
+};
+/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc, jQuery;
+ 
 /**
  * View helper methods for Twitter apps
  *  
@@ -2480,7 +4920,7 @@ sc.helpers.removeExtraElements = function(item_selector, max_items, remove_from_
 			} );
 		}
 	}
-}
+};
 
 
 
@@ -2493,9 +4933,9 @@ sc.helpers.removeExtraElements = function(item_selector, max_items, remove_from_
  * @TODO
  */
 sc.helpers.removeDuplicateElements = function(item_selector, remove_from_top) {
-	dump('removeDuplicateElements TODO');
+	sc.helpers.dump('removeDuplicateElements TODO');
 
-}
+};
 
 
 
@@ -2510,10 +4950,10 @@ sc.helpers.removeDuplicateElements = function(item_selector, remove_from_top) {
 sc.helpers.updateRelativeTimes = function(item_selector, time_attribute) {
 	jQuery(item_selector).each(function(i) {
 		var time = jQuery(this).attr(time_attribute);
-		var relative_time = sch.getRelativeTime(time);
+		var relative_time = sc.helpers.getRelativeTime(time);
 		jQuery(this).html( relative_time );
 	});
-}
+};
 
 
 /**
@@ -2525,7 +4965,18 @@ sc.helpers.updateRelativeTimes = function(item_selector, time_attribute) {
  */
 sc.helpers.markAllAsRead = function(item_selector) {
 	jQuery(item_selector).removeClass('new');
-}
+};
+/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc, DOMParser;
+ 
 sc.helpers.createXMLFromString = function (string) {
 	var xmlParser, xmlDocument;
 	try {
@@ -2533,203 +4984,26 @@ sc.helpers.createXMLFromString = function (string) {
 		xmlDocument = xmlParser.parseFromString(string, 'text/xml');
 		return xmlDocument;
 	} catch (e) {
-		air.trace(&quot;Can't create XML document.&quot;);
-		dump(e.name + &quot;:&quot; + e.message);
+		sc.helpers.dump(e.name + &quot;:&quot; + e.message);
 		return null;
 	}
-}
-
-
-
-/**
- * SpazCron handles repetitive tasks in a somewhat cron-like way. 
- * @param {integer} interval the interval to check for executable jobs IN SECONDS
- * @class SpazCron
- */
-function SpazCron(time_interval) {
-	if (!time_interval) {
-		this.time_interval = 15 * 1000; // 15 seconds
-	} else {
-		this.time_interval = time_interval * 1000;
-	}
-	
-	this.interval = null; // this is a stub for the interval object
-	
-	this.$jobs = [];
-		
-}
-
-/**
- * add a job to the set 
- */
-SpazCron.prototype.addJob = function (name, func, mintime) {
-	/*
-		make a new SpazCronJob and add it to this._jobs
-	*/
 };
 
-/**
- * remove a job to the set 
- */
-SpazCron.prototype.removeJob = function (name) {
-	/*
-		find a job in this._jobs and remove it from the array
-	*/
-};
-
-/**
- * start execution of jobs
- */
-SpazCron.prototype.start = function () {
-	/*
-		create the interval obj to fun this.execJobs every this.time_interval seconds
-	*/
-};
 
-/**
- * start execution of jobs
+/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+sub: true,
+plusplus: true,
+undef: true,
+white: false,
+onevar: false 
  */
-SpazCron.prototype.stop = function () {
-	/*
-		clear the interval obj
-	*/
-
-};
-
-/**
- * execute the jobs in the set
- */
-SpazCron.prototype.execJobs = function () {
-	/*
-		loop through the jobs in this._jobs and execute each one
-	*/
-};
-
-
-/**
- * 
- * @param {string} name  a n identifier for the job
- * @param {function} func  the function that the job executes
- * @param {mintime} integer  the amount of time that must pass for job to re-execute, in SECONDS
- */
-var SpazCronJob = function (name, func, mintime) {
-	this.last_run = 0; // last time run in seconds
-	this.name = name;
-	this.func = func;
-	this.mintime = mintime; // minimum amount of time 
-};
-
-SpazCronJob.prototype.execute = function () {
-	/*
-		if the time passed &gt; this.mintime, then execute this.func
-	*/
-};// Basically just ripped from JazzRecord  HTML5Adapter class
-
-function SpazLocker(db, account) {
-  this.db = openDatabase(db);
-  this.account = account;
-  this.ready = false;
-
-  var locker = this;
-  var query = &quot;CREATE TABLE IF NOT EXISTS `&quot; + account + &quot;` (id INTEGER PRIMARY KEY AUTOINCREMENT, tweet_id INTEGER, in_reply_to_id INTEGER, text TEXT, timestamp TEXT)&quot;;
-  
-  sc.helpers.dump(query);
-  
-  this.db.transaction(function(tx) {
-    tx.executeSql(query, [], function(tx, resultSet) {
-      locker.ready = true;
-    });
-  });
-}
+var sc, jQuery;
 
-SpazLocker.prototype = {
-  run: function(query, success, failure) {
-    this.db.transaction(function(tx) {
-      tx.executeSql(query, [], function(tx, resultSet) {
-          var rows = [];
-          for(var i = 0, j = resultSet.rows.length; i &lt; j; i++) {
-            rows.push(resultSet.rows.item(i));
-          }
-          if(success)
-            success(rows);
-        }, function(tx, err) {
-          if(failure)
-            failure(err.message);
-          else
-            sc.helpers.dump(&quot;There was an error: &quot; + err.message);
-        });
-    });
-  },
-
-  count: function(success, failure) {
-    var query = &quot;SELECT COUNT(*) FROM &quot; + this.account;
-    this.db.transaction(function(tx) {
-      tx.executeSql(query, [], function(tx, resultSet) {
-        if(success)
-          success(resultSet.rows.item(0)[&quot;COUNT(*)&quot;]);
-        }, function(tx, err) {
-        if(failure)
-          failure(err.message);
-        else
-          sc.helpers.dump(&quot;There was an error: &quot; + err.message);
-      });
-    });
-  },
-
-  store: function(data, success, failure) {
-    var tweet_id = data.tweet_id || &quot;NULL&quot;;
-    var in_reply_to_id = data.in_reply_to_id || &quot;NULL&quot;;
-    var text = &quot;NULL&quot;;
-    if(data.text)
-      text = &quot;'&quot; + data.text + &quot;'&quot;;
-    var timestamp = data.timestamp || &quot;NULL&quot;;
-    
-    var query = &quot;INSERT INTO &quot; + this.account + &quot; (tweet_id, in_reply_to_id, text, timestamp) VALUES(&quot; + 
-      tweet_id + &quot;, &quot; +
-      in_reply_to_id + &quot;, &quot; +
-      text + &quot;, &quot; +
-      timestamp + &quot;)&quot;;
-    
-    sc.helpers.dump(query);
-    this.db.transaction(function(tx) {
-      tx.executeSql(query, [], function(tx, resultSet) {
-        if(success)
-          success(resultSet.insertId);
-        }, function(tx, err) {
-        if(failure)
-          failure(err.message);
-        else
-          sc.helpers.dump(&quot;There was an error: &quot; + err.message);
-      });
-    });
-  },
-  
-  retrieve: function(options, success, failure) {
-    var col = &quot;id&quot;, val = options;
-    if(typeof options === &quot;object&quot;) {
-      col = options.col;
-      val = options.val;
-      success = options.success;
-      failure = options.failure;
-    }
-    var query = &quot;SELECT * FROM &quot; + this.account + &quot; WHERE &quot; + col + &quot;=&quot; + val;
-    sc.helpers.dump(query);
-    this.run(query, success, failure);
-  },
-  
-  vanquish: function(options, success, failure) {
-    var col = &quot;id&quot;, val = options;
-    if(typeof options === &quot;object&quot;) {
-      col = options.col;
-      val = options.val;
-      success = options.success;
-      failure = options.failure;
-    }
-    var query = &quot;DELETE FROM &quot; + this.account + &quot; WHERE &quot; + col + &quot;=&quot; + val;
-    sc.helpers.dump(query);
-    this.run(query, success, failure);
-  }
-};function SpazPhotoMailer(opts) {
+function SpazPhotoMailer(opts) {
 
 	this.apis = this.getAPIs();
 	
@@ -2745,7 +5019,7 @@ SpazPhotoMailer.prototype.getAPILabels = function() {
 
 SpazPhotoMailer.prototype.getAPIs = function() {
 	
-	thisSPM = this;
+	var thisSPM = this;
 	
 	var apis = {
 		&quot;yfrog&quot;: {
@@ -2773,7 +5047,7 @@ SpazPhotoMailer.prototype.getAPIs = function() {
 			&quot;email_tpl&quot;  :&quot;{{username}}.???@pikchur.com&quot;,
 			&quot;message_in&quot; :&quot;subject&quot;,
 			&quot;email_info_url&quot;:&quot;http://pikchur.com/dashboard/profile&quot;,
-			'help_text'  :&quot;Log-in to pikchur with your Twitter username and password, and click 'Profile' Your customized posting email will be listed&quot;,
+			'help_text'  :&quot;Log-in to pikchur with your Twitter username and password, and click 'Profile.' Your customized posting email will be listed&quot;,
 			'getToAddress': function(opts) {
 				var username = opts.username;
 				return thisSPM.apis['pikchur'].email_tpl.replace('{{username}}', username);
@@ -2821,7 +5095,7 @@ SpazPhotoMailer.prototype.getAPIs = function() {
 					jQuery.ajax({
 						
 						'success':function(data, textStatus) {
-							var profile = sch.deJSON(data);
+							var profile = sc.helpers.deJSON(data);
 							
 						},
 						
@@ -2838,7 +5112,7 @@ SpazPhotoMailer.prototype.getAPIs = function() {
 						
 					});
 					
-				};
+				}
 				
 				function getTweetPhoto(username, password, settings_url) {
 
@@ -2847,7 +5121,7 @@ SpazPhotoMailer.prototype.getAPIs = function() {
 					jQuery.ajax({
 						
 						'success':function(data, textStatus) {
-							var settings = sch.deJSON(data);
+							var settings = sc.helpers.deJSON(data);
 							success(settings.Email);
 						},
 						
@@ -2882,92 +5156,18 @@ SpazPhotoMailer.prototype.setAPI = function(apilabel) {
 SpazPhotoMailer.prototype.send = function(api, photo_url, message) {
 	
 };
-/**
- * A library to interact with Ping.FM 
- */
-
-/**
- * events raised here 
- */
-if (!sc.events) { sc.events = {} };
-sc.events.pingfmGetUserKeySuccess		= 'pingfmGetUserKeySuccess';
-sc.events.pingfmGetUserKeyFailure		= 'pingfmGetUserKeyFailure';
-sc.events.pingfmValidateUserKeySuccess	= 'pingfmValidateUserKeySuccess';
-sc.events.pingfmValidateUserKeyFailure	= 'pingfmValidateUserKeyFailure';
-sc.events.pingfmGetServicesSuccess		= 'pingfmGetServicesSuccess';
-sc.events.pingfmGetServicesFailure		= 'pingfmGetServicesFailure';
-sc.events.pingfmGetTriggersSuccess		= 'pingfmGetTriggersSuccess';
-sc.events.pingfmGetTriggersFailure		= 'pingfmGetTriggersFailure';
-sc.events.pingfmGetLatestSuccess		= 'pingfmGetLatestSuccess';
-sc.events.pingfmGetLatestFailure		= 'pingfmGetLatestFailure';
-sc.events.pingfmPostSuccess				= 'pingfmPostSuccess';
-sc.events.pingfmPostFailure				= 'pingfmPostFailure';
-sc.events.pingfmTriggerPostSuccess		= 'pingfmTriggerPostSuccess';
-sc.events.pingfmTriggerPostFailure		= 'pingfmTriggerPostFailure';
-
- 
-/**
- * a library for the Ping.fm API 
- * @class SpazPingFM
- * @param {object} opts
- */
-function SpazPingFM(opts) {
-	
-	this.apikey  = opts.apikey  || null;
-	this.devkey  = opts.devkey  || null;
-	this.userkey = opts.userkey || null;
-	
-};
-
-
-SpazPingFM.prototype.getAPIKey = function() {
-	return this.apikey;
-};
-SpazPingFM.prototype.setAPIKey = function(apikey) {
-	this.apikey = apikey;
-};
-
-SpazPingFM.prototype.getUserKey = function() {
-	return this.userkey;
-};
-SpazPingFM.prototype.setUserKey = function(userkey) {
-	this.userkey = userkey;
-};
-
-
-/**
- * Given a mobile key, request a user key via Ajax. Raise event on success or failure
- * Users can get their key from http://ping.fm/key/
- * 
- * All ping.fm responses are in XML. This sucks. Oh well.
- * 
- * @param {string} mobilekey
- * @return void
- */
-SpazPingFM.prototype.getUserKeyWithMobileKey = function(mobilekey) {
-	
-};
-
-
-SpazPingFM.prototype.validateUserKey = function(userkey) {
-	
-}; 
-
-/**
- * get the user's set-up services 
- */
-SpazPingFM.prototype.getServices = function() {
-	
-};
-
-
-SpazPingFM.prototype.getTriggers = function() {};
-
-SpazPingFM.prototype.getLatest = function(limit, order) {};
-
-SpazPingFM.prototype.post = function(msg, opts) {};
-
-SpazPingFM.prototype.triggerPost = function(msg, trigger, opts) {};const SPAZCORE_PREFS_TI_KEY = 'preferences_json';
+/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc, Titanium, air, window, jQuery, Mojo;
+
+var SPAZCORE_PREFS_TI_KEY = 'preferences_json';
  
 /**
  * A preferences lib for AIR JS apps. This requires the json2.js library
@@ -3022,7 +5222,7 @@ function SpazPrefs(defaults, sanity_methods) {
 	}
 	
 	this.loaded = false;
-};
+}
 
 
 /**
@@ -3039,6 +5239,7 @@ SpazPrefs.prototype.setDefaults = function(defaults) {
  * call the onSet sanity method if it is defined for a given pref keys.
  */
 SpazPrefs.prototype._applyDefaults = function() {
+	var key;
 	for (key in this._defaults) {
 		sc.helpers.dump('Copying default &quot;' + key + '&quot;:&quot;' + this._defaults[key] + '&quot; (' + typeof(this._defaults[key]) + ')');
 		this._prefs[key] = this._defaults[key];
@@ -3078,7 +5279,7 @@ SpazPrefs.prototype.get = function(key, encrypted) {
 	} else {
 		return false;
 	}
-}
+};
 
 
 /**
@@ -3095,7 +5296,7 @@ SpazPrefs.prototype.set = function(key, val, encrypted) {
 	this._prefs[key] = val;
 	
 	this.save();
-}
+};
 
 
 
@@ -3110,7 +5311,7 @@ SpazPrefs.prototype.set = function(key, val, encrypted) {
  */
 SpazPrefs.prototype.setSanityMethod = function(key, type, method) {
 	
-	if (type != 'onGet' &amp;&amp; type != 'onSet') {
+	if (type !== 'onGet' &amp;&amp; type !== 'onSet') {
 		return false;
 	}
 	
@@ -3151,7 +5352,7 @@ SpazPrefs.prototype.load = function(name) {
 	*/
 	if (sc.helpers.iswebOS()) {
 
-		dump('this is webOS');
+		sc.helpers.dump('this is webOS');
 		if (!this.mojoDepot) {
 			sc.helpers.dump('making depot');
 			this.mojoDepot = new Mojo.Depot({
@@ -3159,9 +5360,8 @@ SpazPrefs.prototype.load = function(name) {
 				replace:false
 			});
 		}
-
 		
-		function onGet(loaded_prefs) {
+		var onGet = function(loaded_prefs) {
 			if (loaded_prefs) {
 				sc.helpers.dump('Prefs loaded');
 				for (var key in loaded_prefs) {
@@ -3169,13 +5369,13 @@ SpazPrefs.prototype.load = function(name) {
 		            thisPrefs._prefs[key] = loaded_prefs[key];
 		       	}
 			} else {
-				sc.helpers.dump('Prefs loading failed in onGet')
+				sc.helpers.dump('Prefs loading failed in onGet');
 				thisPrefs.resetPrefs();
 			}
 			jQuery().trigger('spazprefs_loaded');
 		};
 
-		function onFail() {
+		var onFail = function() {
 			sc.helpers.dump('Prefs loading failed in onFail');
 			thisPrefs.resetPrefs();
 			jQuery().trigger('spazprefs_loaded');
@@ -3206,7 +5406,7 @@ SpazPrefs.prototype.load = function(name) {
 		jQuery().trigger('spazprefs_loaded');
 	}
 	
-}
+};
 
 
 
@@ -3220,7 +5420,7 @@ SpazPrefs.prototype.save = function(name) {
 		if (!this.mojoDepot) {
 			this.mojoDepot = new Mojo.Depot({
 				name:'SpazDepotPrefs',
-				replace:true
+				replace:false
 			});
 		}
 		
@@ -3246,7 +5446,7 @@ SpazPrefs.prototype.save = function(name) {
  * shortcut for SpazPrefs
  */
 if (sc) {
-	scPrefs = SpazPrefs;
+	var scPrefs = SpazPrefs;
 }
 
 
@@ -3276,7 +5476,7 @@ if (sc.helpers.isTitanium()) {
 			Titanium.App.Properties.setInt('__window-x',      x);
 			Titanium.App.Properties.setInt('__window-y',      y);
 		}
-	}
+	};
 
 	/*
 		Loads the size and placement of the window this executes in
@@ -3298,7 +5498,7 @@ if (sc.helpers.isTitanium()) {
 			Titanium.UI.currentWindow.setX(x);
 			Titanium.UI.currentWindow.setY(y);
 		}
-	}
+	};
 }
 
 
@@ -3317,7 +5517,7 @@ if (sc.helpers.isAIR()) {
 		this.set('__window-height', window.nativeWindow.height);
 		this.set('__window-x', window.nativeWindow.x);
 		this.set('__window-y', window.nativeWindow.y);
-	}
+	};
 
 	/*
 		Loads the size and placement of the window this executes in
@@ -3335,7 +5535,7 @@ if (sc.helpers.isAIR()) {
 			window.nativeWindow.y = y;
 		}
 		
-	}
+	};
 	
 }
 
@@ -3558,6 +5758,17 @@ if (sc.helpers.isAIR()) {
 // 	
 // }
 
+/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc;
+
 /**
  * A library to shorten text 
  */
@@ -3735,7 +5946,7 @@ SpazShortText.prototype.genBaseMaps = function() {
 		'nine'					:'9',
 		'ten'					:'10',
 		'eleven'				:'11',
-		'twelve'				:'12',
+		'twelve'				:'12'
 	};
 	
 	
@@ -3761,25 +5972,27 @@ SpazShortText.prototype.genBaseMaps = function() {
  * This processes the base maps into the this.map object of regexes and replacements 
  */
 SpazShortText.prototype.processBaseMaps = function() {
-	for (var key in this.basemap) {
-		var val = this.basemap[key];
-		var regex = new RegExp('(\\b)'+key+'(\\b)', 'gi');
+	var key, val, regex, israw;
+	
+	for (key in this.basemap) {
+		val = this.basemap[key];
+		regex = new RegExp('(\\b)'+key+'(\\b)', 'gi');
 		this.map[key] = {
 			'short':'$1'+val+'$2',
 			'regex':regex
-		}
+		};
 	}
 	
 	/*
 		take the rawmap stuff and glob it into this.map, so we only have one to worry about
 	*/
-	for (var key in this.baserawmap) {
-		var val = this.baserawmap[key];
-		var regex = new RegExp(key, 'gi');
+	for (key in this.baserawmap) {
+		val = this.baserawmap[key];
+		regex = new RegExp(key, 'gi');
 		this.map[key] = {
 			'short':val,
 			'regex':regex
-		}
+		};
 	}
 	
 	
@@ -3812,7 +6025,7 @@ SpazShortText.prototype.shorten = function(text) {
  * @param {boolean} israw is true, this mapping won't be altered at all when processed into a regex
  */
 SpazShortText.prototype.addMap = function(search, replace, israw) {
-	var israw = israw || false;
+	israw = israw || false;
 	
 	if (israw) {
 		this.baserawmap[search] = replace;
@@ -3831,22 +6044,33 @@ SpazShortText.prototype.addMap = function(search, replace, israw) {
  */
 SpazShortText.prototype.getMaps = function() {
 	return this.map;
-};/**
+};/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc, jQuery;
+
+/**
  * A library to do url shortening 
  */
 
 /**
  * Constants to refer to services 
  */
-const SPAZCORE_SHORTURL_SERVICE_SHORTIE = 'short.ie';
-const SPAZCORE_SHORTURL_SERVICE_ISGD	= 'is.gd';
-const SPAZCORE_SHORTURL_SERVICE_BITLY	= 'bit.ly';
+var SPAZCORE_SHORTURL_SERVICE_SHORTIE = 'short.ie';
+var SPAZCORE_SHORTURL_SERVICE_ISGD	= 'is.gd';
+var SPAZCORE_SHORTURL_SERVICE_BITLY	= 'bit.ly';
 
 
 /**
  * events raised here 
  */
-if (!sc.events) { sc.events = {} };
+if (!sc.events) { sc.events = {}; }
 sc.events.newShortURLSuccess	= 'newShortURLSuccess';
 sc.events.newShortURLFailure	= 'newShortURLFailure';
 sc.events.newExpandURLSuccess = 'recoverLongURLSuccess';
@@ -3865,7 +6089,7 @@ function SpazShortURL(service) {
 
 SpazShortURL.prototype.getAPIObj = function(service) {
 	
-	var apis = {}
+	var apis = {};
 	
 	apis[SPAZCORE_SHORTURL_SERVICE_BITLY] = {
 		'url'	  : 'http://bit.ly/api',
@@ -3887,7 +6111,7 @@ SpazShortURL.prototype.getAPIObj = function(service) {
 		'processResult' : function(data) {
 			if (apis[SPAZCORE_SHORTURL_SERVICE_BITLY].processing_multiple === true) {
 				var result = sc.helpers.deJSON(data);
-				var rs = {}
+				var rs = {};
 				for (var i in result.results) {
 					rs[i] = result.results[i].shortUrl;
 				}
@@ -3904,14 +6128,14 @@ SpazShortURL.prototype.getAPIObj = function(service) {
 		'getData' : function(longurl, opts){
 			
 			if (longurl.match(/ /gi)) {
-				var longurl = longurl.replace(/ /gi, '%20');
+				longurl = longurl.replace(/ /gi, '%20');
 			}
 			
 			var shortie = {
 				orig: longurl,
 				url:  longurl,
 				email:	 '',
-				private: 'false',
+				'private': 'false',
 				format:	 'rest'
 			};
 			return shortie;
@@ -3926,7 +6150,7 @@ SpazShortURL.prototype.getAPIObj = function(service) {
 	};
 	
 	return apis[service];
-}
+};
 
 
 /**
@@ -3938,7 +6162,7 @@ SpazShortURL.prototype.shorten = function(longurl, opts) {
 	
 	var shortener = this;
 	
-	if (!opts) { opts = {} };
+	if (!opts) { opts = {}; }
 
 	/*
 		set defaults if needed
@@ -3960,9 +6184,9 @@ SpazShortURL.prototype.shorten = function(longurl, opts) {
 		complete:function(xhr, rstr) {
 		},
 		'error':function(xhr, msg, exc) {
-			sc.helpers.dump(shortener.api.url + ' error:'+msg)
+			sc.helpers.dump(shortener.api.url + ' error:'+msg);
 			
-			var errobj = {'url':shortener.api.url, 'xhr':null, 'msg':null}
+			var errobj = {'url':shortener.api.url, 'xhr':null, 'msg':null};
 			
 			if (xhr) {
 				errobj.xhr = xhr;
@@ -3982,7 +6206,7 @@ SpazShortURL.prototype.shorten = function(longurl, opts) {
 				return_data = {
 					'shorturl':data,
 					'longurl' :longurl
-				}
+				};
 			}
 			shortener._onShortenResponseSuccess(return_data, opts.event_target);
 		},
@@ -4011,9 +6235,9 @@ SpazShortURL.prototype.expand = function(shorturl, opts) {
 		complete:function(xhr, rstr) {
 		},
 		'error':function(xhr, msg, exc) {
-			sc.helpers.dump(this.url + ' error:'+msg)
+			sc.helpers.dump(this.url + ' error:'+msg);
 			
-			var errobj = {'url':this.url, 'xhr':null, 'msg':null}
+			var errobj = {'url':this.url, 'xhr':null, 'msg':null};
 			
 			if (xhr) {
 				errobj.xhr = xhr;
@@ -4055,6 +6279,18 @@ SpazShortURL.prototype._onExpandResponseSuccess = function(data, target) {
 SpazShortURL.prototype._onExpandResponseFailure = function(errobj, target) {
 	sc.helpers.triggerCustomEvent(sc.events.newExpandURLFailure, target, errobj);
 };
+/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+plusplus: false,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc;
+
 /**
  * SpazTemplate 
  * designed for fast templating functions
@@ -4064,7 +6300,7 @@ function SpazTemplate() {
 	
 	this._tpls = {};
 	
-};
+}
 
 /**
  * @param string name      the name to call the method with in parseTemplate
@@ -4098,6 +6334,18 @@ SpazTemplate.prototype.parseArray    = function(methodname, data_array) {
 	}
 	return parsed;
 };
+/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+plusplus: false,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc, jQuery;
+
 /**
  * @fileOverview File containing the SpazTimeline object definition
  * @author &lt;a href=&quot;mailto:coj@funkatron.com&quot;&gt;coj@funkatron.com&lt;/a&gt;
@@ -4153,7 +6401,7 @@ var SpazTimeline = function(opts) {
 
 SpazTimeline.prototype._init = function(opts) {
 	
-	var opts = opts || {};
+	opts = opts || {};
 	
 	this.max_items                   = opts.max_items     || 100;	
 	this.refresh_time                = opts.refresh_time  || 1000*60*2; // mseconds
@@ -4289,7 +6537,7 @@ SpazTimeline.prototype.renderItem = function(item, templatefunc) {
 	
 	return html;
 	
-}
+};
 
 
 SpazTimeline.prototype.removeExtraItems = function() {
@@ -4359,7 +6607,7 @@ SpazTimeline.prototype.sortItems = function(selector, sortfunc) {
  */
 SpazTimeline.prototype.select = function(selector, container) {
 	if (!container) {
-		container = this.timeline_container_selector
+		container = this.timeline_container_selector;
 	}
 	return jQuery(selector, container).get();
 };
@@ -4377,6 +6625,20 @@ SpazTimeline.prototype.append = function(htmlitem) {
 SpazTimeline.prototype.getEntrySelector = function() {
 	return this.timeline_container_selector + ' ' + this.timeline_item_selector;
 };
+/*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+plusplus: false,
+regexp: false,
+sub: true,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc, jQuery, window, Mojo, use_palmhost_proxy;
+
 /**
  * @depends ../helpers/string.js 
  * @depends ../helpers/datetime.js 
@@ -4387,22 +6649,22 @@ SpazTimeline.prototype.getEntrySelector = function() {
 
 
 /**
- * various const definitions
+ * various constant definitions
  */
-const SPAZCORE_SECTION_FRIENDS = 'friends';
-const SPAZCORE_SECTION_REPLIES = 'replies';
-const SPAZCORE_SECTION_DMS = 'dms';
-const SPAZCORE_SECTION_FAVORITES = 'favorites';
-const SPAZCORE_SECTION_COMBINED = 'combined';
-const SPAZCORE_SECTION_PUBLIC = 'public';
-const SPAZCORE_SECTION_SEARCH = 'search';
-const SPAZCORE_SECTION_USER = 'user-timeline';
+var SPAZCORE_SECTION_FRIENDS = 'friends';
+var SPAZCORE_SECTION_REPLIES = 'replies';
+var SPAZCORE_SECTION_DMS = 'dms';
+var SPAZCORE_SECTION_FAVORITES = 'favorites';
+var SPAZCORE_SECTION_COMBINED = 'combined';
+var SPAZCORE_SECTION_PUBLIC = 'public';
+var SPAZCORE_SECTION_SEARCH = 'search';
+var SPAZCORE_SECTION_USER = 'user-timeline';
 
-const SPAZCORE_SERVICE_TWITTER = 'twitter';
-const SPAZCORE_SERVICE_IDENTICA = 'identi.ca';
-const SPAZCORE_SERVICE_CUSTOM = 'custom';
-const SPAZCORE_SERVICEURL_TWITTER = 'https://twitter.com/';
-const SPAZCORE_SERVICEURL_IDENTICA = 'https://identi.ca/api/';
+var SPAZCORE_SERVICE_TWITTER = 'twitter';
+var SPAZCORE_SERVICE_IDENTICA = 'identi.ca';
+var SPAZCORE_SERVICE_CUSTOM = 'custom';
+var SPAZCORE_SERVICEURL_TWITTER = 'https://twitter.com/';
+var SPAZCORE_SERVICEURL_IDENTICA = 'https://identi.ca/api/';
 
 /**
  * A Twitter API library for Javascript
@@ -4480,8 +6742,8 @@ function SpazTwit(username, password, opts) {
 	*/
 	this.cache = {
 		users:{},
-		posts:{},
-	}
+		posts:{}
+	};
 	
 	this.me = {};
 	
@@ -4493,28 +6755,28 @@ function SpazTwit(username, password, opts) {
 	*/
 	jQuery.ajaxSetup( {
         timeout:1000*45, // 45 seconds
-        async:true,
+        async:true
     });
 
 	/**
 	 * remap dump calls as appropriate 
 	 */
 	if (sc &amp;&amp; sc.helpers &amp;&amp; sc.helpers.dump) {
-		dump = sc.helpers.dump;
+		window.dump = sc.helpers.dump;
 	} else { // do nothing!
-		function dump(input) {
+		var dump = function(input) {
 			return;
-		}
+		};
 	}
 }
 
 
 SpazTwit.prototype.getUsername = function() {
 	return this.username;
-}
+};
 SpazTwit.prototype.getPassword = function() {
 	return this.password;
-}
+};
 
 /**
  * retrieves the last status id retrieved for a given section
@@ -4531,7 +6793,7 @@ SpazTwit.prototype.getLastId   = function(section) {
  * @param {integer} id  the new last id retrieved for this section
  */
 SpazTwit.prototype.setLastId   = function(section, id) {
-	this.data[section].lastid = parseInt(id);
+	this.data[section].lastid = parseInt(id, 10);
 };
 
 
@@ -4619,7 +6881,7 @@ SpazTwit.prototype.combinedTimelineFinished = function() {
  */
 SpazTwit.prototype.combinedTimelineHasErrors = function() {
 	if (this.combined_errors.length &gt; 0) {
-		return true
+		return true;
 	} else {
 		return false;
 	}
@@ -4749,9 +7011,9 @@ SpazTwit.prototype.getAPIURL = function(key, urldata) {
 	
 	if (urls[key].indexOf('{{ID}}') &gt; -1) {
 		if (typeof(urldata) === 'string') {
-			urls[key] = urls[key].replace('{{ID}}', urldata)
+			urls[key] = urls[key].replace('{{ID}}', urldata);
 		} else if (urldata &amp;&amp; typeof(urldata) === 'object') {
-			urls[key] = urls[key].replace('{{ID}}', urldata.id)
+			urls[key] = urls[key].replace('{{ID}}', urldata.id);
 		}
 		
 	}
@@ -4759,20 +7021,20 @@ SpazTwit.prototype.getAPIURL = function(key, urldata) {
 
     if (urls[key]) {
 	
-		if (urldata &amp;&amp; typeof urldata != &quot;string&quot;) {
+		if (urldata &amp;&amp; typeof urldata !== &quot;string&quot;) {
 			urldata = '?'+jQuery.param(urldata);
 		} else {
 			urldata = '';
 		}
 		
-		if (this.baseurl === SPAZCORE_SERVICEURL_TWITTER &amp;&amp; (key == 'search' || key == 'trends')) {
+		if (this.baseurl === SPAZCORE_SERVICEURL_TWITTER &amp;&amp; (key === 'search' || key === 'trends')) {
 			return this._postProcessURL(urls[key] + urldata);
 		} else {
 			return this._postProcessURL(this.baseurl + urls[key] + urldata);
 		}
         
     } else {
-        return false
+        return false;
     }
 
 };
@@ -4806,7 +7068,7 @@ SpazTwit.prototype.verifyCredentials = function(username, password) {
 		'success_event_type':'verify_credentials_succeeded',
 		'failure_event_type':'verify_credentials_failed',
 		'method':'GET'
-	}
+	};
 
 	/*
 		Perform a request and get true or false back
@@ -4829,7 +7091,7 @@ SpazTwit.prototype._processAuthenticatedUser = function(data, finished_event) {
 	// jQuery().trigger(finished_event, [this.me]);
 	this.triggerEvent(finished_event, this.me);
 	
-}
+};
 
 
 /**
@@ -4897,7 +7159,7 @@ SpazTwit.prototype.getFriendsTimeline = function(since_id, count, page, processi
  */
 SpazTwit.prototype._processFriendsTimeline = function(ret_items, finished_event, processing_opts) {
 	this._processTimeline(SPAZCORE_SECTION_FRIENDS, ret_items, finished_event, processing_opts);
-}
+};
 
 
 /**
@@ -4952,7 +7214,7 @@ SpazTwit.prototype.getReplies = function(since_id, count, page, processing_opts)
 SpazTwit.prototype._processRepliesTimeline = function(ret_items, finished_event, processing_opts) {
 	sc.helpers.dump('Processing '+ret_items.length+' items returned from replies method');
 	this._processTimeline(SPAZCORE_SECTION_REPLIES, ret_items, finished_event, processing_opts);
-}
+};
 
 /**
  *  
@@ -5004,7 +7266,7 @@ SpazTwit.prototype.getDirectMessages = function(since_id, count, page, processin
 SpazTwit.prototype._processDMTimeline = function(ret_items, finished_event, processing_opts) {
 	sc.helpers.dump('Processing '+ret_items.length+' items returned from DM method');
 	this._processTimeline(SPAZCORE_SECTION_DMS, ret_items, finished_event, processing_opts);
-}
+};
 
 /**
  *  
@@ -5038,7 +7300,7 @@ SpazTwit.prototype.getFavorites = function(page, processing_opts) {
  */
 SpazTwit.prototype._processFavoritesTimeline = function(ret_items, finished_event, processing_opts) {
 	this._processTimeline(SPAZCORE_SECTION_FAVORITES, ret_items, finished_event, processing_opts);
-}
+};
 
 
 
@@ -5077,7 +7339,7 @@ SpazTwit.prototype.getUserTimeline = function(id, count, page) {
  */
 SpazTwit.prototype._processUserTimeline = function(ret_items, finished_event, processing_opts) {
 	this._processTimeline(SPAZCORE_SECTION_USER, ret_items, finished_event, processing_opts);
-}
+};
 
 
 
@@ -5092,7 +7354,7 @@ SpazTwit.prototype.getCombinedTimeline = function(com_opts) {
 
 	var opts = {
 		'combined':true
-	}
+	};
 	
 	if (com_opts) {
 		if (com_opts.friends_count) {
@@ -5204,7 +7466,7 @@ SpazTwit.prototype._processSearchTimeline = function(search_result, finished_eve
 		/*
 			set lastid
 		*/ 
-		var lastid = ret_items[ret_items.length-1].id
+		var lastid = ret_items[ret_items.length-1].id;
 		this.data[SPAZCORE_SECTION_SEARCH].lastid = lastid;
 		sc.helpers.dump('this.data['+SPAZCORE_SECTION_SEARCH+'].lastid:'+this.data[SPAZCORE_SECTION_SEARCH].lastid);
 
@@ -5220,11 +7482,6 @@ SpazTwit.prototype._processSearchTimeline = function(search_result, finished_eve
 		this.data[SPAZCORE_SECTION_SEARCH].items = this.removeDuplicates(this.data[SPAZCORE_SECTION_SEARCH].items);
 		this.data[SPAZCORE_SECTION_SEARCH].items = this.removeExtraElements(this.data[SPAZCORE_SECTION_SEARCH].items, this.data[SPAZCORE_SECTION_SEARCH].max);
 
-		// sc.helpers.dump('New '+SPAZCORE_SECTION_SEARCH+' items: ('+this.data[SPAZCORE_SECTION_SEARCH].newitems.length+')');
-		// sc.helpers.dump(this.data[SPAZCORE_SECTION_SEARCH].newitems);
-		// sc.helpers.dump('All '+SPAZCORE_SECTION_SEARCH+' items ('+this.data[SPAZCORE_SECTION_SEARCH].items.length+'):');
-		// sc.helpers.dump(this.data[SPAZCORE_SECTION_SEARCH].items);
-
 
 		var search_info = {
 			'since_id'         : search_result.since_id,
@@ -5235,7 +7492,7 @@ SpazTwit.prototype._processSearchTimeline = function(search_result, finished_eve
 			'completed_in'     : search_result.completed_in,
 			'page'             : search_result.page,
 			'query'            : search_result.query
-		}
+		};
 		// jQuery().trigger(finished_event, [this.data[SPAZCORE_SECTION_SEARCH].newitems, search_info]);
 		this.triggerEvent(finished_event, [this.data[SPAZCORE_SECTION_SEARCH].newitems, search_info]);
 		
@@ -5246,7 +7503,7 @@ SpazTwit.prototype._processSearchTimeline = function(search_result, finished_eve
 		this.triggerEvent(finished_event, []);
 	}
 	
-}
+};
 
 
 
@@ -5305,7 +7562,7 @@ SpazTwit.prototype._processSearchItem = function(item, section_name) {
 	
 	
 	return item;
-}
+};
 
 
 SpazTwit.prototype.getTrends = function() {
@@ -5343,7 +7600,7 @@ SpazTwit.prototype._processTrends = function(trends_result, finished_event, proc
 		this.triggerEvent(finished_event, ret_items);
 		
 	}
-}
+};
 
 
 /**
@@ -5363,14 +7620,14 @@ SpazTwit.prototype._getTimeline = function(opts) {
 	var xhr = jQuery.ajax({
         'complete':function(xhr, msg){
             sc.helpers.dump(opts.url + ' complete:'+msg);
-			if (msg == 'timeout') {
+			if (msg === 'timeout') {
 				// jQuery().trigger(opts.failure_event_type, [{'url':opts.url, 'xhr':xhr, 'msg':msg}]);
 				stwit.triggerEvent(opts.failure_event_type, {'url':opts.url, 'xhr':xhr, 'msg':msg});				
 			}
         },
         'error':function(xhr, msg, exc) {
-			sc.helpers.dump(opts.url + ' error:&quot;'+msg+'&quot;')
-			if (msg.toLowerCase().indexOf('timeout') != -1) {
+			sc.helpers.dump(opts.url + ' error:&quot;'+msg+'&quot;');
+			if (msg.toLowerCase().indexOf('timeout') !== -1) {
 				stwit.triggerEvent(document, opts.failure_event_type, {'url':opts.url, 'xhr':null, 'msg':msg});
 			} else if (xhr) {
 				if (!xhr.readyState &lt; 4) {
@@ -5432,7 +7689,7 @@ SpazTwit.prototype._getTimeline = function(opts) {
 					ensures that &quot;this&quot; inside the callback refers to our
 					SpazTwit object, and not the jQuery.Ajax object
 				*/
-				opts.process_callback.call(stwit, data, opts.success_event_type, opts.processing_opts)
+				opts.process_callback.call(stwit, data, opts.success_event_type, opts.processing_opts);
 			} else {
 				// jQuery().trigger(opts.success_event_type, [data]);
 				stwit.triggerEvent(opts.success_event_type, data);
@@ -5448,7 +7705,7 @@ SpazTwit.prototype._getTimeline = function(opts) {
         },
         'type':&quot;GET&quot;,
         'url': 		opts.url,
-        'data': 	opts.data,
+        'data': 	opts.data
 	});
 	
 	return xhr;
@@ -5491,33 +7748,21 @@ SpazTwit.prototype._processTimeline = function(section_name, ret_items, finished
 		
 		if (section_name === SPAZCORE_SECTION_USER) { // special case -- we don't keep this data, just parse and fire it off
 
-			// sc.helpers.dump('New '+section_name+' items: ('+ret_items.length+')');
-			// sc.helpers.dump(ret_items);
-			
-			// jQuery().trigger(finished_event, [ret_items]);
 			this.triggerEvent(finished_event, ret_items);
 			
 		} else { // this is a &quot;normal&quot; timeline that we want to be persistent
 			
 			// set lastid
-			var lastid = ret_items[ret_items.length-1].id
+			var lastid = ret_items[ret_items.length-1].id;
 			this.data[section_name].lastid = lastid;
 			sc.helpers.dump('this.data['+section_name+'].lastid:'+this.data[section_name].lastid);
 
 			// add new items to data.newitems array
 			this.data[section_name].newitems = ret_items;
 
-			// concat new items onto data.items array
-			this.data[section_name].items = this.data[section_name].items.concat(this.data[section_name].newitems);
-			this.data[section_name].items = this.removeDuplicates(this.data[section_name].items);
-			this.data[section_name].items = this.removeExtraElements(this.data[section_name].items, this.data[section_name].max);
+			this._addToSectionItems(section_name, this.data[section_name].newitems);
 
 
-			// sc.helpers.dump('New '+section_name+' items: ('+this.data[section_name].newitems.length+')');
-			// sc.helpers.dump(this.data[section_name].newitems);
-			// sc.helpers.dump('All '+section_name+' items ('+this.data[section_name].items.length+'):');
-			// sc.helpers.dump(this.data[section_name].items);
-
 			// @todo check length of data.items, and remove oldest extras if necessary
 			/*
 				@todo
@@ -5527,8 +7772,7 @@ SpazTwit.prototype._processTimeline = function(section_name, ret_items, finished
 				Fire off the new section data event
 			*/
 			if (!processing_opts.combined) {
-				// jQuery().trigger(finished_event, [this.data[section_name].newitems]);
-				this.triggerEvent(finished_event, this.data[section_name].newitems);
+				this.triggerEvent(finished_event, this.data[section_name].items);
 			} else {
 				this.combined_finished[section_name] = true;
 				sc.helpers.dump(&quot;this.combined_finished[&quot;+section_name+&quot;]:&quot;+this.combined_finished[section_name]);
@@ -5537,22 +7781,10 @@ SpazTwit.prototype._processTimeline = function(section_name, ret_items, finished
 
 
 			/*
-				do combined stuff
+				add on to newitems array for combined section
 			*/
 			this.data[SPAZCORE_SECTION_COMBINED].newitems = this.data[SPAZCORE_SECTION_COMBINED].newitems.concat(this.data[section_name].newitems);
 			
-			// sort these items -- the timelines can be out of order when combined
-			this.data[SPAZCORE_SECTION_COMBINED].newitems = this.data[SPAZCORE_SECTION_COMBINED].newitems.sort(this._sortItemsByDateAsc)
-			
-			this.data[SPAZCORE_SECTION_COMBINED].items = this.data[SPAZCORE_SECTION_COMBINED].items.concat(this.data[SPAZCORE_SECTION_COMBINED].newitems);
-			this.data[SPAZCORE_SECTION_COMBINED].items = this.removeDuplicates(this.data[SPAZCORE_SECTION_COMBINED].items);
-			this.data[SPAZCORE_SECTION_COMBINED].items = this.removeExtraElements(this.data[SPAZCORE_SECTION_COMBINED].items, this.data[SPAZCORE_SECTION_COMBINED].max);
-
-			// sc.helpers.dump('Combined new items ('+this.data[SPAZCORE_SECTION_COMBINED].newitems.length+'):');
-			// sc.helpers.dump(this.data[SPAZCORE_SECTION_COMBINED].newitems);
-			// sc.helpers.dump('Combined all items ('+this.data[SPAZCORE_SECTION_COMBINED].items.length+'):');
-			// sc.helpers.dump(this.data[SPAZCORE_SECTION_COMBINED].items);
-			
 		}
 
 
@@ -5571,12 +7803,22 @@ SpazTwit.prototype._processTimeline = function(section_name, ret_items, finished
 	*/
 	if (this.combinedTimelineFinished()) {
 		
+		/*
+			we do this stuff here to avoid processing repeatedly
+		*/
+		
+		this._addToSectionItems(SPAZCORE_SECTION_COMBINED, this.data[SPAZCORE_SECTION_COMBINED].newitems, this._sortItemsByDateAsc);
+		
+		// sort these items -- the timelines can be out of order when combined
+
+		sc.helpers.dump('Removing duplicates in '+SPAZCORE_SECTION_COMBINED+' newitems');
+		
+		this.data[SPAZCORE_SECTION_COMBINED].newitems = this._cleanupItemArray(this.data[SPAZCORE_SECTION_COMBINED].newitems, this.data[SPAZCORE_SECTION_COMBINED].max, this._sortItemsByDateAsc);
+		
 		if (this.combinedTimelineHasErrors()) {
-			// jQuery().trigger('error_combined_timeline_data', [this.combined_errors]);
 			this.triggerEvent('error_combined_timeline_data', this.combined_errors);
 		}
 		
-		// jQuery().trigger('new_combined_timeline_data', [this.data[SPAZCORE_SECTION_COMBINED].newitems]);
 		this.triggerEvent('new_combined_timeline_data', this.data[SPAZCORE_SECTION_COMBINED].newitems);
 		this.data[SPAZCORE_SECTION_COMBINED].newitems = []; // reset combined.newitems
 		this.initializeCombinedTracker();
@@ -5585,10 +7827,43 @@ SpazTwit.prototype._processTimeline = function(section_name, ret_items, finished
 
 
 /**
+ * Adds an array of items to the .items property of the appropriate section, then
+ * removes dupes, extras, and optionally sorts the section items
+ * @param {string} section_name
+ * @param {array}  arr  an array of items
+ * @param {function}  sortfunc - optional 
+ */
+SpazTwit.prototype._addToSectionItems = function(section_name, arr, sortfunc) {
+	// concat new items onto data.items array
+	this.data[section_name].items = this.data[section_name].items.concat(arr);
+
+	this._cleanupItemArray(this.data[section_name].items, this.data[section_name].max, sortfunc);
+}
+
+/**
+ * Sorts (optionally), removes dupes, and removes extra items from a given
+ * array of section items
+ * 
+ * @param {array} arr
+ * @param {max} integer
+ * @param {func} sortfunc - optional
+ * 
+ * @return {array} 
+ */
+SpazTwit.prototype._cleanupItemArray = function(arr, max, sortfunc) {
+	if (sortfunc) {
+		arr = arr.sort(sortfunc);
+	}
+	arr = this.removeDuplicates(arr);
+	arr = this.removeExtraElements(arr, max);
+	return arr;
+};
+
+/**
  * This modifies a Twitter post, adding some properties. All new properties are
  * prepended with &quot;SC_&quot;
  * 
- * this executes within the jQuery.each scope, so this == the item 
+ * this executes within the jQuery.each scope, so this === the item 
  */
 SpazTwit.prototype._processItem = function(item, section_name) {
 	
@@ -5601,7 +7876,7 @@ SpazTwit.prototype._processItem = function(item, section_name) {
 		is reply? Then add .SC_is_reply
 	*/
 	if ( (item.in_reply_to_screen_name &amp;&amp; item.SC_user_received_by) ) {
-		if (item.in_reply_to_screen_name.toLowerCase() == item.SC_user_received_by.toLowerCase() ) {
+		if (item.in_reply_to_screen_name.toLowerCase() === item.SC_user_received_by.toLowerCase() ) {
 			item.SC_is_reply = true;
 		}
 	}
@@ -5670,15 +7945,18 @@ SpazTwit.prototype._processItem = function(item, section_name) {
  * @private
  */
 SpazTwit.prototype._callMethod = function(opts) {
+	
+	var method;
+	
 	/*
 		for closure references
 	*/
 	var stwit = this;
 	
 	if (opts.method) {
-		var method = opts.method;
+		method = opts.method;
 	} else {
-		var method = 'POST'
+		method = 'POST';
 	}
 	
 	var xhr = jQuery.ajax({
@@ -5724,7 +8002,7 @@ SpazTwit.prototype._callMethod = function(opts) {
 					ensures that &quot;this&quot; inside the callback refers to our
 					SpazTwit object, and not the jQuery.Ajax object
 				*/
-				opts.process_callback.call(stwit, data, opts.success_event_type)
+				opts.process_callback.call(stwit, data, opts.success_event_type);
 			} else {
 				// jQuery().trigger(opts.success_event_type, [data]);
 				stwit.triggerEvent(opts.success_event_type, data);
@@ -5760,7 +8038,7 @@ SpazTwit.prototype.getUser = function(user_id) {
 		'success_event_type':'get_user_succeeded',
 		'failure_event_type':'get_user_failed',
 		'method':'GET'
-	}
+	};
 
 	/*
 		Perform a request and get true or false back
@@ -5785,8 +8063,8 @@ SpazTwit.prototype.addFriend = function(user_id) {
 		'password':this.password,
 		'success_event_type':'create_friendship_succeeded',
 		'failure_event_type':'create_friendship_failed',
-		'data':data,
-	}
+		'data':data
+	};
 
 	/*
 		Perform a request and get true or false back
@@ -5805,8 +8083,8 @@ SpazTwit.prototype.removeFriend = function(user_id) {
 		'password':this.password,
 		'success_event_type':'destroy_friendship_succeeded',
 		'failure_event_type':'destroy_friendship_failed',
-		'data':data,
-	}
+		'data':data
+	};
 
 	/*
 		Perform a request and get true or false back
@@ -5827,8 +8105,8 @@ SpazTwit.prototype.block = function(user_id) {
 		'password':this.password,
 		'success_event_type':'create_block_succeeded',
 		'failure_event_type':'create_block_failed',
-		'data':data,
-	}
+		'data':data
+	};
 
 	/*
 		Perform a request and get true or false back
@@ -5847,8 +8125,8 @@ SpazTwit.prototype.unblock = function(user_id) {
 		'password':this.password,
 		'success_event_type':'destroy_block_succeeded',
 		'failure_event_type':'destroy_block_failed',
-		'data':data,
-	}
+		'data':data
+	};
 
 	/*
 		Perform a request and get true or false back
@@ -5887,7 +8165,7 @@ SpazTwit.prototype.update = function(status, source, in_reply_to_status_id) {
 		'process_callback': this._processUpdateReturn,
 		'success_event_type':'update_succeeded',
 		'failure_event_type':'update_failed'
-	}
+	};
 
 	/*
 		Perform a request and get true or false back
@@ -5924,7 +8202,7 @@ SpazTwit.prototype.getOne = function(id) {
 		'success_event_type':'get_one_status_succeeded',
 		'failure_event_type':'get_one_status_failed',
 		'method':'GET'
-	}
+	};
 
 	/*
 		Perform a request and get true or false back
@@ -5957,8 +8235,8 @@ SpazTwit.prototype.favorite = function(id) {
 		'password':this.password,
 		'success_event_type':'create_favorite_succeeded',
 		'failure_event_type':'create_favorite_failed',
-		'data':data,
-	}
+		'data':data
+	};
 
 	/*
 		Perform a request and get true or false back
@@ -5979,7 +8257,7 @@ SpazTwit.prototype.unfavorite = function(id) {
 		'success_event_type':'destroy_favorite_succeeded',
 		'failure_event_type':'destroy_favorite_failed',
 		'data':data
-	}
+	};
 
 	/*
 		Perform a request and get true or false back
@@ -6005,7 +8283,7 @@ SpazTwit.prototype.updateLocation = function(location_str) {
 		'success_event_type':'update_location_succeeded',
 		'failure_event_type':'update_location_failed',
 		'data':data
-	}
+	};
 
 	/*
 		Perform a request and get true or false back
@@ -6030,11 +8308,11 @@ SpazTwit.prototype.test = function() {};
  */
 SpazTwit.prototype._postProcessURL = function(url) {
 	
-	if (typeof Mojo != &quot;undefined&quot;) { // we're in webOS		
+	if (typeof Mojo !== &quot;undefined&quot;) { // we're in webOS		
 		if (use_palmhost_proxy) { // we are not on an emu or device, so proxy calls
 			var re = /https?:\/\/.[^\/:]*(?::[0-9]+)?/;
 			var match = url.match(re);
-			if (match &amp;&amp; match[0] != Mojo.hostingPrefix) {
+			if (match &amp;&amp; match[0] !== Mojo.hostingPrefix) {
 				url = &quot;/proxy?url=&quot; + encodeURIComponent(url);
 			}
 			return url;		
@@ -6045,7 +8323,7 @@ SpazTwit.prototype._postProcessURL = function(url) {
 	} else {
 		return url;
 	}
-}
+};
 
 
 /**
@@ -6059,7 +8337,7 @@ SpazTwit.prototype._postProcessURL = function(url) {
  */
 SpazTwit.prototype._sortItemsAscending = function(a,b) {
 	return (a.id - b.id);
-}
+};
 
 /**
  * sorting function for an array of tweets. Desc by ID.
@@ -6072,7 +8350,7 @@ SpazTwit.prototype._sortItemsAscending = function(a,b) {
  */
 SpazTwit.prototype._sortItemsDescending = function(a,b) {
 	return (b.id - a.id);
-}
+};
 
 
 
@@ -6091,7 +8369,7 @@ SpazTwit.prototype._sortItemsByDateAsc = function(a,b) {
 	var time_a = sc.helpers.httpTimeToInt(a.created_at);
 	var time_b = sc.helpers.httpTimeToInt(b.created_at);
 	return (time_a - time_b);
-}
+};
 
 /**
  * sorting function for an array of tweets. Desc by date.
@@ -6108,7 +8386,7 @@ SpazTwit.prototype._sortItemsByDateDesc = function(a,b) {
 	var time_a = sc.helpers.httpTimeToInt(a.created_at);
 	var time_b = sc.helpers.httpTimeToInt(b.created_at);
 	return (time_b - time_a);
-}
+};
 
 
 /**
@@ -6119,29 +8397,29 @@ SpazTwit.prototype._sortItemsByDateDesc = function(a,b) {
  * @param {array} array an array of Twitter message objects
  * @return {array}
  */
-SpazTwit.prototype.removeDuplicates = function(array) {
+SpazTwit.prototype.removeDuplicates = function(arr) {
 	
-	var ret = [], done = {};
+	var ret = [], done = {}, length = arr.length;
 
 	try {
-
-		for ( var i = 0, length = array.length; i &lt; length; i++ ) {
-			var id = array[i].id;
-
+		for ( var i = 0; i &lt; length; i++ ) {
+			var id = arr[i].id;
+			
 			if ( !done[ id ] ) {
 				done[ id ] = true;
-				ret.push( array[ i ] );
+				ret.push( arr[ i ] );
+			} else {
+				sc.helpers.dump(&quot;removing dupe &quot; + arr[i].id + ', &quot;'+arr[i].text+'&quot;');
 			}
 		}
 
 	} catch( e ) {
 		sc.helpers.dump(e.name + &quot;:&quot; + e.message);
-		ret = array;
+		ret = arr;
 	}
-
 	return ret;
 	
-}
+};
 
 
 /**
@@ -6169,7 +8447,7 @@ SpazTwit.prototype.removeExtraElements = function(items, max, remove_from_top) {
 	}
 	
 	return items;
-}
+};
 
 
 /**
@@ -6185,7 +8463,7 @@ SpazTwit.prototype.getSavedSearches = function() {
 		'success_event_type':'new_saved_searches_data',
 		'failure_event_type':'error_saved_searches_data',
 		'method':'GET'
-	}
+	};
 
 	/*
 		Perform a request and get true or false back
@@ -6245,9 +8523,8 @@ SpazTwit.prototype.removeSavedSearch = function(search_id) {
 
 
 SpazTwit.prototype.triggerEvent = function(type, data) {
-	
 	var target = this.opts.event_target || document;
-	var data   = data || null;
+	data   = data || null;
 	
 	sc.helpers.dump('TriggerEvent: target:'+target.toString()+ ' type:'+type+ ' data:'+data);
 	
@@ -6265,8 +8542,8 @@ SpazTwit.prototype.triggerEvent = function(type, data) {
  * shortcut for SpazTwit if the SpazCore libraries are being used
  * 
  */
-if (SpazTwit) {
-	scTwit = SpazTwit;
+if (sc) {
+	var scTwit = SpazTwit;
 }
 
 
@@ -6395,7 +8672,20 @@ if (SpazTwit) {
 }
 * 
 * 
-*//**
+*//*jslint 
+browser: true,
+nomen: false,
+debug: true,
+forin: true,
+regexp: false,
+undef: true,
+white: false,
+onevar: false 
+ */
+var sc, Mojo, use_palmhost_proxy;
+ 
+ 
+/**
  * This should contain definitions for all methods from helpers/sys.js tagged @platformsub 
  */
 
@@ -6404,10 +8694,12 @@ if (SpazTwit) {
  * dump an object's first level to console
  */
 sc.helpers.dump = function(obj) {
+	var dumper;
+	
 	if (sc.helpers.isString(obj) || sc.helpers.isNumber(obj) || !obj) {
-		var dumper = Mojo.Log.info;
+		dumper = Mojo.Log.info;
 	} else {
-		var dumper = Mojo.Log.logProperties;
+		dumper = Mojo.Log.logProperties;
 	}
 
 	if (sc.helpers.isString(obj)) {
@@ -6419,26 +8711,22 @@ sc.helpers.dump = function(obj) {
 	} else if (obj === null) {
 		dumper('NULL');
 	} else { // this is an object. we hope.
-		if (dump) { // we really prefer to use dump if it is available
-			dumper(obj);
-		} else {
-			dumper(obj)
-		}
-
+		dumper(obj);
 	}
 
-}
+};
 
 
 /**
  * this is specific to webOS, for retrieving the proper URL prefixed with the Palm Host proxy if needed 
+ * @param {string} url
  */
 sc.helpers.getMojoURL = function(url) {
-	if (typeof Mojo != &quot;undefined&quot;) { // we're in webOS		
+	if (typeof Mojo !== &quot;undefined&quot;) { // we're in webOS		
 		if (use_palmhost_proxy) { // we are not on an emu or device, so proxy calls
 			var re = /https?:\/\/.[^\/:]*(?::[0-9]+)?/;
 			var match = url.match(re);
-			if (match &amp;&amp; match[0] != Mojo.hostingPrefix) {
+			if (match &amp;&amp; match[0] !== Mojo.hostingPrefix) {
 				url = &quot;/proxy?url=&quot; + encodeURIComponent(url);
 			}
 			return url;		</diff>
      <filename>spazcore/spazcore-webos.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>12a637ca1cd4b5ed18f635ad2f23415b026febc5</id>
    </parent>
  </parents>
  <author>
    <name>Ed Finkler</name>
    <email>funkatron@gmail.com</email>
  </author>
  <url>http://github.com/funkatron/spaz-webos/commit/163faec71c286544b06352f7a5644ed458c0924f</url>
  <id>163faec71c286544b06352f7a5644ed458c0924f</id>
  <committed-date>2009-08-18T11:13:17-07:00</committed-date>
  <authored-date>2009-08-18T11:13:17-07:00</authored-date>
  <message>- big refactor of User identification; user accounts now all have a .userid hash which is used to uniquely identify
- temp runtime cache now used; much faster than db-stored caching of timelines
- no cached timelines between starts. This should be fixed.</message>
  <tree>f6a75fc2c65038a5324c98d32a42e768eff079b6</tree>
  <committer>
    <name>Ed Finkler</name>
    <email>funkatron@gmail.com</email>
  </committer>
</commit>
