function play_flashIntro() {
if (window.innerWidth)
 	var theWidth=window.innerWidth;
else if (document.documentElement && document.documentElement.clientWidth)
	 var theWidth=document.documentElement.clientWidth;
else if (document.body)
 	var theWidth=document.body.clientWidth;

if (window.innerHeight)
 	var theHeight=window.innerHeight;
else if (document.documentElement && document.documentElement.clientHeight)
	 var theHeight=document.documentElement.clientHeight;
else if (document.body)
	 var theHeight=document.body.clientHeight;

var introLayer = document.getElementById('flashIntro');
introLayer.style.height = theHeight + "px";
introLayer.style.width = theWidth + "px";
}

function addtrackerlistener(obj) {
	if (obj.addEventListener) {
		obj.addEventListener('click', trackfiles, true);
	} else if (obj.attachEvent) {
		obj.attachEvent("on" + 'click', trackfiles);
	}
}

function trackFiles(elLnk) {
	var regLocal = new RegExp("^https?:\\/\\/"+window.location.hostname);
  var path = elLnk.href.replace(regLocal, '');
  if (path && path.indexOf('/') === 0 ) {
    pageTracker._trackPageview( path );
  } 
}

function drawBar(value) {
  if (document.getElementById('appointments')) {
    var advance = (value/500)*100;
    var bar = document.getElementById('appointments');
    bar.style.width = advance + "%";
    explain = "<dfn title='Our goal is to have 500 people from diverse backgrounds appointed as board members. This shows how many we have made.'>";
    explain = explain + value + "</dfn>";
    bar.innerHTML = explain;
    }
}

function wordCounter(field, countfield, maxlimit) {
    var fieldId = field.substring(1,field.length);
    var area = document.getElementById(fieldId);
    var wordcount = $(field).val().split(/\b[\s,\.-:;]*/).length;
    var wordsleft = maxlimit - wordcount;
    var charCount = area.value.length;
    $(countfield).text('Words left: '+wordsleft);
    if (wordsleft < 1) { area.value = area.value.substring(0, charCount-1); }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function toolkitPopup(path) {
    pageTracker._trackPageview( path );
    if ($.browser.msie) {
        MM_openBrWindow(path, 'Toolkit', 'menubar=0,location=1,width=960,height=654,toolbar=0');
    }
    else {
        MM_openBrWindow(path, 'Toolkit', 'menubar=0,location=0,width=960,height=654,toolbar=1');
    }
}

function barHeight() {
  var entryHeight = $('#entries').height();
  var sidebarHeight = $('#theBar').height();
  if (sidebarHeight < entryHeight) { $('#theBar').height(entryHeight); }
  if (entryHeight < sidebarHeight) { $('#entries').height(sidebarHeight); }
  var sidebarContent = $('#theBar').text();
  if (sidebarContent == "") { $('#theBar').css('display','none'); }
}

