// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

Object.extend(String.prototype, {

upcase: function() {
return this.toUpperCase();
},

downcase: function() {
return this.toLowerCase();
},

strip: function() {
return this.replace(/^\s+/, '').replace(/\s+$/, '');
},

toInteger: function() {
return parseInt(this);
},

toSlug: function() {
return this.strip().downcase().replace(/[^-a-z0-9~\s\.:;+=_]/g, '').replace(/[\s\.:;=+]+/g, '-');
}

});

function swapPhoto(path) {
	Element.update('gallery_photo_large','<img src="' + path + '" />');
}
