// JavaScript Document


	var temps="";
	var tempss="";
	var hoverholdg="";
	var hoverholds="";
	var hoverholdss="";
	var hovercolors=new Array("#0066cc","#cc9900","#663300","#ff6600","#990000","#003399","#006600");
	var hovercolorss=new Array("#0099cc","#ffcc00","#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="#404040";
		}
	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,7)=="animate") makeopacity("quote");
		
		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;
}

// hidden paragraphs without plus and minus sign
var hiddenparagraph="";
function showparagraph(a){
var a;
	if(hiddenparagraph){ 
	hideparagraph(hiddenparagraph);
	document.getElementById(a).style.display="block";
	hiddenparagraph=a;
	}
	else if(!hiddenparagraph){
	document.getElementById(a).style.display="block";
	hiddenparagraph=a;
	}

}
function hideparagraph(a){
var a;
document.getElementById(a).style.display="none";
hiddenparagraph="";
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 here remember to add one to day
			 var hiddenfieldId=d;
		
			
		     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

**************************************************************************************************************************************/






function openapecs(){

if(checkforpopupblocker()){
	document.getElementById("popupblocktext").style.display="block";
	return;
}
else if(checkforbrowser()){
	document.getElementById("browsertext").style.display="block";
	return;
}
else {
	var w=screen.width;
	var h=screen.height;
	h=h-125;
	var wh=w-800;
	var apecswindow=window.open("https://apecsnet.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")
	
	}
}



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=navigator.appName;
	if(browserName !== "Microsoft Internet Explorer"){
	return 1;
	}
	else { return 0; }
}


























