// JavaScript Document


function xGetElementById(e)
{
  if(typeof(e)=='string') {
    if(document.getElementById) e=document.getElementById(e);
    else if(document.all) e=document.all[e];
    else e=null;
  }
  return e;
}

function xStyle(sProp, sVal)
{
  var i, e;
  for (i = 2; i < arguments.length; ++i) {
    e = xGetElementById(arguments[i]);
    if (e.style) {
      try { e.style[sProp] = sVal; }
      catch (err) { e.style[sProp] = ''; } // ???
    }
  }
}

var ultimobordo = 'mini1';

function resetbordo() {
		
	xStyle('border', '1px solid #bebebe', ultimobordo);
	
}

function qualebordo(idimmagine) {
	
	resetbordo();
	xStyle('border', '1px solid #414a52', idimmagine);
	ultimobordo = idimmagine;
	
}

function BorderEffect( style_on, style_off, firstElement)
{
	this.styleOn = style_on;	
	this.styleOff = style_off;	
	this.currentId = firstElement;
	
	this.apply = function(id) {
		xStyle(	'border', this.styleOff, this.currentId);
		xStyle( 'border', this.styleOn, id);
		this.currentId = id;
	};
}
