// JavaScript Document

	function init() {

			if (TransMenu.isSupported()) {
				TransMenu.initialize();
				
			//	document.getElementById("home").onmouseover = function() {
			//	ms.hideCurrent();
			//		this.className = "hover";
			//		}
			//	document.getElementById("home").onmouseout = function() { this.className = ""; }

			/*	menu1.onactivate = function() { 
					document.getElementById("cc").className = "hover";
					HideContent('tagline_bc');
					HideContent('tagline_pac');
					HideContent('tagline_sme');
					HideContent('tagline_about');
					HideContent('tagline_comm');
					HideContent('tagline_resources');
					ShowContent('tagline_cc');
				};
				menu1.ondeactivate = function() { 
					document.getElementById("cc").className = "";
					HideContent('tagline_cc');
				};
*/
				menu1.onactivate = function() { 
					document.getElementById("bc").className = "hover";
					HideContent('tagline_cc');
					HideContent('tagline_pac');
					HideContent('tagline_sme');
					HideContent('tagline_about');
					HideContent('tagline_comm');
					HideContent('tagline_resources');
					ShowContent('tagline_bc');
				};
				menu1.ondeactivate = function() { 
					document.getElementById("bc").className = "";
					HideContent('tagline_bc');
				};
				
				document.getElementById("pac").onmouseover = function() {
					ms.hideCurrent();
					this.className = "hover";
					HideContent('tagline_cc');
					HideContent('tagline_bc');
					HideContent('tagline_sme');
					HideContent('tagline_about');
					HideContent('tagline_comm');
					HideContent('tagline_resources');
					ShowContent('tagline_pac');
				}
				document.getElementById("pac").onmouseout = function() { 
					this.className = "";
					HideContent('tagline_pac');
				}
				
				menu2.onactivate = function() { 
					document.getElementById("sme").className = "hover";
					HideContent('tagline_cc');
					HideContent('tagline_bc');
					HideContent('tagline_pac');
					HideContent('tagline_about');
					HideContent('tagline_comm');
					HideContent('tagline_resources');
					ShowContent('tagline_sme');
				};
				menu2.ondeactivate = function() { 
					document.getElementById("sme").className = "";
					HideContent('tagline_sme');
				};
				
				menu3.onactivate = function() { 
					document.getElementById("community").className = "hover";
					HideContent('tagline_cc');
					HideContent('tagline_bc');
					HideContent('tagline_pac');
					HideContent('tagline_about');
					HideContent('tagline_sme');
					HideContent('tagline_resources');
					ShowContent('tagline_comm');
				};
				menu3.ondeactivate = function() { 
					document.getElementById("community").className = "";
					HideContent('tagline_comm');
				};
				
				menu4.onactivate = function() { 
					document.getElementById("resources").className = "hover";
					HideContent('tagline_cc');
					HideContent('tagline_bc');
					HideContent('tagline_pac');
					HideContent('tagline_about');
					HideContent('tagline_comm');
					HideContent('tagline_sme');
					ShowContent('tagline_resources');
				};
				menu4.ondeactivate = function() { 
					document.getElementById("resources").className = "";
					HideContent('tagline_resources');
				};
								
				menu5.onactivate = function() { 
					document.getElementById("about").className = "hover";
					HideContent('tagline_cc');
					HideContent('tagline_bc');
					HideContent('tagline_pac');
					HideContent('tagline_sme');
					HideContent('tagline_comm');
					HideContent('tagline_resources');
					ShowContent('tagline_about');
				};
				menu5.ondeactivate = function() { 
					document.getElementById("about").className = "";
					HideContent('tagline_about');
				};				
				
			}
		}

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 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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "block";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}

NumImagesToRotate = 8;
random1 = 1;
random2 = 2;

imgTag1Start = '<img src="images/ctd_subpage_randomizers_top';
imgTag1End = '.jpg" height="176" width="170">';
imgTag2Start = '<img src="images/ctd_subpage_randomizers_bottom';
imgTag2End = '.jpg" height="175" width="170">';

function printImage1() {
random1 = Math.ceil(Math.random() * NumImagesToRotate);
document.write(imgTag1Start + random1 + imgTag1End);
}

function printImage2() {
//var random2 = Math.ceil(Math.random() * NumImagesToRotate);
random2 = random1 + 1;
if (random2==9) { random2=1; }
document.write(imgTag2Start + random2 + imgTag2End);
}
