// JavaScript Document


function settingUpWindows() {
	self.moveTo(0,0);
	self.outerWidth=740;
	self.outerHeight=700;
	checkPopup();
	//settingUpPhoto();
	//settingUpDefinition();
	self.focus();
	self.location.href = "index.html"
}

function checkPopup() {
	// var mine = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');
	var mine = window.open('','','width=1,height=1,left=0,top=0,scrollbars=auto');
	if(mine)
		var popUpsBlocked = false
	else
		var popUpsBlocked = true
	mine.close()
}


function changePhoto(matchingPhoto) {
	var PhotoPopupWindow
	if (PhotoPopupWindow == null) {
		// PhotoPopupWindow = window.open("","PhotoPopup","resizable,width=330,height=260")
		PhotoPopupWindow = window.open("","PhotoPopup","resizable,width=330,height=260,scrollbars=auto")
	}	
 	if (PhotoPopupWindow != null) {
		PhotoPopupWindow.moveTo(780,0);
		// PhotoPopupWindow.resizeTo(330, 260);
		photoString = self.document.title.substring;
		PhotoPopupWindow.window.location.href =  "../photos/sob" + matchingPhoto + ".htm";
		PhotoPopupWindow.focus();
	}
}

function settingUpWindows() {
    settingUpPhoto();
    settingUpDefinition();
    self.focus();
}

function settingUpPhoto() {
    var PhotoPopupWindow;
    if (PhotoPopupWindow == null) {
        PhotoPopupWindow = window.open("../photos/photopopup.html","PhotoPopup","resizable,scrollbars=auto,width=330,height=260");
    }
     if (PhotoPopupWindow != null) {
        PhotoPopupWindow.moveTo(780,0);
	//PhotoPopupWindow.focus();
    }
}

function settingUpDefinition() {
    var DefinitionPopupWindow
    if (DefinitionPopupWindow == null) {
        DefinitionPopupWindow = window.open("../glossary/definition0.html","DefinitionPopup","resizable,scrollbars=auto,width=330,height=231");
    }
     if (DefinitionPopupWindow != null) {
        DefinitionPopupWindow.moveTo(780,320);
		//DefinitionPopupWindow.focus();
    }
}

function showPhoto(whichPhoto) {
    var PhotoPopupWindow
    if (PhotoPopupWindow == null) {
        // PhotoPopupWindow = window.open("","PhotoPopup","resizable,width=330,height=260");
        PhotoPopupWindow = window.open("","PhotoPopup","resizable,width=330,height=260,scrollbars=auto");
		PhotoPopupWindow.moveTo(780,0);
    }
     if (PhotoPopupWindow != null) {
        PhotoPopupWindow.moveTo(780,0);
        PhotoPopupWindow.window.location.href = "../photos/sob" + whichPhoto + ".htm";
        PhotoPopupWindow.focus();
    }
}

function showDefinition(termNo) {
    var DefinitionPopupWindow
    if (DefinitionPopupWindow == null) {
    	DefinitionPopupWindow = window.open("","DefinitionPopup","resizable,scrollbars=auto,width=330,height=231");
		DefinitionPopupWindow.moveTo(780,320);
    }
     if (DefinitionPopupWindow != null) {
        DefinitionPopupWindow.moveTo(780,320);
        DefinitionPopupWindow.window.location.href = "../glossary/" + termNo + ".htm";
        DefinitionPopupWindow.focus();
    }
}

function showFigure(figNo) {
    var FigurePopupWindow
    if (FigurePopupWindow == null) {
            FigurePopupWindow = window.open("figureWin","FigurePopup","resizable,scrollbars=auto,width=545,height=275");
    }
     if (FigurePopupWindow != null) {
        FigurePopupWindow.moveTo(780,525);
        FigurePopupWindow.window.location.href = "../figures/" + figNo + ".htm";
        FigurePopupWindow.focus()
    }
}
	
function showMovie(movieName, h, w) {
		var MoviePopupWindow
		if (MoviePopupWindow == null) {
			var MovieSize
			MovieSize = "resizable,scrollbars=yes,width=" + w + ",height=" + h;
				MoviePopupWindow = window.open("movieWin","MoviePopup",MovieSize);
		}
		 if (MoviePopupWindow != null) {
			MoviePopupWindow.moveTo(700,300);
			MoviePopupWindow.window.location.href = "../movies/" + movieName + ".html";
			MoviePopupWindow.focus();
			
		}
	}
