//This displays the presenters for each state using the form drop down on the About > Presenter Page
function state(id) {
	var state = new Array(6);
	state[99]="Once a state has been selected, the presenters for that state will shown in this box.";
	state[0] = "<p style='font-weight:bold'>National Presenters:</p><ul><li><a href='/about/presenters/larrykoenig.shtml'>Dr. Larry Koenig</a></li> <li><a href='/about/presenters/dalehancock.shtml'>Dale Hancock</a></li></ul>";
	state[1] = "This State is in the process of being updated. Please check back soon.";
	state[2] = "This State is in the process of being updated. Please check back soon.";
	state[3] = "This State is in the process of being updated. Please check back soon.";
	state[4] = "This State is in the process of being updated. Please check back soon.";
	state[5] = "This State is in the process of being updated. Please check back soon.";
	state[6] = "This State is in the process of being updated. Please check back soon.";
	state[7] = "This State is in the process of being updated. Please check back soon.";
	state[8] = "This State is in the process of being updated. Please check back soon.";
	state[9] = "This State is in the process of being updated. Please check back soon.";
	state[10] = "This State is in the process of being updated. Please check back soon.";
	state[11] = "This State is in the process of being updated. Please check back soon.";
	state[12] = "This State is in the process of being updated. Please check back soon.";
	state[13] = "This State is in the process of being updated. Please check back soon.";
	state[14] = "This State is in the process of being updated. Please check back soon.";
	state[15] = "This State is in the process of being updated. Please check back soon.";
	state[16] = "This State is in the process of being updated. Please check back soon.";
	state[17] = "This State is in the process of being updated. Please check back soon.";
	state[18] = "This State is in the process of being updated. Please check back soon.";
	state[19] = "This State is in the process of being updated. Please check back soon.";
	state[20] = "This State is in the process of being updated. Please check back soon.";
	state[21] = "<p style='font-weight:bold'>North Carolina Presenters:</p><ul><li><a href='/about/presenters/dalehancock.shtml'>Dale Hancock</a></li></ul>";
	state[22] = "This State is in the process of being updated. Please check back soon.";
	state[23] = "This State is in the process of being updated. Please check back soon.";
	state[24] = "This State is in the process of being updated. Please check back soon.";
	state[25] = "This State is in the process of being updated. Please check back soon.";
	state[26] = "This State is in the process of being updated. Please check back soon.";
	state[27] = "This State is in the process of being updated. Please check back soon.";
	state[28] = "This State is in the process of being updated. Please check back soon.";
	state[29] = "This State is in the process of being updated. Please check back soon.";
	state[30] = "This State is in the process of being updated. Please check back soon.";
	state[31] = "This State is in the process of being updated. Please check back soon.";
	state[32] = "This State is in the process of being updated. Please check back soon.";
	state[33] = "This State is in the process of being updated. Please check back soon.";
	state[34] = "This State is in the process of being updated. Please check back soon.";
	state[35] = "This State is in the process of being updated. Please check back soon.";
	state[36] = "This State is in the process of being updated. Please check back soon.";
	state[37] = "This State is in the process of being updated. Please check back soon.";
	state[38] = "This State is in the process of being updated. Please check back soon.";
	state[39] = "This State is in the process of being updated. Please check back soon.";
	state[40] = "This State is in the process of being updated. Please check back soon.";
	state[41] = "This State is in the process of being updated. Please check back soon.";
	state[42] = "This State is in the process of being updated. Please check back soon.";
	state[43] = "This State is in the process of being updated. Please check back soon.";
	state[44] = "This State is in the process of being updated. Please check back soon.";
	state[45] = "This State is in the process of being updated. Please check back soon.";
	state[46] = "This State is in the process of being updated. Please check back soon.";
	state[47] = "This State is in the process of being updated. Please check back soon.";
	state[48] = "This State is in the process of being updated. Please check back soon.";
	state[49] = "This State is in the process of being updated. Please check back soon.";
	state[50] = "This State is in the process of being updated. Please check back soon.";
	state[51] = "This State is in the process of being updated. Please check back soon.";
	state[52] = "This State is in the process of being updated. Please check back soon.";
	state[53] = "This State is in the process of being updated. Please check back soon.";
	state[54] = "This State is in the process of being updated. Please check back soon.";
	document.getElementById("presenters").innerHTML = state[id];
	//alert("State changed to: "+id);
}


