function em_init() {
    $("embed").attr("wmode", "transparent").each(function() { var cl = $(this).clone(); $(this).replaceWith(cl) });

}


function RequestLogin() {
    if (Sys.Services.AuthenticationService.get_isLoggedIn())
        return;
    this.window.location = "/?returnurl=" + this.window.location;
}

/* map  **/
var editID = null;
var mapEditSrc = null;
function loadMapView(id, s) {
    var c = $('#' + id);
    c.find("iframe").eq(0).each(function() {
        var w = $(this).parent().width();

        this.src = s + '&w=' + w;
        $(this).width(w);
    });
}

function loadMapEdit(id) {

    var c = $('#' + id);
    $('#mapE' + id).eq(0).each(function() {

        var w = c.width();
        this.src = getMapEditSrc(id) + '&w=' + w;
    });

}
function getMapEditSrc(id) {
    return mapEditSrc + '&id=' + id;
}



function MapEditOpen(id) {
//    RequestLogin();

    editID = id;
    var pop = $find("mpeMapEdit" + id);
    pop.show();
    loadMapEdit(id);
}


function MapEditClose() {
    $find('mpeMapEdit' + editID).hide();
    $('#mapE' + editID).attr('src', '');
    
}    
