// product_i.js   functions for product pages with tabs and panels  conor dec 04
// productj.js    upgrade tab functions May 05, and add View button code
//productjb.js    add code to force page into frameset Conor 12 Jun 05
//                add Download buttons (for D3 controls)

	// to force page into frameset

      function checkFrameset() {
         var minNav3 = (navigator.appName == "Netscape" && 
            parseInt(navigator.appVersion) >= 3);
         var minIE4 = (navigator.appName.indexOf("Microsoft") >= 0 &&
            parseInt(navigator.appVersion) >= 4);
         var minDOM = minNav3 || minIE4;   // baseline DOM required for this function
         var isNav4 = (navigator.appName == "Netscape" && 
            parseInt(navigator.appVersion) == 4);
         if (parent == window) {
            // Don't do anything if running NN4 
            // so that the frame can be printed on its own
            if (isNav4 && window.innerWidth == 0) {
               return;
            }
            if (minDOM) {
               // Use replace() to keep current page out of history
               location.replace("../index.html?content=" + escape(location.href));
            } else {
               location.href = "../index.html?content=" + escape(location.href);
            }
         }
      }
      // Invoke the function
      checkFrameset();


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//for tabs, using sliding panel span technique conor nov 04
//          refined conor may 05

var oldSpan, selectedTab; 
if (document.images){  // these are dummy variables to force the pre-load.
						// I can't get backgroundImage to use variables
						// but worthwhile loading them anyway ?
	tabNormal = new Image(150,25);
	tabNormal.src = "../images2/tabsgrey1.gif";
	tabSelected = new Image(150,25);
	tabSelected.src = "../images2/tabsgrey2.gif";
	tabOver = new Image(150,25);
	tabOver.src = "../images2/tabsgrey3.gif";
}
	
function tabInit(){
		if (document.getElementById) {
			selectedTab = document.getElementById('tabbutton1');
			oldSpan = document.getElementById('tab1');
		}
}

function toggleTab(myTab, currSpan) {        
		if (document.getElementById) {
			thisSpan = document.getElementById(currSpan);
			if (thisSpan == oldSpan) {   // if click the displayed Tab again, do nothing
				window.status = '';
				return false
			}
			if (oldSpan) {
				oldSpan.style.display = "none" ; // undisplay old Tab content, if defined 
				selectedTab.style.backgroundImage = "url(../images2/tabsgrey1.gif)"; // un-highlight old tab
				selectedTab.style.borderBottomColor = "#000000";
				window.status = '';
			}
			myTab.style.backgroundImage = "url(../images2/tabsgrey3.gif)"; // highlight tab
			myTab.style.borderBottomColor = "#CCCCCC";
			window.status = '';
			thisSpan.style.display = "block";  // display new Tab content
			oldSpan = thisSpan;
			selectedTab = myTab;
			return false
		}
		else {
			return true
		}
	}
	
function mOver (myTab) {   // highlight tab when mouse over
			myTab.style.backgroundImage = "url(../images2/tabsgrey3.gif)";
			window.status = '';
}
	
function mOut (myTab) {    // on mouse out, set tab to selected or normal
			if (myTab == selectedTab) {
			myTab.style.backgroundImage = "url(../images2/tabsgrey2.gif)";
			}
			else {
			myTab.style.backgroundImage = "url(../images2/tabsgrey1.gif)";
			}
			window.status = '';
}

// View button code. Preload View button images, and (2 Apr 08) download button images
		if (document.images){
			view1=new Image(48,18);
			view2=new Image(48,18);
			view1.src="../images2/viewbutton1.gif";
			view2.src="../images2/viewbutton2.gif";
			download1=new Image(72,18);
			download2=new Image(72,18);
			download1.src="../images2/downloadbutton1.gif";
			download2.src="../images2/downloadbutton2.gif";
		}
		else {
			view1="";
			view2="";
			download1="";
			download2="";
			document.view="";
		}
// to do button rollover on View links
		function chgImg(linkfield, newImg){
			if (document.images) {
				linkfield.firstChild.src = eval(newImg + ".src");
			}
			window.status = '';
			return true;
		}
