$(function(){

	if($.browser.msie && $.browser.version < 7) {
		// Con IE6 il bordo destro č disallineato
		var w = $('.roundCorner4').width() - 2;
		$('.roundCorner4').wrapInner('<div style=\'width:'+w+'px;\'><div style=\'margin:1px 0 1px 1px;\'></div></div>');
		w = $('.roundCorner6').width() - 6;
		$('.roundCorner6').wrapInner('<div style=\'width:'+w+'px;\'><div style=\'margin:3px 0 3px 3px;\'></div></div>');
	} else {
		// IE fix per curvycorners: http://seanmccullough.ca/blog/?p=15
		$('.roundCorner4').css('padding', '0 1px').corner({
			tl: { radius: 4 },
			tr: { radius: 4 },
			bl: { radius: 4 },
			br: { radius: 4 },
			antiAlias: true,
			autoPad: true
		});
		$('.roundCorner6').css('padding', '4px').corner({
			tl: { radius: 6 },
			tr: { radius: 6 },
			bl: { radius: 6 },
			br: { radius: 6 },
			antiAlias: true,
			autoPad: true
		});
	}
/*
	var oldBg = $('.admin-message').eq(0).css('backgroundColor');
	$('.admin-message').animate({backgroundColor:'#2d2d2d'}, 1000)
		.animate({backgroundColor:oldBg}, 1000)
		.animate({backgroundColor:'#2d2d2d'}, 1000)
		.animate({backgroundColor:oldBg}, 1000);
*/
	$('.clickExpand').css('cursor', 'pointer')
		.click(function(){
		    // Lo .slideToggle() non funziona correttamente in IE8
			if($.browser.msie) {
				$(this).children('div').toggle($(this).children('div').css('display') == 'none');
			} else {
				$(this).children('div').slideToggle('slow');
			}
		})
		.children('div').hide();

	$('.infobox *,.infobox2 *,.cite *').replaceText(/Faerun/gi, 'Faerūn');

});


/*
 * jQuery replaceText - v1.1 - 11/21/2009
 * http://benalman.com/projects/jquery-replacetext-plugin/
 *
 * Copyright (c) 2009 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function($){$.fn.replaceText=function(b,a,c){return this.each(function(){var f=this.firstChild,g,e,d=[];if(f){do{if(f.nodeType===3){g=f.nodeValue;e=g.replace(b,a);if(e!==g){if(!c&&/</.test(e)){$(f).before(e);d.push(f)}else{f.nodeValue=e}}}}while(f=f.nextSibling)}d.length&&$(d).remove()})}})(jQuery);

