// set variables based on live or pilot site //

if (location.href.indexOf("btsasacramento") != -1){
	var css_mac = "/styles/mac.css";
	var css_win = "/styles/win.css";
	var photos = "/photos/";
	var site_location = "http://www.btsasacramento.org";
}
else {
	var css_mac = "../styles/mac.css";
	var css_win = "../styles/win.css";
	var photos = "../photos/";
	if (location.href.indexOf("localhost") != -1){
		var site_location = "http://localhost:8500/btsa";
	}
//	else if (location.href.indexOf("btsapilot") != -1){
//		var site_location = "http://www3.scoe.net/btsapilot";
//	}
	else {
		var site_location = "http://test.scoe.net/btsa";
	}
}

// platform check for stylesheets //

if(navigator.appVersion.indexOf("Win") != -1) {
	document.write("<link rel=\"stylesheet\" href=\"" + css_win + "\" type=\"text/css\">");
} else {
	document.write("<link rel=\"stylesheet\" href=\"" + css_mac + "\" type=\"text/css\">");
}

// image loads and swaps //

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];}
}
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];}}
}

// netscape resize fix //

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// drop down menus //

function mmLoadMenus() {
  if (window.mm_menu_0806114500_0) return;
  window.mm_menu_0806114500_0 = new Menu("root",154,18,"Verdana, Arial, Helvetica, sans-serif",12,"#000000","#ffffff","#9999ff","#5656c6","left","middle",3,0,250,-5,7,true,true,true,0,true,true);
  mm_menu_0806114500_0.addMenuItem("Program&nbsp;Requirements","location=site_location + '/new/require.html'");
  mm_menu_0806114500_0.addMenuItem("CSUS&nbsp;Credits&nbsp;[PDF]","location=site_location + '/new/csus.pdf'");
  mm_menu_0806114500_0.addMenuItem("Joining&nbsp;BTSA","location=site_location + '/new/join.html'");
   mm_menu_0806114500_0.hideOnMouseOut=true;
   mm_menu_0806114500_0.menuBorder=1;
   mm_menu_0806114500_0.menuLiteBgColor='#ffffff';
   mm_menu_0806114500_0.menuBorderBgColor='#777777';
   mm_menu_0806114500_0.bgColor='#555555';
  window.mm_menu_0806114626_1 = new Menu("root",132,18,"Verdana, Arial, Helvetica, sans-serif",12,"#000000","#ffffff","#9999ff","#5656c6","left","middle",3,0,250,-5,7,true,true,true,0,true,true);
  mm_menu_0806114626_1.addMenuItem("CSUS&nbsp;Credits&nbsp;[PDF]","location=site_location + '/experienced/csus.pdf'");
   mm_menu_0806114626_1.hideOnMouseOut=true;
   mm_menu_0806114626_1.menuBorder=1;
   mm_menu_0806114626_1.menuLiteBgColor='#ffffff';
   mm_menu_0806114626_1.menuBorderBgColor='#777777';
   mm_menu_0806114626_1.bgColor='#555555';
  window.mm_menu_0806114735_3 = new Menu("root",201,18,"Verdana, Arial, Helvetica, sans-serif",12,"#000000","#ffffff","#9999ff","#5656c6","left","middle",3,0,250,-5,7,true,true,true,0,true,true);
  mm_menu_0806114735_3.addMenuItem("Contact&nbsp;BTSA","location=site_location + '/about/contact.html'");
  mm_menu_0806114735_3.addMenuItem("Member&nbsp;Districts","location=site_location + '/about/districts.html'");
  mm_menu_0806114735_3.addMenuItem("Become&nbsp;a&nbsp;Consortium&nbsp;Member","location=site_location + '/about/member.html'");
//  mm_menu_0806114735_3.addMenuItem("Our&nbsp;Accreditation&nbsp;Program","location=site_location + '/about/accredit.html'");
//  mm_menu_0806114735_3.addMenuItem("Reports","location=site_location + '/about/reports.html'");
   mm_menu_0806114735_3.hideOnMouseOut=true;
   mm_menu_0806114735_3.menuBorder=1;
   mm_menu_0806114735_3.menuLiteBgColor='#ffffff';
   mm_menu_0806114735_3.menuBorderBgColor='#777777';
   mm_menu_0806114735_3.bgColor='#555555';

  mm_menu_0806114735_3.writeMenus();
} // mmLoadMenus()

// random quotes //

