// JScript File

var vspnCourseArray =   [
                   'DIAG206-0310||Quality Man. Part I',
                   'EXOT314-0310||Avian Inf. Diseases',   
                   'STAF133-0310||Practice Management 101',
	               'TECH134-0310||Inter. Dentistry Module 2 ',
                   'STAF110-0310||Front Desk Module 1 ',
                   'STAF126-0410||Equine Office Procedures ',
	               'TECH184-0410||Pain Management' ,
                   'PHAR100-0410||Pharm Reg Review',
                   'ANES101-0410||Canine/Feline Anes Mod 1',
                   'PRAC100-0410||OSHA',
	               'TECH172-0410||Adv. Dentistry Module 3 ' ,
                   'ANES102-0410||Canine/Feline Anes Mod 2',
		           'TECH123-0410||Equine Essentials ' ,			
                   'STAF112-0410||Personnel Issues ',	
	               'TECH181-0410||Animal Blood Bank' ,	
                   'STAF111-0510||Front Desk Module 2 ',  
	               'TECH120-0510||VTNE Review' ,	      
                   'PRAC112-0510||Excel for Veterinary Prof.',
                   'ANES103-0510||Canine/Feline Anes Mod 3',
                   'STAF130-0510||Front Desk Module 3 ',
	               'TECH150-0610||Prof. Dev. for the VT' ,	      
                   'EXOT602-0610||Marsupial Medicine',
                   'ANES104-0610||Canine/Feline Anes Mod 4',
                   'STAF131-0710||Front Desk Module 4 '
                        ];

var ceCourseArray =     [
                    'DIAG206-0310||Quality Man. Part I',   
                    'EXOT314-0310||Avian Inf. Diseases',   
                    'MULT201-0410||ABVP Module A',	
                    'PHAR100-0410||Pharm Reg Review ',
                    'ANES101-0410||Canine/Feline Anes Mod 1',
                    'EXOT315-0410||Imaging Tools - Avian',
                    'PRAC100-0410||OSHA',  
                    'ANES102-0410||Canine/Feline Anes Mod 2', 			
                    'PRAC112-0510||Excel for Veterinary Prof.',
                    'ANES103-0510||Canine/Feline Anes Mod 3',									
                    'ALTM200-0510||Acupuncture',
                    'EXOT602-0610||Marsupial Medicine',
                    'ANES104-0610||Canine/Feline Anes Mod 4',
                    'MULT202-0610||ABVP Module B',	  
                    'MULT203-0810||ABVP Module C'	 																	
                        ];

function loadVSPNOpenClasses() { loadOpenClasses(vspnCourseArray, 1); }
function loadCEOpenClasses() { loadOpenClasses(ceCourseArray, 2); }

function loadOpenClasses(courseArray, courseType)
{
    var tdContainer = document.getElementById('CurrentRegOpenCourses');

    var eleSpan = document.createElement('span');
    eleSpan.setAttribute('class', 'Boards');
    eleSpan.setAttribute('className', 'Boards');

    for (var i=0; i<courseArray.length; i++)
    {
        var courseInfo = courseArray[i].split("||");
        var courseCode = courseInfo[0];
        var courseName = courseInfo[1];

        var eleDiv = document.createElement('div');
        if ((i % 2) == 0)
        {
            eleDiv.setAttribute('class', 'Enroll2');
            eleDiv.setAttribute('className', 'Enroll2');
        }
               
        var eleA1 = document.createElement('a');
        if (courseType == 1)
            eleA1.setAttribute('href', 'http://www.vin.com/ce/' + courseCode + '_VSPN.htm');
        else
            eleA1.setAttribute('href', 'http://www.vin.com/ce/' + courseCode + '.htm');
        eleA1.innerHTML = courseName;

        var eleBr = document.createElement('br');
        
        var eleB = document.createElement('b');
        eleB.innerHTML = "&nbsp;&nbsp;&#187;";
        
        var eleA2 = document.createElement('a');
        if (courseType == 1)
            eleA2.setAttribute('href', "javascript:JoinVSPNCE('" + courseCode + "')");
        else
            eleA2.setAttribute('href', "javascript:JoinCE('" + courseCode + "')");
        eleA2.innerText = 'Enroll Now';
        eleA2.textContent = 'Enroll Now';
            
        eleB.appendChild(eleA2);
        eleDiv.appendChild(eleA1);
        eleDiv.appendChild(eleBr);
        eleDiv.appendChild(eleB);
        
        eleSpan.appendChild(eleDiv);
    }

    tdContainer.appendChild(eleSpan);
}