// Фото
var Photoreportage = {
    showPopup: function(id, im_w, im_h) {
        var base = document.location.protocol + '//' + document.location.host + '';
        //var w = im_w + 20;
        //var h = im_h + 110;
        var w = 830;
        var h = 600; //screen.availHeight * (99/100); 
        var left = (window.outerWidth - w) / 2;
        var top = (window.outerHeight - h) / 2;
        var parms = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + w + ',height=' + h + ",top=" + top + ",left=" + left;
        var newzooming = window.open("", '', parms);
        var html = "";
        var imagePath = id;
        html += "<img src='" + imagePath + "' width='" + im_w + "' height='" + im_h + "' title='Нажмите на картинку чтобы закрыть окно' onclick='javascript:self.close();return false;'/><br />";
        html += '<p style="text-align:center; font: normal 12px Tahoma; color: #666; height: 90px; overflow:auto;">' + $("#" + id + "_desc").html() + '</p>';
        //		html += $("#counter").html();
        newzooming.document.body.innerHTML = html;
        newzooming.document.body.style.padding = "0";
        newzooming.document.body.style.margin = "5";
        newzooming.document.body.style.textAlign = "center";
        newzooming.document.getElementsByTagName('head')[0].innerHTML = '<base href="' + base + '" />';
        newzooming.document.title = "Телекритика - Фоторепортаж";
        return false;
    },
    removePopup: function() {
        var photo_full = document.getElementById('photo_full');
        if (photo_full)
            photo_full.parentNode.removeChild(photo_full);
        var modal_bg = document.getElementById('modal_bg');
        if (modal_bg)
            modal_bg.parentNode.removeChild(modal_bg);
        return false;
    },
    showPopup1: function(imagePath, im_w, im_h) {
        this.removePopup();
        var modal_bg = document.createElement('div');
        modal_bg.id = 'modal_bg';
        var photo_full = document.createElement('div');
        photo_full.id = 'photo_full';
        photo_full.onclick = this.removePopup;
        photo_full.innerHTML = "<img src='" + imagePath + "' id='img_photo_full' width='" + im_w + "' height='" + im_h + "' title='" + Photo_close + "' /><br />" +
        "<p style='color:#999;text-transform:uppercase;'>" + Photo_close + "</p>";

        var cw = document.body.clientWidth;
        var left = document.body.scrollLeft + (document.body.clientWidth - im_w) / 2;
        if (left < 0)
            left = 0;
        photo_full.style.zIndex = 700
        photo_full.style.background = '#fff';
        photo_full.style.padding = '5px';
        photo_full.style.left = left + 'px';
        photo_full.style.top = 150 + document.documentElement.scrollTop + "px";
        document.body.appendChild(modal_bg);
        document.body.appendChild(photo_full);
        document.body.style.zIndex
        return false;
    }



}