function setLogo(cmd, id) {
	var obj = getObject(id);
	if (obj) {
		if (cmd == "tm") {
			obj.src = "/ginclude/images/puremichiganMedia.gif";
		}
		else {
			obj.src = "/ginclude/images/michiganupperhandMedia.gif";
		}
	}
}

function showPopup(id) {
	var obj = getObject(id);
	if (obj) {
		switchLayer2(id, 1);
		setPopupPosition(id);
		showMask();
	}
}

function hidePopup(id) {
	var obj = getObject(id);
	if (obj) {
		hideMask();
		switchLayer2(id, 0);
	}
}

function setPopupPosition(id) {
	var ie = document.all;
	var other = document.getElementById && !document.all;
	var pageYOffset = 0, pageXOffset = 0, offset = 150;
	var obj = getStyleObject(id);
	if (obj) {
		pageYOffset = other ? 0 : parseInt(getIeBody().scrollTop);
		obj.left = (other ? pageXOffset + (window.innerWidth / 2) - offset : getIeBody().scrollLeft + (getIeBody().clientWidth / 2) - offset) + "px";
		obj.top = (other ? pageYOffset + (window.innerHeight / 2) - offset : pageYOffset + (getIeBody().clientHeight / 2) - offset) + "px";
	}
}

function validateShareStuff(from, to, fromEmailInvalidText, toEmailInvalidText) {
	var arr = null, i = 0, success = false;
	errorMsg = '';
	if (fromEmailInvalidText == null) fromEmailInvalidText = '';
	if (toEmailInvalidText == null) toEmailInvalidText = '';
	
	from = trim(from);
	to = trim(to);
	if (! isEmailValid(from)) {
		if (fromEmailInvalidText == '') {
			errorMsg += '\n  The From Email Address is invalid.'
		}
		else {
			errorMsg += '\n' + fromEmailInvalidText;
		}
	}
	
	if (to != '') {
		if (to.indexOf(',') > 0) {
			arr = to.split(',');
			for (i=0;i < arr.length;i++) {
				if ( isEmailValid(arr[i]) ) {
					success = true;
					break;
				}
			}
		}
		else {
			if (isEmailValid(to)) success = true;
		}
	}
	if (! success) {
		if (toEmailInvalidText == '') {
			errorMsg += '\n  The To Email Address is invalid.'
		}
		else {
			errorMsg += '\n' + toEmailInvalidText;
		}
	}

	if (errorMsg != '') {
		return 'Please correct the following error(s):' + errorMsg;
	}
	else {
		return '';
	}
}