/*
function AddBookmark(title, url){

if (window.sidebar && (navigator.userAgent.indexOf("Firefox")!=-1)) { // Mozilla Firefox Bookmark	
	window.sidebar.addPanel(document.title, location.href,"");	} 

else if( (window.external && (navigator.userAgent.indexOf("America Online")==-1)) && (window.external && (navigator.userAgent.indexOf("AOL")==-1)) && (window.external && (navigator.userAgent.indexOf("Netscape")==-1)))  { // IE Favorite	
	window.external.AddFavorite(location.href,document.title);}
else{
	if(navigator.userAgent.indexOf("AOL")!=-1){
			alert("Press CTRL++ to bookmark this page");
		}
	else{
		alert("Press CTRL+D to bookmark this page");
	
		}

	}

}
*/
function MM_preloadImages() { //v3.0
  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) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); 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];}
}

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 leaveSite(url){
window.open(url,"PandemicExit")
}


/*function MM_preloadImages() { //v3.0
  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_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_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); 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];}
}
*/
function hand_func()
{
var y=hand_func.arguments;
document.getElementById(y[0]).style.cursor='pointer';
}
var i=0;
function GetImage()
{
var x=GetImage.arguments;
document.getElementById("largeImage").src=x[0]
if(x[1]=='1st_image')
{
i=0
SetBrdBkgoff()
SetBrdBkgon("smlBkg1","smlBdr1")
/*document.getElementById("smlBkg1").setAttribute("background","images/gradient_large_vertical.jpg")
document.getElementById("smlBdr1").setAttribute("className","Rnav_borderRed")
document.getElementById("smlBdr1").setAttribute("class","Rnav_borderRed")*/
document.getElementById("largeImage").alt="Educational Tool"
document.getElementById("link").href="../preparing-flupandemic/preparing-flupandemic.aspx?state=0"

//document.getElementById("content").innerHTML='<span class="blue_bold_copy2"><u>Learning About Influenza<br /> </u></span> <span class="bodyTextSubHead2 style1">An interactive  module that explores:</span><table width="174" height="79" border="0" cellpadding="0" cellspacing="0"><tr><td width="10" height="24" valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td><td width="135" valign="top" class="bodyText122">Differences between <br />seasonal &amp; &nbsp;pandemic flu</td></tr> <tr><td height="14" valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td><td valign="top" class="bodyText122">How to prepare for a flu pandemic</td></tr><tr><td valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td><td valign="top" class="bodyText122">How to respond to a flu pandemic  </td></tr></table>'
//document.getElementById("content").innerHTML='<span class="blue_bold_copy2"><u>Learning About Influenza<br /></u></span> <span class="bodyTextSubHead2">An interactive module that explores:<br /><br /></span><table width="174" height="103" border="0" cellpadding="0" cellspacing="0"><tr> <td width="10" height="31" valign="top"><img src="images/bullet_gray.jpg" width="10" height="10" /></td><td width="135" valign="top"><span class="bodyText122">Differences between seasonal &amp; pandemic flu</span></td></tr><tr><td height="31" valign="top"><img src="images/bullet_gray.jpg" width="10" height="10" /></td>  <td valign="top"><span class="bodyText122">How to prepare for a flu pandemic</span></td></tr> <tr><td valign="top"><img src="images/bullet_gray.jpg" width="10" height="10" /></td><td valign="top"><span class="bodyText122">How to respond to a flu pandemic</span></td></tr> </table>'
document.getElementById("content").innerHTML='<span class="blue_bold_copy2"><u><a href="../preparing-flupandemic/preparing-flupandemic.aspx?state=0">Learning About Influenza<img src="../images/Red_Arrow2.gif" alt="Educational Tool" width="8" height="10" border="0" title="Educational Tool" /></a><br /></u></span><span class="bodyTextSubHead2">An interactive module that explores:<br /><br /></span><table width="174" height="103" border="0" cellpadding="0" cellspacing="0"><tr><td width="10" height="31" valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td><td width="135" valign="top"><span class="bodyText122">Differences between<br> seasonal &amp; pandemic flu</span></td></tr><tr><td height="31" valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td><td valign="top"><span class="bodyText122">How to prepare for a flu pandemic</span></td></tr><tr><td valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td><td valign="top"><span class="bodyText122">How to respond to a flu pandemic</span></td></tr></table>'

}
if(x[1]=='2nd_image')
{

i=1;
SetBrdBkgoff()
SetBrdBkgon("smlBkg2","smlBdr2")
/*document.getElementById("smlBkg2").setAttribute("background","images/gradient_large_vertical.jpg")
document.getElementById("smlBdr2").setAttribute("className","Rnav_borderRed")
document.getElementById("smlBdr2").setAttribute("class","Rnav_borderRed")*/
document.getElementById("largeImage").alt="White Papers";
document.getElementById("link").href="../educational-resources/white-papers.aspx?state=1"
document.getElementById("content").innerHTML='<span class="blue_bold_copy2"><u><a href="../educational-resources/white-papers.aspx?state=1">Critical Infrastructure Preparedness<img src="../images/Red_Arrow2.gif" alt="White Papers" width="8" height="10" border="0" title="White Papers" /></a><br /></u></span><span class="bodyTextSubHead2">How leading Critical Infrastructure Organizations are planning to:<br /><br /></span></span><table width="174" height="73" border="0" cellpadding="0" cellspacing="0"><tr><td width="10" height="14" valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td><td width="135" valign="top"><span class="bodyText122">Protect their businesses</span></td></tr><tr><td height="13" valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td><td valign="top"><span class="bodyText122">Protect their corporate reputations </span></td></tr><tr><td height="18" valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td><td valign="top"><span class="bodyText122">Protect their employees</span></td></tr></table>'
}
if(x[1]=='3rd_image')
{
i=2
SetBrdBkgoff()
SetBrdBkgon("smlBkg3","smlBdr3")
/*document.getElementById("smlBkg3").setAttribute("background","images/gradient_large_vertical.jpg")
document.getElementById("smlBdr3").setAttribute("className","Rnav_borderRed")
document.getElementById("smlBdr3").setAttribute("class","Rnav_borderRed")*/
document.getElementById("largeImage").alt="Pandemic Workshop"
document.getElementById("link").href="../educational-resources/white-papers.aspx?state=2"
document.getElementById("content").innerHTML='<span class="blue_bold_copy2"><u><a href="../educational-resources/white-papers.aspx?state=2">Hospital Pandemic Workshop<img src="../images/Red_Arrow2.gif" alt="Pandemic Workshop" width="8" height="10" border="0" title="Pandemic Workshop" /></a></u></span><br /><span class="bodyTextSubHead2">Lessons learned from a hospital pandemic workshop<br /><br /></span><table width="174" height="85" border="0" cellpadding="0" cellspacing="0"><tr><td width="10" height="27" valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td><td width="135" valign="top"><span class="bodyText122">Learn what other hospitals discovered</span></td> </tr> <tr><td height="26" valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td><td valign="top"><span class="bodyText122">Recommendations for complex issues</span></td></tr><tr><td height="32" valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td><td valign="top"><span class="bodyText122">Ways to improve your pandemic plan</span></td></tr></table>'
}
if(x[1]=='4th_image')
{
i=3
SetBrdBkgoff()
SetBrdBkgon("smlBkg4","smlBdr4")
/*document.getElementById("smlBkg4").setAttribute("background","images/gradient_large_vertical.jpg")
document.getElementById("smlBdr4").setAttribute("className","Rnav_borderRed")
document.getElementById("smlBdr4").setAttribute("class","Rnav_borderRed")*/
document.getElementById("largeImage").alt="Video History of Pandemic Influenza"
document.getElementById("link").href="../premium-pages/webcasts.aspx?tg=1&state=3"
document.getElementById("content").innerHTML='<span class="blue_bold_copy2"><u><a href="../premium-pages/webcasts.aspx?tg=1&state=3">History of Pandemic Influenza<img src="../images/Red_Arrow2.gif" alt="Video History of Pandemic Influenza" width="8" height="10" border="0" title="Video History of Pandemic Influenza" /></a><br /></u></span><span class="bodyTextSubHead2">One in a series of pandemic videocasts, that explores:<br /><br /></span> <table width="174" height="86" border="0" cellpadding="0" cellspacing="0"><tr> <td width="10" height="27" valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td><td width="135" valign="top"><span class="bodyText122">The origins of pandemic <br />&nbsp;influenza </span></td></tr><tr><td height="18" valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td><td valign="top"><span class="bodyText122">The Great Influenza of 1918</span></td></tr><tr><td valign="top"><img src="../images/bullet_gray.jpg" width="10" height="10" /></td> <td valign="top"><span class="bodyText122">Other pandemics of the 20th century<br /><br /></span></td></tr></table>'
}

}
function AltMaker()
{
if(i==0)
document.getElementById("largeImage").title="Educational Tool"
if(i==1)
document.getElementById("largeImage").title="White Papers"
if(i==2)
document.getElementById("largeImage").title="Pandemic Workshop"
if(i==3)
document.getElementById("largeImage").title="Video History of Pandemic Influenza"
}

