function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function on(layer_on) {
var this_top = (screen.height / 4) + 10 + 'px';
var this_left = screen.width * 0.6 + 'px';
for(i=7; i<=21; i++){     // was 0, 21
	var layer_off="Layer"+i; 
	var Q=document.getElementById(layer_off);
	Q.style.visibility='hidden';
	}
var Q=document.getElementById(layer_on);
Q.style.position='absolute'; 
Q.style.width='285px';
Q.style.height= 'auto';
Q.style.zindex='1';
Q.style.left=this_left;
Q.style.top= this_top;
Q.style.border='1px solid #000000';
Q.style.padding='2';
Q.style.visibility='visible';
}
function off(layer_off){
var Q=document.getElementById(layer_off);
Q.style.visibility='hidden';
}
function popup(doc){
	var page_name = "" + doc + ".php"
	window.self.name="main";
	window.open(page_name,"popup","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=700,height=400");
}
function putFocus(formInst, elementInst) {
  self.name="main";
  if (document.forms.length > 0) {
   document.forms[formInst].elements[elementInst].focus();
  }
 }
function setSize(intHeight,intWidth){
  window.resizeTo(intWidth,intHeight)
}

function popup_port(doc){
	var page_name = "" + doc + ".php"
	window.self.name="main";
	window.open(page_name,"popup","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=720,height=620");
}

// The following relate to enter_data.php
/* Add the selected items in the parent by calling method of parent
function addSelectedItemsToParent() {
self.opener.addToParentList(window.document.forms[2].work_with_schools);
window.close();
}
*/
// Fill the selcted item list with the items already present in parent.
function fillInitialwork_with_schools(item) {
	
//var work_with_schools = window.document.forms[2].work_with_schools; 
var Q = document.getElementById(item); 
//var srcList = self.opener.window.document.forms[2].parentList;
var srcList = document.getElementById(item).parentList;
for (var count = Q.options.length - 1; count >= 0; count--) {
Q.options[count] = null;
}
for(var i = 0; i < school.options.length; i++) { 
if (srcList.options[i] != null)
Q.options[i] = new Option(school.options[i].text);
   }
}
// Add the selected items from the source to destination list
function addSrcTowork_with_schools(item1,item2) {
//work_with_schools = window.document.forms[2].work_with_schools;
var Q = document.getElementById(item1);
//school = window.document.forms[2].school; 
var P = document.getElementById(item2); 
var len = Q.length;
for(var i = 0; i < P.length; i++) {
if ((P.options[i] != null) && (P.options[i].selected)) {
//Check if this value already exist in the work_with_schools or not
//if not then add it otherwise do not add it.
var found = false;
for(var count = 0; count < len; count++) {
if (Q.options[count] != null) {
if (P.options[i].text == Q.options[count].text) {
found = true;
break;
      }
   }
}
if (found != true) {
Q.options[len] = new Option(P.options[i].text); 
len++;
         }
      }
   }
}
// Deletes from the destination list.
function deleteFromwork_with_schools(item) {
var Q  = document.getElementById(item);
var len = Q.options.length;
for(var i = (len-1); i >= 0; i--) {
if ((Q.options[i] != null) && (Q.options[i].selected == true)) {
Q.options[i] = null;
      }
   }
}
// Marks all the items as selected for the submit button.  
//function selectList(sourceList) {
function selectList(item) {
//sourceList = window.document.forms[2].work_with_schools;
var sourceList  = document.getElementById(item);
for(var i = 0; i < sourceList.options.length; i++) {
if (sourceList.options[i] != null)
sourceList.options[i].selected = true;
}
return true;
//submit(window.document.forms[2]);
}
// end of following relate to enter_data.php