pendingClear = "false";
clearTimer = "";


if(document.images){
	aboutOn= new Image();
	aboutOn.src="images/about-on.gif";  
	aboutOff= new Image();
	aboutOff.src="images/about-off.gif";
	
	practiceOn= new Image();
	practiceOn.src="images/practice-on.jpg";  
	practiceOff= new Image();
	practiceOff.src="images/practice-off.jpg";
	
	casesOn= new Image();
	casesOn.src="images/cases-on.gif";  
	casesOff= new Image();
	casesOff.src="images/cases-off.gif";
	
	attorneysOn= new Image();
	attorneysOn.src="images/attorneys-on.gif";  
	attorneysOff= new Image();
	attorneysOff.src="images/attorneys-off.gif";
	
	communityOn= new Image();
	communityOn.src="images/community-on.gif";  
	communityOff= new Image();
	communityOff.src="images/community-off.gif";
	
	technologyOn= new Image();
	technologyOn.src="images/technology-on.jpg";  
	technologyOff= new Image();
	technologyOff.src="images/technology-off.jpg";
	
	contactOn= new Image();
	contactOn.src="images/contact-on.gif";  
	contactOff= new Image();
	contactOff.src="images/contact-off.gif";
	

}
		

function killMenu(menu) { 
	//menuCleanUp();
	clearTimer = setTimeout("menuCleanUp()",500);
}


function showMenu(menu){
	menuCleanUp();
	showDiv(menu);
	clearTimeout(clearTimer);
}

function menuCleanUp(){
	hideDiv('caseMenu');
	changeOpac(0,'caseMenu');
	hideDiv('staffMenu');
	changeOpac(0,'staffMenu');
}


function showMenuFast(menu){
		//menuCleanUp();
		showDivFast(menu);
		clearTimeout(clearTimer);
}

function clearMenu(menu){
	if(menu != 'HomeMenu'){
		hideDiv(menu);
		changeOpac(0,menu);
	}

}


function waxOn(imgName,mode){
	if(document.images){
		if(document.all){
			document.all[imgName].src = eval(imgName+mode+'.src');
		}else{
			document[imgName].src = eval(imgName+mode+'.src');
		}
	}	
}


	xWidth=screen.width;
	yHeight=screen.height;
	xCenter = (xWidth/2)-(300/2);
	yCenter = (yHeight/2)-(350/2);

function popUp(url){
	var winName = "popup";
	myWin = window.open( url, winName,'width=300,height=350,left=' + xCenter + ',top=' + yCenter + ',directories=no,location=yes,menubar=no,scrollbars=yes,status=yes,toolbar=no,resizable=yes');
}

function confirmDelete(url){
	if(confirm("Are you sure you want to delete this record? Deletions cannot be undone. Continue?")){
		document.location.href = url;
	}
}

function confirmMsg(){
	if(confirm("By continuing, you are confirming that you have read and understand this notice.\n\nSending email to anyone at our firm does not constitute a business relationship.\nAnything you send to anyone at our firm will not be confidential or privileged unless we have agreed to represent you.\n\nInformation on this Web site is for general use and is not legal advice.")){
		document.capForm.submit();
	}
}

function createMarker(point,paddress,pcity,pstate,pzipcode,pname,index) {
			var baseIcon = new GIcon();
			baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
			baseIcon.iconSize = new GSize(20, 34);
			baseIcon.shadowSize = new GSize(37, 34);
			baseIcon.iconAnchor = new GPoint(9, 34);
			baseIcon.infoWindowAnchor = new GPoint(9, 2);
			baseIcon.infoShadowAnchor = new GPoint(18, 25);
			// Create a lettered icon for this point using our icon class from above
			//var letter = String.fromCharCode("A".charCodeAt(0) + index);
			var icon = new GIcon(baseIcon);
			icon.image = "http://www.google.com/mapfiles/marker" + index + ".png";
			var marker = new GMarker(point, icon);
			map.addOverlay(marker);
			var pfulladdress = paddress + ', ' + pcity + ', ' + pstate + ' ' + pzipcode;
			var html = '<form action="http://maps.google.com/maps" method="get" target="_blank" style="margin:0px; width:200px;font-size:10px;line-height:12px;">';
			html += '<b>' + pname + '</b><br />' + paddress + '<br />'  + pcity + ', ' + pstate + ' ' + pzipcode + '<br /><br />';
			html += '<b>Get Directions From: <br /></b><input type="text" name="saddr" value="address,city,state" style="font-size:10px; width:120px; height:21px;">';
			//html += '<input type="hidden" name="saddr" value="" />';
			html += '<input type="hidden" name="daddr" value="' + pfulladdress + '" />';
			html += '<input type="submit" value="Go"/></form><br />';
			GEvent.addListener(marker, "click", function() {
			marker.openInfoWindowHtml(html);
		  });
	}


function showDiv(targ){
	//$("div#"+targ).fadeIn(1500);
	document.getElementById(targ).style.display = "inline";
	opacity(targ,0 ,90,1000);
}

function showDivFast(targ){
	//$("div#"+targ).show();
	document.getElementById(targ).style.display = "inline";
}

function hideDiv(targ){
	document.getElementById(targ).style.display = "none";
	//$("div#"+targ).hide();
}


function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 