//popupTutorial.js
// Author: S. Bhattacharjee
// used by States and all other solve files to popup Tutorial pages. It also
// contains the counters.
var popUpWindow = null;
var windowCount = 0;
var windowName = "popUpWindow";
browser=navigator.appName;
browserVersion=parseInt (navigator.appVersion);
function switchImage(docID,imageFile,messageText)
{
if ((browser.substring (0, 8) == "Netscape" && browserVersion >= 3)
|| (browser.substring (0, 9) == "Microsoft" && browserVersion >= 4))
{
document[docID].src = "testcentericons/"+imageFile+".jpg";
window.status=messageText;
}
}
/*
// check for license. This does not work because bottom.html never got reloaded. After cookie has been
// read index.html (parent.index.html) should be reloaded, not the home.html file.
function openPopUpWindowLicensed(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){
if(validUser()=="false") {alert("You must log in (Web Edition) or activate TEST (Local Edition) to view the requested page.\nGo to Home page to log in, register, or access \"My Account\" to extend/upgrade your license.");}
else {openPopUpWindow(winURL, winWidth, winHeight, winFeatures, winLeft, winTop);}
}
*/
// opens a float window named popUpWindow for Problems,Tutorial, etc.
function openPopUpWindow(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){
window.status="The orange colored Task Bar at the bottom provides permanent access to important TEST modules.";
winFeatures="menubar=no, scrollbars=yes, resizable=yes";
if(winHeight==600) winHeight=0.9*screen.availHeight;
var defaultPixelLeft = 200
var defaultPixelTop = 20
windowName = "popUpWindow" + windowCount++ //unique name for each pop-up window
closePopUpWindow()
if (openPopUpWindow.arguments.length >= 4)
winFeatures = "," + winFeatures
else
winFeatures = ""
if (openPopUpWindow.arguments.length == 6)
winFeatures += getLocation(winWidth, winHeight, winLeft, winTop)
else
winFeatures += getLocation(winWidth, winHeight, defaultPixelLeft, defaultPixelTop)
popUpWindow = window.open(winURL, windowName, "width=" + winWidth
+ ",height=" + winHeight + winFeatures)
popUpWindow.moveTo(screen.availWidth-winWidth-5,0);
//alert("executing openPopup in jscript"+winHeight);
if(winHeight>1000){
popUpWindow.moveTo(screen.availWidth-winWidth,0)
popUpWindow.resizeTo(winWidth,screen.availHeight)
}
}
function closePopUpWindow(){
if (navigator.appName != "Microsoft Internet Explorer"
|| parseInt(navigator.appVersion) >=4)
if(popUpWindow != null) if(!popUpWindow.closed) popUpWindow.close()
}
function getLocation(winWidth, winHeight, winLeft, winTop){
return ""
}
function sizeParent(winWidth, winHeight){
window.parent.resizeTo(winWidth,winHeight);
}
function writeYear() { //used by copyright
var date=new Date();
var yy=date.getFullYear();
document.write(yy);
}
function handleCounter(){
//----comment out if page count to be turned off.
//document.write('
');
//_uacct = "UA-128479-1";
//urchinTracker();
}
function handleCounterShow(){
// count without show;
handleCounter();
//----count with show
//document.write('
Since Nov. 1, 2003, this page has been visited
times.');
}