﻿// JScript File


function fillCategory()
    { 
    document.getElementById('11').style.visibility = "hidden";
    document.getElementById('SubCat').style.visibility = "hidden";
//        addOption(document.form1.Category, "Select a specialty", "Select a specialty");
//        addOption(document.form1.Category, "Surgery", "Surgery");
//        addOption(document.form1.Category, "Entrance and Qualifying Exams", "Entrance and Qualifying Exams");
//        addOption(document.form1.Category, "Medical Student", "Medical Student");
//        addOption(document.form1.Category, "Dental Student", "Dental Student");
    }
    
function SelectSubCat()
    {  
        document.getElementById('err1').value = "";
        removeAllOptions(document.form1.SubCat);
        dripdisplay();  
        if(document.form1.Category.value == 'Surgery')
        {
        document.getElementById('SubCat').style.visibility = "visible";
        addOption(document.form1.SubCat,"Select a specialty", "Select a sub specialty");         
        addOption(document.form1.SubCat,"General Surgery", "General Surgery"); 
        dripdisplay1();
        document.getElementById('11').style.visibility = "visible";
        removeAllOptions(document.form1.ssubcat1);
        addOption(document.form1.ssubcat1, "Select a specialty", "Select an exam");
        addOption(document.form1.ssubcat1,"MRCS Part1", "MRCS Part1");
        addOption(document.form1.ssubcat1,"MRCS Part2", "MRCS Part2");
        addOption(document.form1.ssubcat1,"MRCS PartA", "MRCS Part A");       
        }
        
        if(document.form1.Category.value == 'Entrance and Qualifying Exams')
        {
        dripdisplay2();       
        document.getElementById('SubCat').style.visibility = "visible";
        document.getElementById('11').style.visibility = "hidden";  
        addOption(document.form1.SubCat, "Select a specialty", "Select an exam");
        addOption(document.form1.SubCat,"PLAB", "PLAB"); 
        addOption(document.form1.SubCat,"USMLE Step 1", "USMLE Step 1"); 
        addOption(document.form1.SubCat,"USMLE Step 2", "USMLE Step 2");         
        }
        
        if(document.form1.Category.value == 'Medical Student')
        {
        dripdisplay2();
        document.getElementById('SubCat').style.visibility = "visible";  
        document.getElementById('11').style.visibility = "hidden";
        addOption(document.form1.SubCat, "Select a specialty", "Select an exam");
        addOption(document.form1.SubCat,"Medical Student Year 1", "Medical Student Year 1"); 
        addOption(document.form1.SubCat,"Medical Student Year 2", "Medical Student Year 2"); 
        addOption(document.form1.SubCat,"Medical Student Year 3", "Medical Student Year 3"); 
        addOption(document.form1.SubCat,"Medical Student Year 4", "Medical Student Year 4"); 
        addOption(document.form1.SubCat,"Medical Student Final Year", "Medical Student Final Year");         
        }
        if(document.form1.Category.value == 'Dental Student')
        {
        dripdisplay2();
        document.getElementById('SubCat').style.visibility = "visible"; 
        document.getElementById('11').style.visibility = "hidden"; 
        addOption(document.form1.SubCat, "Select a specialty", "Select an exam");
        addOption(document.form1.SubCat,"Dental Student Year 1", "Dental Student Year 1"); 
        addOption(document.form1.SubCat,"Dental Student Year 2", "Dental Student Year 2"); 
        addOption(document.form1.SubCat,"Dental Student Year 3", "Dental Student Year 3"); 
        addOption(document.form1.SubCat,"Dental Student Year 4", "Dental Student Year 4");                  
        }
        
        if(document.form1.Category.value == 'Plastic Surgery')
        {
        dripdisplay2();
        document.getElementById('SubCat').style.visibility = "visible"; 
        document.getElementById('11').style.visibility = "hidden"; 
        addOption(document.form1.SubCat, "Select a specialty", "Select an exam");
        addOption(document.form1.SubCat,"FRCS (Plast)", "FRCS (Plast)"); 
        addOption(document.form1.SubCat,"American Board (Plastic Surg)", "American Board (Plastic Surg)"); 
        addOption(document.form1.SubCat,"EBOPRAS", "EBOPRAS"); 
        addOption(document.form1.SubCat,"MCh", "MCh"); 
        addOption(document.form1.SubCat,"RACS", "RACS");                  
        }
    }
    
function select()
  {
  
  }
function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}

function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}    

function examtyp(val)
    {    
    document.getElementById('Hidden1').value = val;    
    }
    
function dripdisplay()
{
        document.getElementById('SubCat').style.height= "";
        document.getElementById('SubCat').style.width = ""
        document.getElementById('SubCat').style.color = "Black";
        document.getElementById('SubCat').style.borderColor = "black";
}
function dripdisplay1()
{   
        document.getElementById('11').style.height= "";
        document.getElementById('11').style.width = ""
        document.getElementById('11').style.color = "Black";
        document.getElementById('11').style.borderColor = "black";      
        
 }
 
 function dripdisplay2()
 {       
        document.getElementById('11').style.height= "0px";
        document.getElementById('11').style.width = "0px"
        document.getElementById('11').style.color = "White";
        document.getElementById('11').style.borderColor = "White";
 }