// Rev. 22/08/2011
var Faculties = new Array("Institute of Theology","Academie Libanaise des Beaux Arts","Diplome Universitaire de Technologie (DUT)","Faculty of Arts & Social Sciences", "Faculty of Business and Management", "Faculty of Engineering", "Faculty of Sciences", "Faculty of Health Sciences", "Faculty of Medicine", "St. George Faculty Graduate Medical Education", "Institut Universitaire de Technologie", "Special Programs", "INSTITUTE/OFFICE"); 
var Department0 = new Array("Religous studies","Theology"); 
var Department1 = new Array("Architecture","Architecture d'intérieur et Design produit / Interior Architecture & Design", "Arts Décoratifs / Decorative Arts", "Arts Graphique et Publicité", "Arts Plastiques et Appliqués", "Cinema et Réalisation Audiovisuelle", "Computer Graphics and Interactive Media", "Foundation Arts Program", "Graphic Design", "Urbanisme"); 
var Department2 = new Array("Mechatronics","Telecommunications & Networks","Aircraft Maintenance Technology"); 
var Department3 = new Array("Arabic Language and Literature", "Christian - Muslim Studies", "Education: Multimedia Engineering", "Education: English track", "English Language and Literature", "Comparative Literature", "English Language Teaching", "French Language and Literature", "History", "Languages / Translations", "Library and Information Science", "Mass Communication", "Philosophy", "Physical Education", "Sports Management", "Political Science and International Affairs", "Psychology");
var Department4 = new Array("Business Administration", "Economics", "Tourism & Hotel Management"); 
var Department5 = new Array("Aeronautical Engineering", "Chemical Engineering", "Civil Engineering", "Computer Engineering", "Electrical Engineering", "Engineering Management", "Mechanical Engineering");
var Department6 = new Array("Chemistry", "Computer Science", "Environmental Sciences", "Information Systems", "Mathematics", "Physics", "Premedical Program", "Software Engineering");
var Department7 = new Array("Clinical Laboratory Sciences", "Health Promotion", "Medical Laboratory Sciences", "Nursing", "Nutritional Sciences", "Premedical Program", "Public Health & Development Science");
var Department8 = new Array("Biomedical Sciences", "Cognitive Behavior Therapy", "Medicine");
var Department9 = new Array("Anatomical Pathology", "Anesthesiology", "Cardiology", "Cardiothoracic Surgery", "Diagnostic Radiology", "Emergency Medicine", "Endocrinology and Metabolism","Gastroenterology", "General Surgery", "Hematology and Medical Oncology", "Internal Medicine", "Laboratory Medicine", "Nephrology", "Neurosurgery", "Obstetrics and Gynecology", "Ophthalmology", "Orthopedic Surgery", "Otholaryngology-Head and Neck Surgery", "Pediatric Surgery", "Pediatrics", "Plastic Surgery", "Psychiatry", "Pulmonary Diseases and Intensive Care Medicine", "Urology", "Vascular Surgery");
var Department10 = new Array("Mechatronics", "Telecommunications & Networks", "Aircraft Maintenance Technology");
var Department11 = new Array("Freshman Arts", "Freshman Sciences");
var Department12 = new Array("President's Office", "Vice-President's Office", "Office of Admissions & Registration", "Center for Christian-Muslim Studies", "Center for Engineering and Environmental Studies", "Office of Comptroller", "Office of Constructions and Maintenance","Office of Development", "Economics and Capital Markets Research Center", "Geographical Information Systems Center", "Office of Human Resources", "Office of Information Technology Center", "Institute of History, Archaeology, and Near Eastern Heritage", "Institute of the Environment", "Libraries", "Office of Procurement & Campus Services", "Office of Public Relations", "Office of Special Programs", "Office of Student Affairs");
var Campus = new Array("Al-Kurah Campus","Achrafieh Campus","Sin El-Fil Campus"); 
var Status = new Array("Administrator","Full Time Faculty","Part Time", "Faculty", "Staff", "PostGraduate (MA, MS, MD…)", "Freshman", "DUT"); 
var Language = new Array("English", "French")


function SetCombo(Arr)
{
var strCmb;
strCmb = "";
for (i=0; i< Arr.length; i++)
  {
  strCmb = strCmb + "<option value='" + Arr[i] + "'>" + Arr[i]+ "</option>";
  }
 document.write(strCmb); 
 
}

function SetFaculties()
{
var strFaculties;
strFaculties = "";
for (i=0; i< Faculties.length; i++)
  {
  strFaculties = strFaculties + "<option value='" + Faculties[i] + "'>" + Faculties[i]+ "</option>";
  }
 document.write(strFaculties); 
 
}

