 
  
$(document).ready(function(){

    $('table:has(caption)').each(function(){
    	var attr = $(this).attr('align');
    	if (attr == 'right') {
    		$(this).css('marginLeft', '15px');
    	} else if (attr == 'left') {
    		$(this).css('marginRight', '15px');
    	}
    });

    for (var i=100; i<3000; i=i*1.5) {
        setTimeout("$('#edit-body___Frame, #edit-teaser___Frame').css({height:'550px'});", i);
    }

        // make all images in the article block teaser (that are not already linked to something)
        // link to the article node
    $('.block.articleWrapper, div.promo-article').each(function(){
        var url = $('h1 a:eq(0)', this).attr('href');  // liz uses h1's
        url = (url) ? url : $('h2 a:eq(0)', this).attr('href'); // nufgen uses h2's
        var imgs = $('img', this);
        if (imgs.length) {
	        imgs.each(function(){
	            if (! $(this).parents('a').length) {
	                $(this).wrap('<a href="'+url+'"></a>');
	            }
	        });
        } else {
        	$(this).addClass('noImage');
        }
    });

    $('.content div.comment a').each(function(){
        var orig = $(this).attr('href');
        if (orig.indexOf('#') == -1) {
            $(this).attr('href', orig+'#commentForm' );
        }
    });
    $('.articleWrapper .comment button[rel^="/comment"]').each(function(){
        var orig = $(this).attr('rel');
        if (orig.indexOf('#') == -1) {
            $(this).attr('rel', orig+'#commentForm' );
        }
    });
    
    
    $('.pager').prepend('<span class="intro">Pages:</span>');

    // nufgen_jnice_links( $('a.button, div.comment .links a, .articleWrapper div.comment a, a.feature-readmore, .posted-in a.read-more') );

    $('.pager').wrap('<div class="pagerWrap"></div>');
    $('.pagerWrap').append('<div class="clear"></div>');
            
    
    $("#center a[@href^=http]").not("[@href*='"+window.location.host+"']").addClass('extLink').attr('target','_blank');
    
        // remove empty paragraphs
    $('.promo-article p, .articleWrapper p').each(function(){
    	var t = this.innerHTML.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
    	//alert(this.innerHTML);
    	if (t == "" || t == "&nbsp;") {
    		$(this).remove();
    	}
    });
    
});