//////////////////
//SUBSCRIBE FORM//
//////////////////
function printSubscribeForm() {
	document.write('<form name="form1" id="form1" method="post" action="mailto:info@rootdivision.org" enctype="text/plain"><input type=\'text\' name=\'email\' class=\body\' value="Email address" onfocus="this.value=\'\'" /><input name="go" type=\'image\' id="go" style=\'margin-top:2px;margin-left:2px\' src=\'images/go.gif\' alt="submit" align="top" width=29 height=15 border=0 /><input type="hidden" name="subject" value="newsletter subscription" /></form>');
}

/////////////////
//NEWS INFO BOX//
/////////////////
function printNewsInfo() {
	document.write('<div style="background-color: #C7D9D9"><a href="events.html" onmouseover="news.src=\'images/NewsInfo-on.gif\';" onmouseout="news.src=\'images/NewsInfo.gif\';"><img src="images/NewsInfo.gif" width="294" height="21" name="news" alt="News and Information" border="0"></a><div style="padding-left: 10px; padding-right: 10px;"><p>Root Division offers a variety of artistic possiblities, partnerships and programs. Check us out.</p><p><span class="subhead">Resident Artist Studio Program: Apply Now!</span> We are currently seeking applicants for our Resident Artist Studios Program based on 17th Street in the Mission. Artists receive studio space at below market rates and valuable professional & creative development opportunities in exchange for service in the organization.<br>[<a href="http://rootdivision.org/about_facilities.html#RASP" class="link">LEARN MORE</a>] or [<a href="pdfs/ArtistApp09.doc" class="link">DOWNLOAD APPLICATION</a>]</p><p><span class="subhead">Latino Teaching-Artist Fellowship</span><br>Application Deadline is August 1, 2010<br>[<a href="fellowship.html" class="link">LEARN MORE</a>]</p><p><span class="subhead">Host an event!</span> Our space can be yours too! Use our beautiful community and gallery space for an event.<br>[<a href="events_host.html" class="link">LEARN MORE</a>]</p><p><span class="subhead">Curatorial Proposal</span> Submit your curatorial idea to Root Division!<br>[<a href="curatorial_proposal.html" class="link">LEARN MORE</a>]</p></div>');
}

/////////////////////////
//TAKE AN ART CLASS BOX//
/////////////////////////
function printTakeClass() {
	document.write('<div style="background-color: #952358;"><a href="adulted_current.html"><img src="images/TakeAnArtClassFall09.jpg" width="294" height="98" alt="Take an art class!" border="0"></a><br><div style="padding-left: 10px; padding-right: 10px;" class="white takeclass">Our adult education program is the most competitively priced and diverse curriculum of its type in San Francisco.  Courses include painting, photography, drawing, sewing, museum walkthroughs and much more.  Plus all courses are timed to fit the schedules of working people and are taught by working professional artists.<br><br><b>Check out the NEW Summer 2010 schedule and <a class="white" href="adulted_current.html">register NOW!</a></b><br><br></div></div>');
}

///////////////////
//OUR MISSION BOX//
///////////////////
function printOurMission() {
	document.write('<div style="background-image: url(\'images/bg_OurMission.gif\'); background-repeat: no-repeat; padding-left: 10px; padding-right: 10px;"><div style="padding-left: 10px; padding-right: 10px;" class="white"><br><img src="images/OurMission.gif" width="138" height="28" alt="Our Mission" border="0"><br>Root Division\'s mission is to improve appreciation and access to the visual arts by connecting personal inspiration and community participation. We provide subsidized studio space to working artists in exchange for their service in creating shared learning opportunities for the community. Artists develop creatively and professionally by teaching art to underserved youth, leading adult education classes, and producing exhibitions that showcase local emerging artwork. By combining multiple opportunities for creative exchange, Root Division cultivates an artistic ecosystem that enriches life throughout the Bay Area.<br><br></div></div>');
}

//////////////
//NAVIGATION//
//////////////

