// JavaScript Document


	var temps="";
	var tempss="";
	var hoverholdg="";
	var hoverholds="";
	var hoverholdss="";
	var hovercolors=new Array("#0066cc","#0066cc","#663300","#ff6600","#990000","#003399","#006600");
	var hovercolorss=new Array("#0099cc","#0099cc","#996633","#ff9933","#993333","#0066cc","#669966");
	var timer="";
	var num=0;
	var opacitytimer="";
	//the hovertimer is used as a check variable to delay section and subsection drop downs
	var hovertimer="";
	var opactemp="";
	var timerdone="";
	var tagid="";
	//default tagid values reflects gNsNssN
	
	var defaulttagid="";
	
	

//*************************************************************************************

// *********************** 				NAV CODE     	*****************************

//*************************************************************************************


//hovertimer to delay dropdown action calls doit() after .5 seconds clears itself if user rolls through button
function showit(a){
var a;
	if(hovertimer)clearTimeout(hovertimer);
	tagid=a;
	if(hoverholdg)hideithoverholdg();
	if(hoverholds)hideithoverholds();
	hovertimer=setTimeout("doit()",500);
}


// shows section nav triggered by global rollover
function doit(){
		if(timer)clearTimeout(timer);
		if(tempss)hideitsub();
		if(temps)hideit();
		if(document.getElementById(tagid)){	
		document.getElementById(tagid).style.visibility="visible";
		temps=tagid;
		return;
		}
	}
	
//hides section nav called by doit() by global rollover	
function hideit(){
	document.getElementById(temps).style.visibility="hidden";
	temps="";
	return;
	}
//timer to delay hover action for subsection dropdown calls doitsub() after .5 seconds clears itself if user rolls through 
//accidental triggers, cutting corners, mouse drift etc. are cancelled by clearing time out in the showithoverholds function
function showitsub(a){
var a;
	if(hovertimer)clearTimeout(hovertimer);
	tagid=a;
	showithoverholdg(tagid);
	if(hoverholds)hideithoverholds();
	hovertimer=setTimeout("doitsub()",500);
}
//shows subsection dropdown and calls function to hold color on global link
function doitsub(){
	if(timer)clearTimeout(timer);
	if(tempss)hideitsub();
	showithoverholds("li"+tagid);
	if(document.getElementById(tagid)){	
		document.getElementById(tagid).style.visibility="visible";
		tempss=tagid;
		}
	return;
	}	
	
//hides subsection dropdown called by doitsub()
function hideitsub(){
	if(tempss){
	document.getElementById(tempss).style.visibility="hidden";
	tempss="";
	}
	return;
	}
	
//holds global link color
function showithoverholdg(a){
	hoverholdg=a.substr(0,2);
	hoverholdg="li"+hoverholdg;
	if(document.getElementById(hoverholdg)){
	document.getElementById(hoverholdg).style.backgroundColor="#404040";
	//document.getElementById(hoverholdg).style.borderColor="#0066cc";
	//document.getElementById(hoverholdg).style.borderColor="#0066cc";
	}
	return;
	}
//dumps global link color
function hideithoverholdg(){
	if(document.getElementById(hoverholdg)){
	document.getElementById(hoverholdg).style.backgroundColor="transparent";
	hoverholdg="";
	}
	return;
	
	}

//holds section link color called by subsection rollover - clears hovertimer to eliminate accidental rollovers
function showithoverholds(a){
	if(hovertimer)clearTimeout(hovertimer);
	var colortemp=a.substr(3,1);
	if(document.getElementById(a)){
	document.getElementById(a).style.backgroundColor=hovercolors[colortemp];
	hoverholds=a;
	}
	}


function hideithoverholds(){
	if(document.getElementById(hoverholds)){
	document.getElementById(hoverholds).style.backgroundColor="transparent";
	hoverholds="";
	}
	return;
}

