// This is for Student and Faculty Image Galleries

function findImg(){
	var content = document.getElementById('gallery');
	var links=content.getElementsByTagName("img");
	var linkp;
	for(var i=0;i<links.length;i++){
		linkp = links[i];
			addAnEvent(linkp,'mouseover',hover)
			addAnEvent(linkp,'mouseout',out)
			addAnEvent(linkp,'mousedown',showimage)
		
	}
	if(document.getElementById('next')){
		preload();
	}
}

	
function showimage() {
	getHeight();
	this.className="";
	var browserName = navigator.appName;
	var src = this.getAttribute('src');
	src = src.substring(0, src.indexOf('.jpg'));
	var desc = this.title;
	var div = (document.getElementById('alert'));
	var dim = (document.getElementById('dim'));
	var title = (document.getElementById('title'));
	if(document.getElementById('imgwrap')){
	var nxt = document.getElementById('next');
	var prev = document.getElementById('prev');
	nxt.href = "javascript:image1();";
	prev.style.visibility = "hidden";
	hideImage = 'imgwrap';
	var hide = (document.getElementById(hideImage));
	hide.style.height = "auto";
	hide.style.width = "auto";
	hide.style.background = "";
	hide.className = "";
	}
	if(browserName == "Microsoft Internet Explorer"){
	div.style.top = document.documentElement.scrollTop+100+'px';
	}
	else {
	div.style.top = window.pageYOffset+100+'px';
	}
	title.innerHTML = desc;
	imageId = 'img';
	var img = (document.getElementById(imageId));
	div.className = "canvas";
	dim.className = "block";
	img.src = src +'-lg'+'.jpg';
	setOpacity(img, 0);
	img.style.visibility = 'visible';
  	fadeIn(imageId,0);
}

function hover(){
	this.className="imghover";
	this.style.cursor = "pointer";
}

function out(){
	this.className="";
}

// Below is for the Facility Virtual Tour (Very Clumsy on short notice!)

var Pic = new Array()
Pic[0] = 'transparent url(../img/virtualtour/virtualtour-lg.jpg) center 2px no-repeat'
Pic[1] = 'transparent url(../img/virtualtour/virtualtour1-lg.jpg) center 2px no-repeat'
Pic[2] = 'transparent url(../img/virtualtour/virtualtour2-lg.jpg) center 2px no-repeat'
Pic[3] = 'transparent url(../img/virtualtour/virtualtour3-lg.jpg) center 2px no-repeat'
Pic[4] = 'transparent url(../img/virtualtour/virtualtour4-lg.jpg) center 2px no-repeat'
Pic[5] = 'transparent url(../img/virtualtour/virtualtour5-lg.jpg) center 2px no-repeat'
Pic[6] = 'transparent url(../img/virtualtour/virtualtour6-lg.jpg) center 2px no-repeat'
Pic[7] = 'transparent url(../img/virtualtour/virtualtour7-lg.jpg) center 2px no-repeat'
Pic[8] = 'transparent url(../img/virtualtour/virtualtour8-lg.jpg) center 2px no-repeat'
Pic[9] = 'transparent url(../img/virtualtour/virtualtour9-lg.jpg) center 2px no-repeat'
Pic[10] = 'transparent url(../img/virtualtour/virtualtour10-lg.jpg) center 2px no-repeat'
Pic[11] = 'transparent url(../img/virtualtour/virtualtour11-lg.jpg) center 2px no-repeat'


function preload(){
var p = Pic.length
var preload = new Array()
for (i = 0; i < p; i++){
   preload[i] = new Image();
   preload[i].style.background = Pic[i]
 }
}

function image0() {
	var nxt = document.getElementById('next');
	var prev = document.getElementById('prev');
	var desc = text[0];
	var title = (document.getElementById('title'));
	title.innerHTML = desc;
	imageId = 'imgwrap';
	var img = (document.getElementById(imageId));
	img.style.height = "180px"
	img.style.width = "560px"
	img.style.background = Pic[0];
	setOpacity(img, 0);
	img.style.visibility = 'visible';
  	fadeIn(imageId,0);
	nxt.style.visibility = "visible";
	nxt.href = "javascript:image1();";
	prev.style.visibility = "hidden";
}

