
// 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);
  if(this.console) {
    arguments.callee = arguments.callee.caller;
    var newarr = [].slice.call(arguments);
    (typeof console.log === 'object' ? log.apply.call(console.log, console, newarr) : console.log.apply(console, newarr));
  }
};

// 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,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();){b[a]=b[a]||c}})((function(){try
{console.log();return window.console;}catch(err){return window.console={};}})());


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

( function( jQuery ) {
 
    // plugin definition
    jQuery.fn.overlabel = function( options ) {
		
        // build main options before element iteration
        var opts = jQuery.extend( {}, jQuery.fn.overlabel.defaults, options );
 
        var selection = this.filter( 'label[for]' ).map( function() {
 
            var label = jQuery( this );
            var id = label.attr( 'for' );
            var field = document.getElementById( id );
 
            if ( !field ) return;
			
            // build element specific options
            var o = jQuery.meta ? jQuery.extend( {}, opts, label.data() ) : opts;
 
            label.addClass( o.label_class );
 
            var hide_label = function() { this.value == '' ? label.css( o.fade_css ) :  label.css( o.hide_css ) };
            var show_label = function() { this.value || label.css( o.show_css ) };
 
            jQuery( field )
                 .parent().addClass( o.wrapper_class ).end()
                 .focus( hide_label ).keyup( hide_label ).blur( show_label ).each( hide_label ).each( show_label );
 
            return this;
 
        } );
 
        return opts.filter ? selection : selection.end();
    };
	
	//jQuery.fn.hoverTransition = function( attributes , speed ) {
	//  
	//  if ($(this).parent().find(".hoverTransitiom").length > 0) {
	//	return false;
	//  }
	//  
	//  console.log('hover');
	//  
	//  if (speed === undefined) {
	//	speed = 400;
	//  }
	//  
	//  var el = this;
	//  var pos = $(el).position();
	//  
	//  $(el).css("z-index: 1");
	//  var elc = $(el).clone().css({display: 'none', position:"absolute",top: pos.top +"px",left: pos.left +"px","z-index":2}).attr(attributes).addClass("hoverTransition");
	//  $(el).after(elc);
	//  $(elc).fadeIn(speed);
	//  
	//  $(elc).mouseout(function() {
	//	$(elc).fadeOut(speed,function() {
	//	  $(elc).remove();
	//	});
	//  });
	//  
	//};
 
    // publicly accessible defaults


 
} )( jQuery );

