


/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

// set these variables equal to the original top and left of layers
var orig_x=110;  // layers' left
var orig_y=65;	// layers' top

// onresize for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

var cur_lyr;	// holds id of currently visible layer
function swapLayers(id) {
  if (cur_lyr) hideLayer(cur_lyr);
  shiftLayerTo( id, orig_x, orig_y + getScrollY() );
  showLayer(id);
  cur_lyr = id;
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function shiftLayerTo(id,x,y) {
  var px = document.layers? 0: "px";
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) {
    lyr.css.top = y + px;
    lyr.css.left = x + px;
  }
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

// credit to http://www.13thparallel.org for the following function
// returns amount of vertical scroll
function getScrollY() {
	var sy = 0;
	if (document.documentElement && document.documentElement.scrollTop)
		sy = document.documentElement.scrollTop;
	else if (document.body && document.body.scrollTop) 
		sy = document.body.scrollTop; 
	else if (window.pageYOffset)
		sy = window.pageYOffset;
	else if (window.scrollY)
		sy = window.scrollY;
	return sy;
}


if (document.images) {             
            unoff = new Image();      
            unoff.src = "/images/accessores_fr_01_off.gif"; 
            
            unon = new Image();      
            unon.src = "/images/accessores_fr_01_on.gif";
		}
		
if (document.images) {             
            deuxoff = new Image();      
            deuxoff.src = "/images/accessores_fr_02_off.gif"; 
            
            deuxon = new Image();      
            deuxon.src = "/images/accessores_fr_02_on.gif";
				}
if (document.images) {             
            troisoff = new Image();      
            troisoff.src = "/images/accessores_fr_03_off.gif"; 
            
            troison = new Image();      
            troison.src = "/images/accessores_fr_03_on.gif";
		}
				
if (document.images) {             
            quatreoff = new Image();      
            quatreoff.src = "/images/accessores_fr_04_off.gif"; 
            
            quatreon = new Image();      
            quatreon.src = "/images/accessores_fr_04_on.gif";
		}
			

if (document.images) {             
            oneoff = new Image();      
            oneoff.src = "/images/accessores_en_01_off.gif"; 
            
            oneon = new Image();      
            oneon.src = "/images/accessores_en_01_on.gif";
		}
if (document.images) {             
            towoff = new Image();      
            towoff.src = "/images/accessores_en_02_off.gif"; 
            
            towon = new Image();      
            towon.src = "/images/accessores_en_02_on.gif";
					}
if (document.images) {             
            treeoff = new Image();      
            treeoff.src = "/images/accessores_en_03_off.gif"; 
            
            treeon = new Image();      
            treeon.src = "/images/accessores_en_03_on.gif";
		}
				
if (document.images) {             
            fouroff = new Image();      
            fouroff.src = "/images/accessores_en_04_off.gif"; 
            
            fouron = new Image();      
            fouron.src = "/images/accessores_en_04_on.gif";
		}
			
		
// Function to 'activate' images.
function imgOn(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "on.src");
        }
}
// Function to 'deactivate' images.
function imgOff(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "off.src");
        }
}
function msover(img, ref1)
 {
  document.images[img].src = ref1;
  
 }
 
function msout(img, ref)
 {
  document.images[img].src = ref;
  
 }
