/**
?????????? ??????/?????? ???? ????????*/
function WndSize() {
if (self.innerWidth) {
this.Width = self.innerWidth;
this.Height = self.innerHeight;}
else if (document.documentElement && document.documentElement.clientWidth) {
this.Width = document.documentElement.clientWidth;
this.Height = document.documentElement.clientHeight;}
else if (document.body) {
this.Width = document.body.clientWidth;
this.Height = document.body.clientHeight;}
else {
this.Width = 0;
this.Height = 0;}}
function getScrollXY() {
var scrOfX = 0, scrOfY = 0;
if (typeof (window.pageYOffset) == 'number') {
scrOfY = window.pageYOffset;
scrOfX = window.pageXOffset;}
else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
scrOfY = document.body.scrollTop;
scrOfX = document.body.scrollLeft;}
else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
scrOfY = document.documentElement.scrollTop;
scrOfX = document.documentElement.scrollLeft;}
return [scrOfX, scrOfY];}
function blockAlign(obj) {
var oldDisplay = obj.style.display;
var scroll = getScrollXY();
obj.style.display = "block";
var width = obj.offsetWidth;
var height = obj.offsetHeight;
obj.style.display = oldDisplay;
var wndSize = new WndSize();
obj.style.left = Math.round((wndSize.Width-width) / 2)+"px";
obj.style.top = Math.round((wndSize.Height-height) / 2+scroll[1])+"px";}
function ShowPanel(isComment) {
var pnl = document.getElementById("pnlComment");
var pnlBtn = document.getElementById("pnlBtn0");
var pnlBtnEdit = document.getElementById("pnlBtnEdit");
if (pnlBtn == undefined)
pnlBtn = document.getElementById("pnlBtn1");
if (pnl.style.display == "none") {
pnl.style.display = "";
blockAlign(pnl);
pnlBtn.style.display = "";
pnlBtnEdit.style.display = "none";
if (isComment > 1) {
var hidCommentId = document.getElementById('<%= hidCommentId.ClientID %>');
hidCommentId.value = isComment;}
return false;}
else {
pnlBtnEdit.style.display = "";
pnlBtn.style.display = "none";
pnl.style.display = "none";
return true;}}
function CancelPanel() {
var pnl = document.getElementById("pnlComment");
pnl.style.display = "none";}
function ConfirmDelete() {
var hidCommentId = document.getElementById('<%= hidCommentId.ClientID %>');
hidCommentId.value = '';
return confirm('?? ????????????? ?????? ??????? ????????????');}
function ShowPanelForEdit(commentId) {
var pnl = document.getElementById("pnlComment");
var pnlBtn = document.getElementById("pnlBtnEdit");
var pnlBtnPost = document.getElementById("pnlBtn0");
var divText = document.getElementById('divText'+commentId);
var txtMessage = document.getElementById('<%= txtMessage.ClientID %>')
if (pnl.style.display == "none") {
pnl.style.display = "";
blockAlign(pnl);
pnlBtn.style.display = "";
pnlBtnPost.style.display = "none";
var hidCommentId = document.getElementById('<%= hidCommentId.ClientID %>');
hidCommentId.value = commentId;
txtMessage.innerHTML = divText.innerHTML;
return false;}
else {
pnl.style.display = "none";
pnlBtn.style.display = "none";
pnlBtnPost.style.display = "";
return true;}}