function SetBrdBkgoff()
{
document.getElementById("smlBkg1").setAttribute("background","")
document.getElementById("smlBkg2").setAttribute("background","")
document.getElementById("smlBkg3").setAttribute("background","")
document.getElementById("smlBkg4").setAttribute("background","")
document.getElementById("smlBdr1").setAttribute("className","")
document.getElementById("smlBdr2").setAttribute("className","")
document.getElementById("smlBdr3").setAttribute("className","")
document.getElementById("smlBdr4").setAttribute("className","")
document.getElementById("smlBdr1").setAttribute("class","")
document.getElementById("smlBdr2").setAttribute("class","")
document.getElementById("smlBdr3").setAttribute("class","")
document.getElementById("smlBdr4").setAttribute("class","")
}
function SetBrdBkgon()
{

var prop=SetBrdBkgon.arguments
document.getElementById(prop[0]).setAttribute("background","images/gradient_large_vertical.jpg")
document.getElementById(prop[1]).setAttribute("className","Rnav_borderRed")
document.getElementById(prop[1]).setAttribute("class","Rnav_borderRed")
}

function GetCenterContent()
{
i=document.getElementById("hidnstate").value;
//alert(i);
if(i==0)
{
GetImage('images/large_callout1.jpg','1st_image')
}
if(i==1)
{
GetImage('images/large_callout2.jpg','2nd_image')
}
if(i==2)
{
GetImage('images/large_callout3.jpg','3rd_image')
}
if(i==3)
{
GetImage('images/large_callout4.jpg','4th_image')
}
}
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function verifyQueryTop(){
//var strQuery = document.queryboxtop.query.value;
var strQuery = document.gs.q.value;
var reNonSpace = /\S/g;
if (reNonSpace.test(strQuery)) {
//document.queryboxtop.submit();
document.gs.submit();
} else {
alert("Please enter a question and click 'Submit' to submit your question");
document.gs.q.focus();
return false;
}
}



