<!---- *** this is the stylesheet script *** ---->
/* Check if accent is in use and if it is using hight contrast */
var contrastSuffix = "";
if(typeof accentIsHighContrast == 'function' && accentIsHighContrast()) {
  contrastSuffix = "_inv";
}

var styleSheetSuffix = "";
if((navigator.appVersion.indexOf("Mac")!= -1)){
  var maj_version = parseInt(navigator.appVersion);
  var appName = navigator.appName;
  if (appName == "Netscape" && maj_version=="4" ){
    styleSheetSuffix += "_mac_nav" + contrastSuffix;
    
  } else if (navigator.appVersion.indexOf("MSIE")>=0){
    styleSheetSuffix += "_mac_ie" + contrastSuffix;
    
  } else {
    styleSheetSuffix += "_mac_other" + contrastSuffix;
  }

} else {
  if (navigator.appVersion.indexOf("MSIE")>= 1) {
  var iInfo = navigator.appVersion.indexOf("MSIE ") + 5;
  var sInfo = navigator.appVersion.substring(iInfo);
  sVersion = parseInt(sInfo) + "";
  if(sVersion < 7)
  {
   styleSheetSuffix += "_ie" + contrastSuffix; 
  } else {
   styleSheetSuffix += "_ie7" + contrastSuffix; 
  }
 } else {
  styleSheetSuffix += "_nav" + contrastSuffix;
 }
}

document.write("<link rel=\"stylesheet\" href=\"/seniorhealth"   + styleSheetSuffix + ".css\" type=\"text/css\">");   		

<!-- *** this is to make the radio button bigger *** -->
/* Removed, has no business in JS file moved into stylesheet  JP
if ( navigator.appVersion.indexOf('MSIE') >= 0 ){
 document.write(' <style> .bigButton { width: 25px; height: 25px; }</style>' );
}
*/

<!---- buttons  and roll over images -->

function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}

function MM_preloadImages() 
{ 
//v3.0
//DJP 28 Jan 2003 - changed var name to avoid namespace collisions also removed
//    some of the preload, left navbar image caching occurs inside each topic now

var img41 = new Image();
img41.src = "/images/buttons_clickToBeginDOWN.gif";
var img42 = new Image();
img42.src = "/images/buttons_nextPageDOWN.gif";
var img43 = new Image();
img43.src = "/images/buttons_previousPageDOWN.gif";
var img44 = new Image();
img44.src = "/images/buttons_returnTopDOWN.gif";
var img45 = new Image();
img45.src = "/images/top_home2.jpg";
var img46 = new Image();
img46.src = "/images/top_mainmenu2.jpg";
var img47 = new Image();
img47.src = "/images/top_siteindex2.jpg";

// var d=document;
// if(d.images)
// { 
//  if(!d.MM_p) d.MM_p=new Array();
//   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
//   if (a[i].indexOf("#")!=0)
//   {
//    d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
//   }
// }
}

function MM_findObj(n, d) { //v3.0

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;

}

function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

<!--- Script for Video Help previous button --->
 
// Check for passed parameter(s)
function checkHelp()
{
  var reHelp = /=/;
  if(reHelp.exec(location.search))
  {
   history.back();
  }
  else
  {
   window.close();
  }
}
<!--- Script for quiz --->
 
// Extract score from URL
function setScore()
{
        var reScore = /score=(\d+)/;
        if(reScore.exec(location.search))
                {
                document.frmQuiz.score.value = RegExp.$1;
                //window.alert(RegExp.$1);
                }
        else
                {
                document.frmQuiz.score.value = 0;
                //window.alert("Score not found");
                }
} // setScore()
 
function setAction(value)
{
        var address;
 
        address = "answer_" + document.frmQuiz.page.value + value + ".html" + location.search;
        //window.alert(address);
        document.frmQuiz.action = address;
        //window.alert(document.frmQuiz.action);
        return true;
} // setAction()

function incScore()
{
        document.frmQuiz.score.value++;
} // incScore()
 
function getScore()
{
        var reScore = /score=(\d+)/;
        if(reScore.exec(location.search))
                {
                return RegExp.$1;
                }
        else
                {
                return 0;
                }
} // getScore()