function showithoverholdss(a){
	var colortemp=a.substr(3,1);
	if(document.getElementById(a)){
	document.getElementById(a).style.backgroundColor=hovercolorss[colortemp];
	}
	//makes allowance for light yellow background by changing the font color
	if(colortemp==1){
		var linkid="a" + a.substr(2,7);
		document.getElementById(linkid).style.color="#fffffa";
		}
	hoverholdss=a;
	return;
}
function hideithoverholdss(){
	if(document.getElementById(hoverholdss)){
	document.getElementById(hoverholdss).style.backgroundColor="transparent";
	hoverholdss="";
	}
	return;
}
var navdefaultindexid="";
//called by onload event
function setdefault(a){
	var a;
	if(a=="indexpage"){
		navdefaultindexid=a;
		navdefaultindex();
	}
	else{
	defaulttagid=a;//defaulttagid is global
	tagid=a;//tagid is global
	navdefault();
	}
}
function navdefaultindex(){
	if(timer)clearTimeout(timer);
		if(tempss)hideitsub();
		if(temps)hideit();	
}
function navdefault(){
	var a=defaulttagid;
	tagid=defaulttagid;
	tagid=tagid.substr(0,3);
	doit();
	tagid=a;
	tagid=tagid.substr(0,4);
	if(hoverholdg)hideithoverholdg();
	if(hoverholds)hideithoverholds();
	doitsub();
	showithoverholdg(tagid.substr(0,3));
	if(a.length>4)showithoverholdss("li"+a);
	
	//showithoverholds(defaultgNsN);
	//showithoverholdss(defaultgNsNssN);
}
//var trigger="";
var triggertimer="";
function trip(a){ 
	if(hovertimer)clearTimeout(hovertimer);
//trigger+=a;
//if(trigger=="12")triggertimer=window.setTimeout("navdefault()",2000);alert(trigger);
//if(trigger.length>1)trigger="";
if(navdefaultindexid)navdefaultindex();
else navdefault();
}

function textsizer(a){

}


/*   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


			MEDIA LOADER
			
			
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


*/
//called by onload event puts default image in media box

var mediaid="";//dump this as page media get populated
function loadpagemedia(){ 

	if(mediaid.substr(0,5)=="index")	{ 
			document.getElementById("indexmedia").style.backgroundImage="url(/images/media/index/" + mediaid + ")";
		}
if(document.getElementById("media")){
	if(mediaid){ 
	 	if(mediaid.substr(0,6)=="rotate") rotateimages();
		
		else	document.getElementById("media").style.backgroundImage="url(/images/media/" + mediaid + ")";
	}
	else{ 
	document.getElementById("media").style.backgroundImage="url(/images/media/g0s6ss0.jpg)";
	}
}

}






/*   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


			HIDDEN TEXT FIELDS
			
			
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


*/
// hidden fields with plus minus image
function showhiddentext(a){
var a;
if(document["img_" + a].src=="http://www.bc3.edu/images/plus.png"){
document.getElementById(a).style.display="block";
document["img_" + a].src="http://www.bc3.edu/images/minus.png";
}
else hidehiddentext(a);
}
function hidehiddentext(a){
var a;
document.getElementById(a).style.display="none";
document["img_" + a].src="http://www.bc3.edu/images/plus.png";
}






var hiddentext="";

//two column hidden list
function showlist(a){
var a;


if(hiddentext){ 
hidelist(hiddentext);

document.getElementById(a).style.display="block";

document.getElementById(a+"a").style.display="block";
	
	hiddentext=a;
	//if(document["img_"+a].src)document["img_" + a].src="/images/minus.png";

}

else if(!hiddentext){
document.getElementById(a).style.display="block";
hiddentext=a;
document.getElementById(a+"a").style.display="block";
	//if(document["img_"+a].src)document["img_" + a].src="/images/minus.png";	
}

}
function hidelist(a){
var a;

document.getElementById(a).style.display="none";



	if(document.getElementById(hiddentext+"a"))document.getElementById(hiddentext+"a").style.display="none";
	hiddentext="";
	//if(document["img_"+a].src)document["img_" + a].src="/images/plus.png";

return;
}


//directory show function
function showdir(a, b){
var a;
var b;

if(hiddentext){ 
hidedir(hiddentext, tempdir);

document.getElementById(a).style.display="block";


document.getElementById(b).style.backgroundColor="#f7f4e9";
	tempdir=b;
	hiddentext=a;
	//if(document["img_"+a].src)document["img_" + a].src="/images/minus.png";

}

//else if(!hiddentext){
//document.getElementById(a).style.display="block";
//hiddentext=a;
//document.getElementById(a+"a").style.display="block";
	//if(document["img_"+a].src)document["img_" + a].src="/images/minus.png";	


}
function hidedir(a,b){
var a;

document.getElementById(a).style.display="none";
document.getElementById(b).style.backgroundColor="transparent";



	hiddentext="";
	tempdir="";
	//if(document["img_"+a].src)document["img_" + a].src="/images/plus.png";

return;
}



