// This function is used to pull parameters from the URL string
function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

// This function is necessary for some date work being done 
Date.prototype.setISO8601 = function (string) {
    var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
        "(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?" +
        "(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";
    var d = string.match(new RegExp(regexp));

    var offset = 0;
    var date = new Date(d[1], 0, 1);

    if (d[3]) { date.setMonth(d[3] - 1); }
    if (d[5]) { date.setDate(d[5]); }
    if (d[7]) { date.setHours(d[7]); }
    if (d[8]) { date.setMinutes(d[8]); }
    if (d[10]) { date.setSeconds(d[10]); }
    if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); }
    if (d[14]) {
        offset = (Number(d[16]) * 60) + Number(d[17]);
        offset *= ((d[15] == '-') ? 1 : -1);
    }

    offset -= date.getTimezoneOffset();
    time = (Number(date) + (offset * 60 * 1000));
    this.setTime(Number(time));
}

var Months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

function header()
{
	document.write('<div id="container">');
	document.write('  <div id="masthead">');
	document.write('    <div id="logo"><a href="index.htm"><img src="images/sufom_logo.gif" alt="Shepherd University Friends of Music"/></a></div>');
	document.write('  </div>');
	document.write('  <div id="navigation">');
	document.write('    <ul id="main_navigation">');
	document.write('	  <li><a href="about.html">about us</a></li>');
	document.write('	  <li><a href="concerts.html">concerts</a></li>');
	document.write('	  <li><a href="sponsors.html">sponsors</a></li>');
	document.write('	  <li><a href="tworivers.html">2rco</a></li>');
	document.write('	  <li><a href="projects.html">projects</a></li>');
	document.write('	  <li><a href="http://www.shepherd.edu/musicweb">su music</a></li>');
	document.write('	  <li><a href="membership.html">join or donate</a></li>');
	document.write('	  <li><a href="contact.html">contact us</a></li>');
	document.write('	  <li><a href="news.html">news</a></li>');
	document.write('    </ul>');
	document.write('  </div>');
	document.write('</div>');
}

function footer()
{
	document.write('<div id="content_spacer"></div>');
	document.write('<div id="container_info">');
	document.write('  <div id="footer">');
	document.write('	<div id="footer_right">Shepherd University Friends of Music | <A HREF="mailto:friends@sufom.org">friends@sufom.org</A><BR>(304) 876-5765 | P.O. Box 220 | Shepherdstown, WV 25443</div>');
	document.write('    <br class="clear" />');
	document.write('  </div>');
	document.write('</div>');
	document.write('</body>');
	document.write('</html>');
}

