
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.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);
  if(!x && document.getElementById) x=document.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 F_loadRollover(){
} 

function F_roll(){
}

// Handles rollover images for NN3+ and IE4+
var loaded = new Array();

function F_loadRollover(image,imageName) {
	if (image && image.src &&
		(null == image.out || typeof(image.out) == typeof(void(0)))) {
		s = image.src;
		image.out = new Image();
		image.out.src = s;
		image.over = new Image();
		if (imageName.lastIndexOf('/') >= 0 || imageName.lastIndexOf('\\') >= 0) {
			s = imageName;
		} else {
			i = s.lastIndexOf('/');
			if (i<0) i = s.lastIndexOf('\\');
			if (i<0) { s = imageName; }
			else	 { s = s.substring(0,i+1) + imageName; }
		}
		image.over.src = s;
		loaded[image.name] = image;
	}
}
function F_roll(imageName,over) {
	if (document.images) {
	if (over) { imageObject = "over"; }
	else	  { imageObject = "out"; }
	image = loaded[imageName];
	if (image) {
		ref = eval("image."+imageObject);
		if (ref) image.src = eval("image."+imageObject+".src");
	}
	if (window.event)
		window.event.cancelBubble = true;
	}
}
 


function popup(url, name, w, h, scroll)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,toolbar,location,resizable';

  if (confirm("You are now leaving the OCRWM YMP Web site."))
     MyNewWindow=window.open("http://"+url,name,winprops);

}



function externLink(link) {
  if (confirm("You are now leaving the OCRWM YMP Web site."))
     window.location.href=link;
}



function golinks(){
    if (document.links.topic.options[document.links.topic.selectedIndex].value == "")
            return;
        else {
       location.href = document.links.topic.options[document.links.topic.selectedIndex].value;

    }
}


function emailCheck() {
txt=document.list.listmail.value;
if (txt.indexOf("@")<3){
alert("This email address appears inaccurate. Please"
+" check the address.");
return false;
}
if ((txt.indexOf(".com")<5)&&(txt.indexOf(".org")<5)
&&(txt.indexOf(".gov")<5)&&(txt.indexOf(".net")<5)
&&(txt.indexOf(".mil")<5)&&(txt.indexOf(".edu")<5)){
alert("This email address appears inaccurate. Please"
+" check the domain for accuracy. (It should include a suffix: "
+".com, .edu, .net, .org, .gov or .mil)");
return false;
   }
return true;
}


function pdfpop(url, name, w, h, scroll)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable';
NewWindow=window.open("http://"+url,name,winprops);

}


function printpopup(url, name, w, h, scroll)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,toolbar,location,resizable';
NewWindow=window.open("http://"+url,name,winprops);

}


