var ff_results = new Array(
["http://www.joffelaw.com/samplecases.asp","Sample Cases"],
["http://www.joffelaw.com/appellatecases.asp","Appellate Cases"],
["http://www.joffelaw.com/appellatecourtoralarguments.asp","Appellate Oral Arguments"]
);

var ff_practice = new Array(
["http://www.joffelaw.com/wcc.asp","White Collar Crime"],
["http://www.joffelaw.com/internet_crime_attorney.asp","Internet Crime"],
["http://www.joffelaw.com/drug_crime_defense.asp","Drug Crime"],
["http://www.joffelaw.com/healthcare_fraud_attorney.asp","Healthcare Fraud"],
["http://www.joffelaw.com/attorney_criminal_defense_tax_evasion.asp","Tax Crime"],
["http://www.joffelaw.com/economic_crime_attorney.asp","Economic Crime"]
);

var ff_attorneys = new Array(
["http://www.joffelaw.com/florida_attorney.asp","Qualifications"],
["http://www.joffelaw.com/ranking.asp","Martindale Hubbell Ranking"]
);

var ff_media = new Array(
["http://www.joffelaw.com/headlines.asp","Headlines"],
["http://joffelaw.blogspot.com","Blog"],
["http://www.joffelaw.com/caselaw","Caselaw Blog"],
["http://www.joffelaw.com/socialmedia.asp","Social Media"]
);


var tt = new Array(
['','',''],
['Results','results','results'],
['Practice','practice','practice'],
['Attorneys','attorneys','attorneys'],
['Media','media','media']
);



var dd_ns4 = (document.layers) ? 1 : 0;
var dd_ie4 = (document.all && !document.getElementById) ? 1 : 0;
var dd_dom = ((document.getElementById) && (!dd_ie4)) ? 1 : 0; // ns6
var isOver = false;
var timer = null;
var cmTop = 0;
var cmLeft = 0;

// dd_ns4 redraw on resize
if (dd_ns4) {
        origWidth = innerWidth;
        origHeight = innerHeight;
}

function reDo() {
        if (innerWidth != origWidth || innerHeight != origHeight) {location.reload();}
}

if (dd_ns4) onresize = reDo;
if (dd_dom) onload = InitObj;


document.write("<div id=\"gnddhome\"></div>");
	
//build dropdowns
for ( i = 1 ; i < tt.length ; i++ ) {  // runs it threw the loop
	var ff = eval("ff_" + tt[i][1]);       // runs threw and sets the ff_ array # and the first variable in the array.	
	var divNum = "gndd" + tt[i][2];        // runs threw and sets the ff_ array # and the Second variable in the array.	
	var strDiv = "<div class=\"cm\" id=\"" + divNum + "\" style='visibility: hidden' onMouseOver=\"OverLayer();\" onMouseOut=\"OutLayer('"+ divNum + "');\">";
	strDiv = strDiv + "<table cellspacing=1 cellpadding=1 bgcolor=Black width=200 border=0><tr valign=top><td nowrap class=cmLff width=200>";	
	for ( j = 0 ; j < ff.length ; j++ ) {   // runs it threw the loop
		var linkString = new String(ff[j][0]);  // Url String going threw the loop starting at 0 
		if (linkString.indexOf('http:') == -1) ff[j][0] = "" + ff[j][0];		//******
		strDiv = strDiv + "&nbsp\;&nbsp\;&nbsp\;&#183\;&nbsp\;<a  href='" + ff[j][0] + "'>" + ff[j][1] + "</a><br>"; // writes out the actual links.
	}
	strDiv = strDiv + "<br></td></tr></table></div>\n";    // makes the ending of the table.
	document.write(strDiv);  // tells it to write it.
}
//End of dropdowns






function InitObj() {
	for (i = 1; i < tt.length; i++) { 
		whichEl = "gndd" + tt[i][2];
		if (dd_dom) {
			whichEl = document.getElementById(whichEl);
		}
		else {	
			whichEl = (dd_ns4) ? document.layers[whichEl] : document.all[whichEl].style;
		} 
		whichEl.onmouseover = OverLayer;
		whichEl.onmouseout = OutLayer;
	}


}
InitObj();