// hidden paragraphs without plus and minus sign
var hiddenparagraph="";
hiddenlink="";
function showparagraph(a, b){
var a;
	if(hiddenparagraph){ 
	hideparagraph(hiddenparagraph, hiddenlink);
	document.getElementById(a).style.display="block";
	document.getElementById(b).style.display="none";
	hiddenparagraph=a;
	hiddenlink=b;
	}
	else if(!hiddenparagraph){
	document.getElementById(a).style.display="block";
	document.getElementById(b).style.display="none";
	hiddenparagraph=a;
	hiddenlink=b;
	}

}
function hideparagraph(a, b){
var a;
document.getElementById(a).style.display="none";
document.getElementById(b).style.display="block";
hiddenparagraph="";
hiddenlink="";
return;
}










// hidden forms use when page also has hidden text also used with ambassadors profile
var hiddenform="";
function showform(a){
var a;
	if(hiddenform){ 
	hideform(hiddenform);
	document.getElementById(a).style.display="block";
	hiddenform=a;
	}
	else if(!hiddenform){
	document.getElementById(a).style.display="block";
	hiddenform=a;
	}

}
function hideform(a){
var a;
document.getElementById(a).style.display="none";
hiddenform="";
return;
}







// &&&&&&&&&&&   map functions  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


var zoom=1;
var maptemp=null;
function changemap(a){
if(zoom){
maptemp=a;

switch(a){
	case 0:
	document.getElementById('campusmap').style.backgroundImage="url(/images/map/map0.gif)";
	zoom=0;
	break;  
	case 1:
	document.getElementById('campusmap').style.backgroundImage="url(/images/map/map1.gif)";
	zoom=0;
	break;
	case 2:
	document.getElementById('campusmap').style.backgroundImage="url(/images/map/map2.gif)";
	zoom=0;
	break;
	case 3:
	document.getElementById('campusmap').style.backgroundImage="url(/images/map/map3.gif)";
	zoom=0;
	break;
	
	case 'p0':
	document.getElementById(a).style.display="block";
	//document.getElementById('campusmap').style.backgroundImage="url(/images/map/parkinglot_8.png)";
	zoom=1;
	break;
	
	case 'p1':
	document.getElementById(a).style.display="block";
	//document.getElementById('campusmap').style.backgroundImage="url(/images/map/parkinglot_8.png)";
	zoom=1;
	break;
	
	case 'p2':
	document.getElementById(a).style.display="block";
	//document.getElementById('campusmap').style.backgroundImage="url(/images/map/parkinglot_8.png)";
	zoom=1;
	break;
	
	case 'p3':
	document.getElementById(a).style.display="block";
	//document.getElementById('campusmap').style.backgroundImage="url(/images/map/parkinglot_8.png)";
	zoom=1;
	break;
	
	case 'p4':
	document.getElementById(a).style.display="block";
	//document.getElementById('campusmap').style.backgroundImage="url(/images/map/parkinglot_8.png)";
	zoom=1;
	break;
	
	case 'p5':
	document.getElementById(a).style.display="block";
	//document.getElementById('campusmap').style.backgroundImage="url(/images/map/parkinglot_8.png)";
	zoom=1;
	break;
	
	case 'p6':
	document.getElementById(a).style.display="block";
	//document.getElementById('campusmap').style.backgroundImage="url(/images/map/parkinglot_8.png)";
	zoom=1;
	break;
	
	case 'p7':
	document.getElementById(a).style.display="block";
	//document.getElementById('campusmap').style.backgroundImage="url(/images/map/parkinglot_8.png)";
	zoom=1;
	break;
	case 'p9':
	document.getElementById(a).style.display="block";
	//document.getElementById('campusmap').style.backgroundImage="url(/images/map/parkinglot_8.png)";
	zoom=1;
	break;

}

}
else {
document.getElementById('campusmap').style.backgroundImage="url(/images/map/map.jpg)";
zoom=1;
}
}

