//<!-- Javascript file
// PHP's getimagesize() can be used to stat image files for width/height;
// consider using XMLHttpRequest with a server-side image sniffing script
// that returns custom HTTP X-headers

/*function showChapter(ThisChapter) {
    parent.NextQuiz = ThisChapter;

    var nextChapterNo = parent.NextQuiz;
    if (nextChapterNo <= 9) {
        var RunMe = "parent.showChapter('chapter0" + nextChapterNo + "/quiz_index.html')";
        eval(RunMe);
    }
    else if (nextChapterNo <= 14) {
        var RunMe = "parent.showChapter('chapter" + nextChapterNo + "/quiz_index.html')";
        eval(RunMe);
    }
    else {
        parent.NextQuiz = 1;
        parent.showChapter('chapter01/quiz_index.html');
    }
}*/

var NextQuiz = 0;

function showChapter(infoFile) {
    var QuizPopupWindow
    if (QuizPopupWindow == null) {
    QuizPopupWindow = window.open("","QuizPopup","scrollbars,resizable,width=670,height=450");
    }
    if (QuizPopupWindow != null) {
        var newURL = infoFile;
        QuizPopupWindow.window.location = newURL + "/quiz_index.html";
        QuizPopupWindow.moveTo(100,30);
        QuizPopupWindow.focus();
    }
}


function RefreshWindows() {
    var PhotoPopupWindow
    if (PhotoPopupWindow == null) {
        PhotoPopupWindow = window.open("","PhotoPopup","width=1,height=1");
    }    
     if (PhotoPopupWindow != null) {
        PhotoPopupWindow.close();
    }

    var DefinitionPopupWindow
    if (DefinitionPopupWindow == null) {
        DefinitionPopupWindow = window.open("","DefinitionPopup","width=1,height=1");
    }
     if (DefinitionPopupWindow != null) {
        DefinitionPopupWindow.close();
    }
}

function CloseQuiz() {
    var QuizPopupWindow
    if (QuizPopupWindow == null) {
            QuizPopupWindow = window.open("","QuizPopup","width=1,height=1");

    }
     if (QuizPopupWindow != null) {
        QuizPopupWindow.close();
    }
}

function showExam(infoFile,height,width) {
	var PopupWindow;
	var ConfigWindow = "scrollbars,resizable,width=" + width + ",height=" + height;
	if (PopupWindow == null) {
	PopupWindow = window.open("","PicPopup",ConfigWindow);
	}

	if (PopupWindow != null) {
		var newURL = infoFile;
		PopupWindow.window.location.href = newURL;
		PopupWindow.moveTo(100,30);	
		PopupWindow.focus();
	}
}

//-->
