function photoPopup(Path,Width,Height)
{
window.open('/photo.php?photo='+Path,'Image','scrollbars=no,toolbar=no,width='+Width+',height='+Height+' location=no,status=no,resizable=yes,screenX=120,screenY=100');
return false;
        }
function articlesContent(pg,ID,SortBy)
{
xajax_AjaxNavigation('articlesContent',pg,ID,SortBy);
return false;
        }
function AuthorsN(pg,ID)
{
xajax_AjaxNavigation('AuthorsN',pg,ID);
return false;
        }
function news(pg,ID)
{
xajax_AjaxNavigation('news',pg,ID);
return false;
        }
function avertContent(pg,ID)
{
xajax_AjaxNavigation('avertContent',pg,ID);
return false;
        }
function articlesByAuthor(pg,ID)
{
xajax_AjaxNavigation('articlesByAuthor',pg,ID);
return false;
        }
function newsByDate(pg,ID,sortBy)
{
xajax_AjaxNavigation('newsByDate',pg,ID,sortBy);
return false;
        }
function recordComment()
{
textos=document.getElementById('textos').value;
name=document.getElementById('name').value;
email=document.getElementById('email').value;
article=document.getElementById('article').value;
xajax_recordComment(textos,name,email,article);
return false;
        }

function getAdvert()
{
id_parent=document.getElementById('id_parent').value;
user=document.getElementById('user').value;
email=document.getElementById('email').value;
text=document.getElementById('text').value;
error='';
if(user.length==0) error = error + 'Введите ваше имя \n';
if(email.length==0) error = error + 'Введите ваш e-mail \n';
if(text.length==0) error = error + 'Введите текст объявления \n';
if(error.length==0) xajax_getAdvert(id_parent,user,email,text);
else alert(error);
return false;
        }

function getPageSize(){

        var xScroll, yScroll;

        if (window.innerHeight && window.scrollMaxY) {
                xScroll = document.body.scrollWidth;
                yScroll = window.innerHeight + window.scrollMaxY;
        } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
                xScroll = document.body.scrollWidth;
                yScroll = document.body.scrollHeight;
        } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
                xScroll = document.body.offsetWidth;
                yScroll = document.body.offsetHeight;
        }

        var windowWidth, windowHeight;
        if (self.innerHeight) {        // all except Explorer
                windowWidth = self.innerWidth;
                windowHeight = self.innerHeight;
        } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
                windowWidth = document.documentElement.clientWidth;
                windowHeight = document.documentElement.clientHeight;
        } else if (document.body) { // other Explorers
                windowWidth = document.body.clientWidth;
                windowHeight = document.body.clientHeight;
        }

        // for small pages with total height less then height of the viewport
        if(yScroll < windowHeight){
                pageHeight = windowHeight;
        } else {
                pageHeight = yScroll;
        }

        // for small pages with total width less then width of the viewport
        if(xScroll < windowWidth){
                pageWidth = windowWidth;
        } else {
                pageWidth = xScroll;
        }
        arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
        return arrayPageSize;
}


function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}
function getBodyScrollTop()
{
        return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}
function getHeight()
{
var result=getPageSize();
var paddingTop=parseInt(getClientHeight()/2)+parseInt(getBodyScrollTop()/2);
var a=getBodyScrollTop();
document.getElementById('photoShot').style.height=result[1];
document.getElementById('photoShot').style.padding=a +'px 0px 0px 0px';
return false;
        }
function closePSC()
{
        document.getElementById('photoShot').style.display='none';
        return false;
        }
function shots(FileName)
{
xajax_shots(FileName);
return false;
        }
function Authors()
{
Path=document.getElementById('Path').value;
author=document.getElementById('choose').value;
window.location.href=Path+author+'/';
return false;
        }
function tellMeAboutAuthor(ID)
{
xajax_tellMeAboutAuthor(ID);
return false;
        }
function advertEcho(ID)
{
   var Item=document.getElementById('echoReq');
   if(Item) Item.parentNode.removeChild(Item);
xajax_advertEcho(ID);
return false;
        }
function showContextLib(ID)
{
xajax_showContextLib(ID);
return false;
        }
function getArticlesPeriod()
{
        HiddenSince=document.getElementById('HiddenSince').value;
        HiddenTill=document.getElementById('HiddenTill').value;
        xajax_getArticlesPeriod(HiddenSince,HiddenTill);
        return false;
        }

function getNewsPeriod()
{
        HiddenSince=document.getElementById('HiddenSince').value;
        HiddenTill=document.getElementById('HiddenTill').value;
        section=document.getElementById('section').value;

        xajax_getNewsPeriod(HiddenSince,HiddenTill,section);
        return false;
        }
function fullNews(ID)
{
var div="news"+ID;
   var Item=document.getElementById('newsDetails');
   if(Item) Item.parentNode.removeChild(Item);
   xajax_fullNews(ID);
return false;
        }

function sendAdvertEcho()
{
ID=document.getElementById('advertID').value;
email=document.getElementById('email').value;
msg=document.getElementById('msg').value;
   var Item=document.getElementById('echoReq');
   if(Item) Item.parentNode.removeChild(Item);
xajax_sendAdvertEcho(ID,email,msg);

return false;
        }