// -- string trim function
String.prototype.trim = function () {
	return this.replace(/[\s\0\n\t\r\f\v]+/g," ").replace(/(^\s*|\s*$)/g,"");
};

// -- MSIE 6.0 & 7.0

var ie7 = /MSIE 7.0/g.test(navigator.userAgent),
ie6 = /MSIE 6.0/g.test(navigator.userAgent),
classAttr = (ie7 || ie6) ? "className":"class";
if(document.documentMode && document.documentMode == 7) {
    classAttr = "className";
};

// -- placeholder attributes for those without

(function(placeholder) {
	if(!placeholder) {
		$(document.forms).find('input').each(function() {
			var text = $(this).attr("placeholder");
			if(!!text && text != "" && this.value == "") {
				this.value = text;
				this.onfocus = function(){
					if(this.value == text) { this.value = '' };
				};
				this.onblur = function(){
					if(this.value == '') { this.value = text };
				};
			};
		});
	};
})((Modernizr && Modernizr.input.placeholder) || false);
