function closeFlash() {
    showContent();
    /*$("#curtains").hide();*/
}
function showContent() {
    $("#contentlayer").show();
}
var requiredMajorVersion = 7;
var requiredMinorVersion = 0;
var requiredRevision = 0;
    
var currentPosition = 1;
var positionElementId = "positions";
var numPositions = 6;
function showNextPosition(next) {
    currentPosition += next ? 1 : -1;
    if (currentPosition < 1) {
        currentPosition = numPositions;
    }
    if (currentPosition > numPositions) {
        currentPosition = 1;
    }
    return showPosition(currentPosition);
}

function showPosition(step) {
    $.$(positionElementId).className = "step" + step;
    return false;
}

function zoomSizeGrid(grid) {
    $("#" + grid + "grid").center().show();
}
function closeZoomSizeGrid() {
    $("#ftgrid").hide();
    $("#stgrid").hide();
}


function pfFlashObject(swfUrl, width, height, flashvars) {
    document.writeln("<object type=\"application/x-shockwave-flash\" data=\"" + swfUrl + "\" width=\"" + width + "\" height=\"" + height + "\">");
    document.writeln("<param name=\"movie\" value=\"" + swfUrl + "\" />");
    if (flashvars != null && flashvars.length > 0) {
        document.writeln += "<param name=\"flashvars\" value=\"" + flashvars + "\" />";
    }    
    document.writeln("<param name=\"swliveconnect\" value=\"true\" />");
    document.writeln("<param name=\"quality\" value=\"high\" />");
    document.writeln("<param name=\"wmode\" value=\"transparent\" />");
    document.writeln("</object>");
}


function pfFlashObject2(swfUrl, width, height, id, flashvars, fullscreen) {
    fullscreen = fullscreen == null ? "false" : fullscreen;
    html = "<object type=\"application/x-shockwave-flash\" data=\"" + swfUrl + "\" width=\"" + width + "\" height=\"" + height + "\" name=\"" + id + "\" id=\"" + id + id +"\">";
    html += "<param name=\"movie\" value=\"" + swfUrl + "\" />";
    if (flashvars != null && flashvars.length > 0) {
        html += "<param name=\"flashvars\" value=\"" + flashvars + "\" />";
    }
    if (fullscreen != null && fullscreen == true) {
        html += "<param name=\"AllowFullScreen\" value=\"true\" />";
        html += "<param name=\"wmode\" value=\"window\" />";
    } else {
        html += "<param name=\"wmode\" value=\"transparent\" />";
    }
    html += "<param name=\"swliveconnect\" value=\"true\" />";
    html += "<param name=\"quality\" value=\"high\" />";
    html += "</object>";
    document.write(html);
}

function getFlash() {
    return (navigator.appName.indexOf("Microsoft") != -1) ? document.getElementById("flashObject") : window.document.flashObject;
}

function displayImages(i) {
    var targetFlash = getFlash();
    try {
        targetFlash.displayImages(i);
    } catch (ex) { }
}         

function skipVideo(i) {
    var targetFlash = getFlash();
    var flashInfo = targetFlash.skipVideo(i);	 
}

function loadNewVideo(i) {
    var targetFlash = getFlash();
    var flashInfo = targetFlash.loadNewVideo(i);	 
    step = i.split("_")[1].substring(0,1);
    chapterLoaded(step);
}

function chapterLoaded(step) {
    if (step > 7) {
    return;
    }
    $.$("vn").className = "step" + step;
    currentPosition = step;
}