
function popup1 (txt,hth,wth) {
var winX = (screen.availWidth - wth)*.5;
var winY = (screen.availHeight - hth)*.5;
var features = "width="+wth+",height="+hth+",scrollbars=1,resizable=1,menubar=0,location=0,status=0,left="+winX+",top="+winY;
pop1 = document.open ("", "popup1",features)
pop1.document.write(txt)
pop1.document.close()
pop1.focus ()
}

function anspop1 (txt,hth,wth) {
var winX = (screen.availWidth - wth)*.5;
var winY = (screen.availHeight - hth)*.5;
var features = "width="+wth+",height="+hth+",scrollbars=1,resizable=1,menubar=0,location=0,status=0,left="+winX+",top="+winY;
pop1 = document.open ("", "popup1",features)
pop1.document.write(txt);
pop1.document.write("<a href ='javascript: window.print()'><font size=1>Click to print this window</font></a> ");
pop1.document.close()
pop1.focus ()
}

function popfile1 (url,hth,wth) {
var winX = (screen.availWidth - wth)*.5;
var winY = (screen.availHeight - hth)*.5;
var features = "width="+wth+",height="+hth+",scrollbars=1,resizable=1,menubar=0,location=0,status=0,left="+winX+",top="+winY;
file1 = window.open(url,"popfile1",features)
file1.window.focus()
}

function refwin1 (location) {
var features = "width=640,height=480,scrollbars=1,resizable=1,menubar=1,location=1,status=1,screenY=0,top=0";
ref1 = window.open (location, "refwin1",features)
ref1.focus ()
}

function artwin1 (location) {
var features = "width=640,height=480,scrollbars=1,resizable=1,menubar=1,location=1,status=1,screenY=0,top=0";
art1 = document.open ("", "popup1",features)
art1.document.write('<center>');
art1.document.write("<img src='"+location+"' width='600'>");
art1.document.write('</center>');
art1.document.close()
art1.focus ()
}

function refscroll1 (location) {
var features = "width=640,height=480,scrollbars=1,resizable=1,menubar=1,location=1,status=1,screenY=0,top=0";
ref1 = window.open (location, "refwin1",features)
ref1.window.scrollBy (0,740)
ref1.focus ()
}
function refscroll2 (location) {
var features = "width=640,height=480,scrollbars=1,resizable=1,menubar=1,location=1,status=1,screenY=0,top=0";
ref2 = window.open (location, "refwin1",features)
ref2.window.scrollBy (0,799)
ref2.focus ()
}

// att =  i to ignore case, null to match case
//ans = correct answer written as regular expression
//str = answer STRING submitted by user
// txt = alert content for incorrect answer
function matchxt1 (str,ans,att,txt){
  re = new RegExp(ans,att)
 if (re.test(str)) {
     alert ('That\'s right')}
   else {
     alert(txt)}
}

// att =  i to ignore case, null to match case
//ans = correct answer written as regular expression
//str = answer STRING submitted by user
function matchxt2 (str,ans,att){
var wth = "150"
var hth = "100"
var winX = (screen.availWidth - wth)*.5;
var winY = (screen.availHeight - hth)*.5;
var features = "width="+wth+",height="+hth+",scrollbars=1,resizable=1,menubar=0,location=0,status=0,left="+winX+",top="+winY;

  re = new RegExp(ans,att)
 if (re.test(str)) {
pop1 = document.open ("", "popup1",features)
pop1.document.write("<center>That's Right</center>");
pop1.document.close()
pop1.focus ()
}
   else {
	pop1 = document.open ("", "popup1",features)
pop1.document.write("<center>Try Again</center>");
pop1.document.close()
pop1.focus ()
}
}

function select1(select,ans){
var wth = "150"
var hth = "100"
var winX = (screen.availWidth - wth)*.5;
var winY = (screen.availHeight - hth)*.5;
var features = "width="+wth+",height="+hth+",scrollbars=1,resizable=1,menubar=0,location=0,status=0,left="+winX+",top="+winY;

 if (select == ans)
  {
	pop1 = document.open ("", "popup1",features)
pop1.document.write("<center>That's Right</center>");
pop1.document.close()
pop1.focus ()
	}
   else {
	pop1 = document.open ("", "popup1",features)
pop1.document.write("<center>Try Again</center>");
pop1.document.close()
pop1.focus ()
	}
}

function imgpop1 (url,hth,wth) {
var winX = (screen.availWidth - wth)*.5;
var winY = (screen.availHeight - hth)*.5;
var features = "width="+wth+",height="+hth+",scrollbars=1,resizable=1,menubar=0,location=0,status=0,left="+winX+",top="+winY;
pop1 = document.open ("", "popup1",features)
pop1.document.write("<img src=",url,">");
pop1.document.close()
pop1.focus ()
}

function embpop1 (url,emh,emw,hth,wth) {
var winX = (screen.availWidth - wth)*.5;
var winY = (screen.availHeight - hth)*.5;
var features = "width="+wth+",height="+hth+",scrollbars=1,resizable=1,menubar=0,location=0,status=0,left="+winX+",top="+winY;
pop1 = document.open ("", "popup1",features)
pop1.document.write("<embed src =",url,"width=",emw,"height=",emh,">");
pop1.document.close()
pop1.focus ()
}

function answer (txt) {
var winX = (screen.availWidth - 100)*.5; 
var winY = (screen.availHeight - 100)*.5;
time1 = document.open("","clock","width=100,height=125,left="+winX+",top="+winY+"")
time1.document.write("<center><img src='dnaspin.gif'></center>"); 
time1.document.close() 
time1.focus () 

setTimeout ("time1.close(); popup1 ('<center>The correct answer is:<br><b><font size= +1>"+txt+"</font></b></center>',150,200)",500);
}

function fullScreen (file) {
var wid =(screen.availWidth);
var hit = (screen.availHeight - 75);
flash1 = document.open("","flashimg", 'fullscreen=yes, scrollbars=auto');
flash1.document.write ("<embed src =",file," width =",wid," height =",hit,"><br>");
flash1.document.write ("<a href='javascript:window.close()'><div align=center> Close Window </div></a>")
flash1.document.close();
flash1.focus()
}