execOnLoad = function() {
 updateContentForNav();
 an_StartList();
 fixH('jsLeftCont','jsRightCont');
 //timedCount();
 //timedCount2();
 //an_SetNavAndCrumbs();
// preloadImages();
 //initPopups();
// Back/Forward remedy for javascript-controlled tabs. Only works for VI3 pages for now.
// if(usetabs = true) { return pollHash(); }
 if (window.location.href.match('/products/server/') || window.location.href.match('/products/vi/')) {
   return pollHash();
 }
}

execNow = function() {
 updateContentForNav();
}

window.onload=execOnLoad;

// ------------------------------------------------------------------------- \\

function updateContentForNav() {
  if (document.getElementById("secondary_navigation")) {
    var cw = document.getElementById("content-wrapper");
	if(cw && cw.style) {
		cw.style.marginRight = "200px";
		if (!cw.attributes["id"].value) { cw.style.width = "100%"; } /* IE 5.5 needs this also */
	};
  }
}

function an_StartList() {
  if (document.all&&document.getElementById && !window.opera) {
    navRoot = document.getElementById("primary-navigation");
    if (navRoot) {
      for (i=0; i<navRoot.childNodes.length; i++) {
   	    node1 = navRoot.childNodes[i];
       	if (node1.nodeName=="UL") {
	      for (j=0; j<node1.childNodes.length; j++) {
    	    node2 = node1.childNodes[j];
        	if (node2.nodeName=="LI") {
	          node2.onmouseover=function() {
    	        this.className+=" over";
        	  }
	          node2.onmouseout=function() {
    	        this.className=this.className.replace(" over", "");
        	  }
    } } } } }
	navRoot = document.getElementById("sites");
    if (navRoot) {
      for (i=0; i<navRoot.childNodes.length; i++) {
        node = navRoot.childNodes[i];
		if (node.attributes["class"].value) { cls = node.attributes["class"].value; } /* IE 6 */
		else { cls = node.attributes["class"]+""; /* IE 5.5 */ }
		if (cls.indexOf("expand") >= 0) {
          if (node.nodeName=="LI") {
            node.onmouseover=function() {
              this.className+=" over";
            }
            node.onmouseout=function() {
              this.className=this.className.replace(" over", "");
            }
    } } } }
	cls = "";
    navRoot = document.getElementById("site-tools");
    if (navRoot) {
      for (i=0; i<navRoot.childNodes.length; i++) {
   	    node1 = navRoot.childNodes[i];
       	if (node1.nodeName=="UL") {
	      for (j=0; j<node1.childNodes.length; j++) {
    	    node2 = node1.childNodes[j];
			if (node2.attributes["class"].value) { cls = node2.attributes["class"].value; /* IE 6 */ }
			else { cls = node2.attributes["class"]+""; /* IE 5.5 */ }
			if (cls.indexOf("expand") >= 0) {
        	if (node2.nodeName=="LI") {
	          node2.onmouseover=function() {
    	        this.className+=" over";
        	  }
	          node2.onmouseout=function() {
    	        this.className=this.className.replace(" over", "");
        	  }
    } } } } } }
} }


function an_IE_GetAttribute(tag,attribute,removeOnlyIfTwo) {
  attribute = attribute.toLowerCase();
  // Find the first instance of the attribute.
  var startOfClass = tag.toLowerCase().indexOf(attribute);
  if (startOfClass == -1) { return tag; /* probably need some kind of timeout event or something because IE sucks */ }
  // Make sure there is another class assigned
  if (startOfClass != tag.toLowerCase().lastIndexOf(attribute) || !removeOnlyIfTwo) {
    // Find the first space after the first class
    var lengthOfClass = tag.substring(startOfClass).indexOf(" ");
    // The string to remove is from 'class' up to the next space
    var classString = tag.substr(startOfClass,lengthOfClass)+" ";
    tag = an_StringReplace(tag,classString,"");
  }
  return tag;
}

/**** DOM CSS Width Allocater ***/
function fixH(one,two) 
{
	if (document.getElementById(one))
	{
		var lh=document.getElementById(one).offsetHeight;
		var rh=document.getElementById(two).offsetHeight;
		var nh = Math.max(lh, rh);
		document.getElementById(one).style.height=nh-19+"px";
		document.getElementById(two).style.height=nh+"px";
	}
}
/**** end DOM CSS Width Allocater ***/


function mainPage()
{
	if (isHomeInt != null)
	{
		timedCount();
		timedCount2();
	}
}

/**** Front Page Graphic and Textual Switch ****/
var imgTextStr = "";
var t
function timedCount()
{
	var ranNumInt = (Math.floor(Math.random()*6));
	switch (ranNumInt)
	{
		case 0:
			imgTextStr = '<img src="images/fpContortionist.png">';
			break;
		case 1:
			imgTextStr = '<img src="images/fpDart.png">';
			break;
		case 2:
			imgTextStr = '<img src="images/fpMaze.png">';
			break;
		case 3:
			imgTextStr = '<img src="images/fpRope.png">';
			break;
		case 4:
			imgTextStr = '<img src="images/fpScale.png">';
			break;
		case 5:
			imgTextStr = '<img src="images/fpShoes.png">';
			break;
	}
	document.getElementById('jsRightCont').innerHTML = imgTextStr;
	t=setTimeout("timedCount()",10000);
}

var customerTestimonialStr = "";
var t2
function timedCount2()
{
	var ranNumInt = (Math.floor(Math.random()*6));
	switch (ranNumInt)
	{
		case 0:
			customerTestimonialStr = '<em>“Your idea made me enough to subscribe for the next 217 years so you can consider me a long-term Subscriber.”</em><br /><div style="margin-left: 400px;">-- John F., New York, NY</div>';
			break;
		case 1:
			customerTestimonialStr = '<em>“Every <b>BSR Alert</b> and issue of <b>Biotech Monthly</b> is an eagerly awaited event!” </em><br /><div style="margin-left: 400px;">-- -- Zeke S., New York, NY</div>';
			break;
		case 2:
			customerTestimonialStr = '<em>“I\'ve always thought your service and coverage was very good.  Hope to take a look at BSR+Alpha soon.”</em><br /><div style="margin-left: 400px;">-- Bert R., Encino, CA</div>';
			break;
		case 3:
			customerTestimonialStr = '<em>“Your informative, hard hitting, & to-the-point articles have been an asset to my portfolio AND my peace of mind.”</em><br /><div style="margin-left: 400px;">--Jeff H., Issaquah, WA</div>';
			break;
		case 4:
			customerTestimonialStr = '<em>“Sign me up for another year. It\'s the best buy for the money in the biotech investing field.” </em><br /><div style="margin-left: 400px;">-- John H., Charlotte, NC</div>';
			break;
		case 5:
			customerTestimonialStr = '<em>“Thank you again for your intelligent and refreshingly unbiased analysis.” </em><br /><div style="margin-left: 400px;">-- Bruce W., Bellevue, WA</div>';
			break;
	}
	document.getElementById('jsQoute').innerHTML = customerTestimonialStr;
	t2=setTimeout("timedCount2()",10000);
}
/**** end Front Page Graphic and Textual Switch ****/