var locked = 0;

$(document).ready( //Handle locking and unlocking of mouseovers
  function(){
    $( '#switches' ).click(
      function(){
		if (locked == 0) {
			locked = 1;
			var status = document.getElementById("status");
			status.firstChild.nodeValue="UNLOCK";
		} else {
			locked = 0;
			var status = document.getElementById("status");
			status.firstChild.nodeValue="LOCK";
		}
	  }
    );
	}
);

$(document).ready( //Handle locking and unlocking of slides in table form
  function(){
    $( '#switches td' ).mouseover(
      function(){
		if (locked == 0) {
        $( "#slides div" ).hide();
        <!-- $( '#switches td' ).css( 'font-weight', 'normal' ); -->
        <!-- $( this ).css( 'font-weight', 'bold' ); -->
		$( '#switches td' ).css('color', 'black');
		$( this ).css('color', '#00549F');
        $( '#slide' + $( this ).attr( 'id' ).replace( 'switch', '' ) ).show();
		}
	  }
    );
	}
);

$(document).ready( //Handle locking and unlocking of slides in list form
  function(){
    $( '#switches li' ).mouseover(
      function(){
		if (locked == 0) {
        $( "#slidesList div" ).hide();
        $( '#switches li' ).css( 'font-weight', 'normal' );
		$( '#switches li' ).css('color', 'black');
        $( this ).css( 'font-weight', 'bold' );
		$( this ).css('color', '#00549F');
        $( '#slide' + $( this ).attr( 'id' ).replace( 'switch', '' ) ).show();
		}
      }
    );
  }
);

function playSound(soundfile) { //play sounds of wines
 document.getElementById("dummy").innerHTML=
 "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
 }
 
//Used to select all default text automatically when a textarea is selected
function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}

function checkAll()
{
var boxes = cBoxes.getElementsByTagName("input");
for (var i = 0; i < boxes.length; i++) {
myType = boxes[i].getAttribute("type");
if ( myType == "checkbox") {
boxes[i].checked=1;
}
}
}
function checkNone()
{
var boxes = cBoxes.getElementsByTagName("input");
for (var i = 0; i < boxes.length; i++) {
myType = boxes[i].getAttribute("type");
if ( myType == "checkbox") {
boxes[i].checked=0;
}
}
}

/*
function checkAll() {
  var container;

   if (document.getElementById && (container = document.getElementById('cBoxes'))
       && container.getElementsByTagName) {
    var controls = container.getElementsByTagName('input');

    for (var i = 0, n = controls.length; i < n; ++i)
    if (controls[i].type == 'checkbox') boxes[i].checked = true;
  }
}
function checkNone() {
  var container;

  if (document.getElementById && (container = document.getElementById('cBoxes'))
      && container.getElementsByTagName) {
    var controls = container.getElementsByTagName('input');

    for (var i = 0, n = controls.length; i < n; ++i)
    if (controls[i].type == 'checkbox') boxes[i].checked = false;
  }
}
*/
 /* previously used for mouseover images.  Now using swapimage class built into jquery.
var inames = new Array('home', 'about', 'portfolio', 'contact', 'Scores');
var revert = new Array();
//var inames = new Array('home', 'about', 'portfolio', 'contact', 'resources', 'map', 'email', 'cert', 'ftp');
if (typeof precursor == 'undefined') {
	var precursor = new String();
}
// Preload
if (document.images) {
  var flipped = new Array();
  for(i=0; i< inames.length; i++) {
    flipped[i] = new Image();
    flipped[i].src = precursor +"images/"+inames[i]+"over.gif";
  }
}

function over(num) {
  if(document.images) {
    revert[num] = document.images[inames[num]].src;
    document.images[inames[num]].src = flipped[num].src;
  }
}
function out(num) {
  if(document.images) document.images[inames[num]].src = revert[num];
}
*/