function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function checkData()
{
var correct = true;
if (document.order.__phone.value == "") {correct = false; alert("Please enter a phone number")};
if (document.order.__email.value == "") {correct = false; alert("Please enter your E-mail address")};
return correct;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/* Sliding Menu JS ************************/

function goToURL() { history.go(-1); }


  var height = 20; // height of the menu headers
  var iheight = 15; // height of the menu_items
  
  var bgc = "#F7F7F7" // background color of the item
  var tc = "black" // text color of the item
  
  var over_bgc = "silver";
  var over_tc = "blue";
  
  var speed = 6;
  var timerID = "";
  var N = (document.all) ? 0 : 1;
  var width = 164
  


  var self_menu = new Array();
function write_menu()
{
  smc = 0; // count the position of the self_menu
  document.write("<div style='position: relative; top: 2px; left: 0px;'>");
  mn = 0;
  mni = 1;
  start = -1;
  
  for(i=0;i<Link.length;i++)
  {
   la = Link[i].split("|");

   if (la[0] == "0")
   {
    if(start == 0) 
     {
      document.write("</div>");
      h =  csmc * iheight;
      tmn = mn; //-h
      self_menu[smc] = new Array(tmn,h,0,-2);
      smc++;
      mn--;
     }
     csmc = 0;
    document.write("<div align='left' class='menu' style='top:"+mn+";height:"+height+"' id='down"+smc+"' onclick='pull_down("+smc+","+mni+")'>&nbsp;"+ la[1] + "</div>");
    self_menu[smc] = new Array(mn,height,0,mni);
    smc++;
    mni++;
    mn+=height;
    start = 1;
   }
   else
   {
    if(start == 1) 
     {
      if(N)mn+=2;
       document.write("<div align='left' class='item_panel' id='down"+smc+"' style='top:"+mn+"'>");
       start = 0;
     }
    
    document.write("<a href='"+la[2]+"'");
    if (la[3] != "") document.write(" target='" + la[3] + "' ");
    document.write("><div class='item' id='d"+i+"' style='height:"+iheight);
    if (N) document.write(";width:165");
    document.write("' onmouseover='color(this.id)' onmouseout='uncolor(this.id)'>&nbsp;&nbsp;"+ la[1] + "</div></a>");
    csmc++;
   }
  }
  if (start == 0) 
   {
     document.write("</div>");
     h =  csmc * iheight;
     tmn = mn + 5; //-h
     self_menu[smc] = new Array(tmn,h,0);
     name = "down" + (self_menu.length-1);
     obj = document.getElementById(name);
     obj.style.borderBottomColor = "darkblue";
     obj.style.borderBottomWidth = 1;
     obj.style.borderBottomStyle = "solid";
   }
  document.write("</div>");
}
  

function color(obj)
{
 document.getElementById(obj).style.backgroundColor = over_bgc;
 document.getElementById(obj).style.color = over_tc
}

function uncolor(obj)
{
 document.getElementById(obj).style.backgroundColor = bgc;
 document.getElementById(obj).style.color = tc
}

function pull_down(nr,c)
{
 if (timerID == "")
 {
 to = self_menu[nr+1][1]
 begin = nr + 2;
 if (timerID != "") clearTimeout(timerID);
 if (self_menu[nr+1][2] == 0)
 {
  self_menu[nr+1][2] = 1;
  if(nr == self_menu.length-2) {to++;}
  epull_down(begin,to,0);
 }
 else
 {
  to = 0;
  self_menu[nr+1][2] = 0;
  name = "down"+(nr+2);
  open_item = 0;
  for(i=0;i<nr;i++)
  {
   if(self_menu[i][2] == 1) 
    {open_item += self_menu[i][1];
    }
  }
  if (N == false) {open_item-= (c*1)};
  if (nr== self_menu.length-2) {val = self_menu[self_menu.length-1][1];to=-1;}
  else  val = parseInt(document.getElementById(name).style.top) -(open_item)-(c*height);
  epull_up(begin,to,val);
 }
 }
}

function epull_down(nr,to,nowv)
{
 name = "down" + (nr-1);
 obj = document.getElementById(name).style.clip = "rect(0,"+width+","+(nowv+1)+",0)";
 for (i=nr;i<self_menu.length;i++)
 {
  name = "down" + i;
  obj = document.getElementById(name);
  obj.style.top = parseInt(obj.style.top)+1;
 }
 nowv++;
 if(nowv < to) timerID = setTimeout("epull_down("+nr+","+to+","+nowv+")",speed);
 else timerID = "";
}

function epull_up(nr,to,nowv)
{
 name = "down" + (nr-1);
 obj = document.getElementById(name).style.clip = "rect(0,"+width+","+nowv+",0)";
 for (i=nr;i<self_menu.length;i++)
 {
  name = "down" + i;
  obj = document.getElementById(name);
  obj.style.top = parseInt(obj.style.top)-1;
 }
 nowv--;
 if(nowv > to) timerID = setTimeout("epull_up("+nr+","+to+","+nowv+")",speed);
 else timerID = "";
}

function startup(nr)
{
 write_menu();
 if (nr != 0)
 {
 for(i=0;i<self_menu.length;i++)
 {
  if(self_menu[i][3] == nr) pull_down(i,nr)
  i==self_menu.length;
 }
 }
}  

/* Crumbtrail JS ************************/

function breadcrumbs(){

  var path= new Array(20);	
  sURL = new String;
  bits = new Object;
  var x = 0;
  var stop = 0;
  var output = "<a href=\"/index.shtml\">Home</a>  >  ";
  sURL = location.href;
  sURL = sURL.slice(8,sURL.length);
  chunkStart = sURL.indexOf("/");
  sURL = sURL.slice(chunkStart+1,sURL.length)
  while(!stop){
    chunkStart = sURL.indexOf("/");
    if (chunkStart != -1){
      bits[x] = sURL.slice(0,chunkStart)
      sURL = sURL.slice(chunkStart+1,sURL.length);

    }else{
      stop = 1;
    }
    x++;
  }
  for(var i in bits){
    output += "<a href=\"";
    for(y=1;y<x-i;y++){
      output += "../";
    }
	if (bits[i] == "transport")
	{ path[i] = "Transporting Nuclear Waste"; }
	else if (bits[i] == "welcome")
	{ path[i] = "Welcome"; }
	else if (bits[i] == "ym_repository")
	{ path[i] = "Yucca Mountain Repository"; }
	else if (bits[i] == "science")
	{ path[i] = "Advanced Science Studies"; }
	else if (bits[i] == "receiving")
	{ path[i] = "Receiving Nuclear Waste"; }
	else if (bits[i] == "info_library")
	{ path[i] = "Information Library"; }
	else if (bits[i] == "links")
	{ path[i] = "Related Links"; }
	else if (bits[i] == "youth")
	{ path[i] = "Youth Zone"; }
	else if (bits[i] == "about")
	{ path[i] = "About OCRWM"; }
	else if (bits[i] == "contact")
	{ path[i] = "Contact OCRWM"; }

// third tier crumb trail

	else if (bits[i] == "newsroom")
	{ path[i] = "Newsroom"; }
		else if (bits[i] == "technical")
	{ path[i] = "Document Library"; }
			else if (bits[i] == "factsheets")
	{ path[i] = "Fact Sheets"; }
	else if (bits[i] == "quick")
	{ path[i] = "Quick Facts"; }
	else if (bits[i] == "about_project")
	{ path[i] = "About the Project"; }
	else if (bits[i] == "license")
	{ path[i] = "License Application"; }	
		else if (bits[i] == "strategy")
	{ path[i] = "The Strategy for a Safe Repository"; }
		else if (bits[i] == "regulatory")
	{ path[i] = "Regulatory Standards for Safety"; }
		else if (bits[i] == "future")
	{ path[i] = "Future Repository Safety"; }
			else if (bits[i] == "results")
	{ path[i] = "The Results of Our Safety Analyses"; }
		else if (bits[i] == "unknown")
	{ path[i] = "Dealing With the Unknown"; }
		else if (bits[i] == "confidence")
	{ path[i] = "Confidence in Our Safety Analyses"; }
			else if (bits[i] == "eprotection")
	{ path[i] = "Environmental Protection"; }	
	else if (bits[i] == "studies")
	{ path[i] = "Studies Behind Yucca Mountain"; }
	else if (bits[i] == "people")
	{ path[i] = "Protecting People and the Environment"; }
	else if (bits[i] == "weather")
	{ path[i] = "Weather Conditions"; }
	else if (bits[i] == "safety")
	{ path[i] = "Worker Safety & Health"; }
	else if (bits[i] == "foia")
	{ path[i] = "Freedom of Information Act"; }
	else if (bits[i] == "rad_explained")
	{ path[i] = "Radiation Explained"; }
	else if (bits[i] == "pm")
	{ path[i] = "Program Management"; }
	else if (bits[i] == "advanced_tech")
	{ path[i] = "Advanced Technologies"; }
	else if (bits[i] == "targeted_thrusts")
	{ path[i] = "Targeted Thrusts"; }
	else if (bits[i] == "business")
	{ path[i] = "Business & Employment"; }
	else if (bits[i] == "disruptevent")
	{ path[i] = "Disruptive Event Analyses"; }
	else if (bits[i] == "analogues")
	{ path[i] = "Natural Analogues"; }
	else if (bits[i] == "tspa")
	{ path[i] = "Total System Performance Assessment"; }
	else if (bits[i] == "qa")
	{ path[i] = "Quality Assurance"; }
	else if (bits[i] == "ymsd")
	{ path[i] = "Yucca Mountain Site Description"; }
	else if (bits[i] == "photos")
	{ path[i] = "Audiovisual Gallery"; }
	else if (bits[i] == "comments")
	{ path[i] = "Public Comments"; }

	else if (bits[i] == "budget")
	{ path[i] = "Budget & Funding"; }
	
		else if (bits[i] == "why")
	{ path[i] = "Why Yucca Mountain"; }
			else if (bits[i] == "concept")
	{ path[i] = "The Repository Concept"; }
				else if (bits[i] == "waste_explained")
	{ path[i] = "Nuclear Waste Explained"; }
	
				else if (bits[i] == "sr")
	{ path[i] = "Site Recommendation"; }
	
				else if (bits[i] == "program_docs")
	{ path[i] = "Program Documents"; }
					else if (bits[i] == "qa")
	{ path[i] = "Quality Assurance"; }
					else if (bits[i] == "annualreports")
	{ path[i] = "Annual Reports"; }

	
    output += bits[i] + "/index.shtml\">" + path[i] + "</a>  >  ";
  }

  document.write(output + document.title);
}

/* Crumbtrail JS for factsheets, technical, calendar and other off directory sites************************/

function breadcrumbs1(){

  var path= new Array(20);	
  sURL = new String;
  bits = new Object;
  var x = 3;
  var stop = 0;
  var output = "<a href=\"/info_library/index.shtml\">Information Library</a>  >  ";
  sURL = location.href;
  sURL = sURL.slice(8,sURL.length);
  chunkStart = sURL.indexOf("/");
  sURL = sURL.slice(chunkStart+1,sURL.length)
  while(!stop){
    chunkStart = sURL.indexOf("/");
    if (chunkStart != -1){
      bits[x] = sURL.slice(0,chunkStart)
      sURL = sURL.slice(chunkStart+1,sURL.length);

    }else{
      stop = 1;
    }
    x++;
  }
  for(var i in bits){
    output += "<a href=\"";
    for(y=0;y<x-i;y++){
      output += "../";
    }
	if (bits[i] == "transport")
	{ path[i] = "Transporting Nuclear Waste"; }
	else if (bits[i] == "welcome")
	{ path[i] = "Welcome"; }
	else if (bits[i] == "ym_repository")
	{ path[i] = "Yucca Mountain Repository"; }
	else if (bits[i] == "science")
	{ path[i] = "Advanced Science Studies"; }
	else if (bits[i] == "receiving")
	{ path[i] = "Receiving Nuclear Waste"; }
	else if (bits[i] == "info_library")
	{ path[i] = "Information Library"; }
	else if (bits[i] == "links")
	{ path[i] = "Related Links"; }
	else if (bits[i] == "youth")
	{ path[i] = "Youth Zone"; }
	else if (bits[i] == "about")
	{ path[i] = "About Us"; }
	else if (bits[i] == "contact")
	{ path[i] = "Contact OCRWM"; }

// third tier crumb trail

	else if (bits[i] == "newsroom")
	{ path[i] = "Newsroom"; }
		else if (bits[i] == "technical")
	{ path[i] = "Document Library"; }
			else if (bits[i] == "factsheets")
	{ path[i] = "Fact Sheets"; }
		else if (bits[i] == "calendar")
	{ path[i] = "OCRWM Calendar"; }

	

    output += bits[i] + "/index.shtml\">" + path[i] + "</a>  >  ";
  }

  document.write(output + document.title);
}
/* Crumbtrail JS for factsheets, technical, calendar and other off directory sites.************************/

function breadcrumbs2(){

  var path= new Array(20);	
  sURL = new String;
  bits = new Object;
  var x = 3;
  var stop = 0;
  var output = "<a href=\"/ym_repository/index.shtml\">Yucca Mountain Repository</a>  >  ";
  sURL = location.href;
  sURL = sURL.slice(8,sURL.length);
  chunkStart = sURL.indexOf("/");
  sURL = sURL.slice(chunkStart+1,sURL.length)
  while(!stop){
    chunkStart = sURL.indexOf("/");
    if (chunkStart != -1){
      bits[x] = sURL.slice(0,chunkStart)
      sURL = sURL.slice(chunkStart+1,sURL.length);

    }else{
      stop = 1;
    }
    x++;
  }
  for(var i in bits){
    output += "<a href=\"";
    for(y=0;y<x-i;y++){
      output += "../";
    }
	if (bits[i] == "weather")
	{ path[i] = "Weather Conditions"; }


	

    output += bits[i] + "/weather.shtml\">" + path[i] + "</a>  >  ";
  }

  document.write(output + document.title);
}