
function rgb2hex(rgb) {
     if (!rgb) {
          return '';
     } else if (  rgb.search("rgb") == -1 ) {
          return rgb;
     } else {
          rgb = rgb.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/);
          function hex(x) {
               return ("0" + parseInt(x).toString(16)).slice(-2);
          }
          return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]); 
     }
}

j(document).ready(function() {
//

	if(typeof (sIFR) == "function"){
		sIFR.replaceElement(named({sSelector:".content-start-top h1", sFlashSrc:"fileadmin/sifr_new/sifr.swf", sColor:rgb2hex(j('.content-start-top h1').css('color')), sLinkColor:rgb2hex(j('a').css('color')), sBgColor:"#FFFFFF", sHoverColor:rgb2hex(j('a:hover').css('color')), nPaddingTop:0, nPaddingBottom:0, sFlashVars:"", sWmode: 'transparent'}));
	}
	if(typeof (sIFR) == "function"){
		sIFR.replaceElement(named({sSelector:"h1,h2,h3,h4,h5", sFlashSrc:"fileadmin/sifr_new/sifr.swf", sColor:rgb2hex(j('h1,h2,h3,h4,h5').css('color')), sLinkColor:rgb2hex(j('a').css('color')), sBgColor:"#FFFFFF", sHoverColor:rgb2hex(j('a:hover').css('color')), nPaddingTop:0, nPaddingBottom:0, sFlashVars:"", sWmode: 'transparent'}));
	}


});
/*
if(typeof (sIFR) == "function"){

// This is the preferred "named argument" syntax
	sIFR.replaceElement(named({sSelector:"h1,h2,h3,h4,h5", sFlashSrc:"fileadmin/sifr_new/sifr.swf", sColor:"#355683", sLinkColor:"#1966A9", sBgColor:"#FFFFFF", sHoverColor:"#1966A9", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"", sWmode: 'transparent'}));
	


// This is the older, ordered syntax

	sIFR.replaceElement("", "tradegothic.swf", "#000000", "#000000", "#FFFFFF", "#FFFFFF", 0, 0, 0, 0);
	sIFR.replaceElement("h2", "tradegothic.swf", "#000000", null, null, null, 0, 0, 0, 0);
	sIFR.replaceElement("h4.subhead", "tradegothic.swf", "#660000", null, null, null, 0, 0, 0, 0);
	sIFR.replaceElement("h3.sidebox","tradegothic.swf","#000000", "#000000", "#DCDCDC", "#DCDCDC", 0, 0, 0, 0, null);
	sIFR.replaceElement("h3", "tradegothic.swf", "#000000", null, null, null, 0, 0, 0, 0, null);

};
*/

