// JavaScript Document
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_openCard() { //v2.0
  window.open("card.php","i-TUTOR Card","status=no,width=412,height=400");
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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();
}
MM_reloadPage(true);



function get_radio_value(){
			for (var i=0; i < document.form2.terms.length; i++){
   				if (document.form2.terms[i].checked){
      				var rad_val = document.form2.terms[i].value;
      			}
   			}
			return rad_val;
}//get

function checkAgree(){
	if(get_radio_value()=="false"){
	alert("You must agree to the terms!");
	event.returnValue=false;
	}else{
    //print("<?php $_SESSION['agree'] = 'true'?>");
	document.form2.hidagree.value = "true";
	
  	}
}


function trans(){
selNow = document.form1.selec.value;
//alert(selNow);
fie = document.form1.selec2.options;
canAdd = true;
if(fie.length<5){
	for(s=0;s<fie.length;s++){
		if(fie[s].text==selNow){
		canAdd = false;
		}
	}
	if(canAdd){
	fie.length++;
	fie[fie.length-1].text = selNow;
	fie[fie.length-1].value = selNow;
	}
}

}//trans


function removeFromList() {
listField = document.form1.selec2.options;
   if ( listField.length == -1) {  // If the list is empty
      alert("There are no values which can be removed!");
   } else {
      var selected = listField.selectedIndex;
      if (selected == -1) {
         alert("You must select an entry to be removed!");
      } else {  // Build arrays with the text and values to remain
         var replaceTextArray = new Array(listField.length-1);
         var replaceValueArray = new Array(listField.length-1);
         for (var i = 0; i < listField.length; i++) {
            // Put everything except the selected one into the array
            if ( i < selected) { replaceTextArray[i] = listField.options[i].text; }
            if ( i > selected ) { replaceTextArray[i-1] = listField.options[i].text; }
            if ( i < selected) { replaceValueArray[i] = listField.options[i].value; }
            if ( i > selected ) { replaceValueArray[i-1] = listField.options[i].value; }
         }
         listField.length = replaceTextArray.length;  // Shorten the input list
         for (i = 0; i < replaceTextArray.length; i++) { // Put the array back into the list
            listField.options[i].value = replaceValueArray[i];
            listField.options[i].text = replaceTextArray[i];
         }
      } // Ends the check to make sure something was selected
   } // Ends the check for there being none in the list
}

function view(){
theForm = document.form1;
	if(theForm.selec2.options.length==1){
	theForm.c1.value = theForm.selec2.options[0].value;
	}else if(theForm.selec2.options.length==2){
	theForm.c1.value = theForm.selec2.options[0].value;
	theForm.c2.value = theForm.selec2.options[1].value;
	}else if(theForm.selec2.options.length==3){
	theForm.c1.value = theForm.selec2.options[0].value;
	theForm.c2.value = theForm.selec2.options[1].value;
	theForm.c3.value = theForm.selec2.options[2].value;
	}else if(theForm.selec2.options.length==4){
	theForm.c1.value = theForm.selec2.options[0].value;
	theForm.c2.value = theForm.selec2.options[1].value;
	theForm.c3.value = theForm.selec2.options[2].value;
	theForm.c4.value = theForm.selec2.options[3].value;
	}else if(theForm.selec2.options.length==5){
	theForm.c1.value = theForm.selec2.options[0].value;
	theForm.c2.value = theForm.selec2.options[1].value;
	theForm.c3.value = theForm.selec2.options[2].value;
	theForm.c4.value = theForm.selec2.options[3].value;
	theForm.c5.value = theForm.selec2.options[4].value;
	}
	
}

function gotoUpdate(){
	window.location.href = "update_tut.php";
}


function h(x){
x.className="trred"
}
function n(x){
x.className="tr"
}
//-->
</script>