/////////////////////////////////////////////
// CD version Stuff
/////////////////////////////////////////////
var gbIsCD = false;// set to false if site
// check if the window should go up
function putUpCDWarningWindowP(xsWhere) {
var vbPutUpWindow = false;
if(gbIsCD) {
if(xsWhere.indexOf("webquest") != -1 ||
xsWhere.indexOf("assessment") != -1 ||
xsWhere.indexOf("explore") != -1 ||
xsWhere.indexOf("grlab") != -1 ||
xsWhere.indexOf("skills") != -1 ||
xsWhere.indexOf("ocs") != -1) {
vbPutUpWindow = true;
}
}
return vbPutUpWindow;
}
// put up the window
function openCDWarningWindow(xsWhereFrom) {
var vsURL;
switch(xsWhereFrom) {
case "chapmap":
vsURLPath = "../../../";
break;
case "mininav":
vsURLPath = "../../../../";
break;
case "content":
vsURLPath = "../../../../../";
break;
case "unithome":
vsURLPath = "../../";
break;
case "toolbar":
vsURLPath = "../";
break;
}
var thisWindow = window.open(vsURLPath + "shared/cdwarning.html", "CDWarning", "height=240,width=325,screenX=300,screenY=200,left=300,top=200,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no");
thisWindow.focus();
}
// Go to the homepage
function takeMeHome(xsWhichFile, xsPath) {
if (xsPath == null || xsPath == "") {
xsPath = "./";
}
top.maincontent.location = xsPath + xsWhichFile;
}
function goToFromChapmap(xsWhere) {
if(putUpCDWarningWindowP(xsWhere)) {
openCDWarningWindow("chapmap");
} else {
//alert("Chapmap: " + xsWhere);
top.gsCurMiniNavLoc = xsWhere;
top.maincontent.document.location = "../../../shared/mininav/index.html";
}
}
function goToFromContentPage(xsWhere) {
if(putUpCDWarningWindowP(xsWhere)) {
openCDWarningWindow("content");
} else {
top.gsCurMiniNavLoc = xsWhere;
top.maincontent.document.location = "../../../../../shared/mininav/index.html";
}
}
function goToUnitAssessment() {
if(putUpCDWarningWindowP("assessment") ) {
openCDWarningWindow("unithome");
} else {
openSmallerWindowunitAssessment("assessment/index.html");
}
}
function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}
/////////////////////////////////////////////////////////////////
// TOOLBAR FUNCTIONS
/////////////////////////////////////////////////////////////////
function ContentsViewbyClick(xsWhich){
var vsPageName;
if(xsWhich=="contents") {
vsPageName = "index.html";
document['viewby'].src = "images/viewby.gif";
parent.gbIsViewBy = false;
} else {
vsPageName = "viewby.html"
document['contents'].src = "images/contents.gif";
parent.gbIsViewBy = true;
}
document[xsWhich].src = "images/" + xsWhich + "hi.gif";
parent.maincontent.location = "../../home/" + vsPageName;
}
// writes the link to the teachers guide if true, student if false
function writeTeachersGuideLink(xbIsTeacher){
if(gbIsCD){
document.write('
');
} else if (xbIsTeacher) {
document.write('