//javascript to handle the display of featured items

// Changes the cursor to the pointing hand
function cursor_hand() {
document.body.style.cursor = 'hand';
}

// Returns the cursor to the default pointer
function cursor_clear() {
document.body.style.cursor = 'default';
}

function arrowShow(inID1,inID2) {
	document.getElementById(inID1).style.display = 'block';
    document.getElementById(inID2).style.display = 'none';
}

function darkenButtons(inID){
	document.getElementById('feat_mon').style.backgroundColor = "#993300";
	document.getElementById('feat_year').style.backgroundColor = "#993300";
	document.getElementById('feat_all').style.backgroundColor = "#993300";
	document.getElementById('feat_news').style.backgroundColor = "#993300";
	document.getElementById(inID).style.backgroundColor = "#FFFF00";
}

function createRequestObject(){
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}

// Create an instance of the XML HTTP Request object
var http8 = createRequestObject();

function getItems(tweek) {
	document.getElementById('feat_text').innerHTML = "Loading, Please Wait...";
	var params = "tweek="+tweek;
	// Prepare the XMLHTTP object for a HTTP POST to our validation ASP page
	http8.open('post', 'feat_ajs.php', true);
	http8.onreadystatechange = handleTrans;
	// Execute the request
	http8.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http8.setRequestHeader("Content-length", params.length);
	http8.setRequestHeader("Connection", "close");
	http8.send(params);
}

function handleTrans(){
	if (http8.responseText != "")
	{ document.getElementById('feat_text').innerHTML = http8.responseText;	
	}
}