if ((navigator.appVersion.substring(0,1) < 5) && (navigator.appName == 'Netscape')) fg = 121652; else top.document.title = document.title;

if (top.location == self.location)
 {
 protocol = "'"+self.location.protocol+"'";
 caller = "'"+self.location.href+"'";
 host = self.location.host;
 if (protocol == "'file:'")
  {
  content = caller.substring(caller.indexOf('eAcademy')+9,caller.length-1);
  }
 else
  {
  content = caller.substring(caller.indexOf(host)+(host.length+1),caller.length-1);
  }
  top.location.replace('http://'+host+'/index.htm?'+content);
 }

function setvar(name, value)
 {document.cookie = name + "=" + escape(value); expires="Wdy, 08-Nov-01 10:10:10 GMT"; path="/";
 }

function getvar(Name)
 {var search = Name+"=";
  if (document.cookie.length > 0)
	{offset = document.cookie.indexOf(search);
	 if (offset != -1)
	  {offset += search.length;
		end = document.cookie.indexOf(";", offset);
		if (end == -1) end = document.cookie.length;
		return unescape(document.cookie.substring(offset, end));
	  }
	}
 }

function init(picnum, len, wid)
{
eval ("nav"+picnum+"l = new Image("+len+","+wid+")");
eval ("nav"+picnum+"h = new Image("+len+","+wid+")");
eval ("nav"+picnum+"w = new Image()");
eval ("nav"+picnum+"l.src = './images/nav"+picnum+"l.gif'");
eval ("nav"+picnum+"h.src = './images/nav"+picnum+"h.gif'");
return true;
}

function initx(picnum, len, wid)
{
eval ("nav"+picnum+"l = new Image("+len+","+wid+")");
eval ("nav"+picnum+"h = new Image("+len+","+wid+")");
eval ("nav"+picnum+"w = new Image()");
eval ("nav"+picnum+"l.src = '/appimages/nav"+picnum+"l.gif'");
eval ("nav"+picnum+"h.src = '/appimages/nav"+picnum+"h.gif'");
return true;
}

x = initx(1,78,21);
x = initx(2,78,21);
x = init(3,96,21);
x = initx(4,27,21);
x = initx(5,80,21);
x = init(6,122,21);
x = init(7,37,21);
x = init(8,49,21);
x = init(9,94,21);
x = initx(10,77,21);
x = init(91,14,11);
x = init(92,14,11);
nav1hw = "Help on using USCAP Continuning Medical Education";
nav2hw = "Save all answered test results and close window";
nav3hw = "Close Window and return to Testing Facility";
nav4hw = "Exit facility and close window";
nav5hw = "Submit your completed test for scoring";
nav6hw = "Submit your evalutaion to USCAP";
nav7hw = "Print Report";
nav8hw = "Return to Administator Main Menu";
nav9hw = "Submit your Course Rating to USCAP";
nav10hw = "Return to CME/SAM Main Menu";
nav91hw = "Convert this case's CME to SAM credit";
nav92hw = "Convert this case's SAM to CME credit";

function rollover(place,imagename,stat)
 {
 document[place].src = eval(imagename+".src");
 if (stat == 'over')
  {eval('window.status = '+imagename+'w');}
 else
  {window.status='Document: Done';}
 }

function backbutton()
 {
 if (navigator.appName == 'Netscape' && navigator.appVersion.substr(0,1) < '5')
  {
  back();
  }
 else
  {
  top.history.back();
  }
 }

function newroll(txt)
 {
 return overlib(txt);
 }

function newnav(code)
 {
 //document.form1.action = "cme_test.asp?op=test&question="+code; ph 9/19/08
 //document.form1.submit();
  if ((code != 'nonext') && (code != 'noprev'))
  {
  document.form1.action = "cme_test.asp?op=qna&page="+code;
  document.form1.submit();
  }
 else warnem(code);
 }

function evalnav(code)
 {
 document.form1.action = "cme_eval.asp?op=eval&question="+code;
 document.form1.submit();
 }

function toolbarnav(file,op,question)
 {
 document.toolbar1.action = file+"?op="+op+"&question="+question;
 document.toolbar1.submit();
 }

function popone(loc,h,w,tname)
 {
 newWindow = window.open(loc,tname,'toolbar=no,screenX=1,screenY=1,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width='+w+',height='+h+'');
 }

function popmax(doc)
 {
 hsize = window.screen.availHeight - 30;
 wsize = window.screen.availWidth - 10;
 popone(doc,hsize,wsize,'Docs');
 }

function popup(loc,h,w,tname)
 {
 newWindow = window.open(loc,tname,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+w+',height='+h+'');
 if (!newWindow.closed) newWindow.close();
 newWindow = window.open(loc,tname,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+w+',height='+h+'');
 }

function printcheck(theframe)
 {
 if (window.print)
  {
  if ((navigator.appName == 'Netscape') && (navigator.appVersion.substr(0,1) < 5))
	{
	popup('badnetscape.htm',280,400,'Print');
	}
  else
	{
	window.print();
	}
  }
 else
  {
  popup('badprint.htm',280,400,'Print');
  }
 }