function navgo(dir){
var dir;
if(!zoom){
zoom=1;
switch(dir){
	case 'up':
	if(maptemp>1)maptemp=maptemp-2;
	break;
	case 'down':
	if(maptemp<2)maptemp=maptemp+2;
	break;
	case 'right':
	if((maptemp==0)||(maptemp==2))maptemp=maptemp+1;
	break; 
	case 'left':
	if((maptemp==1)||(maptemp==3))maptemp=maptemp-1;
}
changemap(maptemp);
return;
}
}

//changemap back is for campus police parking map page

function changemapback(a){ 
	document.getElementById(a).style.display="none"; 
	//document.getElementById('campusmap').style.backgroundImage="url(/images/map/map.jpg)";
	
}




/***********************************************************************************************

					Click and pledge code

**************************************************************************************************/

			function ChargeWindow(OrgID)
			{
			window.open('https://128bit.clickandpledge.com/Default.asp?ID='+OrgID,'ChargeWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=710,height=600');
			}

/***********************************************************************************************

					rollover image and link code

**************************************************************************************************/		
	function imagelinkrollover(aa){
var aa;
if(document.all != null){document.getElementById(aa).style.filter ="alpha(opacity=50)";}
else {document.getElementById(aa).style.opacity=".5";}

document.getElementById("h2-" + aa).style.textDecoration="underline";
return;
}

function imagelinkrollout(aa){
var aa;
if(document.all != null)document.getElementById(aa).style.filter ="alpha(opacity=100)";
else document.getElementById(aa).style.opacity="1.0";

document.getElementById("h2-" + aa).style.textDecoration="none";
return;
}

/*****************************************************************************************************************************************

						timer code

**************************************************************************************************************************************/

function texttimer(a, b, c, d){
			var a, b, c, d;
		
			
			
		     var current_date=new Date();
		     var date=current_date.getDate();
		     var month=current_date.getMonth();
		     var year=current_date.getFullYear();
		     var timer_year=a;//put year here
		     var timer_month=b;//put month here remember getMonth() returns 0-11 so make month minus one
		     var timer_date=c;//put date returns exact date
			 var hiddenfieldId=d;//refers to the tag id
		
			
		     if(year<=timer_year){
				 if(month<=timer_month){
				 		if(month<timer_month){document.getElementById(hiddenfieldId).style.display="block"; return;
						}
				  if(month==timer_month){
								if(date<=timer_date){
								document.getElementById(hiddenfieldId).style.display="block";
								}
		    			}
				}
			 }
						
		     else {
			 document.getElementById(hiddenfieldId).style.display="none";
			}
			 
			 
}



function textontimer(a, b, c, d){
			var a, b, c, d;
		
			
			
		     var current_date=new Date();
		     var date=current_date.getDate();
		     var month=current_date.getMonth();
		     var year=current_date.getFullYear();
		     var timer_year=a;//put year here
		     var timer_month=b;//put month here remember getMonth() returns 0-11 so make month minus one
		     var timer_date=c;//put date returns exact date
			 var hiddenfieldId=d;//refers to the tag id
			 
			     if(year>=timer_year){
				 if(month>=timer_month){
				 		if(month>timer_month){document.getElementById(hiddenfieldId).style.display="block"; return;
						}
				  if(month==timer_month){
								if(date>=timer_date){
								document.getElementById(hiddenfieldId).style.display="block";
								}
		    			}
				}
			 }
						
		     else {
			 document.getElementById(hiddenfieldId).style.display="none";
			}	 
			 
			 
}

/*****************************************************************************************************************************************

				apecs code

**************************************************************************************************************************************/
var classchecker=0;

function checkclass(){
	classchecker=1;
	openapecs();
	return;
}




