$(function(){

	if(typeof console === "undefined") {
		console = { log: function() { } };
	}
	
	var $ = jQuery;
	
	var SHARE	=	{

		placeholders: function() {
			var showPlaceholder = function(input) {    
				if ('placeholder' in document.createElement('input')) return;
				var placeholderText = input.attr("placeholder");
				if ( input.val() === "" || input.val() === placeholderText ) {
					input.val(placeholderText);
				}
			};	
			$("input[type=text][placeholder]").each(function() {
				showPlaceholder($(this));
			}).blur(function() {
				showPlaceholder($(this));
			}).focus(function() {
				var input = $(this);
				if (input.val() === input.attr("placeholder")) {
					input.val("");
				}
			});
		},

		ui: function(){
			// DROP-CAPS
			if ($("p.dropcap").length > 0) {
				if ($.browser.msie && $.browser.version.substr(0,1)<8) {
				}
				else {
					p1= $('p.dropcap:first');
					console.log(p1[0].textContent);
					p= p1[0].textContent.replace(/^\s+/, '').replace(/^"/, '').replace(/^'/, '');
					c= p.charAt(0);
					p1.html('<span class="dropcap">' 
						+ c 
						+ '</span>' 
						+ p.substring(1, p.length));

					
				} 
			}
			
			// NAV
			$nav = $('.closing .last').html();
			$('.details').append('<p class="last">'+$nav+'</p>');
			
			// CLEARING FLOATS
			$('.cleared').append('<span class="clear"></span>');
		},

		init: function(){
			SHARE.placeholders();
			SHARE.ui();
		}
			
	};
	
	SHARE.init();

});
