ver=Math.round(parseFloat(navigator.appVersion)*100);
ie=navigator.appName.toLowerCase().indexOf('microsoft') != -1;
opera=navigator.userAgent.toLowerCase().indexOf('opera') != -1;
win = navigator.userAgent.toLowerCase().indexOf('win') != -1;
goodie = !opera && ie && ver >= 400 && win;
if (!goodie) alert("Internet Explorer 6+ is required.");

var copier;
function initializePrinting(engine)
{
    try
    {
        copier = new ActiveXObject("CarbonCopy.CopierX");
        copier.Engine = Cortona.engine;
        var x = document.forms.x;
        x.btn_pagesetup.disabled = false;
        x.btn_print.disabled = false;
    }
    catch (e)
    {
        copier = null;
    }
}
function uninitializePrinting()
{
    var x = document.forms.x;
    x.btn_pagesetup.disabled = true;
    x.btn_print.disabled = true;
    copier = null;
}
function print3d()
{
    if (!copier)
        return;
        
    var x = document.forms.x;

    copier.FooterText = x.footer.value;
    copier.HeaderText = x.header.value;
    var s = copier.HeaderStyle;
    s.FontFamily = x.header_font.value;
    s.FontSize = x.header_fontsize.value;
    s = copier.FooterStyle;
    s.FontFamily = x.footer_font.value;
    s.FontSize = x.footer_fontsize.value;

    copier.PrintScene();
}
function pageSetup()
{
    if (copier)
        copier.PageSetup();
}
function onFontFaceChanged(select)
{
    var name = select.name.split("_")[0];
    select.form.elements[name].style.fontFamily = select.value;
}
