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
  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 for left hand menu - controls which list item to display
function change(id){
var menu = document.getElementById(id); 
switch(id)
{case 1:menu.style.display="";if(document.getElementById(2).style.display==""){document.getElementById(2).style.display="none"
window.document.getElementById("area2").style.backgroundColor="#D6D6D6";
window.document.getElementById("text2").style.color="#666666";}
if(document.getElementById(3).style.display==""){document.getElementById(3).style.display="none"
window.document.getElementById("area3").style.backgroundColor="#D6D6D6";
window.document.getElementById("text3").style.color="#666666";}break;
case 2:menu.style.display="";
if(document.getElementById(1).style.display==""){document.getElementById(1).style.display="none"
window.document.getElementById("area1").style.backgroundColor="#D6D6D6";
window.document.getElementById("text1").style.color="#666666";}
if(document.getElementById(3).style.display==""){document.getElementById(3).style.display="none"
window.document.getElementById("area3").style.backgroundColor="#D6D6D6";
window.document.getElementById("text3").style.color="#666666";}break;
case 3:menu.style.display="";
if(document.getElementById(1).style.display==""){document.getElementById(1).style.display="none"
window.document.getElementById("area1").style.backgroundColor="#D6D6D6";
window.document.getElementById("text1").style.color="#666666";}
if(document.getElementById(2).style.display==""){document.getElementById(2).style.display="none"
window.document.getElementById("area2").style.backgroundColor="#D6D6D6";
window.document.getElementById("text2").style.color="#666666";}break;}
}
//function for left hand menu - changes the button for an active list
function navigation(number,area,text){var num=document.getElementById(number);
if(num.style.display==""){window.document.getElementById(area).style.backgroundColor="#FFFFFF";

window.document.getElementById(text).style.color="#D7182A";}else{
window.document.getElementById(area).style.backgroundColor="#D6D6D6";
window.document.getElementById(text).style.color="#666666";}
}
//function for left hand menu - onmouseover event
function switches(number,area,text){
if(document.getElementById(number).style.display=="none"){
window.document.getElementById(area).style.backgroundColor="#FFFFFF";

window.document.getElementById(text).style.color = "#D7182A";}
}
//function for left hand meny - onmouseout event
function back_switch(number,area,text){
if(document.getElementById(number).style.display=="none"){
window.document.getElementById(area).style.backgroundColor="#D6D6D6";

window.document.getElementById(text).style.color="#666666";}
}
//functions to hide main page - unhide menu
function unhide(){document.getElementById("menu").style.display="";document.getElementById("agents").style.display="";}
function hide(){document.getElementById("main").style.display='none';}

//function to display the ColdFusion driven agent quote
function agentQuotes(ur)
{var a = document.getElementById(ur);var link = a.getAttribute('name',2);document.getElementById('agentQuote').src="agentQuote.cfm?page=/" + link;}
//function to show focus on which story line has focus
function active(section,number,text)
{
agentQuotes(text);
var num=document.getElementById(number);var txt=document.getElementById(text);txt.style.color="#D7182A";num.style.color="#D7182A"
for(i=number; i<34; i++){if(i!=number){document.getElementById(i).style.color="#666666";}}
for(i=number; i>3; i--){if(i!=number){document.getElementById(i).style.color="#666666";}}
for(j=text; j<341; j+=10){if(j!=text){document.getElementById(j).style.color="#666666";}}
for(j=text;j>34; j-=10){if(j!=text){document.getElementById(j).style.color="#666666";}}}
