Cufon.replace('#sub-content h1');
$(document).ready(function(){
	//$('#sub-content h1').sIFR({ font: 'citybold',path: '/flash', fontSize: 30, width:495 ,height:35, color: '#000029', embedOptions:{wmode:'transparent'} });
	$("a.expand").toggle(function(){
		$(this).parent().addClass("expanded");
		$(this).next("div.expandable").slideDown();
		return false;
	},function(){
		$(this).parent().removeClass("expanded");
		$(this).next("div.expandable").slideUp();
		return false;
	});
	
	
	$("div.expandable a.more").click(function(){
		$(this).parent().next("div.overflow").slideDown();
		$(this).css("display", "none");
		return false;
	});
	
	//colored OL
	$('ol li').wrapInner('<span class="olcontent"></span>');
	$("#sub-content h1").css("visibility", "visible");
	
	$("div.image-caption").each(function(){
		if($(this).hasClass('no-size') == false){
		var $imgChil = $(this).children("img");
		if($imgChil.length == 1){
			var getWidth = $imgChil.width();
			$(this).css("width",getWidth);
			if(getWidth > 330){
				$(this).next("p").css("clear","both");
			}
		}else{
			var totalWidth = 0;
			for(i=0;i<$imgChil.length;i++){
				totalWidth += $(this).children("img").eq(i).width();
			}
			totalWidth += ($imgChil.length * 2);
			$(this).css("width",totalWidth);
			if(totalWidth > 330){
				$(this).next("p").css("clear","both");
			}
		}
		}
	});
	
	$("div.image-caption-fr").each(function(){;
		var $imgChil = $(this).children("img")
		if($imgChil.length == 1){
			var getWidth = $(this).children("img").width();
			$(this).css("width",getWidth);
			if(getWidth > 330){
				$(this).next("p").css("clear","both");
			}
		}else{
			var totalWidth = 0;
			for(i=0;i<$imgChil.length;i++){
				totalWidth += $(this).children("img").eq(i).width();
			}
			totalWidth += ($imgChil.length * 2);
			$(this).css("width",totalWidth);
			if(totalWidth > 330){
				$(this).next("p").css("clear","both");
			}
		}
	});
	
	
});

