function clickclear(thisfield, defaulttext)
{
if (thisfield.value == defaulttext)
{
thisfield.value = "";
}
}


function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
     anchor.target = "_blank";
   }
 }
}

 


$(document).ready(function() {
	$('a[@rel*=lightbox]').lightBox();

var rowIndex = 0;
	
	$('.striped tr:not(.exclude)').each(function(index) {
		if ($('th',this).length) {
			$(this).addClass('subhead');
			rowIndex = -1;
		} else {
			if (rowIndex % 2 == 0) {
				$(this).addClass('even');
			} else {
				$(this).addClass('odd');
			}
		};
		rowIndex++;
	}); 

	$(".striped tr:not(.exclude)").mouseover(function() {
		$(this).addClass("over");
	});

	$(".striped tr").mouseout(function() {
		$(this).removeClass("over");

	});

// highlight current page
	var path = location.pathname.substring(9);
// staging, the first number should be 9
	var concertprefix = location.pathname.substring(1,12);
	var newsprefix = location.pathname.substring(1,5);
	var bioprefix = location.pathname.substring(1,4);
if (path) {
	if (concertprefix.substring(0,4) == "1011") {
		$('.menu_body a[@href^="' + concertprefix + '"]').attr('class', 'selected');
	} else if (concertprefix.substring(0,4) == "0910") {
		$('.menu_body a[@href^="' + concertprefix + '"]').attr('class', 'selected');
	} else if (concertprefix.substring(0,4) == "0809") {
		$('.menu_body a[@href^="' + concertprefix + '"]').attr('class', 'selected');

	} else  {
		// $('.menu_head a[@href$="' + path + '"]').attr('class', 'selected');
     	
		 $('.menu_body a[@href^="' + path + '"]').attr('class', 'selected');
		$('.menu_body a[@href^="' + newsprefix + '"]').attr('class', 'selected');
		$('.menu_body a[@href^="' + bioprefix + '"]').attr('class', 'selected');

	}
}


	$('area.new-window').click(function(){
		window.open(this.href);
		return false;
	});    

	$("#main_nav p#selectednav").next("div.menu_body").toggle(0).siblings("div.menu_body").slideUp("slow");


	// accordian for main nav
	$("#main_nav p.menu_head").click(function()
    {
		$(this).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
      
	});

	$("#main_nav p.menu_head a").mouseover(function()
    {
		$(this).addClass("over");
	});

	$("#main_nav p.menu_head a").mouseout(function()
    {
		$(this).removeClass("over");
	});

	
	


	// home page jflow
$("#myController").jFlow({
		slides: "#mySlides",
		controller: ".jFlowControl", // must be class, use . sign
		slideWrapper : "#jFlowSlide", // must be id, use # sign
		selectedWrapper: "jFlowSelected",  // just pure text, no sign
		width: "651px",
		height: "318px",
		duration: 800,
		prev: ".jFlowPrev", // must be class, use . sign
		next: ".jFlowNext" // must be class, use . sign
	});
	

 



	
});