function ShowLayer(showEl,event) {
	if (showEl == "gnddhome") return;
	clearTimeout(timer);
	HideAllLayers();
	
	if (dd_dom) {
		var whichEl = document.getElementById(showEl);
	

	}
	else {	
		var whichEl = (dd_ns4) ? document.layers[showEl] : document.all[showEl].style;
	
	}
	
	
//POSITIONING OF DIVS	
	whichAnchor = showEl + "A";      //this area set the div into position.  showEl is the name ex. gnddnfl + A =  gnddnflA
	if (dd_ie4) {										// if you are IE the do this
		if (document.all[whichAnchor]){    // is whichAnchor, which is showEl at the point of show 
			cmTop = findy(document.all[whichAnchor]) + 20;   //then go ahead and set it 20 from top 
			cmLeft = findx(document.all[whichAnchor]) - 20;   
		}
	}
	if (dd_ns4) {
		if (document.anchors[whichAnchor]) {
			cmTop = document.anchors[whichAnchor].y + 20;
			cmLeft = document.anchors[whichAnchor].x - 20;
		}
	}
	if (dd_dom){
		if (document.getElementById(whichAnchor)){
                        var myObject = document.getElementById(whichAnchor);
                        var leftCoord = parseInt(myObject.coords.match(/^(\d+)/)[1]);
                        myObject = myObject.parentNode.parentNode;
                        do {
                                cmTop  = cmTop  + myObject.offsetTop;
                                cmLeft = cmLeft + myObject.offsetLeft;
                                myObject = myObject.offsetParent
                        } while (myObject.offsetParent) 
                        cmLeft = leftCoord + cmLeft;
		}
	}
	
	
	if (dd_dom) {
		whichEl.style.visibility = "visible";
		whichEl.style.top = (cmTop + 30) + 'px';
                if (showEl != 'gnddmore' && showEl) {
                        if (cmLeft > 940) cmLeft = 892;
                }
		whichEl.style.left = cmLeft + 'px';
	}
	
	else {	
		whichEl.visibility = "visible";
		whichEl.top = cmTop;
                if (showEl != 'gnddmore' && showEl) {
                        if (cmLeft > 940) cmLeft = 892;
                }
		whichEl.left = cmLeft;
	} 	
	cmTop = 0; cmLeft = 0;
}



function findy(item) {
	if (item.offsetParent) {
		return item.offsetTop + findy(item.offsetParent);
	}
	else {
		return item.offsetTop;
	}
}

function findx(item) {
	if (item.offsetParent) {
		return item.offsetLeft + findx(item.offsetParent);
	}
	else {
		return item.offsetLeft;
	}
}

//End of POSITIONING




function HideAllLayers() {
	if (dd_dom) {
		var divTemp = document.getElementsByTagName('div');
		for (i = 0; i < divTemp.length; i++) { 
			var divString = new String(divTemp[i].id);
			if (divString.indexOf('gndd') != -1) divTemp[i].style.visibility = "hidden";
		}
	}	
	if (dd_ie4) {
		var divTemp = document.all.tags("div");
		for (i = 0; i < divTemp.length; i++) { 
			var divString = new String(divTemp[i].id);
			if (divString.indexOf('gndd') != -1) divTemp[i].style.visibility = "hidden";
			
		}
	}
	if (dd_ns4) {
		for (i = 0; i < document.layers.length; i++) { 
			var divString = new String(document.layers[i].name);
			if (divString.indexOf('gndd') != -1) document.layers[i].visibility = "hidden";
		}
	}
}

function OverLayer() { clearTimeout(timer); isOver = true; }

function OutLayer() {  // so  when the mouse is off the SPOT, then set time out make variable isOver set False and set time to execute 
clearTimeout(timer);   //function HideAllLayers  in 300 microseconds.
	isOver = false; 
	timer = setTimeout("HideAllLayers()",300);
}


