﻿//the functions in this file require the jQuery javascript library

jQuery(document).ready(function() {

});

function SwapImage(senderElem, newImageSrc) {
	jQuery(senderElem).attr('src', newImageSrc);
}

var popupHandle;

function closePopup() {
	if (popupHandle != null && !popupHandle.closed) {
		popupHandle.close();
	}
}
/*
function openWindow(theURL,winName,features) usage:
<a href="javascript:void(0)" 
onMouseOver="window.status='Add your own event'; return true;" 
onmouseout="window.status='';" 
onClick="openWindow('URL','windowName','status=yes,scrollbars=yes,resizable=yes,width=600,height=450')"
>
*/
function openWindow(theURL, winName, features) { //v2.0
	closePopup();
	popupHandle = open(theURL, winName, features);
}

/*
function confirmDelete(question) usage:
onClick="return confirmDelete('Are you sure you wish to delete this?');"
*/
function confirmDelete(question) {
	var agree = confirm(question);
	if (agree) return true;
	else return false;
}

function showHideElement(id) {
	var elem = document.getElementById(id);
	if (elem.style.display == "none")
		elem.style.display = "inline";
	else
		elem.style.display = "none";
}

function swapLinkText(id, text1, text2) {
	var elem = document.getElementById(id);
	if (elem.innerHTML == text1)
		elem.innerHTML = text2;
	else
		elem.innerHTML = text1;
}