//this controls what happens when buttons are click in the toolbar under the vrtour

function DoAutorotationStart()
{
	document.ptviewer.startAutoPan( 0.5, 0.0, 1.0 );
}

function DoAutorotationStop()
{
  document.ptviewer.stopAutoPan();
}

function DoZoomIn()
{
	document.ptviewer.startAutoPan( 0.0, 0.0, 1.0/1.03 );
}

function DoZoomOut()
{
	document.ptviewer.startAutoPan( 0.0, 0.0, 1.03 );
}

function DoShowHideHotspots() 
{
	document.ptviewer.toggleHS();
}

function DoReset()
{
	document.ptviewer.gotoView( -45, -60, 80 );
}

function changePicture(name, source)
{
	name.src=source;
}

// this code is for the hotlink map of the campus
function changePage(n)
{	  
	switch(n)
  {
	case 0:		//Front of Library Bldg 2
	  parent.Map.location = "MapFrontBldg2.asp";
	  parent.Info.location = "InfoFrontBldg2.asp";
	  parent.Pano.location = "VRFrontBldg2.asp";
	  break;
	case 1:		//Administration
	  parent.Map.location = "MapBldg1.asp";
	  parent.Info.location = "InfoBldg1.asp";
	  parent.Pano.location = "VRBldg1.asp";
	  break;
	case 2:		//Library
	  parent.Map.location = "MapBldg2.asp";
	  parent.Info.location = "InfoBldg2.asp";
	  parent.Pano.location = "VRBldg2.asp";
	  break;		
	case 3:		//Social Science
	  parent.Map.location = "MapBldg3_14.asp";
	  parent.Info.location = "InfoBldg3_14.asp";
	  parent.Pano.location = "VRBldg3_14.asp";
	  break;
	case 4:		//Business
	  parent.Map.location = "MapBldg4.asp";
	  parent.Info.location = "InfoBldg4.asp";
	  parent.Pano.location = "VRBldg4.asp";
	  break;
	case 5:		//Communications/Playhouse
	  parent.Map.location = "MapBldg5.asp";
	  parent.Info.location = "InfoBldg5.asp";
	  parent.Pano.location = "VRBldg5.asp";
	  break;
	case 6:		//Fine Arts
	  parent.Map.location = "MapBldg6.asp";
	  parent.Info.location = "InfoBldg6.asp";
	  parent.Pano.location = "VRBldg6.asp";
	  break;
	case 7:		//Gymnasium and Fitness Center
	  parent.Map.location = "MapBldg7.asp";
	  parent.Info.location = "InfoBldg7.asp";
	  parent.Pano.location = "VRBldg7.asp";
	  break;	
	case 8:		//Chemistry and Life Sciences
	  parent.Map.location = "MapBldg8.asp";
	  parent.Info.location = "InfoBldg8.asp";
	  parent.Pano.location = "VRBldg8.asp";
	  break;	
	case 9:		//Institute for Extended Learning
	  parent.Map.location = "MapBldg9.asp";
	  parent.Info.location = "InfoBldg9.asp";
	  parent.Pano.location = "VRBldg9.asp";
	  break;	
	case 10:	//Warehouse/Maintenance Shop

	  break;	
	case 11:	//Photography
	  parent.Map.location = "MapBuilding11.asp";
	  parent.Info.location = "InfoBldg11.asp";
	  parent.Pano.location = "VRBldg11.asp";
	  break;	
	case 12:	//Music Annex
	  parent.Map.location = "MapBldg12.asp";
	  parent.Info.location = "InfoBldg12.asp";
	  parent.Pano.location = "VRBldg12.asp";
	  break;	
	case 13:	//Stadium/Physical Education Complex
	  parent.Map.location = "MapBldg13.asp";
	  parent.Info.location = "InfoBldg13.asp";
	  parent.Pano.location = "VRBldg13.asp";
	  break;	
	case 14:	//Social Science
	  parent.Map.location = "MapBldg3_14.asp";
	  parent.Info.location = "InfoBldg3_14.asp";
	  parent.Pano.location = "VRBldg3_14.asp";
	  break;	
	case 15:	//Music/Performing Arts
	  parent.Map.location = "MapBldg15.asp";
	  parent.Info.location = "InfoBldg15.asp";
	  parent.Pano.location = "VRBldg15.asp";
	  break;	
	case 16:	//Human Services/ELC
	  parent.Map.location = "MapBldg16.asp";
	  parent.Info.location = "InfoBldg16.asp";
	  parent.Pano.location = "VRBldg16.asp";
	  break;	
	case 17:	//SUB Bldg 17
	  parent.Map.location = "MapBldg17.asp";
	  parent.Info.location = "InfoBldg17.asp";
	  parent.Pano.location = "VRBldg17.asp";
	  break;	
	case 18:	//Computing, Mathematics and Science
	  parent.Map.location = "MapBldg18.asp";
	  parent.Info.location = "InfoBldg18.asp";
	  parent.Pano.location = "VRBldg18.asp";
	  break;	
	case 19:	//Technical Arts
	  parent.Map.location = "MapBldg19.asp";
	  parent.Info.location = "InfoBldg19.asp";
	  parent.Pano.location = "VRBldg19.asp";
	  break;	
	case 20:	//Fine Arts Annex
	  parent.Map.location = "MapBldg20.asp";
	  parent.Info.location = "InfoBldg20.asp";
	  parent.Pano.location = "VRBldg20.asp";
	  break;
	case 21:	//Front of Human Services
	  parent.Map.location = "MapFrontBldg16.asp";
	  parent.Info.location = "InfoFrontBldg16.asp";
	  parent.Pano.location = "VRFrontBldg16.asp";
	  break;
	case 22:	//Admissions
	  parent.Map.location = "MapAdmis.asp";
	  parent.Info.location = "InfoAdmis.asp";
	  parent.Pano.location = "VRAdmis.asp";
	  break;
	case 23:	//Behind Library Bldg 2
	  parent.Map.location = "MapBehindBldg2.asp";
	  parent.Info.location = "InfoBehindBldg2.asp";
	  parent.Pano.location = "VRBehindBldg2.asp";
	  break;
	case 24:	//Front of Gym Bldg 7
	  parent.Map.location = "MapFrontBldg7.asp";
	  parent.Info.location = "InfoFrontBldg7.asp";
	  parent.Pano.location = "VRFrontBldg7.asp";
	  break;
	case 25:	//Front Stadium
	  parent.Map.location = "MapFrontStadium.asp";
	  parent.Info.location = "InfoFrontStadium.asp";
	  parent.Pano.location = "VRFrontStadium.asp";
	  break;
	case 26:	//Behind Bldg 11
	  parent.Map.location = "MapBehindBldg11.asp";
	  parent.Info.location = "InfoBehindBldg11.asp";
	  parent.Pano.location = "VRBehindBldg11.asp";
	  break;
	case 27:	//Bookstore
	  parent.Map.location = "MapBldg17.asp";
	  parent.Info.location = "InfoBldg17.asp";
	  parent.Pano.location = "VRBookStore.asp";
	  break;
	case 28:	//Dining Area
	  parent.Map.location = "MapBldg17.asp";
	  parent.Info.location = "InfoBldg17.asp";
	  parent.Pano.location = "VRDining.asp";
	  break;	  
	case 29:	//Falls Cafe
	  parent.Map.location = "MapBldg17.asp";
	  parent.Info.location = "InfoBldg17.asp";
	  parent.Pano.location = "VRSFCCCafe.asp";
	  break;	  
	case 30:	//Saddle Making
	  parent.Map.location = "MapBldg19.asp";
	  parent.Info.location = "InfoBldg19.asp";
	  parent.Pano.location = "VRSaddle.asp";
	  break;	  
	case 31:	//O and P
	  parent.Map.location = "MapBldg19.asp";
	  parent.Info.location = "InfoBldg19.asp";
	  parent.Pano.location = "VROandP.asp";
	  break;	
	case 32:	//Weight Room
	  parent.Map.location = "MapBldg7.asp";
	  parent.Info.location = "InfoBldg7.asp";
	  parent.Pano.location = "VRWeightRoom.asp";
	  break;	  
	case 33:	//Gym
	  parent.Map.location = "MapBldg7.asp";
	  parent.Info.location = "InfoBldg7.asp";
	  parent.Pano.location = "VRGym.asp";
	  break;	  
	case 34:	//Interior
	  parent.Map.location = "MapBldg16.asp";
	  parent.Info.location = "InfoBldg16.asp";
	  parent.Pano.location = "VRInterior.asp";
	  break;	
	case 35:   //International Learning Center  
	  parent.Map.location = "MapBldg5.asp";
	  parent.Info.location = "InfoBldg5.asp";
	  parent.Pano.location = "VRILC.asp";
	  break;
	case 36:	//SUB Bldg Lounge A & B
	  parent.Map.location = "MapBldg17.asp";
	  parent.Info.location = "InfoBldg17.asp";
	  parent.Pano.location = "VRLounges.asp";
	  break;	
	default:	//Front Library Bldg 2
	  parent.Map.location = "MapFrontBldg2.asp";
	  parent.Info.location = "InfoFrontBldg2.asp";
	  parent.Pano.location = "VRFrontBldg2.asp";
	  break;
  }
}

function openFloorPlan(SourceURL, WinWidth, WinHeight)
{
	var NewWin=parent.window;
  
  width=WinWidth;
  height=WinHeight;
	url = SourceURL;

	//if a window is already open then close it 
	//then open a new one with URL passed from link above
	if (NewWin && NewWin!=null && NewWin!=""&& NewWin!=parent.window)
	{
		NewWin.close()
		NewWin=window.open(url,"Sample","resizable=yes,status=no,scrollbars=yes,width=" + width + ",height=" + height);
	}
	//if a window has not been open then open one with URL passed from link above
	else
	{
		NewWin=window.open(url,"Sample","resizable=no,status=no,scrollbars=no,width=" + width + ",height=" + height);
		NewWin.focus();
	}
}

