var gObject;

var gToWidth;
var gStepWidth;
var gStepHeight;


//function loadPhotoP(obj) {
//	zoomPhoto(obj, 52, 70, 360, 480, 3, 4);
//  }
//function loadPhotoL(obj) {
//	zoomPhoto(obj, 70, 52, 480, 360, 4, 3);
//  }
function LoadSlideShow(URLfileName) {
	openPhoto(URLfileName, 500, 600);
  }
function loadPhotoP(URLfileName) {
	openPhoto(URLfileName, 360+20, 480+20);
  }
function loadPhotoL(URLfileName) {
	openPhoto(URLfileName, 480+20, 360+20);
  }

function openPhoto(URLname,winWidth,winHeight) {  // v4.01
        newWindow = window.open(URLname,"WeddingWindow","width="+winWidth+",height="+winHeight+",scrollbars=no,left=0,top=0");
        newWindow.focus();
}

function zoomPhoto(obj, fromW, fromH, toW, toH, stepW, stepH) {
//  document.getElementById("body001").innerHTML = obj.src;
  var imgName;
  var srcName = obj.src.split("/");
  if (srcName[srcName.length - 1].substring(0,2) == "t_") {
    imgName = srcName[srcName.length - 1].substring(2);
    }
  else {
    imgName = srcName[srcName.length - 1];
    }
//  document.getElementById("head001").innerHTML = srcName[srcName.length - 1].substring(0,2);
	obj.src = "Speech/Images/" + imgName;
	obj.width=fromW;
	obj.height=fromH;
	
  gObject = obj;
  gToWidth = toW;
  gStepWidth = stepW;
  gStepHeight = stepH;
//	while (obj.width < toW) {
//		obj.width += stepW;
//		obj.height += stepH;
//    }
//  resizeQuick();
  resizeSlow();

//	obj.width=toW;
//	obj.height=toH;
  }

function loadPhotoSlow(obj) {
  var srcName = obj.src.split("/");
  var imgName = srcName[srcName.length - 1].substring(2);

	obj.src = "Speech/Images/" + imgName;
	obj.width=70;
	obj.height=52;
  gObject = obj;
  resize();
  }

function resizeQuick() {
	while (gObject.width <= gToWidth - gStepWidth) {
		gObject.width += gStepWidth;
		gObject.height += gStepHeight;
    }
  }
function resizeSlow() {
	if (gObject.width <= gToWidth - gStepWidth) {
		gObject.width += gStepWidth * 4;
		gObject.height += gStepHeight * 4;
		
    setTimeout("resizeSlow()", 1);
    }
  }
