var fade_color = new Array();

function xmlhttp_req() {
	var req = false;
    // branch for native XMLHttpRequest object
    if(window.XMLHttpRequest) {
    	try {
			req = new XMLHttpRequest();
        } catch(e) {
			req = false;
        }
    // branch for IE/Windows ActiveX version
    } else if(window.ActiveXObject) {
       	try {
        	req = new ActiveXObject("Msxml2.XMLHTTP");
      	} catch(e) {
        	try {
          		req = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		req = false;
        	}
		}
    }
	return req;
}

// ================================

function thumbq_hideLayer(id) {
	get(id).style.visibility = 'hidden';
	get(id).style.display = 'none';
}
function thumbq_showLayer(id) {
	get(id).style.visibility = 'visible';
	get(id).style.display = 'block';
}

// ================================

function get(id) {
	return(document.getElementById(id));
}

// ================================

function thumb_fade_item(id) {

	if(!fade_color[id]) {
		fade_color[id] = 150;
	}

	if(fade_color[id] < 250) {
		get('img_'+id).style.backgroundColor = "rgb(255,255,"+fade_color[id]+")";
		eval("setTimeout(\"thumb_fade_item('"+id+"')\",100)"); 
		fade_color[id]+=5;
	} else {
		get('img_'+id).style.backgroundColor = '#ffffff';
		fade_color[id] = 150;
	}
}

// ================================

function thumb_highlight(i) {
	i.select();
}