/**
 * This function redirects to another URL when certain links are NOT clicked
 * 
 * @param mouseEvent
 * @param target
 */
function redirectUnless(mouseEvent, target) {
	var elementType;
	// If event doesn't exist, use window.event
	if (!mouseEvent)
		mouseEvent = window.event;
	
	if (mouseEvent.target.hasClassName('isLink')) {
		return;
	}
	
	if (mouseEvent.target)
		elementType = mouseEvent.target.type;
	// Get the type of the element that was clicked (IE)
	else if(mouseEvent.srcElement)
		elementType = mouseEvent.srcElement.type;
	
	// Perform the desired action UNLESS these elements are clicked
	var noActionTypes = new Array();
	noActionTypes[0] = "checkbox";
	
	for(var i = 0; i < noActionTypes.length; i++) {
		if(elementType == noActionTypes[i])
			return;
	}
	
	document.location.href = target;
}

function changeInputType(oldObject, oType) {
	var newObject = document.createElement('input');
	newObject.type = oType;
	if(oldObject.size) newObject.size = oldObject.size;
	if(oldObject.value) newObject.value = oldObject.value;
	if(oldObject.name) newObject.name = oldObject.name;
	if(oldObject.id) newObject.id = oldObject.id;
	if(oldObject.className) newObject.className = oldObject.className;
	oldObject.parentNode.replaceChild(newObject, oldObject);
	return newObject;
}