function SetDepartment()
{
var strDept;

var indx = document.getElementsByName('Faculty_Institute_Office')[0].selectedIndex;
//indx = 1;
var x = document.getElementsByName('Department')[0];
var Arr = new Array();

Arr = eval("Department" + indx);
temp = x.length;

/// first remove all items
for (j=0; j<temp; j++)
{
   x.remove(x.j);
}

//second add new items
for (i=0; i< Arr.length; i++)
  {
  var y=document.createElement('option');
  y.text=Arr[i];
  y.value=Arr[i];
  
    try
	  {
	  x.add(y,i); // standards compliant
	  }
	catch(ex)
	  {
	  x.add(y); // IE only
	  }

  }
}

function isStd() {

    var indx = document.getElementsByName('Status')[0].selectedIndex;
    if ((indx == 3) || (indx == 6) || (indx == 7))
        return true;
    else
        return false;   

}


function ToggleAll(item)
  {
	for(i=1; i<5; i++)
	  {
		
		obj=document.getElementById(i);
		if (i != item)
		  obj.style.display="none";
		else
		   {
		     if (obj.style.display == "block")
			    {
					document.getElementById("infoAbout").style.display = "block" //window.location.href="index.asp"
			 		obj.style.display="none";
				}
			 else
			 	{
					obj.style.display="block";
					document.getElementById("infoAbout").style.display = "none"
				}//window.location.href="index.asp"*/
		   }
	  
	  }
  }


function Toggle(item) {
   obj=document.getElementById(item);
   visible=(obj.style.display!="none")
   key=document.getElementById("x" + item);
   if (visible) {
     obj.style.display="none";
   } else {
      obj.style.display="block";
   }
}

function Expand() {
   divs=document.getElementsByTagName("DIV");
   for (i=0;i<divs.length;i++) {
     divs[i].style.display="block";
     key=document.getElementById("x" + divs[i].id);
   }
}

function Collapse() {
   divs=document.getElementsByTagName("DIV");
   for (i=0;i<divs.length;i++) {
     divs[i].style.display="none";
     key=document.getElementById("x" + divs[i].id);
   }
}




function SetFrame()
   {   
  	var pgwidth = screen.width;
	var pgheight = screen.height;
	//document.write("it is scrolling:" + top.document.contentWindow.document.body.scrollHeight);
	if (pgwidth == 800)
	 	top.document.getElementById('frmContent').height= pgheight - 280;
		//resize the frame according to the content
		
	 else
	 	top.document.getElementById('frmContent').height= pgheight - 326;
		
/*		var f = document.getElementById("frmContent");
                function resize() {
                    var h = "";
                    var w = "";
                    if (f.contentDocument) {
                        h = f.contentDocument.documentElement.offsetHeight + 20 + "px";
                        // can't find anything for Opera and Firefox that works for the width. OffetWidth doesn't work right either.
                        w = f.contentDocument.defaultView.getComputedStyle(f.contentDocument.documentElement,"").getPropertyValue("width");
                    } else if (f.contentWindow) {
                        h = f.contentWindow.document.body.scrollHeight + 5 + "px";
                        w = f.contentWindow.document.body.scrollWidth + 8 + "px";
                    } else {
                        return;
                    }
                    f.setAttribute("width", w);
                    f.setAttribute("height",h);
                    f.parentNode.setAttribute("width",w);
                    f.parentNode.setAttribute("height",h);
                }
                if (window.addEventListener) {
                    f.onload = resize;
                } else if (f.attachEvent) {
                    f.attachEvent("onload", resize);
                } else {
                    return;
                }
                resize();
		*/
   }




function SetContent(strpage, iID, strTitle)
   {
    if (strpage.indexOf('#') > 0)
	    {
			parent.frames['frmContent'].location.href = strpage.split("#")[0] + "&PageName=" +  strTitle + "#" + strpage.split("#")[1];}
	else        
		parent.frames['frmContent'].location.href = strpage + "&PageName=" +  strTitle;
	SetFrame();	
	document.getElementById('aPrinter').href = "javascript: popup(" + iID + ", '" + strTitle + "');"
	document.getElementById('aPrinter').onclick = "#"
   }
   
function dynamictoggle(item, myarray)
 {
  for(i=0; i < myarray.length; i++)
  	 {
	    obj=document.getElementById(myarray[i]);
		if (myarray[i] == item) 
	 		{
				if (obj.style.display=="block")
					obj.style.display="none";
				else
					obj.style.display="block";
			}
		else
		   	obj.style.display="none";
	 }
 
 }

function onHover(thename)
  {
	document.getElementById(thename).className = 'bg-title-hover';
	document.getElementById("tr" + thename).className = 'bg-title-hover';  
	document.getElementById("tr" + thename).style.cursor = "hand"
	  
  }

function offHover(thename)
  {
	document.getElementById(thename).className = 'bg-title';
	document.getElementById("tr" + thename).className = 'bg-title';  
	  
  }