//rollover script
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//Writes the navigation to the page based on variable at the top of each page.
//MAIN NAV
function printNav() { 
	if (section == "about" ) {
		document.write('<a href="about.html"><img src="images/nav/about-on.gif" name="Image1" width="52" height="20" border="0" id="Image1" alt="about" /></a>');
	} 
	else {
		document.write('<a href="about.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image1\',\'\',\'images/nav/about-on.gif\',1)"><img src="images/nav/about.gif" name="Image1" width="52" height="20" border="0" id="Image1" alt="about" /></a>');
	}
	if (section == "artists" ) {
		document.write('<a href="artists.html"><img src="images/nav/artists-on.gif" name="Image2" width="61" height="20" border="0" id="Image2" alt="artists" /></a>');
	} 
	else {
		document.write('<a href="artists.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image2\',\'\',\'images/nav/artists-on.gif\',1)"><img src="images/nav/artists.gif" name="Image2" width="61" height="20" border="0" id="Image2" alt="artists" /></a>');
	}
	if (section == "youth" ) {
		document.write('<a href="youthed.html"><img src="images/nav/youth-on.gif" name="Image3" width="109" height="20" border="0" id="Image3" alt="youth arts program" /></a>');
	} 
	else {
		document.write('<a href="youthed.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image3\',\'\',\'images/nav/youth-on.gif\',1)"><img src="images/nav/youth.gif" name="Image3" width="109" height="20" border="0" id="Image3" alt="youth arts program" /></a>');
	}
	if (section == "adult" ) {
		document.write('<a href="adulted.html"><img src="images/nav/adult-on.gif" name="Image4" width="109" height="20" border="0" id="Image4" alt="adult education" /></a>');
	} 
	else {
		document.write('<a href="adulted.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image4\',\'\',\'images/nav/adult-on.gif\',1)"><img src="images/nav/adult.gif" name="Image4" width="109" height="20" border="0" id="Image4" alt="adult education" /></a>');
	}
	if (section == "events" ) {
		document.write('<a href="events.html"><img src="images/nav/events-on.gif" name="Image5" width="128" height="20" border="0" id="Image5" alt="events" /></a>');
	} 
	else {
		document.write('<a href="events.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image5\',\'\',\'images/nav/events-on.gif\',1)"><img src="images/nav/events.gif" name="Image5" width="128" height="20" border="0" id="Image5" alt="events" /></a>');
	}
	document.write('<img src="images/spacer.gif" width="160" height="1" border="0">');
	if (section == "press" ) {
		document.write('<a href="press.html"><img src="images/nav/press-on.gif" name="Image6" width="53" height="20" border="0" id="Image6" alt="press" /></a>');
	} 
	else {
		document.write('<a href="press.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image6\',\'\',\'images/nav/press-on.gif\',1)"><img src="images/nav/press.gif" name="Image6" width="53" height="20" border="0" id="Image6" alt="press" /></a>');
	}
	if (section == "contact" ) {
		document.write('<a href="contact.html"><img src="images/nav/contact-on.gif" name="Image7" width="64" height="20" border="0" id="Image7" alt="contact" /></a>');
	} 
	else {
		document.write('<a href="contact.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image7\',\'\',\'images/nav/contact-on.gif\',1)"><img src="images/nav/contact.gif" name="Image7" width="64" height="20" border="0" id="Image7" alt="contact" /></a>');
	}
	if (section == "home" ) {
		document.write('<a href="index.html"><img src="images/nav/home-on.gif" name="Image8" width="47" height="20" border="0" id="Image8" alt="home" /></a>');
	} 
	else {
		document.write('<a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image8\',\'\',\'images/nav/home-on.gif\',1)"><img src="images/nav/home.gif" name="Image8" width="47" height="20" border="0" id="Image8" alt="home" /></a>');
	}
}

//ABOUT SUBNAV
function printAboutSubNav() { 
	if (subsection == "overview" ) {
		document.write('<a href="about.html"><img src="images/nav/about_overview-on.gif" name="Image9" width="72" height="19" border="0" id="Image9" alt="overview" /></a>');
	} 
	else {
		document.write('<a href="about.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image9\',\'\',\'images/nav/about_overview-on.gif\',1)"><img src="images/nav/about_overview.gif" name="Image9" width="72" height="19" border="0" id="Image9" alt="overview" /></a>');
	}
	if (subsection == "facilities" ) {
		document.write('<a href="about_facilities.html"><img src="images/nav/about_facilities-on.gif" name="Image10" width="72" height="19" border="0" id="Image10" alt="facilities" /></a>');
	} 
	else {
		document.write('<a href="about_facilities.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image10\',\'\',\'images/nav/about_facilities-on.gif\',1)"><img src="images/nav/about_facilities.gif" name="Image10" width="72" height="19" border="0" id="Image10" alt="facilities" /></a>');
	}
	if (subsection == "staff" ) {
		document.write('<a href="about_staff.html"><img src="images/nav/about_staff-on.gif" name="Image11" width="52" height="19" border="0" id="Image11" alt="staff" /></a>');
	} 
	else {
		document.write('<a href="about_staff.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image11\',\'\',\'images/nav/about_staff-on.gif\',1)"><img src="images/nav/about_staff.gif" name="Image11" width="52" height="19" border="0" id="Image11" alt="staff" /></a>');
	}
	if (subsection == "board" ) {
		document.write('<a href="about_board.html"><img src="images/nav/about_board-on.gif" name="Image12" width="55" height="19" border="0" id="Image12" alt="board" /></a>');
	} 
	else {
		document.write('<a href="about_board.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image12\',\'\',\'images/nav/about_board-on.gif\',1)"><img src="images/nav/about_board.gif" name="Image12" width="55" height="19" border="0" id="Image12" alt="board" /></a>');
	}
	if (subsection == "contributors" ) {
		document.write('<a href="about_contributors.html"><img src="images/nav/about_contributors-on.gif" name="Image27" width="90" height="19" border="0" id="Image27" alt="contributors" /></a>');
	} 
	else {
		document.write('<a href="about_contributors.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image27\',\'\',\'images/nav/about_contributors-on.gif\',1)"><img src="images/nav/about_contributors.gif" name="Image27" width="90" height="19" border="0" id="Image27" alt="contributors" /></a>');
	}
}