/* Select Text Size function

function setActiveStyleSheet(title,asize) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
	if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
     if(a.getAttribute("title") == 'print') a.disabled = false;
    }
  }

// Ed Toro: added this line to handle times when asize isn't specified instead of changing HTML to always specify
  if(!asize) asize = title + 'A';
  createCookie("style", title, 365);
}

function highlightStyleText()
{ 
var sheetType = readCookie("style");//getActiveStyleSheet()
setActiveStyleSheet(sheetType,sheetType+'A');
}
function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

window.onload = function(e) {
  var cookie = readCookie("style");  
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title,'');
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

function optionSelect(formname) {
    location.href = formname.GoWhere.options[formname.GoWhere.options.selectedIndex].value;
}
*/
function printWindow(url){
window.open(url,'print','scrollbars=yes,width=750,height=555');
}

function checkquery()
{
	document.getElementById('popup').innerHTML=""
	var query = window.location.search.substring(1);
	//alert(" html " + document.getElementById('popup').innerHTML);
	if(query!="")
	{
		var val=readCookie("movie");
		var parms = query.split('=');
		if(val==parms[1])
		{				
			document.getElementById('popup').innerHTML= '<iframe id="popup" src="' + url + '" width="0" height="0"></iframe>';
		}
		//alert(val + " frame url aft4 " + document.getElementById('popup').);						
		createCookie("0");
	}		
}

function myFunc()
{	
	return true;
}

function launchwin(param,url)
{
	createCookie(param);
	url1= url;
	window.location.href=url1;		
	return true;
}

function createCookie(value)
{
	document.cookie = "movie="+value+"; path=/";
}

function readCookie(name) 
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}	
