﻿/*===================================
  [関数 chPhoto]
  写真をランダム表示するJavascript
====================================*/
function chPhoto(alt,position,caption,img,img_w,img_h){
			number=new Array();
			count=0;

			for(i=0 ;i<img.length ;i++){
					number[i]=0;
			}
			for(i=0;;i++){
				n = Math.floor(Math.random() * img.length );
				if(number[n]==0){
					if(position[n] == "")
					{
						document.write('<div class="leftimage"><img src="'+img[n]+'" width="' + img_w[n] +'" height="' + img_h[n] + '" alt="'+alt[n]+'" title="'+alt[n]+'"></div>');
					}
					else{
						document.write('<div class="leftimage"><img src="'+img[n]+'" width="' + img_w[n] +'" height="' + img_h[n] +'" alt="'+alt[n]+'" title="'+alt[n]+'"><br><span class="imgcomment">'+ caption[n]+'</span></div>');
					}
					number[n]=1;
					count++;
				}
				if(count==2){
					break;
				}
			}
}

// _______________________________________ end of function fsc() ___ 

//EOF
