jQuery(document).ready(function() {
	stripeable();
	P7_ExpMenu();
});
				
function stripeable() {
	jQuery("div.alternateRowColor:odd").addClass("tableRowOdd");
	jQuery("div.alternateRowColor:even").addClass("tableRowEven");
	jQuery("table.stripeable tr:nth-child(odd)").addClass("tableRowOdd");
	jQuery("table.stripeable tr:nth-child(even)").addClass("tableRowEven");
	jQuery("table.errorTagTable tr").removeClass("tableRowOdd").removeClass("tableRowEven");
}

function clearInputErrors() {
	jQuery(':input.error').removeClass('error');
	jQuery('.inputErrorMessageContainer').html('');
}

function addLoadEvent(func) {
	var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        };
    }
}

function setValue(id, value) {
	document.getElementById(id).value = value;
}

function toggleVisibility(id) {
	var e = document.getElementById(id);
	if (e.style.display == 'block') {
		e.style.display = 'none';
	} else {
		e.style.display = 'block';
	}
}

function submitForm(formId, formAction) {
	if (formAction != null) {
		document.getElementById(formId).action = formAction;
	}
	document.getElementById(formId).submit();
}

function getDocumentViewerPublication(newspaper) {
	var publication = '';
	if (newspaper == 'Advertiser') {
		publication = 'Eldon_Advertiser';
	} else if (newspaper == 'Autogram-Sentinel') {
		publication = 'Miller_County_Autogram-Sentinel';
	} else if (newspaper == 'Beacon') {
		publication = 'Highway_Five_Beacon';
	} else if (newspaper == 'Leader-Statesman') {
		publication = 'Versailles_Leader-Statesman';
	} else if (newspaper == 'Press') {
		publication = 'Morgan_County_Press';
	} else if (newspaper == 'Times') {
		publication = 'Tipton_Times';
	}
	return publication;
}
