///////////////////////
// calendar.js
// ATTIK 2007
// Kevin Tahara
///////////////////////

function doStyle(obj, styleObj, newStyle) {
	//alert(newStyle);
	document.getElementById(obj).style.backgroundImage = newStyle;
}

function setStyle(obj, action) {
	styleObj = "backgroundImage";
	if(action == "over") {
		newStyle = "url('images/calendar_cell_active.png')";
		doStyle(obj, styleObj, newStyle);
	} else {
		newStyle = "url('')";
		doStyle(obj, styleObj, newStyle);
	}
}

// checks browser has innerText feature

function checkForInnerTextFeature() {
	var obj = (document.getElementsByTagName("body")[0].innerText != undefined) ? true : false;
	return obj;
}

function updateYear(val) {
	if(!checkForInnerTextFeature()) {
		var thisYear = parseInt(document.getElementById('year').textContent);
    	document.getElementById('year').textContent = eval(thisYear + val);
	} else{
		var thisYear = parseInt(document.getElementById('year').innerText);
    	document.getElementById('year').innerText = eval(thisYear + val);
	}
}

// change both searchLink values to results page(s) for calendar search

function searchYear(thisMonth) {
	if(!checkForInnerTextFeature()) {
		var thisYear = parseInt(document.getElementById('year').textContent);
		var searchLink = "events/default.aspx?dt="+thisMonth + "/1/" + thisYear;
    	window.location = searchLink;
	} else{
		var thisYear = parseInt(document.getElementById('year').innerText);
		var searchLink = "events/default.aspx?dt="+thisMonth + "/1/" + thisYear;
    	window.location = searchLink;
	}
}


function searchEventSchedules(thisMonth) {
	if(!checkForInnerTextFeature()) {
		var thisYear = parseInt(document.getElementById('year').textContent);
		var searchLink = "ReadMoreIndie.aspx?type=4&dt="+thisMonth + "/1/" + thisYear;
    	window.location = searchLink;
	} else{
		var thisYear = parseInt(document.getElementById('year').innerText);
		var searchLink = "ReadMoreIndie.aspx?type=4&dt="+thisMonth + "/1/" + thisYear;
    	window.location = searchLink;
	}
}