function loadMember(id) {
 	
	 xajax_members_query(id);
	 xajax_concert_query(id);
 }

function tab(){
	document.myForm.input(1).focus();
}

function login() {
		xajax_verify_user(xajax.$('username').value, xajax.$('pwd').value);
     	}

function not_logged_in(){
 	document.getElementById('member_info').innerHTML = "<center><h2>Welcome<br>to the<br>La Crosse Concert Band<br>Member Page</h2><h3>You must <A href='#' onclick='xajax_password_reset(1,\"What\")'>Login</A> or <a href='#' onclick='xajax_register();'>Register</a> to edit your information</h3></center>";
 	}


function concert_query(item) {
	 if (!item) {var item=1;}
	 var id = document.getElementById('member_id').value;
	 if (id>0){
	var d=new Date();
	var concert_year=d.getFullYear();
	var e=new Date();
	e.setFullYear(concert_year,3,14);
	var f=new Date();
	f.setFullYear(concert_year,4,10);
var today = new Date();

if (today < e)
	{
  		document.getElementById('member_info').innerHTML = "<H2>One moment while a new window opens.</H2>";
		window.open("concert_availability.php?id=" + id);
  	}
if (today>f)
	{
		var str = "<div id='avail_header'><ul><li id='schedule'><a href='#' onclick='xajax_concert_schedule("+id+")'>Your Concert Schedule</a></li><li id='rehearsal' ><a href='#' onclick='xajax_rehearsal_info()'>Rehearsal Info</a></li><li id='attire'><a href='#' onclick='xajax_concert_attire()' >Concert Attire</a></li><li id='rain_site'><a href='#' onclick='xajax_rain_site()'>If It Rains</a></li></ul> </div><div id='avail_info'></div>";
    	  
	  document.getElementById('member_info').innerHTML = str;
	 	xajax_rehearsal_info();
	}
else
  {
  document.getElementById('member_info').innerHTML = "<br /><center><H2>At this time online concert availability is closed.</H2><br /><h3>Contact your Section Leader with updates or changes.</h3></center>";	
  }	
	 	}
	else {
	 not_logged_in();
	 }
	 }   

function create_iCal(id) {
 		window.open("iCalendar/test.php","iCal");
 		setTimeout("window.open('iCalendar/icaldownload/"+id+".ics','iCal')",4000);
 		}
function apply() {
 		window.open("application.php");
 		}
 	
function members_query() {
 	var id = document.getElementById('member_id').value;
	 if (id>0){
	  	xajax_members_query(id);
	  	}
	else {
	 not_logged_in();
	 }
	 }   

function experience_query() {
 	var id = document.getElementById('member_id').value;
	 if (id>0){
	  	xajax_experience_query(id);
	  	}
	else {
	 not_logged_in();
	 }
 }   

function section_query() {
 	var id = document.getElementById('primary_inst').value;
	 if (id>0){
	  	xajax_section_list(2010, id);
	  	}
	else {
	 not_logged_in();
	 }
 }   

function bylaws() {
 	var id = document.getElementById('member_id').value;
	 if (id>0){
	  	xajax_bylaws();
	  	}
	else {
	 not_logged_in();
	 }
 }
 
function password_reset(str){
 	xajax_password_reset(str, "Yes");
 	}

function submitSignup(id, i){
	xajax_set_user_id(id, xajax.$('username').value, xajax.$('pwd').value, xajax.$('newpwd').value, i);
	}
 
function show_hide(obj)
{
	state = document.getElementById(obj).style.display;					
	if (state == "block") {document.getElementById(obj).style.display = "none";}
	if (state == "none") {document.getElementById(obj).style.display = "block";}
}

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=700,height=300,left=200,top=250,scrollbars=yes');
return false;
}

function refresh() {
window.refresh();
}



