(function($){

 	$.fn.extend({ 
    	
    	/**
		 * Placeholder Plugin
		 * Enables the placeholder functionality for all browsers that don't support that feature yet
		 * The // if clause needs to be executed before the browser
		 * 
		 * @author Erik Frister <ef@aijko.de>
		 */
 		aiPlaceholder: function() {
    		
    		return this.each(function() {
    			
    			var $this = $(this);
    			
    			if ($this.val() == '' && $this.attr('placeholder') != '') {
    				
    				$this
    					.val($this.attr('placeholder'))
    					.addClass('ai-placeholder');
    				
    				$this.bind('focus', function(){
    					if ($this.val() == $this.attr('placeholder')) 
    						$this.val('');
    					
    					$this.removeClass('ai-placeholder');
    				});
    				
    				$this.bind('blur', function(){
    					if ($this.val() == '') {
    						$this.val($this.attr('placeholder'));
    						$this.addClass('ai-placeholder');
    					}
    				});
    			}
    			
				
    		});
    	}
	});
	
})(jQuery);



window.log = function(){
  log.history = log.history || []; 
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};

(function(doc){
  var write = doc.write;
  doc.write = function(q){ 
    log('document.write(): ',arguments); 
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
  };
})(document);



