// JavaScript Document

function selPymt(value){
	
	if (value == 1){
		document.getElementById('paymentMsg1').style.display="block";
		document.getElementById('paymentMsg0').style.display="none";
		
	} else {
		document.getElementById('paymentMsg1').style.display="none";
		document.getElementById('paymentMsg0').style.display="block";
	}
	
	document.getElementById("custom").value = value;
	
}

<!-- ************************************************ -->	
<!-- Functions to Control Display of Homepage Modules -->
<!-- ************************************************ -->
	matchHeight=function(){

     var divs,contDivs,maxHeight,divHeight,d;

     // get all <div> elements in the document

     divs=document.getElementsByTagName('div');

     contDivs=[];

     // initialize maximum height value

     maxHeight=0;

     // iterate over all <div> elements in the document

     for(var i=0;i<divs.length;i++){

          // make collection with <div> elements with class attribute 'container'

          if(divs[i].className=='xbox'){

                d=divs[i];

                contDivs[contDivs.length]=d;

                // determine height for <div> element

                if(d.offsetHeight){

                     divHeight=d.offsetHeight;
					// alert('offset height '+i+': '+divHeight);

                }

                else if(d.style.pixelHeight){

                     divHeight=d.style.pixelHeight;
					// alert('pixel height '+i+': '+divHeight);

                }

                // calculate maximum height
				
                maxHeight=Math.max(maxHeight,divHeight);
				
          }

     }

     // assign maximum height value to all of container <div> elements

     for(var i=0;i<contDivs.length;i++){

          contDivs[i].style.height=maxHeight+"px";
		  //alert('new height '+i+': '+maxHeight);

     }

} 


function NOajaxReq(choice, dataid, qstring) {
	
	document.location='/jmmadmin/default.asp?c=' + choice + '&' + qstring;
	
}

//main AJAX functionality
function ajaxReq(choice, dataid, qstring){
	var ajaxRequest;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  ajaxRequest=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		ajaxRequest=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  ajaxRequest=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  
	
				
	ajaxRequest.onreadystatechange = function(){
		
			
		if(ajaxRequest.readyState == 4){
			if (ajaxRequest.status == 200){	
			
				document.getElementById(dataid).innerHTML = ajaxRequest.responseText;
				
			}
		}
		
		
	}
	
	
	
	//default data page and querystring
	var queryString
	var dispPage
	var timestamp = new Date().getTime();
	
	if (qstring == '') {
		queryString = '?c=' + choice + "&dataid=" + dataid + "&ts=" + timestamp;
	} else {
		queryString = '?c=' + choice + '&' + qstring + "&dataid=" + dataid + "&ts=" + timestamp;
	}	
	
	dispPage = "/jmmadmin/dispData.asp" + queryString;	
	document.getElementById(dataid).innerHTML = ' <div style="text-align:center; width:98%;"><br><br><h3>Loading View<img src="/images/spin-globe.gif" hspace="5" align="absmiddle" /></h3></div>';

	ajaxRequest.open("GET", dispPage, true);
	ajaxRequest.send(null); 

}


function darkenScreen(mode) {
	
	if(mode != 'close') {
		document.getElementById('darkenit').style.display = "block";
		document.getElementById('darkenit').style.width = document.body.clientWidth+"px";
		document.getElementById('darkenit').style.height = document.body.clientHeight+20+"px";
	} else {
		document.getElementById('darkenit').style.display = "none";	
		document.getElementById('darkenit').style.width = "0px";
		document.getElementById('darkenit').style.height = "0px";
	}
}






function refreshWindow() {
	window.location.reload();
}

var myimages=new Array()

function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}

preloadimages("/images/jmm-headerback.gif","/images/jmm-tncurve.gif","/images/mchalfcircle-blk.gif")


function submitform(theForm, field, value) {

	document.getElementById(field).value = value;
	document.getElementById(theForm).submit();


}


function url(loc) 
{ 
var id = loc.selectedIndex; 
if(id==0) return; 
var url = loc.options[id].value; 
if(url==""|| url=="#" ) return; 
window.location = url; 
}

function ajaxSelect(choice, dataid, loc) 
{ 
var id = loc.selectedIndex; 
if(id==0) return; 
var qstring = loc.options[id].value; 
if(qstring==""|| qstring=="#" ) return; 
ajaxReq(choice, dataid, qstring); 
}

function pressIMG(id, wsize) {

	if(wsize=="sml") {
		if(document.getElementById(id) != null) {
			document.getElementById(id).width = document.getElementById(id).width / 2
			document.getElementById(id).height = document.getElementById(id).height / 2
		}
	}
	

}




//specify interval between slide (in mili seconds)
var slidespeed=10000
var whichdiv=1
var hidediv=1

function showPress(numtoshow) {


//show whichdiv and hide the others

document.getElementById(whichdiv).style.display = "block";

	if( hidediv != whichdiv) {
		document.getElementById(hidediv).style.display = "none";	
	}


hidediv = whichdiv
whichdiv=(whichdiv<numtoshow)? whichdiv+1 : 1

setTimeout("showPress("+numtoshow+")",slidespeed)



}

moz=document.getElementById&&!document.all
mozHeightOffset=20

function frm_onload(f) 
{ 
	document.getElementById(f).style.height = document.getElementById(f).contentWindow.document.body.scrollHeight + "px";
}

function swapClass(id, newclass) 
{
	document.getElementById(id).className = newclass;
	
}

//-->


//-->
