Num = 0;
NumA = 0;
NumB = 0;
NumC = 0;
maxPage = 0;
layX = 20;
layName1 = "";
layName2 = "";
NumStr = "";
timerID = 0;
PageWidth = 1023;
PageHeight = 571;

function fullopen() {
var options;
if (navigator.appName.charAt(0)=='M') 
{
options = "fullscreen=1,scrollbars=0";
}
else if (navigator.appName.charAt(0)=='N')
{
options = "scrollbars=0,left=0,top=0"
                + ",width="+ screen.width
                + ",height="+ screen.height;
}
window.open("index.html", "", options);
}

function winclose() {
window.close("index.html");
}

function select(NumSelect)
{
Num=NumSelect;
next();
}

function next()
{
NumA1=Num;
if (Num == maxPage){
NumA2 = 0;
}else{
NumA2=Num+1;
}
LayVis();
NumB=NumA1;
ImgRead();
NumB=NumA2;
ImgRead();
NumC=NumA1;
OpenLay();
if (Num < maxPage+1) Num++;
}

function back()
{
if (Num == 0) exit;
NumA1=Num;
NumA2=Num-1;
LayVis();
NumB=NumA1;
ImgRead();
NumB=NumA2;
ImgRead();
NumC=NumA2;
ImgWidth();
CloseLay();
Num--;
}

function OpenLay()
{
if(navigator.userAgent.indexOf("MSIE") != -1){
if (NumC == 0 && document.PAD.width >= 0 )    
{
document.PAD.width = document.PAD.width - 25;
document.PAD.height = PageHeight;
document.PAD.left = layX;
}
}else{
if (NumC == 0){document.PAD.width = 0;}
}
clearTimeout(timerID);
timerID = setTimeout("OpenLay()",0);
}

function CloseLay()
{
if(navigator.userAgent.indexOf("MSIE") != -1){
if (NumC == 0 && document.PAD.width < PageWidth )    
{
document.PAD.width = document.PAD.width + 25;
document.PAD.height = PageHeight;
document.PAD.left = layX;
}
}else{
if (NumC == 0){document.PAD.width = PageWidth;}
}
clearTimeout(timerID);
timerID = setTimeout("CloseLay()",0);
}

function LayVis()
{
for (i = 0; i < maxPage+1; i++)
{
if (i < 10){
NumStr = "00"+i;
}else if (i < 100){
NumStr = "0"+i;
}else{
NumStr = i;
}
if (i == 0){
layName1="title_page";
}else{
layName1="p"+NumStr+"mp";
}
if (i == NumA1 || i == NumA2){
if (document.layers) document.layers[layName1].visibility = "visible";
if (document.all)    document.all(layName1).style.visibility = "visible";
}else{
if (document.layers) document.layers[layName1].visibility = "hidden";
if (document.all)    document.all(layName1).style.visibility = "hidden";
}
}
}

function ImgRead()
{
if (NumB == 0) document.PAD.src = "images/PAD.png"; 
}

function ImgWidth()
{
if (NumC == 0) document.PAD.width = 0; 
}

