// --- [start /site/sifr_3_config.js] ---


var tColour = '';

function RGBtoHex(R,G,B) {return toHex(R)+toHex(G)+toHex(B)}
function toHex(N) {	
	if (N==null) {return "00";}
	N=parseInt(N); 
	if (N==0 || isNaN(N)) {return "00";}	
	N=Math.max(0,N); 
	N=Math.min(N,255); 
	N=Math.round(N);
	return "0123456789ABCDEF".charAt((N-N%16)/16) + "0123456789ABCDEF".charAt(N%16);
}

function getFontColour(tagName,optionalClassName) {
	//returns the font colour of the first tag with specified class
	var tagList = (optionalClassName!='')?lm.getElementsBy({tagName:tagName,className:optionalClassName}):lm.getElementsBy({tagName:tagName});
	if (tagList.length>0) {
		var firstTag = tagList[0];
		if (firstTag.currentStyle){
			// We're in Internet Explorer
			return firstTag.currentStyle.color;
		}
		else if (document.defaultView.getComputedStyle) {
			//We're in Mozilla
			var tColour = document.defaultView.getComputedStyle(firstTag,null).color;
			if (tColour.indexOf('rgb')!=-1){
				tColour = tColour.replace('rgb(','').replace(')','').split(',');
				tColour = RGBtoHex(tColour[0],tColour[1],tColour[2]);
				return '#' + tColour;
			}
		}
		else {
			return '#000000';
		}
	}
	else {
		return '#000000';
	}
}

function sifrReplace(tagName,optionalClassName,optionalCSS,additionalSelectors,swfPath,tuneHeight,offsetTop) {
	var strCSS = '.sIFR-root {color:'+getFontColour(tagName,optionalClassName)+';'+optionalCSS+';},'+[additionalSelectors];
	var strSelector = (optionalClassName=='') ? tagName : tagName+'.'+optionalClassName;
	var swfPathToUse = (swfPath=='') ? swfPath1 : swfPath;
	var intTuneHeight = (tuneHeight=='') ? 0 : tuneHeight;
        var intOffsetTop = (offsetTop=='') ? 0 : offsetTop;
	sIFR.replace(swfPathToUse,{selector: strSelector, css: [strCSS], wmode: 'transparent',tuneHeight: intTuneHeight,offsetTop: intOffsetTop});
}


if (typeof sIFR == "object"){
	// Global replace for cat headers
	var frontierSIFRProtocol = (document.location.href.indexOf('https')>-1)? 'https://' : 'http://';
	var swfPath1 = frontierSIFRProtocol + 'cdn.lastminute.com/site/dinf_black_436_reg_en.swf';
	swfPath1 = {src: swfPath1};
	var swfPath2 = frontierSIFRProtocol + 'cdn.lastminute.com/site/funmunger_medium_436.swf';
	swfPath2 = {src: swfPath2};
	sIFR.activate(swfPath1,swfPath2);
	//sIFR.replace(swfPath, {selector: 'h2.highlightHeader',css: ['.sIFR-root {color:#ff0099;}']});
	//sifrReplace('h2','highlightHeader','text-decoration:underline;');
	sifrReplace('h1','','','em { font-style: normal; color: #000000; }','','','');
	sifrReplace('h1','richFont1a','','','','-8','-4');
	sifrReplace('h1','richFont1b','','','','-8','-4');
	sifrReplace('h1','richFont1c','color: #EC008C','em { font-style: normal; color: #000000; }','','-8','-4');
	sifrReplace('h2','merchHeader','','','','','');
	sifrReplace('h2','searchHeader','','','','','');
	sifrReplace('h2','sponsorHeader','','','','','');
	sifrReplace('h2','highlightHeader','text-decoration:underline;','','','','');
	sifrReplace('span','interstitialHeader','','','','','');
	sifrReplace('','richFont','','','','','');

}

// --- [end prdpctbd4305:5002 - /site/sifr_3_config.js - Nov 22, 2009 11:41 pm GMT - akamai,pcth0614,pct0410 - PpP5TAqoVrcAAGirf-oAACAX - cache 1800 ] ---
