<!--

function init(){
	var imgs=$.className('image_wrap','image_right');
	var len=imgs.length;

	if(len!=0)
		{
		var max_h=0;
	
		for(var i=0;i<imgs.length;i++)
			if(imgs[i].offsetHeight>max_h)
				max_h=imgs[i].offsetHeight;
		}
	else
		var max_h=0;
	
	var mid=$.id('column_middle');
	var left=$.id('column_left');

	var lh=left.offsetHeight-50;

	if(lh>max_h)
		max_h=lh;

	if(mid.offsetHeight<(max_h+50))
		mid.style.height=max_h+'px';

	if(len==1)
		imgs.style.visibility='visible';
	else if(len!=0)
		{
		rotate(0);
		}
}

function rotate(n){

	list=$.className('image_wrap','image_right');

	n++;
	old=n-1;

	if(n==list.length)
		{
		n=0;
		old=list.length-1;
		}

	fader(list[n].id,0.2,100,0,1);
	fader(list[old].id,-0.2,0,0,1);

	setTimeout("rotate("+n+")",5000);
}


function fade(obj,d,target,f){

	lyr=document.getElementById(obj);
	lyr.fade+=(d*20);

	if((d>0 && lyr.fade>=target) || (d<0 && lyr.fade<=target))
		{
		lyr.fade=target*0.9999999;
		clearInterval(lyr.fade_on);
		lyr.fade_on=0;
		if(f==1 && d>0)
			{
			lyr.style.visibility='visible';
			lyr.focus();
			}
		}

	if(f>0)
		{
		if(lyr.fade==0)
			lyr.style.visibility='hidden';
		else
			lyr.style.visibility='visible';
		}

	lyr.style.opacity=lyr.fade/100;
	lyr.style.filter="Alpha(Opacity="+lyr.fade+")";
}

function fader(lyr,d,target,init,f){
	obj=$.id(lyr);
	
	if(obj.fade_on==null)
		{
		obj.fade_on=0;
		obj.fade=init;
		}

	if(obj.fade_on!=0)
		{
		clearInterval(obj.fade_on);
		obj.fade_on=0;
		}
	
	obj.fade_on=setInterval("fade('"+lyr+"',"+(d/2)+","+target+","+f+")",50);
}

function nospam(domain,name){
	window.location='mailto:'+name+'@'+domain+'?subject=web site contact';
}

function formFocus(obj,on){
	obj.style.backgroundColor='#ceeded';
}

function formBlur(obj){
	obj.style.backgroundColor='#ffffff';
}

function formSubmit(frm){
	$.id(frm).submit();
}

$ = function() {

	return {

	/* Accepts any number of arguments. Each can be an id or actual element object reference. Or will accept array of these. */

		id: function() {
	
			/* 
			Makes new array
			Checks to see if array has been passed and sets args variable accordingly
			*/
		
			var el = new Array();
			var args = (arguments[0] instanceof Array)? arguments[0]: arguments;

			for(var i = 0; i < arguments.length; i++) {
		
				/* Checks to see if argument is string and if not assumes object passed and simply adds it to the array */
		
				el[i] = (typeof args[i] == 'string')?
					document.getElementById(args[i]):
					args[i];
			}	
		
			/* Returns only first item of the array if only one non-array argument was passed. Else returns array */
	
			return (args.length == 1)? el[0]: el;
		},

		thisName: function(method, string, parent) {

			var els = ($.id(parent) || document).getElementsByTagName('*');
			var matched = new Array;
			var re = new RegExp("(^|\\s)" + string + "(\\s|$)");

			for (var i = 0, n = els.length; i < n; i++) {
				if (els[i][method].match(re))
					matched.push(els[i])
			}
		
			return (matched.length == 1)? matched[0]: matched;
		},

		className: function(className, parent) {
			
			return $.thisName('className', className, parent);
		}

	}

}();
//-->