function winPopup(tVar)
{       
sWidth = screen.width;
sHeight = screen.height;
xValue = Math.round((sWidth-672)/2);
yValue =  Math.round((sHeight-480)/2);
//if (sWidth <= 800) {
//newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=no,height=480,width=672,titlebar=no,screenX=20,screenY=23,top=20,left=23,resizable=no");
//} else {
newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=no,height=480,width=672,titlebar=no,screenX="+xValue+",screenY="+yValue+",top="+yValue+",left="+xValue+",resizable=no");
//}
newWindow.focus();
}

function articulatePopup(tVar)
{       
newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=no,resizable=yes");
newWindow.focus();
}

function launchSWFStudyMate(sFile, url)
{
   newwin = window.open("","StudyMate","scrollbars=0,resizable=yes,width=790,height=590");
   newwin.resizeBy(0,0);
   var htmlString =
   "<HT"+"ML><TIT"+"LE>Just for Fun Exercise</TIT"+"LE> \n"+
	"<SCR"+"IPT language='javascript' sr"+"c='/Courses/Includes/StudyMateTest.js' type='text/javascript'>"+ 
   "</SCR" + "IPT>\n"+
   "</HE"+"AD>\n"+
"<BO"+"DY marginheight=0 marginwidth=0 topmargin=0 rightmargin=0 leftmargin=0 bottommargin=0 BGCOLOR=#000000>"+
  "<span id='SWFStudyMateTest'><font color='white'>Loading . . . </font></span><SCR" + "IPT>writeStudyObject('" + sFile + "','" + url + "','SWFStudyMateTest'); </SCR" + "IPT>\n" +"</BO"+"DY></HT"+"ML>";
   newwin.document.open();
   newwin.document.write(htmlString);
   newwin.document.close();
  var detect = navigator.userAgent.toLowerCase();
  if (detect.indexOf('msie') >= 0)
  {
    if ( (detect.indexOf('safari') < 0)
      && (detect.indexOf('opera') < 0)
      && (detect.indexOf('firefox') < 0)
      && (detect.indexOf('konqueror') < 0) )
    {
	newwin.location.reload(false);
    }
  }
}

function winPopupScroll(tVar)
{       
sWidth = screen.width;
sHeight = screen.height;
xValue = Math.round((sWidth-672)/2);
yValue =  Math.round((sHeight-480)/2);
//if (sWidth <= 800) {
//newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=yes,height=480,width=672,titlebar=no,screenX=20,screenY=23,top=20,left=23,resizable=no");
//} else {
newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=yes,height=480,width=672,titlebar=no,screenX="+xValue+",screenY="+yValue+",top="+yValue+",left="+xValue+",resizable=no");
//}
newWindow.focus();
}

function winPopupPreview(tVar)
{       
newWindow = window.open(tVar,"window2","toolbar=yes,location=yes,menubar=yes,directories=yes,status=yes,scrollbars=yes,height=640,width=800,titlebar=yes,resizable=yes");
newWindow.focus();
}

function MultipleChoicePopUp(form)
{ 
IDVar = form.ID.value;
ansVar = -1
for (i=0; i<form.mcAnswer.length; i++) {
  if (form.mcAnswer[i].checked)
    ansVar = i
}
if (ansVar == -1) {
   alert("You must select an answer.")
   return false
}
if (ansVar == 0) {answerVar = "A"}
if (ansVar == 1) {answerVar = "B"}
if (ansVar == 2) {answerVar = "C"}
if (ansVar == 3) {answerVar = "D"}
sWidth = screen.width;
sHeight = screen.height;
xValue = Math.round((sWidth-672)/2);
yValue =  Math.round((sHeight-480)/2);
tVar = "multiplechoice.asp?ID=" + IDVar + "&Answer=" + answerVar;
//if (sWidth <= 800) {
//newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=yes,height=480,width=672,titlebar=no,screenX=20,screenY=23,top=20,left=23,resizable=no");
//} else {
newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=yes,height=480,width=672,titlebar=no,screenX="+xValue+",screenY="+yValue+",top="+yValue+",left="+xValue+",resizable=no");
//}
newWindow.focus();
}

