/*Use Object Detection to detect IE6*/ 
var ie = document.uniqueID /*IE*/ 
&& document.compatMode /*>=IE6*/ 
&& !window.XMLHttpRequest /*<=IE6*/ 
&& document.execCommand ;

// NORMALISE THE LINE-HEIGHT TO 1
// (done because IE bug that if defined more than 1 it acts as multiplier to any value defined after the text is replaced with Cufon)
$('h1').css('line-height','1em');

Cufon.now();

function fixLineHeight($replaced, lineHeight, clearFloat) {
    $replaced.each(function(){
    
        var $current = $(this);
        if (clearFloat==null) {
            clearFloat = false;
        }
        var clearFloatClassname = 'fltbox';
        var $cufonWords = $current.children('cufon')
        var $cufonSiblings = $current.children(':not(cufon)');
        
        if ($(this).css('display')=='inline') {
            $cufonWords.css('display','inline-block');
        } else {
            $cufonWords.css('float','left');
            $cufonWords.css('display','inline');// IE floats margin bug
            $cufonSiblings.each(function(){
                $sib = $(this);
                if (!($sib.css('float')=='left' || $sib.css('float')=='right') ) {
                    $sib.css('float','left');
                    $sib.css('display','inline');// IE floats margin bug
                }
            });
            if (clearFloat && !$current.hasClass(clearFloatClassname)) { //
                $current.addClass(clearFloatClassname);
            }
        }
        $current.css('line-height', lineHeight);
        $cufonWords.css('height', lineHeight); 
    });
}
fixLineHeight($('h1'),'47px');

$("h1 .cufon-vml").css('height', '50px');
$("h1 .maroon .cufon-vml").css('height', '60px');
