var w=480;
var h=360;
var t=4;
var num=3;
var i=0;
var j=0;

if (screen.width < 1000) {w=480; h=360;}
if (screen.width > 1000 && screen.width <1100 && w==800) {w=640; h=480;}

function IMGWrite(img){
  if(document.getElementById){
    document.getElementById('photo').innerHTML='<IMG SRC="'+img+'" width="'+w+'" height="'+h+'" border=0>';
  }else{
    if(document.all){
      document.all('photo').innerHTML='<IMG SRC="'+img+'" width="'+w+'" height="'+h+'" border=0>';
    }
  }
}

function FRAMEIMG(img,wh){
  var ww; 
  var hh;
  if(wh==0){ ww=w; hh=h; }
  if(wh==1){ ww=h*0.8; hh=w*0.8; }
  if(wh==2){ if(screen.width < 1000) {ww=240; hh=320;}else{ww=h*0.8; hh=w*0.8;}}
  if(document.getElementById){
    document.getElementById('photo').innerHTML='<IMG SRC="'+img+'" width="'+ww+'" height="'+hh+'" border=0>';
  }else{
    if(document.all){
      document.all('photo').innerHTML='<IMG SRC="'+img+'" width="'+ww+'" height="'+hh+'" border=0>';
    }
  }
}

function Winopen(jpURL){
  var xx=w*1.1;
  var yy=h+90;
  var ww=(screen.width-xx)/2;
  var hh=(screen.height-yy)/2;
	window.open(jpURL,"sub","width="+xx+",height="+yy+",top="+hh+",left="+ww+",menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,alwaysRaised=1");
}

function SlideShow(){
  if (i <= num) {
    var img = '<IMG SRC="img'+i+'.jpg" width="'+w+'" height="'+h+'" border=0>';
    if (document.getElementById){
      document.getElementById('photo').innerHTML = img;
      document.getElementById('pname').innerHTML = PhotoName[i];
    }else{
      if (document.all){
        document.all('photo').innerHTML = img;
        document.all('pname').innerHTML = PhotoName[i];
      }
    }
    i++;
    setTimeout('SlideShow()',t*1000);
  }else{
    window.close();
  }
}

function FSlide(){
  var img;
  if (i <= num) {
    if(Photoflg[i]==0) img = '<IMG SRC="img'+i+'.jpg" width="'+w+'" height="'+h+'" border=0>';
      else img = '<IMG SRC="img'+i+'.jpg" width="'+h*0.8+'" height="'+w*0.8+'" border=0>';
    if (document.getElementById){
      document.getElementById('photo').innerHTML = img;
      document.getElementById('pname').innerHTML = PhotoName[i];
    }else{
      if (document.all){
        document.all('photo').innerHTML = img;
        document.all('pname').innerHTML = PhotoName[i];
      }
    }
    i++;
    setTimeout('FSlide()',t*1000);
  }else{
    location.href="../index.htm";
  }
}

function NextPhoto(){
  if(j <= num){
    j++;
    parent.page.location.href="images/"+(j-1)+".htm";
  }else{
    j=0;
    parent.page.location.href="title.htm";
  }
}

function BeforePhoto(){
  if(j > 1){
    j=j-1;
    parent.page.location.href="images/"+(j-1)+".htm";
  }else{
    j=0;
    parent.page.location.href="title.htm";
  }
}

function Gotitle(){
  j=0;
  parent.page.location.href="title.htm";
}

function change(img){
  var image;
  image="<IMG SRC='"+img+"' WIDTH=320 HEIGHT=240 BORDER=0>";
  if (document.getElementById) {
    document.getElementById("pic").innerHTML=image;
  }else{
    if (document.all) {
      document.all("pic").innerHTML=image;
    }
  }
}