function image1() {
	var nxt = document.getElementById('next');
	var prev = document.getElementById('prev');
	var desc = text[1];
	var title = (document.getElementById('title'));
	var image = document.getElementById('img');
	image.style.visibility = "hidden";
	title.innerHTML = desc;
	imageId = 'imgwrap';
	var img = (document.getElementById(imageId));
	img.style.height = "288px"
	img.style.width = "360px"
	img.className = "border";
	img.style.background = Pic[1];
	setOpacity(img, 0);
	img.style.visibility = 'visible';
  	fadeIn(imageId,0);
	nxt.href = "javascript:image2();";
	prev.style.visibility = "visible";
	prev.href = "javascript:image0();";
}

function image2() {
	var src = document.getElementById('img').getAttribute('src');
	var nxt = document.getElementById('next');
	var prev = document.getElementById('prev');
	var desc = text[2];
	var title = (document.getElementById('title'));
	title.innerHTML = desc;
	imageId = 'imgwrap';
	var img = (document.getElementById(imageId));
	img.style.height = "254px"
	img.style.width = "560px"
	img.style.background = Pic[2];
	setOpacity(img, 0);
	img.style.visibility = 'visible';
  	fadeIn(imageId,0);
	nxt.href = "javascript:image3();";
	prev.href = "javascript:image1();";
}

function image3() {
	var src = document.getElementById('img').getAttribute('src');
	var nxt = document.getElementById('next');
	var prev = document.getElementById('prev');
	var desc = text[3];
	var title = (document.getElementById('title'));
	title.innerHTML = desc;
	imageId = 'imgwrap';
	var img = (document.getElementById(imageId));
	img.style.height = "254px"
	img.style.width = "560px"
	img.style.background = Pic[3];
	setOpacity(img, 0);
	img.style.visibility = 'visible';
  	fadeIn(imageId,0);
	nxt.href = "javascript:image4();";
	prev.href = "javascript:image2();";
}

function image4() {
	var src = document.getElementById('img').getAttribute('src');
	var nxt = document.getElementById('next');
	var prev = document.getElementById('prev');
	var desc = text[4];
	var title = (document.getElementById('title'));
	imageId = 'imgwrap';
	var img = (document.getElementById(imageId));
	img.style.height = "269px"
	img.style.width = "560px"
	img.style.background = Pic[4];
	setOpacity(img, 0);
	img.style.visibility = 'visible';
  	fadeIn(imageId,0);
	nxt.href = "javascript:image5();";
	prev.href = "javascript:image3();";
}

function image5() {
	var src = document.getElementById('img').getAttribute('src');
	var nxt = document.getElementById('next');
	var prev = document.getElementById('prev');
	var desc = text[5];
	var title = (document.getElementById('title'));
	title.innerHTML = desc;
	imageId = 'imgwrap';
	var img = (document.getElementById(imageId));
	img.style.height = "254px"
	img.style.width = "560px"
	img.style.background = Pic[5];
	setOpacity(img, 0);
	img.style.visibility = 'visible';
  	fadeIn(imageId,0);
	nxt.href = "javascript:image6();";
	prev.href = "javascript:image4();";
}

function image6() {
	var src = document.getElementById('img').getAttribute('src');
	var nxt = document.getElementById('next');
	var prev = document.getElementById('prev');
	var desc = text[6];
	var title = (document.getElementById('title'));
	title.innerHTML = desc;
	imageId = 'imgwrap';
	var img = (document.getElementById(imageId));
	img.style.height = "254px"
	img.style.width = "560px"
	img.style.background = Pic[6];
	setOpacity(img, 0);
	img.style.visibility = 'visible';
  	fadeIn(imageId,0);
	nxt.href = "javascript:image7();";
	prev.href = "javascript:image5();";
}