function nextFOMConcertWidget()
{
	document.write('<A HREF="concerts.html"><h2 style="color: #d49923;">Next FOM Concert</h2></A>');
	document.write('<div class="box_right">');
	document.write('<p style="font-size: 9pt;">');
	
	var today = new Date();
	var tworivers1 = new Date("October 17, 2009");
	var vienna = new Date("October 27, 2009");
	var awadagin = new Date("November 7, 2009");
	var mozart = new Date("November 15, 2009");
	var gala = new Date("December 6, 2009");
	var uptown = new Date("January 22, 2010");
	var jazz = new Date("February 27, 2010");
	var tworivers2 = new Date("March 13, 2010");
	var chopin = new Date("March 26, 2010");
	var rebel = new Date("March 31, 2010");
	var brahms = new Date("May 2, 2010");
	
	if (today <= tworivers1)
	{
		document.write('<img src="images/tworivers-mini.jpg" style="float: left; padding-right: 5px;">Our own <B>Two Rivers Chamber Orchestra</B> returns with a wide and varied lineup that really does offer something for everyone. Bernstein – Overture to <I>Candide</I>; Guy Frank – <I>Symphonic Triptych</I>; Joseph Curiale – <I>Awakening</I>; Copland – Four Dances from <I>Rodeo</I> <strong>October 17, 2009</strong>');
		document.write(' (<A HREF="tickets.html">Buy Tickets</A>)');
	}
	else if (today <= vienna)
	{
		document.write('<img src="images/vienna-mini.jpg" style="float: left; padding-right: 5px;">We are very fortunate to have coaxed the <B>Vienna Boys Choir</B> to Shepherdstown, for it is the best known boys choir in the world. The choir (numbering between 14 and 20) is the modern-day descendant of the boys’ choirs of the Viennese Court, dating back to the late Middle Ages. The boys are individually selected and auditioned from Austria and around the world, and must meet an exceedingly high vocal standard. <strong>October 27, 2009</strong>');
	document.write(' (<A HREF="tickets.html">Buy Tickets</A>)');
	}
	else if (today <= awadagin)
	{
		document.write('<img src="images/awadagin-mini.jpg" style="float: left; padding-right: 5px;">Among his generation of concert artists, pianist <B>Awadagin Pratt</B> is acclaimed for his musical insight and intensely involving performances that receive tremendous audience response and press attention throughout the United States. Pratt’s career received its impetus when in 1992 he became the first African-American pianist to win the Naumburg International Piano Competition. Since then, he has performed with nearly every major orchestra in the United States, at the Clinton White House, and on Sesame Street. In 1994 Pratt made his debut at Lincoln Center with the New York Philharmonic. <strong>November 7, 2009</strong>');
	document.write(' (<A HREF="tickets.html">Buy Tickets</A>)');
	}
	else if (today <= mozart)
	{
		document.write('<img src="images/masterworks-mini.jpg" style="float: left; padding-right: 5px;">Masterworks Chorale, <B>Mozart’s <I>Requiem</I> (Levin completion).</B> Composed in 1791, the <I>Requiem</I> was Mozart’s last composition and is one of his most popular and respected works. It is said to have been composed on his deathbed, so its creation is followed by 200 years of great and fanciful stories. The  Chorale performs with full orchestra and soloists. This performance will use the recent completion by master Mozart scholar Robert Levin. <strong>November 14, 2009 (St. James Catholic Church, Charles Town) and November 15, 2009 (Frank Arts Center)</strong>');
	document.write(' (<A HREF="tickets.html">Buy Tickets</A>)');
	}
	else if (today <= gala)
	{
		document.write('<img src="images/holiday-mini.jpg" style="float: left; padding-right: 5px;"><B>Holiday Gala</B>, Enjoy classic sounds of the season featuring the Shepherd University Wind Symphony, Chamber Singers, Camerata Singers, Masterworks Chorale and others. Followed by a reception at the Cress Creek Country Club on Saturday. <strong>December 5 and 6, 2009</strong>');
	document.write(' (Saturday is SOLD OUT. Sunday buy tickets at the door.)');
	}
	else if (today <= uptown)
	{
		document.write('<img src="images/uptown-mini.jpg" style="float: left; padding-right: 5px;"><B>Uptown Vocal Jazz Quartet</B> has been delighting audiences worldwide with their tightly harmonized renditions of jazz, big band swing, pop, doo-wop, original songs and American Songbook classics from Sinatra to Gershwin to Ellington and beyond. The stylishly entertaining quartet has captivated guests at festivals, concerts, parties and special events, with their lush harmonies, toe tapping rhythms, inventive lyrics, and versatile repertoire... all wrapped up in an irresistible stage show fueled by a hot jazz band accompaniment. <strong>January 22, 2010</strong>');
	document.write(' (<A HREF="tickets.html">Buy Tickets</A>)');
	}
	else if (today <= jazz)
	{
		document.write('<img src="images/jazz-mini.jpg" style="float: left; padding-right: 5px;">The <B>Shepherd University Jazz Ensemble</B> with special guest artist Chris Vadala, welcomes you to a scintillating evening of incredible music! The Jazz Ensemble has performed throughout the East Coast and Europe and is in great demand as a feature band in Jazz Festivals around the globe. <strong>February 27, 2010</strong>');
	document.write(' (<A HREF="tickets.html">Buy Tickets</A>)');
	}
	else if (today <= tworivers2)
	{
		document.write('<img src="images/tworivers-mini.jpg" style="float: left; padding-right: 5px;"><B>Two Rivers Chamber Orchestra</B> performs Shostakovich – Festive Overture, Op. 96; Mozart – Concerto for Clarinet in A; Marquez – <I>Conga del Fuego</I>; Beethoven – Symphony No.7 in A, Op. 92 <strong>March 13, 2010</strong>');
	document.write(' (<A HREF="tickets.html">Buy Tickets</A>)');
	}
	else if (today <= chopin)
	{
		document.write('<img src="images/beard-mini.jpg" style="float: left; padding-right: 5px;"><B>Chopin Concert</B>. Commemorate the 200th anniversary of the birth of Frederic Chopin with Shepherd’s own Dr. Scott Beard. Dr. Beard is a nationally recognized pianist, teacher, clinician, author and recording artist. He was named 2006 West Virginia Music Teacher of the Year. Concerts as a soloist, chamber musician and orchestral soloist have taken Dr. Beard throughout the United States and also to Canada and France. <strong>March 26, 2010</strong>');
	document.write(' (<A HREF="tickets.html">Buy Tickets</A>)');
	}
	else if (today <= rebel)
	{
		document.write('<img src="images/rebel-mini.jpg" style="float: left; padding-right: 5px;">This New York-based Baroque ensemble <B>REBEL</B> (pronounced <I>Re-BEL</I>) has earned an impressive international reputation, enchanting diverse audiences by their unique style and their virtuosic, highly expressive and provocative approach to the Baroque and Classical repertoire. The core formation of two violins, recorder/traverso, cello/viola da gamba and harpsichord/organ expands with additional strings, winds, theorbo and vocalists, performing on period instruments. REBEL is currently in residence at historic Trinity Church, Wall Street in New York City, collaborating with Trinity Choir in works ranging from the cantatas of Bach to the major oratories of Handel, Bach, Mozart and Haydn. <A HREF="tickets.html">(Purchase Tickets) <strong>March 31, 2010</strong>');
	document.write(' (<A HREF="tickets.html">Buy Tickets</A>)');
	}
	else if (today <= brahms)
	{
		document.write('<img src="images/masterworks-mini.jpg" style="float: left; padding-right: 5px;">Masterworks Chorale, <B>Brahms <I>Ein deutsches Requiem</I></B>. Brahms’s mother died in February, 1865, a loss that painfully grieved him and that may well have inspired <I>Ein deutsches Requiem</I>. The title (<I>A German Requiem</I>) refers primarily to the language rather than the intended audience. Brahms told Karl Martin Reinthaler, director of music at the Bremen cathedral, that he would have gladly called the work <I>A Human Requiem</I>.  <strong>May 1, 2010 (St. James Catholic Church, Charles Town) and May 2, 2010 (Frank Arts Center)</strong>');
	document.write(' (<A HREF="tickets.html">Buy Tickets</A>)');
	}
	else
	{
		document.write('Our season has come to a close! Check back in August for our 2010-11 concerts.');
	}

	document.write('</p></div>');
}
