//login sliding box
$(document).ready(function(){

	$(".tab-slide").click(function(){
		$("#panel").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
	 
});

//Dynamic Text in Search Box
function clickclear(thisfield, defaulttext) {
if (thisfield.value == defaulttext) {
thisfield.value = "";
 }
}
function clickrecall(thisfield, defaulttext) {
if (thisfield.value == "") {
thisfield.value = defaulttext;
 }
}

//Display confirmation dialogue box
function doconfirm(message) {
	if (confirm(message)) {return true;}
    else {return false;}
}

//===========Disable Google's AutoComplete coloring===========//
  if(window.attachEvent)
    window.attachEvent("onload",setListeners);
  
  function setListeners(){
    inputList = document.getElementsByTagName("INPUT");
    for(i=0;i<inputList.length;i++){
      inputList[i].attachEvent("onpropertychange",restoreStyles);
      inputList[i].style.backgroundColor = "";
    }
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++){
      selectList[i].attachEvent("onpropertychange",restoreStyles);
      selectList[i].style.backgroundColor = "";
    }
  }

  function restoreStyles(){
    if(event.srcElement.style.backgroundColor != "" && event.srcElement.style.backgroundColor != "#ffffff"){
      event.srcElement.style.backgroundColor = "#ffffff";
      event.srcElement.style.border = "1px solid #9a9a9d";
      event.srcElement.style.padding = "2px";
      document.all['googleblurb'].style.display = "block";
    }
  }
//=========End Disable Google's AutoComplete=========//

//=========Accesskey underline=========//
function underline() {
	var nav = document.getElementById('nav');
	var navlinks = nav.getElementsByTagName('A');
	for (var i = 0; i < navlinks.length; i++) {
		var accesskey = navlinks[i].getAttribute('accesskey');
		if (accesskey) {
			var link = navlinks[i];
			var linktext = link.childNodes[0].nodeValue;
			var keypos = linktext.indexOf(accesskey);
			var firstportion = linktext.substring(0,keypos);
			var keyportion = linktext.substring(keypos,keypos+1);
			var lastportion = linktext.substring(keypos+1,linktext.length);
			
			link.childNodes[0].nodeValue = firstportion;
			var s = document.createElement("span");
			var span = link.appendChild(s);
			var keyt = document.createTextNode(keyportion);
			span.appendChild(keyt);
			var lastt = document.createTextNode(lastportion);
			link.appendChild(lastt);
		}
	}
}

window.onload = function() {
	underline();
}
//=========End Accesskey underline=========//