function preloadImages()      // this function is called on page load
{	var i=0;
	objImage = new Image();
	for	(i=1; i<=hoverImages.length; i++)	{	objImage.src = hoverImages[i];	}
	for	(i=1; i<=clickImages.length; i++)	{	objImage.src = clickImages[i];	}
}



function resetAll()          // this function resets all the images to their "normal" state.   Used when clicking on an image, to reset all images 
{	for	(i=1; i<=normalImages.length; i++)	{	obj = eval('document.image' + i);	obj.src = normalImages[i-1];	}	}
function setHover(num)       // used on mouseover.  Swap the named image into "hover" state,  but only if it is not already in "click" state
{	obj = eval('document.image' + num);
	str = obj.src;
	if (str.search(clickImages[num-1]) == -1)	{	obj.src = hoverImages[num-1];	}
}
function setClick(num) {    // swap the named image into "click" state.  Previously clicked images must go back to "normal" state first 
	resetAll();
	obj = eval('document.image' + num);
	obj.src = clickImages[num-1];
}
function setNormal(num)    // used on mouseout.  Swap the named image into "normal" state, but only if it is not already in "click" state
{	// obj = eval('document.image' + num);
	// str = obj.src;
	// if (str.search(clickImages[num-1]) == -1)	{	obj.src = normalImages[num-1];	}
    resetAll();
}


function handleEnter (field, event) {
	var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
	if (keyCode == 13) {
		var i;
		for (i = 0; i < field.form.elements.length; i++)
			if (field == field.form.elements[i])
				break;
		i = (i + 1) % field.form.elements.length;
		field.form.elements[i].focus();
		return false;
	} 
	else
	return true;
}      


//////////////////  POPUPs  //////////////////
function PopUpSmall(filename){	var win2 = window.open(filename,"Window2","titlebar=no,height=589,width=790,resizable=yes,left=0,top=0,screenY=0,scrollbars=yes");     win2.focus();	return false; }
function PopUpBig(filename)	 {	var win2 = window.open(filename,"Window2","titlebar=no,height=860,width=1010,resizable=yes,left=0,top=0,screenY=0,scrollbars=yes");    win2.focus();	return false; }
function disclaimer() 		 {  var win2 = window.open("disclaimer.html","Window2","titlebar=no,height=350,width=450,resizable=no,left=0,top=0,screenY=0,scrollbars=no");  win2.focus(); }


//////////////////  RIGHT MOUSE CLICK  //////////////////
var message="Copyrighted material. Sorry.";
function clickIE4(){  if (event.button==2){ alert(message); return false; }  }
function clickNS4(e){
	if (document.layers||document.getElementById&&!document.all){  if (e.which==2||e.which==3){ alert(message); return false; } }  }
	if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4;  }  else if (document.all&&!document.getElementById){  document.onmousedown=clickIE4;  }
	document.oncontextmenu=new Function("alert(message);return false"
)