//This Sets the cookie for the Presenter, so when a presenter is selected under "alabama", alabama presenters still stay in nav bar, and it doesnt blank itself out

function SetCookie(cookieName,cookieValue) {
	document.cookie = cookieName+"="+escape(cookieValue) + ";path=/;";
}

function ReadCookie(cookieName) {
	var theCookie=""+document.cookie;
	var ind=theCookie.indexOf(cookieName);
	if (ind==-1 || cookieName=="") return ""; 
	var ind1=theCookie.indexOf(';',ind);
	if (ind1==-1) ind1=theCookie.length; 
	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

//This styles all links within the secondaryNav div, and creates onMouse events for the TDs.
/*function styleSecondaryNav(){	
	var theTable = document.getElementById('secondaryNavTable');
	var theRows = theTable.getElementsByTagName('tr');
	var theLinks = theTable.getElementsByTagName('a');
	var curr_row;
	
	for (curr_row = 0; curr_row < theRows.length; curr_row++)
	{
		currentpath=window.location.href;
		newpath=theLinks[curr_row].href;
		curr_array=currentpath.split("/");
		new_array=newpath.split("/");

		if(curr_array[curr_array.length-1]=="" || curr_array[curr_array.length-1]=="#"){
				//remove empty value or test link
				curr_array.pop();
		}
		if(new_array[new_array.length-1]==""){
				new_array.pop();
		}
		//alert(curr_array[curr_array.length-1]+" = "+new_array[new_array.length-1]);
		theRow=curr_row;
		theLinks[curr_row].className="secondaryNav";
		
			if(curr_array[curr_array.length-1]==new_array[new_array.length-1] && newpath.lastIndexOf('#')<0){
				theRows[curr_row].className="secondaryNavSelect secondaryNavTD";
				theLinks[curr_row].style.color="#721413";
			}else{
				theRows[curr_row].className="secondaryNavOut secondaryNavTD";
		
				theLinks[curr_row].onmouseover = function() {
					this.parentNode.className="secondaryNavOver secondaryNavTD";		
				}
				theLinks[curr_row].onmouseout = function() {
					this.parentNode.className="secondaryNavOut secondaryNavTD";	
				}
				
			}
		
	
}*/

function NewWindow(mypage,myname,w,h,scroll){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=no';
  win=window.open(mypage,myname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function styleSecondaryNav(){	
	for (x=1;x<4;x++){
		var theTable = document.getElementById('secondaryNavTable' + x);
		var theRows = theTable.getElementsByTagName('tr');
		var theLinks = theTable.getElementsByTagName('a');
		var curr_row;
		
		for (curr_row = 0; curr_row < theRows.length; curr_row++)
		{
			currentpath=window.location.href;
			newpath=theLinks[curr_row].href;
			curr_array=currentpath.split("/");
			new_array=newpath.split("/");
	
			if(curr_array[curr_array.length-1]=="" || curr_array[curr_array.length-1]=="#"){
					//remove empty value or test link
					curr_array.pop();
			}
			if(new_array[new_array.length-1]==""){
					new_array.pop();
			}
			//alert(curr_array[curr_array.length-1]+" = "+new_array[new_array.length-1]);
			theRow=curr_row;
			theLinks[curr_row].className="secondaryNav";
			
				if(curr_array[curr_array.length-1]==new_array[new_array.length-1] && newpath.lastIndexOf('#')<0){
					theRows[curr_row].className="secondaryNavSelect secondaryNavTD";
					theLinks[curr_row].style.color="#002861";
				}else{
					theRows[curr_row].className="secondaryNavOut secondaryNavTD";
			
					theLinks[curr_row].onmouseover = function() {
						this.parentNode.className="secondaryNavOver secondaryNavTD";		
					}
					theLinks[curr_row].onmouseout = function() {
						this.parentNode.className="secondaryNavOut secondaryNavTD";	
					}
					
				}
		
			}
	
		}
	}
	
	
	
/////////////////////////
// Resize PopUp Windows//
/////////////////////////
function resizeWindow(mypage,myname,w,h,scroll){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable,menubar,status';
  win=window.open(mypage,myname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}


/////////////////////////
// Rollover Buttons//
/////////////////////////
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];}
}