function Show(Page) {
    var RegPages=new Array("RegCartPane","RegIndPane","RegMainPane","RegWavPane","RegInstPane","RegDepoPane","RegRecPane");
    for (var i=0;i<7;i++) {	
        if (RegPages[i] == Page) { 
	        document.getElementById(RegPages[i]).style.display='';
	        }
        else {
	        document.getElementById(RegPages[i]).style.display='none';
	        }
    }
}
        
var FCKeditorLoaded = false;
function FCKeditor_OnComplete(editorInstance) {
  FCKeditorLoaded = true;
}
function switchEditors(ID) {
  if(!FCKeditorLoaded) {
    setTimeout('switchEditors(\'' + ID + '\')', 500);
    return;
  }
  DoSwitchEditors(document.getElementById(ID));
}
function DoSwitchEditors(oNode) {
  var i;
  for (i = 0; i < oNode.childNodes.length;i++) {
    childNode = oNode.childNodes.item(i);
    editor = FCKeditorAPI.GetInstance(childNode.name);
    if (editor && editor.EditorDocument && editor.EditMode == FCK_EDITMODE_WYSIWYG) {
      editor.SwitchEditMode();
      editor.SwitchEditMode();
    }
    DoSwitchEditors(childNode);
  }
}

var offsetfromcursorX=12 
var offsetfromcursorY=10 

var offsetdivfrompointerX=10 
var offsetdivfrompointerY=14

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="images/arrow2.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
    var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
    if (ns6||ie){
        if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
            if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
        tipobj.innerHTML='<font class=BodyTx>' + thetext + '</font>';
        enabletip=true;
    }
    return false;
}

function positiontip(e){
if (enabletip){
    var nondefaultpos=false
    var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
    var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
    //Find out how close the mouse is to the corner of the window
    var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
    var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

    var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
    var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

    var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

    //if the horizontal distance isn't enough to accomodate the width of the context menu
    if (rightedge<tipobj.offsetWidth){
        //move the horizontal position of the menu to the left by it's width
        tipobj.style.left=curX-tipobj.offsetWidth+"px"
        nondefaultpos=true
    }
    else if (curX<leftedge)
        tipobj.style.left="5px"
    else{
        //position the horizontal position of the menu where the mouse is positioned
        tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
        pointerobj.style.left=curX+offsetfromcursorX+"px"
    }

    //same concept with the vertical position
    if (bottomedge<tipobj.offsetHeight){
        tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
        nondefaultpos=true
    }
    else{
        tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
        pointerobj.style.top=curY+offsetfromcursorY+"px"
    }
    tipobj.style.visibility="visible"
    if (!nondefaultpos)
        pointerobj.style.visibility="visible"
    else
        pointerobj.style.visibility="hidden"
    }
}

function hideddrivetip(){
    if (ns6||ie){
        enabletip=false
        tipobj.style.visibility="hidden"
        pointerobj.style.visibility="hidden"
        tipobj.style.left="-1000px"
        tipobj.style.backgroundColor=''
        tipobj.style.width=''
    }
}

document.onmousemove=positiontip

var sfHover = function() {
    if (document.getElementById("nav")) {
	    var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	    for (var i=0; i<sfEls.length; i++) {
		    sfEls[i].onmouseover=function() {
			    this.className+=" sfhover";
		    }
		    sfEls[i].onmouseout=function() {
			    this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		    }
	    }
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


if (document.images) {
  var endon = new Image();
  endon.src = "images/btn_right_w.gif";
  var endoff = new Image();
  endoff.src = "images/btn_right_g.gif";

  var image1on = new Image();
  image1on.src = "images/results_w.gif";
  var image2on = new Image();
  image2on.src = "images/onlinereg_w.gif";
  var image3on = new Image();
  image3on.src = "images/systems_w.gif";
  var image4on = new Image();
  image4on.src = "images/services_w.gif";
  var image5on = new Image();
  image5on.src = "images/contactus_w.gif";
  
  var image1off = new Image();
  image1off.src = "images/results_g.gif";
  var image2off = new Image();
  image2off.src = "images/onlinereg_g.gif";
  var image3off = new Image();
  image3off.src = "images/systems_g.gif";
  var image4off = new Image();
  image4off.src = "images/services_g.gif";
  var image5off = new Image();
  image5off.src = "images/contactus_g.gif";
}

function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
    if (document.endimg.src == endon.src) {
		document.endimg.src = endoff.src;
	}
	else {
		document.endimg.src = endon.src;
	}
  }
}

var startHighlight = function()
{				
	if (document.all && document.getElementById)
	{
		if(document.getElementById("table1")) {
			navRoot = document.getElementById("table1");					
			// Get a reference to the TBODY element 
			tbody = navRoot.childNodes[0];			
			for (i = 1; i < tbody.childNodes.length; i++)
			{
				node = tbody.childNodes[i];
				if (node.nodeName == "TR")
				{
					node.onmouseover=function()
					{
						this.className = this.className.replace("row", "over");						
					}					
					node.onmouseout=function()
					{
						this.className = this.className.replace("over", "row");
					}
				}
			}
		}
	}
}	
window.onload = startHighlight;

		