function doProcessing() {
  document.getElementById('submitBtn').className = 'thide'; 	
  document.getElementById('processing').className = 'tshow';
}

function openWin(page,win_width,win_height) {

    try {
    	popup_window.close();
    } catch(e) {
					
    }

    if ( page.indexOf("mailto") == -1 ) {
    	var options = "scrollbars=yes, width=" + win_width + ", height=" + win_height;
    	var win = window.open(page, 'MyWin', options);
    	if (window.focus) { win.focus() }
    }
}

function displaySelectedSchool( pvKeyjs ) {
	if(pvKeyjs == -1){
		pvKeyjs = schoolArray[0].pvKey;
	}

	var index = 0;
	for( var i=0; i<schoolArray.length; i++ ) {
		document.getElementById( 'schoolBox' + (i+1) ).className = "schoolBox";
		if( schoolArray[i].pvKey == pvKeyjs ) {
			document.getElementById( 'schoolBox' + (i+1) ).className = "redBox";
			var posY = document.getElementById( 'schoolBox' + (i+1) ).offsetTop;
			var browserName=navigator.appName; 
			if (browserName=="Netscape"){ 
				posY = posY - 131;
			}else if (browserName=="Microsoft Internet Explorer"){
				//do nothing!?
				posY = posY + 10;
			}
			document.getElementById('redBoxRight').style.top = posY + 'px';
			index = i;
		}
	}
	
	document.getElementById( 'selectedLogo' ).innerHTML		= "<img src='" + schoolArray[index].logoURL
						+ "' alt='" + schoolArray[index].pvDescription + "'>";
	document.getElementById( 'selectedName' ).innerHTML		= schoolArray[index].pvDescription;
	document.getElementById( 'selectedDesc' ).innerHTML		= schoolArray[index].blurb;
	document.form.pvKey.value = schoolArray[index].pvKey;
}


// On_change method for State field
function onChangeSP() {
	try{
		var cn = document.form.SP.value.substring(0,2);
		if(cn == "US" || cn == "CA" || cn == "UM"){
			document.form.CN.value = cn;
			//document.form.PC.disabled = '';
		}else{
			document.form.CN.value = '---Select One---';
			
			//document.form.PC.disabled = 'disabled';
		}
	}catch(e){}
}

// On_change method for Country field
function onChangeCN() {
	try{
		if ( document.form.CN.value == "US" 
				|| document.form.CN.value == "UM"
				|| document.form.CN.value == "CA" ) {
			//document.form.PC.disabled = '';
			//document.form.SP.disabled = '';
		}else{
			//document.form.PC.value = '';
			document.form.SP.value = '(Unspecified)';
			//document.form.PC.disabled = 'disabled';
	//		document.form.SP.disabled = 'disabled';
		}
	}catch(e){}
}