function image7() {
	var src = document.getElementById('img').getAttribute('src');
	var nxt = document.getElementById('next');
	var prev = document.getElementById('prev');
	var desc = text[7];
	var title = (document.getElementById('title'));
	title.innerHTML = desc;
	imageId = 'imgwrap';
	var img = (document.getElementById(imageId));
	img.style.height = "253px"
	img.style.width = "560px"
	img.style.background = Pic[7];
	setOpacity(img, 0);
	img.style.visibility = 'visible';
  	fadeIn(imageId,0);
	nxt.href = "javascript:image8();";
	prev.href = "javascript:image6();";
}

function image8() {
	var src = document.getElementById('img').getAttribute('src');
	var nxt = document.getElementById('next');
	var prev = document.getElementById('prev');
	var desc = text[8];
	var title = (document.getElementById('title'));
	title.innerHTML = desc;
	imageId = 'imgwrap';
	var img = (document.getElementById(imageId));
	img.style.height = "254px"
	img.style.width = "560px"
	img.style.background = Pic[8];
	setOpacity(img, 0);
	img.style.visibility = 'visible';
  	fadeIn(imageId,0);
	nxt.href = "javascript:image9();";
	prev.href = "javascript:image7();";
}

function image9() {
	var src = document.getElementById('img').getAttribute('src');
	var nxt = document.getElementById('next');
	var prev = document.getElementById('prev');
	var desc = text[9];
	var title = (document.getElementById('title'));
	title.innerHTML = desc;
	imageId = 'imgwrap';
	var img = (document.getElementById(imageId));
	img.style.height = "254px"
	img.style.width = "560px"
	img.style.background = Pic[9];
	setOpacity(img, 0);
	img.style.visibility = 'visible';
  	fadeIn(imageId,0);
	nxt.href = "javascript:image10();";
	prev.href = "javascript:image8();";
}

function image10() {
	var src = document.getElementById('img').getAttribute('src');
	var nxt = document.getElementById('next');
	var prev = document.getElementById('prev');
	var desc = text[10];
	var title = (document.getElementById('title'));
	title.innerHTML = desc;
	imageId = 'imgwrap';
	var img = (document.getElementById(imageId));
	img.style.height = "255px"
	img.style.width = "560px"
	img.style.background = Pic[10];
	setOpacity(img, 0);
	img.style.visibility = 'visible';
  	fadeIn(imageId,0);
	nxt.href = "javascript:image11();";
	prev.href = "javascript:image9();";
}

function image11() {
	var src = document.getElementById('img').getAttribute('src');
	var nxt = document.getElementById('next');
	var prev = document.getElementById('prev');
	var desc = text[11];
	var title = (document.getElementById('title'));
	title.innerHTML = desc;
	imageId = 'imgwrap';
	var img = (document.getElementById(imageId));
	img.style.height = "253px"
	img.style.width = "560px"
	img.style.background = Pic[11];
	setOpacity(img, 0);
	img.style.visibility = 'visible';
  	fadeIn(imageId,0);
	nxt.style.visibility = "hidden";
	prev.href = "javascript:image10();";
}




