function pnewp_detail_disp(id)
{
    new Effect.toggle(id, 'slide', {duration:.8});

}
function pnewp_disp_all(sc, cat, pg, stt)
{
    var scrolly, xScroll, yScroll;
    var id = "allview";

    r = new Array();
    r[0] = "#ffd700";
    r[1] = "#8ec7ff";
    r[2] = "#7fff00";
    r[3] = "#20b2aa";
    r[4] = "#778899";
    r[5] = "#2e8b57";
    r[6] = "#ff8500";
    cnt = 7;

    var r2 = Math.floor(Math.random() * cnt);
    var color = r[r2];

    if (self.pageYOffset) {
        scrolly = self.pageYOffset;
    } else if (document.documentElement && document.documentElement.scrollTop){
        scrolly = document.documentElement.scrollTop;
    } else if (document.body) {
        scrolly = document.body.scrollTop;
    }


    if (window.innerHeight && window.scrollMaxY) {
        xScroll = document.body.scrollWidth;
        yScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight > document.body.offsetHeight){
        xScroll = document.body.scrollWidth;
        yScroll = document.body.scrollHeight;
    } else {
        xScroll = document.body.offsetWidth;
        yScroll = document.body.offsetHeight;
    }

    var windowWidth, windowHeight;
    if (self.innerHeight) {
        windowWidth = self.innerWidth;
        windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        windowWidth = document.documentElement.clientWidth;
        windowHeight = document.documentElement.clientHeight;
    } else if (document.body) {
        windowWidth = document.body.clientWidth;
        windowHeight = document.body.clientHeight;
    }

    if(yScroll < windowHeight){
        pageHeight = windowHeight;
    } else { 
        pageHeight = yScroll;
    }

    if(xScroll < windowWidth){    
        pageWidth = windowWidth;
    } else {
        pageWidth = xScroll;
    }

    x = (pageWidth - 20 - 500) / 2 + 'px';
    y = (scrolly + (windowHeight - 35 - 400) / 2) + 'px';

    var url = sc;
    var pars = 
    {
        mode  : 'all',
        cat : cat,
        page : pg,
        st : stt
    };
    var endc = "";

    new Ajax.Updater(id, url, {
        method:'get', 
        parameters: $H(pars).toQueryString(),
        onComplete: function() {
            new Effect.Highlight(id, {startcolor:color, endcolor:endc, restorecolor:endc});
            $(id).style.left = x;
            $(id).style.top = y;
            $(id).style.display='inline';
        }
    });
}
function pnewp_all_close()
{
    $('allview').hide();
}