function MultipleChoiceFeedbackPopUp(form)
{ 
IDVar = form.ID.value;
ansVar = -1
for (i=0; i<form.mcAnswer.length; i++) {
  if (form.mcAnswer[i].checked)
    ansVar = i
}
if (ansVar == -1) {
   alert("You must select an answer.")
   return false
}
if (ansVar == 0) {answerVar = "A"}
if (ansVar == 1) {answerVar = "B"}
if (ansVar == 2) {answerVar = "C"}
if (ansVar == 3) {answerVar = "D"}
sWidth = screen.width;
sHeight = screen.height;
xValue = Math.round((sWidth-672)/2);
yValue =  Math.round((sHeight-480)/2);
tVar = "multiplechoicefeedback.asp?ID=" + IDVar + "&Answer=" + answerVar;
//if (sWidth <= 800) {
//newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=yes,height=480,width=672,titlebar=no,screenX=20,screenY=23,top=20,left=23,resizable=no");
//} else {
newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=yes,height=480,width=672,titlebar=no,screenX="+xValue+",screenY="+yValue+",top="+yValue+",left="+xValue+",resizable=no");
//}
newWindow.focus();
}

function AlternativeChoicePopUp(form)
{ 
IDVar = form.ID.value;
ansVar = -1
for (i=0; i<form.aAnswer.length; i++) {
  if (form.aAnswer[i].checked)
    ansVar = i
}
if (ansVar == -1) {
   alert("You must select an answer.")
   return false
}
if (ansVar == 0) {answerVar = "T"}
if (ansVar == 1) {answerVar = "F"}
sWidth = screen.width;
sHeight = screen.height;
xValue = Math.round((sWidth-672)/2);
yValue =  Math.round((sHeight-480)/2);
tVar = "alternativechoice.asp?ID=" + IDVar + "&Answer=" + answerVar;
//if (sWidth <= 800) {
//newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=yes,height=480,width=672,titlebar=no,screenX=20,screenY=23,top=20,left=23,resizable=no");
//} else {
newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=yes,height=480,width=672,titlebar=no,screenX="+xValue+",screenY="+yValue+",top="+yValue+",left="+xValue+",resizable=no");
//}
newWindow.focus();
}

function ThoughtExercisePopUp(form)
{ 
IDVar = form.ID.value;
answerVar = form.mcAnswer.value;
sWidth = screen.width;
sHeight = screen.height;
xValue = Math.round((sWidth-672)/2);
yValue =  Math.round((sHeight-480)/2);
tVar = "thoughtexercise.asp?ID=" + IDVar + "&Answer=" + answerVar;
//if (sWidth <= 800) {
//newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=yes,height=480,width=672,titlebar=no,screenX=20,screenY=23,top=20,left=23,resizable=no");
//} else {
newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=yes,height=480,width=672,titlebar=no,screenX="+xValue+",screenY="+yValue+",top="+yValue+",left="+xValue+",resizable=no");
//}
newWindow.focus();
}

function HTMLExercisePopUp(form)
{ 
//IDVar = form.ID.value;
answerVar = form.mcAnswer.value;
sWidth = screen.width;
sHeight = screen.height;
xValue = Math.round((sWidth-672)/2);
yValue =  Math.round((sHeight-240)/2);
tVar = "HTMLTestexercise.asp?Answer=" + answerVar;
//if (sWidth <= 800) {
//newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=yes,height=480,width=672,titlebar=no,screenX=20,screenY=23,top=20,left=23,resizable=no");
//} else {
newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=yes,height=240,width=672,titlebar=no,screenX="+xValue+",screenY="+yValue+",top="+yValue+",left="+xValue+",resizable=no");
//}
newWindow.focus();
}

function MultiOptionPopUp(form)
{ 
IDVar = form.ID.value;
//answerVarA = form.mcAnswerA.value;
//answerVarB = form.mcAnswerB.value;
//answerVarC = form.mcAnswerC.value;
//answerVarD = form.mcAnswerD.value;
//if (form.mcAnswerA.checked) {answerVarA = "T"}
//if (form.mcAnswerB.checked) {answerVarB = "T"}
//if (form.mcAnswerC.checked) {answerVarC = "T"}
//if (form.mcAnswerD.checked) {answerVarD = "T"}
sWidth = screen.width;
sHeight = screen.height;
xValue = Math.round((sWidth-672)/2);
yValue =  Math.round((sHeight-480)/2);
tVar = "multioption.asp?ID=" + IDVar;
//tVar = "multioption.asp?ID=" + IDVar + "&AnswerA=" + answerVarA + "&AnswerB=" + answerVarB + "&AnswerC=" + answerVarC + "&AnswerD=" + answerVarD;
////if (sWidth <= 800) {
//newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=yes,height=480,width=672,titlebar=no,screenX=20,screenY=23,top=20,left=23,resizable=no");
//} else {
newWindow = window.open(tVar,"window1","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=yes,height=480,width=672,titlebar=no,screenX="+xValue+",screenY="+yValue+",top="+yValue+",left="+xValue+",resizable=no");
//}
newWindow.focus();
}


