// Copyright Acro Media Inc. 1998-2005, www.acromediainc.com


function onOver(){
	this.src = imgOvers[this.number].src;
}
function onOut(){
	this.src = imgOuts[this.number].src;
}

function copyrightYear(){
	var d=new Date();
	if(document.getElementById('insertYear')) document.getElementById('insertYear').innerHTML = d.getFullYear();
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
 }
}

/*
var currentSection, currentLink;
function toggleExpand(section, linkObj){
	if(currentLink) currentLink.className = "";
	if(currentSection) currentSection.style.display = "none";
	var obj = document.getElementById("learnMore" + section);
	if(obj == currentSection){
		document.getElementById('dirList').className = "";
		currentSection = null;
	} else {
		obj.style.display = "block";
		document.getElementById('dirList').className = "grayData";
		linkObj.className = "antiGray";
		currentSection = obj;
		currentLink = linkObj;
	}
}
*/

/** This is called when the user clicks on the "close" button that is displayed on the lawyer details pop-out.
This clears all the info in the hidden lawyer Details box and resets all styles for the list of lawyer names.
*/
function closeMe(){
	var linkObj = document.getElementById("learnMore");
	linkObj.style.display = "none";
	document.getElementById('dirList').className = "antiGray";
	document.getElementById('lastLawyer').id = "lastLawyer";
	document.getElementById('lastLawyer').className = "";
}

//Checks to see if safari is on, boolean
var detect = navigator.userAgent.toLowerCase();
var safStatus,thestring;
function checkSafari(){	
	if (checkIt('safari')) safStatus = true;
	else safStatus = false;
	function checkIt(string){
		place = detect.indexOf(string) + 1;
		return place;
	}
}

/** Function to set the value of the category text box on the search page.
This will also hide/clear the menus when a category is clicked and leave just the textBoxes filled.

@param categoryID The ID that will be used by SQL for searching, assigned as a hidden value
@param categoryName The name of the category that will be displayed within the textBox
*/
function setCategory(categoryID, categoryName){
	$('categoryValue').value = categoryID;
	$('categoryName').value = categoryName;
	$('category_0').style.display = "none";
	$('category_0').className = "";	
}

/** Function to set the value of the state/city text box on the search page.
This will also hide/clear the menus when a category is clicked and leave just the textBoxes filled.  The values will be separated by a comma and search.php page will parse the search based on that.

@param state The state that will appear in the text box.
@param city The city that will appear, city is optional, as sometimes the user will only want to search states.
function setStateCity(state, city){
	var value = "";
	
	// if there is a city add it as well.
	if(city != ""){
		value += city + ",";
	}
	
	// there will always be a state
	value += state;
	
	$('stateVal').value = value;	
	$('stateHolder').style.display = "none";
	$('stateHolder').className = "";	
}
*/

/*
window.onload = function (){
	copyrightYear();
	checkSafari();
	externalLinks();	
	initDD();
	addImageHandlers();
	startList();
	pickAColor();	
}*/


function pageShift(){
	return;
}

siteOnLoad = function (){
	copyrightYear();
//	initDD();
	addImageHandlers();
	startList();
	pickAColor();	
	checkSafari();
	externalLinks();
}

function addLoadEvent(func){
	var oldOnLoad = window.onload;
	if(typeof window.onload != 'function'){ 
		window.onload = func;
	}
	else{ 
		window.onload = function(){ 
			oldOnLoad();
			func();
		}
	}
}

addLoadEvent(siteOnLoad);
