/* js file */
function cvv_win() {
	var thewin = window.open("cvv.php","cvv","height=280,width=300,toolbar=no,statusbar=no,scrollbars=yes");
	thewin.focus();
}

function privacyWindow() {
	var thewin = window.open("/privacy.php?mode=popup","privacy","height=400,width=350,toolbar=no,statusbar=no,scrollbars=yes");
	thewin.focus();
}

function printHtmlItem(oForm,sHtmlID) {
	pWindow = window.open('','printWindow');
	dpt = document.getElementById(sHtmlID);
	oForm.printHTML.value = dpt.innerHTML;
	oForm.submit();
}

function printPage() {
	eWindow = window.open('','printWindow');
	bodyDiv = document.getElementById('bodyCellPadding');
	document.printThisPageForm.printHTML.value = bodyDiv.innerHTML;
	document.printThisPageForm.submit();	
}

//variables used for timer
function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()');
		eval(imgObj+'.src = "'+imgSrc+'"');
	}
}

function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
	  document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
  }
}

preload("donate_on", "/i/donate/donate_on.gif");
preload("donate_off", "/i/donate/donate.gif");


// add an event to the page
// usage: addEvent(window, 'load', myFunction);
function addEvent(obj, eventType,fn, useCapture)
{
	if (obj.addEventListener) {
		obj.addEventListener(eventType, fn, useCapture);
		return true;
	} else {
		if (obj.attachEvent) {
			var r = obj.attachEvent("on"+eventType, fn);
			return r;
		}
	}
}

//generic get element function, for browsers that don't support.
if(document.all && !document.getElementById) {
	document.getElementById = function(id) {
		 return document.all[id];
	}
}