// 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="background_header">');
	document.write('<div id="container">');
	document.write('  <div id="masthead">');
	document.write('    <div id="logo"><a href="/index.htm"><img src="/images/header_space.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('</div>');
	document.write('</body>');
	document.write('</html>');
}

function nextFOMConcertWidget()
{
	document.write('<A HREF="concerts.html"><h2>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("September 18, 2010");
	var barrueco = new Date("October 5, 2010");
	var chiara = new Date("October 19, 2010");
	var masterworks = new Date("November 6, 2010");
	var gala = new Date("December 4, 2010");
	var canadian = new Date("January 22, 2010");
	var voces8 = new Date("February 27, 2010");
	var jazz = new Date("March , 2010");
	var tworivers2 = new Date("March 12, 2011");
	var faculty = new Date("April 2, 2011");
	var masterworks2 = new Date("April 30, 2011");
	
 if (today <= tworivers1)
	{
		document.write('<img src="images/tworivers-mini.jpg" style="float: left; padding-right: 5px;"><b>Two Rivers Chamber Orchestra</b><br>(Sept. 18, 2010)<br>What a great way to launch the season, featuring our own principal oboist, Greg Shook, and some outstanding selections from Glinka, Albinoni, Haydn and Dvorak. ');
		document.write(' (<A HREF="/tickets.html">Buy Tickets</A>)');
	}
	else if (today <= barrueco)
	{
		document.write('<img src="images/barrueco_mini.jpg" style="float: left; padding-right: 5px;"><b>Manuel Barrueco</b><br>(October 5, 2010)<br>Manuel Barrueco is internationally recognized as one of the most important guitarists of our time. His unique artistry has been described as that of a superb instrumentalist and a superior and elegant musician with uncommon lyrical gifts. He has performed across the United Sates from the Los Angeles Philharmonic to New York’s Lincoln Center. ');
	document.write(' (<A HREF="/tickets.html">Buy Tickets</A>)');
	}
	else if (today <= chiara)
	{
		document.write('<img src="images/chiara_mini.jpg" style="float: left; padding-right: 5px;"><b>Chiara String Quartet</b><br>(October 19, 2010)<br>Playing “Chamber Music in Any Chamber,” the Chiara String Quartet reaches from the concert hall into clubs, bars and galleries, expanding the places to hear live classical music while returning chamber music to its roots in intimate spaces. The Chiara Quartet are Blodgett Artists-in- Residence at Harvard University. ');
	document.write(' (<A HREF="/tickets.html">Buy Tickets</A>)');
	}
	else if (today <= masterworks)
	{
		document.write('<img src="images/masterworks-mini.jpg" style="float: left; padding-right: 5px;"><b>Masterworks Chorale, Handel&rsquo;s <I>Messiah</I></b><br>(November 6 or 7, 2010)<br>Messiah is not only one of the most popular works in the entire Western choral literature, it is considered to be one of the greatest works in music history—the very fruit of Handel’s genius. Its story is taken entirely from the King James and Great Bibles, and today a Messiah performance is a not-to-be-missed Christmastime tradition around the world. ');
	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 Concert</b><br>(Dec. 4 or 5, 2010)<br>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. ');
	document.write(' (<A HREF="/tickets.html">Buy Tickets</A>)');
	}
	else if (today <= canadian)
	{
		document.write('<img src="images/canadian_mini.jpg" style="float: right; padding-left: 5px;"><B>Canadian Brass Quintet</b><br>(December 9, 2010)<br>The Canadian Brass is one of the hottest tickets in any town, often selling out in minutes. This is their first ever performance in Shepherdstown and we expect a similar response. This world renowned ensemble will present their much loved “Holiday Concert”, so why not get an early stocking stuffer for a friend or loved one and give them an evening of great music they will never forget. Order early—space is limited. ');
	document.write(' (<A HREF="/tickets.html">Buy Tickets</A>)');
	}
	else if (today <= voces8)
	{
		document.write('<img src="images/voces8_mini.jpg" style="float: left; padding-right: 5px;"><b>VOCES8</b><br>(February 12, 2011)<br>International award-winning vocal ensemble VOCES8 has established itself as the foremost young British a cappella group performing repertoire ranging from early polyphony to unique jazz and popular arrangements. In 2005 VOCES8 swept the board at the 44th International Grand Prix in Gorizia, Italy, winning first prize for performances in the jazz category and the audience vote for best performance. ');
	document.write(' (<A HREF="/tickets.html">Buy Tickets</A>)');
	}
	else if (today <= jazz)
	{
		document.write('<img src="images/fedchock_mini.jpg" style="float: left; padding-right: 5px;"><B>John Fedchock</b><br>(March 5, 2011)<br>Since his emergence on the scene in 1980, Fedchock has established himself as a world-class trombone soloist, a heralded bandleader, and a Grammy-nominated arranger. An in-demand performer and writer in New York City for over twenty years, his multifaceted talents have led him to become one of NYC’s premiere jazz artists.<br>');
	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><br>(March 12, 2011)<br>Featuring our own principal oboist, Greg Shook, and some outstanding selections from Alvarez, Mendelssohn and Piazzola.<br>');
	document.write(' (<A HREF="/tickets.html">Buy Tickets</A>)');
	}
	else if (today <= faculty)
	{
		document.write('<img src="images/faculty_mini.jpg" style="float: left; padding-right: 5px;"><b>Faculty Showcase w/3 Sopranos</b><br>(April 2, 2011)<br>The Faculty Showcase features selections that highlight the virtuosity of Shepherd’s Department of Music faculty. ');
	document.write(' (<A HREF="/tickets.html">Buy Tickets</A>)');
	}
	else if (today <= masterworks2)
	{
		document.write('<img src="images/masterworks-mini.jpg" style="float: left; padding-right: 5px;"><b>Masterworks Chorale</b><br>(April 30 or May 1, 2011)<br>Haydn’s The Creation. Considered by many to be Haydn’s masterpiece, The Creation depicts and celebrates the creation of the world as described in the biblical Book of Genesis and in Paradise Lost. ');
	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 2011-12 concerts.');
	}

	document.write('</p></div>');
}