//YOUTH SUBNAV
function printYouthSubNav() { 
	if (subsection == "overview" ) {
		document.write('<a href="youthed.html"><img src="images/nav/youth_overview-on.gif" name="Image13" width="72" height="19" border="0" id="Image13" alt="overview" /></a>');
	} 
	else {
		document.write('<a href="youthed.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image13\',\'\',\'images/nav/youth_overview-on.gif\',1)"><img src="images/nav/youth_overview.gif" name="Image13" width="72" height="19" border="0" id="Image13" alt="overview" /></a>');
	}
	if (subsection == "schools" ) {
		document.write('<a href="youthed_schools.html"><img src="images/nav/youth_partner-on.gif" name="Image14" width="119" height="19" border="0" id="Image14" alt="partner programs" /></a>');
	} 
	else {
		document.write('<a href="youthed_schools.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image14\',\'\',\'images/nav/youth_partner-on.gif\',1)"><img src="images/nav/youth_partner.gif" name="Image14" width="119" height="19" border="0" id="Image14" alt="partner programs" /></a>');
	}
	if (subsection == "studentart" ) {
		document.write('<a href="youthed_studentart.html"><img src="images/nav/youth_studentart-on.gif" name="Image15" width="86" height="19" border="0" id="Image15" alt="student art" /></a>');
	} 
	else {
		document.write('<a href="youthed_studentart.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image15\',\'\',\'images/nav/youth_studentart-on.gif\',1)"><img src="images/nav/youth_studentart.gif" name="Image15" width="86" height="19" border="0" id="Image15" alt="student art" /></a>');
	}
	if (subsection == "testimonials" ) {
		document.write('<a href="youthed_testimonials.html"><img src="images/nav/youth_testimonials-on.gif" name="Image16" width="90" height="19" border="0" id="Image16" alt="testimonials" /></a>');
	} 
	else {
		document.write('<a href="youthed_testimonials.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image16\',\'\',\'images/nav/youth_testimonials-on.gif\',1)"><img src="images/nav/youth_testimonials.gif" name="Image16" width="90" height="19" border="0" id="Image16" alt="testimonials" /></a>');
	}
	if (subsection == "yinstructors" ) {
		document.write('<a href="youthed_instructors.html"><img src="images/nav/youth_instructors-on.gif" name="Image28" width="84" height="19" border="0" id="Image28" alt="instructors" /></a>');
	} 
	else {
		document.write('<a href="youthed_instructors.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image28\',\'\',\'images/nav/youth_instructors-on.gif\',1)"><img src="images/nav/youth_instructors.gif" name="Image28" width="84" height="19" border="0" id="Image28" alt="instructors" /></a>');
	}
}

//ADULT SUBNAV
function printAdultSubNav() { 
	if (subsection == "overview" ) {
		document.write('<a href="adulted.html"><img src="images/nav/adult_overview-on.gif" name="Image17" width="73" height="19" border="0" id="Image17" alt="overview" /></a>');
	} 
	else {
		document.write('<a href="adulted.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image17\',\'\',\'images/nav/adult_overview-on.gif\',1)"><img src="images/nav/adult_overview.gif" name="Image17" width="73" height="19" border="0" id="Image17" alt="overview" /></a>');
	}
	if (subsection == "current" ) {
		document.write('<a href="adulted_current.html"><img src="images/nav/adult_current-on.gif" name="Image18" width="64" height="19" border="0" id="Image18" alt="current" /></a>');
	} 
	else {
		document.write('<a href="adulted_current.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image18\',\'\',\'images/nav/adult_current-on.gif\',1)"><img src="images/nav/adult_current.gif" name="Image18" width="64" height="19" border="0" id="Image18" alt="current" /></a>');
	}
	if (subsection == "upcoming" ) {
		document.write('<a href="adulted_upcoming.html"><img src="images/nav/adult_upcoming-on.gif" name="Image19" width="72" height="19" border="0" id="Image19" alt="upcoming" /></a>');
	} 
	else {
		document.write('<a href="adulted_upcoming.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image19\',\'\',\'images/nav/adult_upcoming-on.gif\',1)"><img src="images/nav/adult_upcoming.gif" name="Image19" width="72" height="19" border="0" id="Image19" alt="upcoming" /></a>');
	}
	if (subsection == "past" ) {
		document.write('<a href="adulted_past.html"><img src="images/nav/adult_past-on.gif" name="Image20" width="42" height="19" border="0" id="Image20" alt="past" /></a>');
	} 
	else {
		document.write('<a href="adulted_past.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image20\',\'\',\'images/nav/adult_past-on.gif\',1)"><img src="images/nav/adult_past.gif" name="Image20" width="42" height="19" border="0" id="Image20" alt="past" /></a>');
	}
	if (subsection == "instructors" ) {
		document.write('<a href="adulted_instructors.html"><img src="images/nav/adult_instructors-on.gif" name="Image21" width="91" height="19" border="0" id="Image21" alt="instructors" /></a>');
	} 
	else {
		document.write('<a href="adulted_instructors.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image21\',\'\',\'images/nav/adult_instructors-on.gif\',1)"><img src="images/nav/adult_instructors.gif" name="Image21" width="91" height="19" border="0" id="Image21" alt="instructors" /></a>');
	}
}

