// xImgRollSetup r3, Copyright 2002-2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL

function xImgRollSetup(p,s,x)
{
  var ele, id;
  for (var i=3; i<arguments.length; ++i) {
    id = arguments[i];
    if (ele = xGetElementById(id)) {
      ele.xIOU = p + id + x;
      ele.xIOO = new Image();
      ele.xIOO.src = p + id + s + x;
      ele.onmouseout = imgOnMouseout;
      ele.onmouseover = imgOnMouseover;
    }
  }
  function imgOnMouseout(e)
  {
    if (this.xIOU) {
      this.src = this.xIOU;
    }
  }
  function imgOnMouseover(e)
  {
    if (this.xIOO && this.xIOO.complete) {
      this.src = this.xIOO.src;
    }
  }
}

function xImgPortfolio( )
{
	var el1, el2, id;
	
	document.prevPanels = new Array();
	
	for (var i=0; i<arguments.length; ++i) {
		id = arguments[i];
		if( el1 = xGetElementById(id) ) {
			if( el2 = xGetElementById('prev_'+id) ) {
				document.prevPanels[ id ] = el2;
		  		el1.onmouseout = imgPortOnMouseout;
		  		el1.onmouseover = imgPortOnMouseover;
			}
		}
	}
	
	xGetElementById( arguments[ 0 ] ).onmouseover();
	
	function imgPortOnMouseout(e)
	{
	}
	
	function imgPortOnMouseover(e)
	{
		for( i in document.prevPanels ) {
			document.prevPanels[ i ].style.display = 'none';
		}
		document.prevPanels[ this.id ].style.display = 'block';
	}
}

// xGetElementById r2, Copyright 2001-2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL

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;
}