//Virtual Tour Descriptions
var text = new Array()
text[0] = "Click 'next' to begin your facility tour"
text[1] = "<p>Come to Mountain View and discover Silicon Valley’s newest venue for your corporate function, meeting, workshop, private party, performance or milestone event. Home to the Community School of Music and Arts (CSMA), the region’s premier center for arts education, Finn Center is now available to meet your rental needs.</p><p>Recognized for its striking architecture, this state-of-the-art, 25,000 square-foot facility – the recipient of numerous awards, including the prestigious international 2004 BusinessWeek/ Architectural Record Award for design excellence – provides a welcoming, functional and inspirational backdrop for events.  As practical as it is beautiful, Finn Center offers flexibility and diverse rental configurations.</p><p>And because Finn Center is first and foremost designed to serve the arts and the community, renters benefit from outstanding acoustics, soaring spaces and unparalleled accessibility. Conveniently located within walking distance of Caltrain and other public transportation – and only minutes from major freeways, hotels and restaurants – the venue is suited both for one-day retreats or weeklong trainings.</p>"
text[2] = "<p>The heart of the new facility, Tateuchi Hall presents an elegant venue for performances and events. With modern audio system, automated drop-down screen and comfortable Green Room, the Hall and its sizable hardwood stage are ideally suited for musical performances, lectures, slide or film presentations, or even small theater productions.</p><p>Tateuchi Hall's intimate 200-seat (maximum 236) house keeps the audience close and involved. Sculpted wood panels gently wave along the wall and overhead, offering natural beauty and exquisite acoustics. Comfortable seats, ample leg room and unobstructed sightlines ensure an enjoyable viewing experience for all.</p><p>Adorned by large clerestory windows, the Vestibule through which guests enter Tateuchi Hall opens fully onto the entry courtyard at Finn Center’s front entrance. Renters have the option of greeting guests in the courtyard, allowing people to mingle and enjoy the fresh air before and after the event.</p>"
text[3] = "<p>The Fenwick Front Lobby Atrium provides a modern, aesthetically beautiful place for receptions and intimate gatherings. It seamlessly opens onto Mohr Gallery, the site of exhibitions year-round by world-renowned artists.</p>"
text[4] = "<p>With its beautiful art, comfortable sofa seating and central location, this space, available in conjunction with Tateuchi Hall and the outside Central Courtyard, offers a multitude of flexible options for professional and private events.</p>"
text[5] = "<p>Finn Center houses a large, private Central Courtyard, completely sheltered from the street. Ideal for greeting and gathering, as well as for holding outdoor events on warm days and in the evenings, the space can accommodate up to 280 guests.</p><p>With its adjacent catering kitchen, the Courtyard makes having a reception easy and convenient before or after your concert, lecture or event in Tateuchi Hall or other area of the building.</p>"
text[6] = "<p>These acoustically sound, light-filled rooms combine comfort and functionality to create the perfect location for meetings, recitals, presentations or other events. The carpeted Reay Room boasts a 36-foot mirrored wall and can hold up to 60 people. It can also serve as an extension of Tateuchi Hall’s Green Room to accommodate large groups prior to on-stage performances.</p>"
text[7] = "<p>The smaller Ensemble Room, also fully carpeted, accommodates up to 30 people. Pianos are available for use in both rooms.</p>"
text[8] = "<p>CSMA has 17 acoustically sound private music studios equipped with pianos and ceiling-to-floor mirrors. In addition, larger music rooms can accommodate small ensembles in need of rehearsal space.</p><p>Rehearsal studios are rented on a space-available basis throughout the day, both during the week and on weekends.</p>"
text[9] = "<p>&nbsp;</p>"
text[10] = "<p>&nbsp;</p>"
text[11] ="<p>You may request that CSMA's friendly, professional on-site technicians and staff provide various kinds of assistance on the day of your event.</p><p>Depending upon your rental package, support services may include: house management; lighting and audio system technicians; catering kitchen; select equipment (screens, music stands, etc); janitorial service; security (during normal business hours); limited on-site and street parking.</p><p>In addition, CSMA can provide professional music – pianist, string quartet, jazz ensemble, vocalist or other entertainment –  for your special occasion, as well as instrument rental (baby grand pianos, etc.) to accommodate your own musicians.</p>"
text[11] = "<p>Since 1968, the Community School of Music and Arts (CSMA) has served residents throughout the region by providing Arts for All, regardless of age, level, background or economic means. As a non-profit organization, CSMA relies on community support to provide lessons, classes, camps, arts-in-the-schools programs, free concerts, lectures, exhibitions and outreach events.</p><p>Not only does your choice of Finn Center provide you with a world-class venue for your event, but rental income benefits CSMA’s operations and arts education programs serving youth and low-income families.</p><h2 class=\"body\"><a href=\"javascript:image0();\">Start Over</a></h2>"