//Open and close boxes, currently used in About Us and Catalogue pages

function OpenClose(itemID, sectionID)
{
	if(document.getElementById(itemID).style.display == 'block') {
		document.getElementById(itemID).style.display = 'none';
		if(sectionID != undefined)
			document.getElementById(sectionID).style.backgroundImage = "url(images/aboutus/"+ sectionID +".png)";
	} else {
		if(document.getElementById("ecornell_content") != undefined)
			document.getElementById("ecornell_content").style.display = 'none';
			
		if(document.getElementById("fitt_content") != undefined)
			document.getElementById("fitt_content").style.display = 'none';
			
		if(document.getElementById("econcordia_content") != undefined)
			document.getElementById("econcordia_content").style.display = 'none';
			
		if(document.getElementById("sefl_content") != undefined)
			document.getElementById("sefl_content").style.display = 'none';
		
		if(document.getElementById("seminars_content") != undefined)
			document.getElementById("seminars_content").style.display = 'none';
			
		if(document.getElementById("fac_content") != undefined)
			document.getElementById("fac_content").style.display = 'none';			
			
			
		document.getElementById(itemID).style.display = 'block'; 
		if(sectionID != undefined)
			document.getElementById(sectionID).style.backgroundImage = "url(images/aboutus/"+ sectionID +"_o.png)";
		
		}
}

//Used to switch images in the portfolio section
	
function Portfolio(imgName, sectionName, urlLink, multipleItems)
{
	document.getElementById('imgSwap').src = 'images/portfolio/' + imgName + ".jpg";
	
	//Checks if there are multiple images for that section
	if(multipleItems != undefined)
	{
		var itemLinks = "";
		for(x=1; x <= multipleItems; x++)
		{
			theScript = "javascript:Portfolio('classroom" + x + "', 'Virtual Classrooms', 'javascript:void(0);', 2); void(0);";
			itemLinks += '<a href="' + theScript + '">' + x + '</a>'
		}
		document.getElementById('headerTitle').innerHTML = sectionName + "<span style='margin-right:15px;'> </span>" + itemLinks
	}
	else
	{
		document.getElementById('headerTitle').innerHTML = sectionName
	}
	
	if(urlLink != undefined){
		document.getElementById('portfolio_link').href = urlLink
		if(imgName != 'classroom1')
			document.getElementById('portfolio_link').target = "_blank"
		else
			document.getElementById('portfolio_link').target = "_self"
	} else {
		document.getElementById('portfolio_link').href = "javascript:void(0);"
		document.getElementById('portfolio_link').target = "_self"
	}
	
}


// OPEN POP-UP
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

