String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}
if(!Array.indexOf){
    Array.prototype.indexOf = function(obj){
        for(var i=0; i<this.length; i++){
            if(this[i]==obj){
                return i;
            }
        }
        return -1;
    }
}

function addClass(cur,n) {
	if (cur.indexOf(n) != -1) { return cur; }
	return cur + ' ' + n;
}

function remClass(cur,n) {
	if (cur.indexOf(n) == -1) { return cur; }
	var arrClass = new Array();
	var strNewClass = cur.trim();
	arrClass = strNewClass.split(' ');
	arrClass.splice(arrClass.indexOf(n),1);
	strNewClass = arrClass.join(' ');
	return strNewClass;
}

function img_MO(obj,desc)
{
	img_highlight(obj);
	document.getElementById('description').innerHTML = desc;
}

function img_highlight(img)
{
	img.parentNode.parentNode.className = addClass(img.parentNode.parentNode.className,'img_hi');
}

function img_unhighlight(img)
{
	img.parentNode.parentNode.className = remClass(img.parentNode.parentNode.className,'img_hi');
	document.getElementById('description').innerHTML = '&nbsp;<br>&nbsp;';
}