function openapecs(){

if(checkforpopupblocker()){
	document.getElementById("popupblocktext").style.display="block";
	return;
}
else if(checkforbrowser()){
	document.getElementById("browsertext").style.display="block";
	return;
}
else if(classchecker){
	var w=screen.width;
	var h=screen.height;
	h=h-125;
	var wh=w-800;
	var apecswindow=window.open("https://apecsportal.bc3.edu/hestuportal/apecs_hestuportal_schedule_of_classes_link.aspx?instid=bu00","apecswin","scrollbars=1,height=" + h + ",width=780,left=0,top=0");
	var apecshelpwindow=window.open("http://www.bc3.edu/BC3_Online/help.asp","apecshelpwin","scrollbars=1,height=" + h + ",width=" + wh + ",left=790,top=0");
	classchecker=0;
	
	return;

}
else {
	var w=screen.width;
	var h=screen.height;
	h=h-125;
	var wh=w-800;
	var apecswindow=window.open("https://apecsportal.bc3.edu/hestuportal/APECS_HESTUPORTAL.ASPX?INSTID=BU00","apecswin","scrollbars=1,height=" + h + ",width=780,left=0,top=0");
	var apecshelpwindow=window.open("http://www.bc3.edu/BC3_Online/help.asp","apecshelpwin","scrollbars=1,height=" + h + ",width=" + wh + ",left=790,top=0");
	
	return; }
	
}



function checkforpopupblocker(){
 var checkwin="";
 checkwin=window.open("http://www.bc3.edu/beta/popup.html","popup","width=1,height=1,left=0,top=0,scrollbars=no");
 if(!checkwin){
    return 1;
	}
 else {
 checkwin.close()
	return 0;
 	}
 
}

function checkforbrowser(){
	var browserName=whichBrs();
	if(browserName == "Internet Explorer"){
	return 0;
	}
	if(browserName == "Safari"){
	return 0;
	}
	else { return 1; }
}

function whichBrs() {
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("staroffice") != -1) return 'Star Office';
if (agt.indexOf("webtv") != -1) return 'WebTV';
if (agt.indexOf("beonex") != -1) return 'Beonex';
if (agt.indexOf("chimera") != -1) return 'Chimera';
if (agt.indexOf("netpositive") != -1) return 'NetPositive';
if (agt.indexOf("phoenix") != -1) return 'Phoenix';
if (agt.indexOf("firefox") != -1) return 'Firefox';
if (agt.indexOf("safari") != -1) return 'Safari';
if (agt.indexOf("skipstone") != -1) return 'SkipStone';
if (agt.indexOf("msie") != -1) return 'Internet Explorer';
if (agt.indexOf("netscape") != -1) return 'Netscape';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
if (agt.indexOf('\/') != -1) {
if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
return navigator.userAgent.substr(0,agt.indexOf('\/'));}
else return 'Netscape';} else if (agt.indexOf(' ') != -1)
return navigator.userAgent.substr(0,agt.indexOf(' '));
else return navigator.userAgent;
}


/********************************************************************************************************************

				non credit apecs code

***********************************************************************************************************************/

function gotoapecs(){

		//var tempplace=a; 
		
var browserName=navigator.appName;
var newwin="";
if(checkforbrowser()){
	alert("You must use the Microsoft Internet Explorer or the Safari browser to register online. Sorry for the inconvenience.");
}

else {
newwin=window.open("https://apecsportal.bc3.edu/hestuportal/apecs_hestuportal_ceu_web_store_details.aspx?instid=bu00&wscatid=1","");
if(!newwin)alert("You must turn off your browser's pop-up blocker feature to continue");

}


}
function gotoapecsps(){

		//var tempplace=a; 
		
var browserName=navigator.appName;
var newwin="";
if(checkforbrowser()){
	alert("You must use the Microsoft Internet Explorer or the Safari browser to register online. Sorry for the inconvenience.");
}

else {
newwin=window.open("https://apecsportal.bc3.edu/hestuportal/apecs_hestuportal_ceu_web_store_details.aspx?instid=bu00&wscatid=3","");
if(!newwin)alert("You must turn off your browser's pop-up blocker feature to continue");

}


}

function gotoapecsconf(){

		//var tempplace=a; 
		
var browserName=navigator.appName;
var newwin="";
if(checkforbrowser()){
	alert("You must use the Microsoft Internet Explorer or the Safari browser to register online. Sorry for the inconvenience.");
}

else {
newwin=window.open("https://apecsportal.bc3.edu/hestuportal/apecs_hestuportal_ceu_web_store_details.aspx?instid=bu00&wscatid=5","");
if(!newwin)alert("You must turn off your browser's pop-up blocker feature to continue");

}


}




/********************************************************************************************************************

					disable the enter key in form fields so form isn't accidentally submitted

***********************************************************************************************************************/

function disableEnterKey(e)
{

     var key;

     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

     if(key == 13)
          return false;
     else
          return true;
}














