function imghelper(sDest, sBright, sDim, nDim){
	this.sDest 		= sDest;
	this.sBright 	= sBright;
	this.sDim 		= sDim;
	this.nDim		  = nDim;
	
	this.setupStyles();
}

imghelper.prototype.setupStyles = function() {
var exStyle = 'width: 60px; height: 42px; border-style: none; border-width: 0; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; display: block;';
	  
	if ((navigator.appName.indexOf('Microsoft')+1)) {
		document.write('<style type="text/css"> .float {height: 44px;} </style>');
		document.write('<style type="text/css"> .'+this.sDim+' {'+exStyle+' filter:alpha(opacity='+this.nDim+');} .'+this.sBright+' {'+exStyle+' filter:alpha(opacity=100);} </style>');
	}
	else if ((navigator.appName.indexOf('Netscape')+1)) {
		document.write('<style type="text/css"> .float {height: 42px;} </style>');
		sDim = this.nDim / 100;
		document.write('<style type="text/css"> .'+this.sDim+' {'+exStyle+' -moz-opacity:'+sDim+';} .'+this.sBright+' {'+exStyle+' -moz-opacity:1;} </style>');
	}
	else 	{
		// document.write('');
	}
}

imghelper.prototype.swap = function(sHref) {
	if (sHref == ''){ return false; }
	if (this.sDest == ''){ return false; }

	if (!document.getElementById) { return false; }
	var oDest = document.getElementById(this.sDest);
	if (!oDest){ return false; }

	oDest.src = sHref;
	return false;
}

imghelper.prototype.brighten = function(oImg) {
	return this.swapClassnames(oImg, this.sBright, this.sDim);
}

imghelper.prototype.dim = function(oImg) {
	return this.swapClassnames(oImg, this.sDim, this.sBright);
}

imghelper.prototype.swapClassnames = function(oImg, sIn, sOut) {
	if (!oImg) { return false; }
	if (sIn == ''){ return false; }
	if (sOut == ''){ return false; }

	// swap out first
	oImg.className = oImg.className.replace(' '+sOut, '');
	oImg.className = oImg.className.replace(sOut, '');

	// swap in the new class
	oImg.className += ' '+sIn;

	return false;
}

