var homeworkNormal = {
    src: 'flash/sifr.swf'
};

if(typeof sIFR == "object"){
    sIFR.rollback = function(){
        function rollback(sSelector){
            if(sSelector == null){
                sSelector = "";
            } else {
                sSelector += ">";
            };

            sIFR.removeFlashClass();

            if(doRollback(sSelector+"embed") == false){
                doRollback(sSelector+"object");
            };
        };

        function doRollback(sSelector){
            var node, nodeParent, nodeAlternate, nodeAlternateChild, nodeAlternateNextChild, indexNodeToRemove;
            var listNodes = parseSelector(sSelector);
            var i = listNodes.length - 1;
            var bHasRun = false;

            while(i >= 0){
                node = listNodes[i];
                listNodes.length--;
                nodeParent = node.parentNode;

                if(node.className == 'sIFR-flash'){
                    /*  Flash blockers may add other nodes as siblings to the Flash element. 
                        Thus, we remove all children of nodeParent, and look for nodeAlternate at the same time */
                    indexNodeToRemove = 0;

                    while(indexNodeToRemove < nodeParent.childNodes.length){
                        node = nodeParent.childNodes[indexNodeToRemove];
                        if(node.className == "sIFR-alternate"){
                            nodeAlternate = node;
                            indexNodeToRemove++;
                            continue;
                        };
                        nodeParent.removeChild(node);
                    };

                    if(nodeAlternate != null){
                        nodeAlternateChild = nodeAlternate.firstChild;
                        while(nodeAlternateChild != null){
                            nodeAlternateNextChild = nodeAlternateChild.nextSibling;
                            nodeParent.appendChild(nodeAlternate.removeChild(nodeAlternateChild));
                            nodeAlternateChild = nodeAlternateNextChild;
                        };
                        nodeParent.removeChild(nodeAlternate);
                    };

                    nodeParent.className = nodeParent.className.replace(/\bsIFR\-replaced\b/, "");
                    bHasRun = true;
                };

                i--;
            };

            return bHasRun;
        };

        return rollback;
    }();
};

sIFR.useStyleCheck = true;
sIFR.activate(homeworkNormal);

function replaceSIFR() {
	/* Homepage */
	sIFR.replace(homeworkNormal, {
			selector: 'div#findDealer, div#tellAFriend'
			,css: ['.sIFR-root { font-size: 30px; color: #e53138; text-decoration: none;} a { color: #e53138; text-decoration: none; } a:hover {color: #e53138; text-decoration: none; }']
			,wmode: 'transparent'
			,selectable: false
			,forceSingleLine: true
		});
		
	/* Productpages */
	sIFR.replace(homeworkNormal, {
			selector: 'div.deurmatKolom h5'
			,css: ['.sIFR-root { font-size: 30px; color: #FFFFFF; text-decoration: none; text-align: center;} a { color: #FFFFFF; text-decoration: none; } a:hover {color: #FFFFFF; text-decoration: none; }']
			,wmode: 'transparent'
			,selectable: false
		});
		
	/* Navigation */
	sIFR.replace(homeworkNormal, {
			selector: 'div#bottomNav, div#productBottomLinks, div#productRightLinks, div#bottomLinks'
			,css: ['.sIFR-root { font-size: 24px; color: #e53138; text-decoration: none;} a { color: #e53138; text-decoration: none; } a:hover {color: #e53138; text-decoration: none; }']
			,wmode: 'transparent'
			,selectable: false
			,forceSingleLine: true
		});

	sIFR.replace(homeworkNormal, {
			selector: 'div#productDealerLinks'
			,css: ['.sIFR-root { font-size: 30px; color: #e53138; text-decoration: none; line-height: 0px;} a { color: #e53138; text-decoration: none; } a:hover {color: #e53138; text-decoration: none; }']
			,wmode: 'transparent'
			,selectable: false
			,forceSingleLine: true
		});
		
	sIFR.replace(homeworkNormal, {
			selector: 'a.sifrLink'
			,css: ['.sIFR-root { font-size: 25px; color: #e53138; text-decoration: none; line-height: 0px;} a { color: #e53138; text-decoration: none; } a:hover {color: #e53138; text-decoration: none; }']
			,wmode: 'transparent'
			,selectable: false
			,forceSingleLine: true
		});
}