﻿/*
var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0;
var tempY = 0;
function getMouseXY(e) {
    if (IE) { // grab the x-y pos.s if browser is IE
        tempX = event.clientX + document.body.scrollLeft;
        tempY = event.clientY + document.body.scrollTop;
    }
    else {  // grab the x-y pos.s if browser is NS
        tempX = e.pageX;
        tempY = e.pageY;
    }
    if (tempX < 0) { tempX = 0; }
    if (tempY < 0) { tempY = 0; }

    return true;
}
*/


function ViewPaper(PageURL)
{
    //window.open(PageURL,'epwin','scrollbars=1,fullscreen=yes');
    window.open(PageURL,'epwin','top=0,left=0,menubar=1,scrollbars=1,width='+screen.width+',height='+screen.height);
    return false;
}

function ViewPageSize(PageURL, W, H) {
    //alert('x:'+SetMouseValues('X'));
    //alert('y:'+SetMouseValues('Y'));
    //return false;

    window.open(PageURL, 'epwin', 'top=' + SetMouseValues('Y') + ',left=' + SetMouseValues('X') + ',menubar=0,scrollbars=1,width=' + W + ',height=' + H);
    return false;
}

function ViewPageSizeWName(PageURL, W, H, winName) {
    //alert('x:'+SetMouseValues('X'));
    //alert('y:'+SetMouseValues('Y'));
    //return false;

    window.open(PageURL, winName, 'top=' + SetMouseValues('Y') + ',left=' + SetMouseValues('X') + ',menubar=0,scrollbars=1,width=' + W + ',height=' + H);
    return false;
}

function SetMouseValues(XorY) {
    try {
        var IE = document.all ? true : false;
        if (XorY == 'X') {
            if (IE)
                return window.event.clientX;
            else
                return window.event.pageX;
        }

        if (XorY == 'Y') {
            if (IE)
                return window.event.clientY;
            else
                return window.event.pageY;
        }
    } catch (err) {
        return 200;
    }

    return 200;
    //var s = 'X=' + window.event.clientX + ' Y=' + window.event.clientY;
    //alert(s);

}