//EVENTS SUBNAV
function printEventsSubNav() { 
	//if (subsection == "current" ) {
		//document.write('<a href="events.html"><img src="images/nav/events_current-on.gif" name="Image21" width="63" height="19" border="0" id="Image21" alt="current" /></a>');
	//} 
	//else {
		//document.write('<a href="events.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image21\',\'\',\'images/nav/events_current-on.gif\',1)"><img src="images/nav/events_current.gif" name="Image21" width="63" height="19" border="0" id="Image21" alt="current" /></a>');
	//}
	if (subsection == "upcoming" ) {
		document.write('<a href="events.html"><img src="images/nav/events_upcoming-on.gif" name="Image22" width="70" height="19" border="0" id="Image22" alt="upcoming" /></a>');
	} 
	else {
		document.write('<a href="events.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image22\',\'\',\'images/nav/events_upcoming-on.gif\',1)"><img src="images/nav/events_upcoming.gif" name="Image22" width="70" height="19" border="0" id="Image22" alt="upcoming" /></a>');
	}
	if (subsection == "past" ) {
		document.write('<a href="events_past.html"><img src="images/nav/events_past-on.gif" name="Image23" width="42" height="19" border="0" id="Image23" alt="past" /></a>');
	} 
	else {
		document.write('<a href="events_past.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image23\',\'\',\'images/nav/events_past-on.gif\',1)"><img src="images/nav/events_past.gif" name="Image23" width="42" height="19" border="0" id="Image23" alt="past" /></a>');
	}
	if (subsection == "host" ) {
		document.write('<a href="events_host.html"><img src="images/nav/events_host-on.gif" name="Image24" width="101" height="19" border="0" id="Image24" alt="host an event!" /></a>');
	} 
	else {
		document.write('<a href="events_host.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image24\',\'\',\'images/nav/events_host-on.gif\',1)"><img src="images/nav/events_host.gif" name="Image24" width="101" height="19" border="0" id="Image24" alt="host an event!" /></a>');
	}
}

//PRESS SUBNAV
function printPressSubNav() { 
	if (subsection == "in" ) {
		document.write('<a href="press.html"><img src="images/nav/press_in-on.gif" name="Image25" width="101" height="19" border="0" id="Image25" alt="in the press" /></a>');
	} 
	else {
		document.write('<a href="press.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image25\',\'\',\'images/nav/press_in-on.gif\',1)"><img src="images/nav/press_in.gif" name="Image25" width="101" height="19" border="0" id="Image25" alt="in the press" /></a>');
	}
	if (subsection == "for" ) {
		document.write('<a href="press_for.html"><img src="images/nav/press_for-on.gif" name="Image26" width="101" height="19" border="0" id="Image26" alt="for the press" /></a>');
	} 
	else {
		document.write('<a href="press_for.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image26\',\'\',\'images/nav/press_for-on.gif\',1)"><img src="images/nav/press_for.gif" name="Image26" width="101" height="19" border="0" id="Image26" alt="for the press" /></a>');
	}
}

///////////////
//POP UP CODE//
///////////////
function newWindow(filename,w,h) {
	var Prop="location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes"+",width=" + w + ",height=" + h + ",top=" +50+ ",left=" +50;
	if (!window.window2) {
	// has not yet been defined
		window2 = window.open(filename,'windowRef',Prop);
    }
	else {
	// has been defined
		if (window2.focus) {
		// still open
   			window2.close();
	     	window2 = window.open(filename,'windowRef',Prop);
        }
        else {
            window2 = window.open(filename,'windowRef',Prop);
        }
    }
}

