/* PLUGIN DIRECTORY
What you can find in this file [listed in order they appear]

    1.) LOG - paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
    2.) Cross-Browser HTML5 Placeholder Text - webdesignerwall.com/tutorials/cross-browser-html5-placeholder-text/
    3.) Plguin Example - pluginurl.com

    NOTE: Always include comments for the start and end of a plugin:
    // 2.) Plugin name
    // End Plugin 2

*/



// 1) LOG
// usage: log('inside coolFunc', this, arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  arguments.callee = arguments.callee.caller;  
  if(this.console) console.log( Array.prototype.slice.call(arguments) );
};
// make it safe to use console.log always
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});
//End Plugin 1


// 2.) Cross-Browser HTML5 Placeholder Text
// Allows for the use of the placeholder attribute in none supporting browsers
// useage: <input type="text" placeholder="username" />
// webdesignerwall.com/tutorials/cross-browser-html5-placeholder-text/
$(document).ready(function(){
  if(!Modernizr.input.placeholder){
	$('[placeholder]').focus(function() {
	  var input = $(this);
	  if (input.val() == input.attr('placeholder')) {
		input.val('');
		input.removeClass('placeholder');
	  }
	}).blur(function() {
	  var input = $(this);
	  if (input.val() == '' || input.val() == input.attr('placeholder')) {
		input.addClass('placeholder');
		input.val(input.attr('placeholder'));
	  }
	}).blur();
	$('[placeholder]').parents('form').submit(function() {
	  $(this).find('[placeholder]').each(function() {
		var input = $(this);
		if (input.val() == input.attr('placeholder')) {
		  input.val('');
		}
	  })
	});
  }
});
// End Plugin 2



// place any jQuery/helper plugins in here, instead of separate, slower script files.