function scorePage(correct)
{
        var reScore = /score=(\d+)/;
        if(reScore.exec(location.search))
        {
         var score = RegExp.$1;
         if (correct)
         score++;
         var address;
	 address = "score" + score + ".html";
	 //window.alert(address);
	 document.frmQuiz.action = address;
	 //window.alert(document.frmQuiz.action);
         return true;
        }
        else
        {
         var address;
	 address = "score0.html";
	 //window.alert(address);
	 document.frmQuiz.action = address;
	 //window.alert(document.frmQuiz.action);
         return true;
        }
} // scorePage()
function checkAnswer()
{
        var answer = document.frmQuiz.answer;
        var count = 0;
 
        //  check if more than one answer is given
        if ( answer.length == null )
                {
                if ( answer.checked ) count++;
                }
        else
                {
                for( k = 0; k < answer.length; k++ )
                        {
                        if ( answer[k].checked ) count++;
                        }
                }
 
        if ( count == 0 )
                alert( 'Please select an answer.' );
        else
                {
                document.frmQuiz.submit();
                }
} // checkSelection()

<!--- ***** Quick Time Movie java script -->

function MM_openBrWindow(theURL,winName,features) { //v2.0
  	window.open(theURL,winName,features);
}
 
function openWindow(URL, WinName, options) {
       myWindow=open(URL, WinName, options);
       myWindow.focus();
}
 
var slates = null;
var transcript = null;
var help = null;
function openTranscript(TRANSCRIPT)
{
 transcript = window.open(TRANSCRIPT,"transcript",config="left=430,screenx=0,top=20,screeny=0,height=530,width=370,menubar=yes,toolbar=no,status=yes,location=no,resizable=yes,scrollbars=yes");
 transcript.focus();
}
function openHelp()
{
 help = window.open("/videohelp.html","help",config="left=20,screenx=20,top=20,screeny=20,height=530,width=620,menubar=yes,toolbar=no,status=yes,location=no,resizable=yes,scrollbars=yes");
 help.focus();
}
function openSlate(URL)
{
 if (navigator.appVersion.indexOf("Win") >= 0)
 {
  slates = window.open(URL,"video",config="height=530,width=400,left=20,screenx=20,top=20,screeny=20,menubar=yes,toolbar=no,status=yes,location=no,resizable=yes,scrollbars=yes");
 }
 else
 {
  slates = window.open(URL,"video",config="height=530,width=400,left=0,screenx=0,top=20,screeny=0,menubar=yes,toolbar=no,status=yes,location=no,resizable=yes,scrollbars=yes");
 }
 slates.focus();
}
function openMac(URL)
{
 slates = window.open(URL,"video",config="height=530,width=400,left=0,screenx=0,top=20,screeny=0,menubar=yes,toolbar=no,status=yes,location=no,resizable=yes,scrollbars=yes");
 slates.focus();
}
function openMacTranscript(TRANSCRIPT)
{
 transcript = window.open(TRANSCRIPT,"transcript",config="left=430,screenx=0,top=20,screeny=0,height=530,width=370,menubar=yes,toolbar=no,status=yes,location=no,resizable=yes,scrollbars=yes");
 transcript.focus();
}
function openMacHelp()
{
 help = window.open("/videohelp.html","help",config="left=20,screenx=20,top=yes,screeny=20,height=530,width=620,menubar=yes,toolbar=no,status=yes,location=no,resizable=yes,scrollbars=yes");
 help.focus();
}
function openPopup(POPUP)
  {
  var popup =  window.open(POPUP,'popup','width=700,left=20,screenx=20,top=20,screeny=20,toolbar=yes,location=yes,directories=yes,menubar=yes,status=yes,scrollbars=yes,resizable=1');
  popup.focus();
  }
function openWin(myUrl)
{
    var x,y,winOptions;
    var x_dim=screen.width;
    var y_dim=screen.height;
    if(x_dim && x_dim > 640)
    {
        x=parseInt(.9 * x_dim);
        y=parseInt(.75 * y_dim);
    }
    else
    {
        x=620;
        y=440;
    }
    winOptions='width=' + x + ',height='+y+',left=10,screenx=10,top=10,screeny=10,toolbar=yes,location=yes,directories=yes,menubar=yes,status=yes,scrollbars=yes,resizable=1';
    //alert("x: " + x + " y: " + y + '\n' + winOptions);

    var popup =  window.open(myUrl,'popup', winOptions);
    popup.focus();
}
function submitcomment()
	{
	var form =
		(
		document.all ?
			document.all.FeedbackForm :
			document.FeedbackForm
		);
	var spaces = /^\s*$/ig;
	form.subject.value;

	RegExp.multiline = false;
	spaces = /^\s*$/g;
	if ( spaces.exec( form.subject.value ) != null )
		{
		alert( 'Please enter subject for this comment/question.' );
		return;
		}
	if ( spaces.exec( form.message2.value ) != null )
		{
		alert( 'Please enter message for this comment/question.' );
		return;
		}
	form.submit();
	}
// -->

