function replaceFonts(){

	// Finds the colour of the selected element, and returns the hexidecimal value
	function getHexColour(selector) {

		var rgbColourString = $(selector).css("color");

		if (rgbColourString != undefined) {

			if(rgbColourString.indexOf("#") === -1) {
				var rgbColourArray = rgbColourString.replace("rgb(","").replace(")","").split(", ");
				var hexColourArrayNumbers = [];

				for (var i=0; i<3; i++) {
					var thisHex = Number(rgbColourArray[i]).toString(16)
					if (thisHex.length === 1) {	thisHex = "0" + thisHex; }
					hexColourArrayNumbers.push( thisHex );
				}

				var hexValue = "#" + hexColourArrayNumbers.join("");

				return hexValue;
			} else {
				return rgbColourString;
			}
		} 
	}


	// Find the text alignment 
	function getTextAlignment(selector) {
		var alignment = $(selector).css("text-align");
		if (alignment != undefined) {
			return $(selector).css("text-align");
		} else {
			return "left";
		}
	}





	// Perform SIFR replacements (please note the end of assignments include insertion of text-alignment)
	if(typeof sIFR == "function"){

		// h1s
		sIFR.replaceElement(named({sSelector:"#content h1", sFlashSrc:"/images/so_frutiger-light.swf", sColor:getHexColour("#content h1"), sBgColor:"#FFFFFF", nPaddingTop:0, nPaddingBottom:0,sWmode:"transparent",sFlashVars:"textalign="+getTextAlignment("#content h1")}));

		// Home page story titles 
		sIFR.replaceElement(named({sSelector:"div.homepageHeroPanels p.homePageStoryTitle", sFlashSrc:"/images/so_frutiger-light.swf", sColor:getHexColour("div.homepageHeroPanels p.homePageStoryTitle"), sBgColor:"", nPaddingTop:0, nPaddingBottom:0,sWmode:"transparent",sFlashVars:"textalign="+getTextAlignment("div.homepageHeroPanels p.homePageStoryTitle")}));

		// Hub page story titles
		sIFR.replaceElement(named({sSelector:"div.hubHeroPanels div.issueSummary p.issueSummaryHeader strong", sFlashSrc:"/images/so_frutiger-light.swf", sColor:getHexColour("div.hubHeroPanels div.issueSummary p.issueSummaryHeader strong"), sBgColor:"", nPaddingTop:0, nPaddingBottom:0,sWmode:"transparent",sFlashVars:"textalign="+getTextAlignment("div.hubHeroPanels div.issueSummary p.issueSummaryHeader strong")}));
		sIFR.replaceElement(named({sSelector:"div.hubHeroPanels div.heroPanel p.heroPanelHeader strong", sFlashSrc:"/images/so_frutiger-light.swf", sColor:getHexColour("div.hubHeroPanels div.heroPanel p.heroPanelHeader strong"), sBgColor:"", nPaddingTop:0, nPaddingBottom:0,sWmode:"transparent",sFlashVars:"textalign="+getTextAlignment("div.hubHeroPanels div.heroPanel p.heroPanelHeader strong")}));
		
		// h2s
		sIFR.replaceElement(named({sSelector:"div.hubOverviewList h2", sFlashSrc:"/images/so_frutiger-light.swf", sColor:getHexColour("div.hubOverviewList h2"), sBgColor:"#FFFFFF", nPaddingTop:0, nPaddingBottom:0,sWmode:"transparent"}));

	};

};