/* - ++resource++iz.bankenverband.javascripts/sifr-config.js - */
var trebuchet = {
    src: 'http://www.bankenverband.de/trebuchet.swf',
	ratios: [
	    10, 1.32, 12, 1.26, 16, 1.27, 19, 1.23, 24, 1.22, 33, 1.2, 37, 1.19, 
		38, 1.2, 51, 1.19, 55, 1.18, 56, 1.19, 82, 1.18, 83, 1.17, 84, 1.18, 
		87, 1.17, 88, 1.18, 89, 1.17, 90, 1.18, 93, 1.17, 94, 1.18, 1.17
	]
};
sIFR.activate(trebuchet);

jQuery(document).ready(function() {
	jQuery('h1.stageH1').each(function() {
		var selector = '#' + jQuery(this).attr('id');
		var stageheadcolor = jQuery(this).css('color');
	    if (!stageheadcolor) {
	        stageheadcolor = '#000000';
	    }
	    if (stageheadcolor.indexOf('rgb') != -1) {
	        var rgb = stageheadcolor.substring(stageheadcolor.indexOf('(') + 1,
	                                           stageheadcolor.indexOf(')'));
	        rgb = rgb.split(', ');
	        stageheadcolor = '#' + rgb2HEX(rgb[0])
	                             + rgb2HEX(rgb[1])
	                             + rgb2HEX(rgb[2]);
	    }
		sIFR.replace(trebuchet, {
            selector: selector,
            ratios: [
			    10, 1.32, 12, 1.26, 16, 1.27, 19, 1.23, 24, 1.22, 33, 1.2, 37, 
				1.19, 38, 1.2, 51, 1.19, 55, 1.18, 56, 1.19, 82, 1.18, 83, 
				1.17, 84, 1.18, 87, 1.17, 88, 1.18, 89, 1.17, 90, 1.18, 93, 
				1.17, 94, 1.18, 1.17
			],
            css: [
                'a { text-decoration: none; color: ' + stageheadcolor + ';}',
                'h1 {font-size: 24px; color: ' + stageheadcolor + ';}',
                'a:link { color: ' + stageheadcolor + '; }',
                'a:hover { color: ' + stageheadcolor + '; text-decoration: underline; }'
            ],
            tuneWidth: 0,
            wmode: 'transparent',
            repaintOnResize: 1,
            filters: {
                DropShadow: {
                    knockout: false,
					distance: 2,
					color: '#333333',
					strength: 1
                }
            },
			onRelease: function(event) {
				jQuery('body').html('');
			}
        });
	});
});

rgb2HEX = function(rgb) {
    var c = '0123456789ABCDEF';
    return String(c.charAt(Math.floor(rgb / 16)))
         + String(c.charAt(rgb - (Math.floor(rgb / 16) * 16)));
}

renderSiFR = function() {
	sIFR.replace(trebuchet, {
		selector: 'h1.documentFirstHeading',
		css: [
		    'h1 {font-size: 24px; color: #000000;}'
		],
		tuneWidth: 0,
		wmode: 'transparent',
		repaintOnResize: 1,
		filters: {
			DropShadow: {
			    knockout: false,
				distance: 2,
				color: '#333333',
				strength: 1
			}
		}
	});	
	
	sIFR.replace(trebuchet, {
		selector: 'h1.shop-detail-articleHead',
		css: [
		    'h1 {font-size: 24px; color: #000000; margin-bottom: 10px;}'
		],
		tuneWidth: 0,
		wmode: 'transparent',
		repaintOnResize: 1,
		filters: {
			DropShadow: {
			    knockout: false,
				distance: 2,
				color: '#333333',
				strength: 1
			}
		}
	});	
	
	sIFR.replace(trebuchet, {
		selector: 'h2',
		css: [
		    'a { text-decoration: none; color: #000000;}',
			'a:link { color: #000000; }',
			'a:hover { color: #000000; text-decoration: underline; }'
		],
		tuneWidth: 0,
		wmode: 'transparent',
		repaintOnResize: 1,
		filters: {
			DropShadow: {
			    knockout: false
			    ,distance: 2
			    ,color: '#666666'
			    ,strength: 1
			}
		}
	});
	
	sIFR.replace(trebuchet, {
		selector: 'h2.collageH2',
		css: [
		    'a { text-decoration: none; color: #000000;}',
			'a:link { color: #000000; }',
			'a:hover { color: #000000; text-decoration: underline; }'
		],
		tuneWidth: 0,
		wmode: 'transparent',
		repaintOnResize: 1,
		filters: {
			DropShadow: {
			    knockout: false
			    ,distance: 2
			    ,color: '#666666'
			    ,strength: 1
			}
		}
	});
	
	sIFR.replace(trebuchet, {
		selector: '.collageH3',
		css: [
		    'a { text-decoration: none; color: #000000;}',
			'a:link { color: #000000; }',
			'a:hover { color: #000000; text-decoration: underline; }'
		],
		tuneWidth: 0,
		wmode: 'transparent',
		repaintOnResize: 1,
		filters: {
			DropShadow: {
			    knockout: false,
				distance: 2,
				color: '#666666',
				strength: 1
			}
		}
	});
	
	sIFR.replace(trebuchet, {
		selector: '.newsitem h2',
		css: [
		    'a { text-decoration: none; color: #000000;}',
			'a:link { color: #000000; }',
			'a:hover { color: #000000; text-decoration: underline; }'
		],
		tuneWidth: 0,
		wmode: 'transparent',
		repaintOnResize: 1,
		filters: {
			DropShadow: {
			    knockout: false,
				distance: 2,
				color: '#666666',
				strength: 1
			}
		}
	});	
};
