$(function(){	
	    $("div.portfolio div.port-item, div.sidebar-block:not(#alltabs div.sidebar-block), div.blog-post-content div.entry").each(
        function(i) {
				w = $(this).width();
				h = $(this).height();
            $(this).wrap('<span class="border" style="width: '+ w +'px;height: '+ h +'px;"></span>');

	
        }
		);
		
		$('span.border').after('<div class = "clear"></div>')
	

	$('#footer li a').hover(function(){
		link = $(this).attr('href').split('/');
		h = $(this).html();
		$(this).html(h + '<span class = "show">' + link[2] + '</span>').css('height', 'auto').find('.show').css('display','none').fadeIn('fast')
	}, function(){
		$(this).find('span.show').remove();
	})
	
	$('a.top').click(function(){
		$.scrollTo($('#top'), 800, {offset:-50});
	});
	
	$('h1.logo').hover(function(){
		$(this).css('opacity', 0.5);
	},function(){
		$(this).css('opacity', 1.0);
	});
	
	$('a.lsm').hover(function(){
		$('<div class = "lsm-over">Click to return home. RD is powered by Drupal, XHTML, CSS and good quality coffee</div>').insertAfter(this).css('display', 'none').fadeIn('fast');
	}, function(){
		$(this).parent().find('.lsm-over').remove();
	});	
	
	$('#search-block-form input').focus(function(){
		if($(this).val() == 'Search'){
			$(this).val('');
		} 
	});
	$('#search-block-form input').blur(function(){
			if($(this).val() == ''){
				$(this).val('Search');
			} 
	});
	$('.webform-client-form input, .webform-client-form textarea').focus(function(){
		$(this).addClass('cfocus');
	});
	$('.webform-client-form input, .webform-client-form textarea').blur(function(){
		$(this).removeClass('cfocus');
	});
	$('.webform-client-form input.form-submit').hover(function(){
		$(this).addClass('cfocus');
	},function(){
		$(this).removeClass('cfocus');
	});
	
	
	// if($.browser.msie == false){
		// DD_roundies.addRule('div.blog-previews ul, div.socnet-pipes ul, span.border', '15px', true);
		// DD_roundies.addRule('h1.logo, div.wrapper-portfolio div.blog-post-content div.entry div.content, div.port-item, .sidebar-block', '10px', true);
		// DD_roundies.addRule('div.socnet-pipes li, div.blog-previews li a, a.top', '5px', true);
		// DD_roundies.addRule('.sidebar-block h2, div.blog-post-date, div.title', '10px 10px 0px 0px', true);
		// DD_roundies.addRule('div.port-meta, div.coms div.sidebar-block, div.cats div.sidebar-block, div.recent div.sidebar-block, div.tags div.sidebar-block, div.dark, div.blog-post div.entry, div.blog-post div.content', '0px 0px 10px 10px', true);
	// }
	
});
