jQuery.noConflict();

jQuery(function() {
	jQuery( ".top" ).click(function () {
		var middle = jQuery(this).next();
		var topChildren = jQuery(this).children();
		
		if (jQuery(middle).css('display') == 'none') {
			jQuery(".middle").each(function () {
				if(jQuery(this).css('display') == 'block') {
					jQuery(this).stop().hide('blind', 750, function () {
						jQuery(this).prev().children().eq(0).css('display', 'none');
						jQuery(this).prev().children().eq(1).css('display', '');
						jQuery(this).prev().children().eq(3).text('(Click to expand)');
					});
				}				
			});
			jQuery(middle).stop().show('blind', 750);
			jQuery(topChildren).eq(0).css('display', '');
			jQuery(topChildren).eq(1).css('display', 'none');
			jQuery(topChildren).eq(3).text('');
		}
		return false;
	});
	jQuery('.read-more').toggle(
		function () {
			jQuery(this).siblings('.hidden-text').show('blind', 750);
			jQuery(this).siblings('.first-para').children('.first-paraP').children('.first-para-hide').show();
			jQuery(this).siblings('.first-para').children('.first-paraP').children('.dots').hide();
			jQuery(this).text("Hide Text");
			return false;
		},
		function () {
			jQuery(this).siblings('.hidden-text').hide('blind', 750);
			jQuery(this).siblings('.first-para').children('.first-paraP').children('.first-para-hide').hide();
			jQuery(this).siblings('.first-para').children('.first-paraP').children('.dots').show();
			jQuery(this).text("Read More");
			return false;
		}
	);
});

jQuery(document).ready(function () {
	jQuery(".middle").slice(1, jQuery(".middle").size()).css('display', 'none');
	jQuery(".bottom").css('cursor', 'pointer');
	
	var limit = 240;
	jQuery('.first-paraP').each(function () {
		var strLength = jQuery(this).html().length;
		if (strLength > limit) {
			var strTemp = jQuery(this).html().substr(0, limit);
			var newStr = strTemp + '<span class="dots">...</span><span class="first-para-hide" style="display:none;">' + jQuery(this).html().substr(limit, strLength) + '</span>';
			jQuery(this).html(newStr);
		}
	});
	var expand = window.location.hash;
	if (expand) {
		jQuery(expand).children('.right1').children('.hidden-text').show();
		jQuery(expand).children('.right1').children('.first-para').children('.first-paraP').children('.first-para-hide').show();
		jQuery(expand).children('.right1').children('.first-paraP').children('.dots').hide();
	}
});