function pullQuote() {
var quote = new Array();
	quote[0] = "I am a better classroom teacher as a result of being a support provider and trainer."
	quote[1] = "I really think that my teaching has improved with each year I have been a Support Provider."
	quote[2] = "At last! A common language for assessing and defining teacher performance."
	quote[3] = "Teacher leadership, inquiry-based learning, and systems thinking are essential for schools of the 21st century."
	quote[4] = "The best part of BTSA is what I have been able to learn and apply in my classroom."
	quote[5] = "The ability to discuss district issues with other districts sharing the same issues has been invaluable."
	quote[6] = "BTSA has also been the catalyst to push me out of my box as a kindergarten teacher."
	quote[7] = "BTSA affords both New Teachers and Support Providers the opportunity to talk about, think about, reflect upon and celebrate the art of teaching!"
	quote[8] = "BTSA keeps me motivated to improve my practice after 17 years of teaching!"
	quote[9] = "Having the opportunity to be a BTSA Support Provider has stimulated my professional growth."
	quote[10] = "Being a BTSA Support Provider is better than chocolate milk!"
	quote[11] = "...I found it difficult to find professional development that moved beyond entry level information... until BTSA."
	quote[12] = "BTSA has given me a great opportunity to collaborate with teachers."
	quote[13] = "As a beginning teacher I benefited from BTSA training and mentoring from a great Support Provider."
	quote[14] = "BTSA enables Participating Teachers and Support Providers to grow professionaly and personally..."
	quote[15] = "As a consulting teacher BTSA has made me more reflective of my own teaching."
	quote[16] = "The reflections on my lesson really clarified the strengths and weaknesses of my lesson plan and presentation."
var author = new Array();
	author[0] = "Martha Neill"
	author[1] = "Lisa Hedgahl"
	author[2] = "Brenda Golubski"
	author[3] = "Karen Schauer"
	author[4] = "Kimberly Henderson"
	author[5] = "Kathy Magnani"
	author[6] = "Caron Walker"
	author[7] = "Patti Faires"
	author[8] = "Cassie Reimer"
	author[9] = "Terri Hollister"
	author[10] = "Gail Kelly"
	author[11] = "Holly Bordwell"
	author[12] = "Kristina Roy"
	author[13] = "Alan Clark"
	author[14] = "Ruth Ward"
	author[15] = "Jann Carlson"
	author[16] = "Chris Klostermann"
var textStyle = "headerText"
// round down the result of random * array length
var a = Math.floor(Math.random() * (quote.length));
document.write("&quot;" + quote[a] + "&quot;<br>" + "&#8212;" + author[a]);
}

// random photos //

function photo() { //By Paul Davis - www.kaosweaver.com
var j,l="",m="",p="",q="",z="",list= new Array()
  list[list.length]='' + photos + 'array_f02.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f03.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f04.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f05.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f06.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f07.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f08.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f09.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f10.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f11.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f12.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f13.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f14.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f15.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f16.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f17.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f18.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f19.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f20.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f21.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f22.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f23.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f24.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f25.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f26.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f27.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f28.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f29.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f30.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f31.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f32.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f33.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f34.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f35.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f36.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f37.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f38.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f39.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f40.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f41.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  list[list.length]='' + photos + 'array_f42.jpg?&width=136&height=151&name=world&alt=We Shape the World&border=0';
  j=parseInt(Math.random()*list.length);
  j=(isNaN(j))?0:j;
  if (list[j].indexOf('?')==-1) {
    document.write("<img src='"+list[j]+"'>");
  }
  else {
    nvp=list[j].substring(list[j].indexOf('?')+2).split('&');
    for(var i=0;i<nvp.length;i++) {
      sub=nvp[i].split('=');
   	  switch(sub[0]) {
 	    case 'link':
          l="<a href='"+unescape(sub[1])+"'>";
          p="</a>";
		  break;
	    case 'target':
          q=" target='"+unescape(sub[1])+"'";
  		  break;
  	    default:
          m+=" "+sub[0]+"='"+unescape(sub[1])+"'";
  		  break;
      }
    }
    z=(l!="")?((q!="")?l.substring(0,l.length-1)+q+">":l):"";
    z+="<img src='"+list[j].substring(0,list[j].indexOf('?'))+"'"+m+">"+p;
  document.write(z);
  }
}

// popup window script //

var features = "width=580,height=400,scrollbars,resizable,menubar,location,toolbar,status,screenX=10,screenY=10,top=10,left=10";
function popUp(newPage) {
	window.open(newPage,'popUp',features);
	return false;
}

// focus //

function placeFocus() {
	if (document.forms.length > 0) {
		var field = document.forms[0];
		for (i = 0; i < field.length; i++) {
			if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type == "password") || 				(field.elements[i].type.toString().charAt(0) == "s")) {
				document.forms[0].elements[i].focus();
				break;
         		}
      		}
   		}
}

// breadcrumbs //

function breadCrumbs(base, delStr, defp, cStyle, tStyle, dStyle, nl) {
	base = site_location;
	delStr = ":";
	defp = "index.html";
	cStyle = "None";
	tStyle = "None";
	dStyle = "None";
	nl = "0";
	loc = window.location.toString();
	subs = loc.substr(loc.indexOf(base) + base.length + 1).split("/");
    document.write("<a href=\"" + getLoc(subs.length - 1) + defp + "\" class=\"" + cStyle + "\">Home</a>  " + "<span class=\"" + dStyle + "\">" + delStr + "</span> ");
    a = (loc.indexOf(defp) == -1) ? 1 : 2;
    for (i = 0; i < (subs.length - a); i++) {
        subs[i] = makeCaps(unescape(subs[i]));
        document.write("<a href=\"" + getLoc(subs.length - i - 2) + defp + "\" class=\"" + cStyle + "\">" + subs[i] + "</a>  " + "<span class=\"" + dStyle + "\">" + delStr + "</span> ");
    }
    if (nl == 1) {
        document.write("<br>");
    }
    document.write("<span class=\"" + tStyle + "\">" + document.title + "</span>");
}
function makeCaps(a) {
	switch (a) {
	case "about": 
		aBack = "About Us";
		break; 
	case "experienced":
		aBack = "For Experienced Teachers";
		break;
	case "mybtsa":
		aBack = "MyBTSA";
		break;
	case "new":
		aBack = "For New Teachers";
		break;
	default:
		g = a.split(" ");
		for (l = 0; l < g.length; l++) {
			g[l] = g[l].toUpperCase().slice(0, 1) + g[l].slice(1);
		aBack = g.join(" ");
		break;
		}
	}
return aBack;
} 
function getLoc(c) {
    var d = "";
    if (c > 0) {
        for (k = 0; k < c; k++) {
            d = d + "../";
        }
    }
    return d;
}

// change style display

function changeDisplayStyle(inObj,state) {
  inObj.style.display = state;
}