function SymError()
{
  return true;
}

window.onerror = SymError;

function stoperror(){
return true
}
window.onerror=stoperror

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) { //v3.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); 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];}
}

var color = '';

function over(a,b,c,d,id,cc) {

    MM_swapImage(a,b,c,d);

    if (document.getElementById) {
        color = document.getElementById(id).style.backgroundColor;
        document.getElementById(id).style.backgroundColor = cc;

    }

}

function out(id) {

    MM_swapImgRestore();

    if (document.getElementById)
        document.getElementById(id).style.backgroundColor  = color;



}

function subCancel (subID,col){

  var sub = document.getElementById(subID);
  sub.style.background = col;
}

function subHover (subID,col){

  var sub = document.getElementById(subID);
  sub.style.background = col;

}

function rate(rt,f) {

  for (i = 1; i <= rt; i++) {

    r = i/2;
    temp = r.toString();


    if (temp.length > 1) {

      side = 1;

    }
    else {

      side = 2;

    }


    MM_swapImage("rate"+i,"","images/"+f+"rate_"+side+".gif",1);

  }

}

var xOffset = -100;
var yOffset = -150;
var timeoutID;
var txtId  = "off_desc_txt";
var addId  = "off_desc_add";
var expId  = "off_desc_exp";

// function triggered by glossary term mouseover events does the core
// work of positioning the definition "window" for the particular browser
// in use and enables its visibility
function show( domId, eventObj,txtVal,addVal,expVal)
{
    var theWidth = 0
    var theHeight = 0

    if(eventObj) {

    	hide(domId);

        // move popup div to current cursor position
	    // (add scrollTop to account for scrolling for IE)
	    var left = mouseX(eventObj) + xOffset + "px";
	    var top = mouseY(eventObj) + yOffset + "px";

	    setIdProperty( domId, "left", left )
	    setIdProperty( domId, "top", top )

        document.getElementById( txtId ).innerHTML = txtVal;
        document.getElementById( addId ).innerHTML = addVal;
        document.getElementById( expId ).innerHTML = expVal;

	    // timeout delay
	    timeoutID = window.setTimeout( 'setIdProperty( "'+ domId + '", "visibility", "visible" );', 200 );
    }
}

function hide( domId )
{

    // cancel the dely on the show code
    window.clearTimeout(timeoutID);

    setIdProperty( domId, "visibility", "hidden" );
    document.getElementById( txtId ).innerHTML = "";
    document.getElementById( addId ).innerHTML = "";
    document.getElementById( expId ).innerHTML = "";
}


// function for poking a new property value into a DOM element;
// used here to toggle the visibility of the floating definition "window"
function setIdProperty( id, property, value )
{
    var styleObject = document.getElementById( id );
    if (styleObject != null)
    {
        styleObject = styleObject.style;
        styleObject[ property ] = value;
    }
}

function mouseX(evt) {
if (evt.pageX) return evt.pageX;
else if (evt.clientX)
   return evt.clientX + (document.documentElement.scrollLeft ?
   document.documentElement.scrollLeft :
   document.body.scrollLeft);
else return null;
}

function mouseY(evt) {
if (evt.pageY) return evt.pageY;
else if (evt.clientY)
   return evt.clientY + (document.documentElement.scrollTop ?
   document.documentElement.scrollTop :
   document.body.scrollTop);
else return null;
}

topmenus = new Array('top_mn_1','top_mn_2','top_mn_3','top_mn_4','top_mn_4a','top_mn_4b')

function showTopMenu(id,sel){

    if (document.getElementById( 'top_mni_'+ id ).className == 'top_menu_sel')
        return false;

    for (var i=1; i<=4;i++){

        if (id == i) document.getElementById( 'top_mni_'+ i ).className = 'top_menu_sel';
        else document.getElementById( 'top_mni_'+ i ).className = 'top_menu';

    }

    for (var i=0; i<=topmenus.length;i++){

        if (sel == i) setIdProperty( topmenus[i], "visibility", "visible" );

        else setIdProperty( topmenus[i], "visibility", "hidden" );

    }

}


