$(document).ready(function() {
	
	$(' #body-wrapper ').show();
	
	if ( $(window).width() < 920 ) {
		$(' body ').width("920px");
	}
	
	// Help Text
	function showHelpText() {
		$(' body ').prepend(" <span id='help-box'></span> ");
		$(' #help-box ').css({ position: "absolute", padding: "5px 10px", display: "inline-block", background: "#000", color: "#FFF", font: "13px/1 Tahoma, Arial" });
		$(' #help-box ').hide();
		
		$(' body ').html( $(' body ').html().replace(/class="help" title=/g, "class='help' helpText=") );
		
		$(' .help ').hover(function(e) {
		$(' #help-box ').fadeIn("slow");
		$(' #help-box ').css({ top: e.pageY+10 , left: e.pageX+25 });
		var helpBoxText = $(this).attr("helpText");
		$(' #help-box ').text( helpBoxText);
	},
		function() {
			$(' #help-box ').fadeOut();
		});
	}
	
	
	function floatingMenu() {
		if ( $(document).height() > $(window).height() ) {
			var windowHeight = $(window).height() - 130;
			
			$(' body ').prepend(" <span id='top' title='goto Top'></span> ");
			$(' #top ').css({ position: "absolute", top: $(document).scrollTop() + windowHeight + 65, right: "10px", display: "block", width: "50px", height: "56px", background: "url(images/takeTop.png) top no-repeat", cursor: "pointer" });
			$(' #top ').fadeTo(0, "0.6");
			
			
			$(document).scroll(function() {
				if ( $(window).width() < 920 ) {
					$(' #top ').animate({ top:  $(document).scrollTop() + windowHeight + 65, right: "-" + $(document).scrollLeft() },{queue:  false, duration: 1000});
				}
				
				else {
					$(' #top ').animate({ top:  $(document).scrollTop() + windowHeight + 65 },{queue:  false, duration: 1000});
				}
			});
			
			$(' #top ').hover(function() {
				$(this).fadeTo(500, "1");
			},
				function() {
					$(this).fadeTo(500, "0.6");
				});
			
			$(' #top ').click(function() {
				$(' body ').animate({ scrollTop: "0"}, {queue: false, duration: 1000});
			});
		}
	}
	
	if ($.browser.msie == false) {
		showHelpText();
		floatingMenu();
	}
	
	// navigation bar customization begins
	
	var hiddenFileName = $(' #current-file-name ').val();
	
	if ( hiddenFileName == "profile" ) {
		$(' #header-menu li:nth-child(2) ').attr({ id: "current" }).siblings("li").attr({ id: "" });
	}
	
	if ( hiddenFileName == "portfolio" ) {
		$(' #header-menu li:nth-child(3) ').attr({ id: "current" }).siblings("li").attr({ id: "" });
	}
	
	if ( hiddenFileName == "contact" ) {
		$(' #header-menu li:nth-child(4) ').attr({ id: "current" }).siblings("li").attr({ id: "" });
	}
	
	if ( hiddenFileName == "iconnect" ) {
		$(' #header-menu li:nth-child(5) ').attr({ id: "current" }).siblings("li").attr({ id: "" });
	}
	
	if ( hiddenFileName == "non-profit" ) {
		$(' #header-menu li:nth-child(6) ').attr({ id: "current" }).siblings("li").attr({ id: "" });
	}
	
	$(' #header-menu li:last ').attr({ id: "gaq" });
	
	// navigation bar customization ends
	
	// input control
	$(' input:text.default-value ').focus(function() {
		if ( $(this).val() == "write the text in the above image .." ) {
			$(this).val("");
		}
		
	});
	
});
