function enterPressed(approved, lang_ver) {
    if (approved == true) {
        window.location.href = '/index.php?approved=yes&lang_ver='+lang_ver;
    }
}

function loadFlash(lang) {
    var params = {
        quality: "high",
        scale: "noscale",
        wmode: "window",
        allowscriptaccess: "always",
        bgcolor: "#000000"
    };
    var flashvars = {
        siteXML: lang + "xml/site.xml"
    };
    var attributes = {
        id: "flashcontent",
        name: "flashcontent"
    };
    swfobject.embedSWF("main.swf", "flashcontent", "100%", "100%", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
}

function removeHash(str) {
    if (str) {
        str = str.replace('#', '');
        return str;
    }
    return '';
}

//function SessionReboot() {
//    $.ajax({
//        url: '../../closeTab_handler.php',
//        success: function(data) {
//          $('body').html(null).show();
//          if(data == 'done') {
//            //  window.location.reload();
//            window.location.href = '/index.php?approved=no&last_url=' + removeHash(location.hash);
//          } 
//        }
//    }); 
//}   
//
//function CheckWindowClosed() {
//    if (navigator.appName!="Opera" && navigator.appName!="Microsoft Internet Explorer") {
//        SessionReboot();
//    } 
//}

$(function() {
//    if (document.referrer == "") {
//        window.location.href = '/index.php?approved=no&last_url=' + removeHash(location.hash);
//    }
    if (location.hash && is_approved == 'no') {
        window.location.href = '/index.php?last_url=' + removeHash(location.hash);
    }
})
