isIE = false;
isNav4 = false;
isNav6 = false;
topMenuTimer = null;
loaded = false;

if (navigator.appVersion.charAt(0) == "4"){
	if (navigator.appName.indexOf("Explorer") >= 0) {
		isIE = true;
		document.write("<style>.dropdown {width:100%;}</style>");
	}
	else {
		isNav4 = true;
	}
}
else if (navigator.appVersion.charAt(0) > "4"){
    isNav6 = true;
	document.write("<style>.dropdown {width:100%;}</style>");
}

function initTopNav() {
 if (document.images) {
 	// MAIN NAV IMAGES
 	theconcept_up = new Image();theconcept_up.src = navImageRoot + "mainnav/" + "theconcept_up.gif";
	theconcept_ov = new Image();theconcept_ov.src = navImageRoot + "mainnav/" + "theconcept_ov.gif";
  	thecommunity_up = new Image();thecommunity_up.src = navImageRoot + "mainnav/" + "thecommunity_up.gif";
	thecommunity_ov = new Image();thecommunity_ov.src = navImageRoot + "mainnav/" + "thecommunity_ov.gif";
	thehomes_up = new Image();thehomes_up.src = navImageRoot + "mainnav/" + "thehomes_up.gif";
	thehomes_ov = new Image();thehomes_ov.src = navImageRoot + "mainnav/" + "thehomes_ov.gif";
	thebuilders_up = new Image();thebuilders_up.src = navImageRoot + "mainnav/" + "thebuilders_up.gif";
	thebuilders_ov = new Image();thebuilders_ov.src = navImageRoot + "mainnav/" + "thebuilders_ov.gif";
	contactus_up = new Image();contactus_up.src = navImageRoot + "mainnav/" + "contactus_up.gif";
	contactus_ov = new Image();contactus_ov.src = navImageRoot + "mainnav/" + "contactus_ov.gif";
	s_arrow_up = new Image();s_arrow_up.src = navImageRoot + "space.gif";
	s_arrow_ov = new Image();s_arrow_ov.src = navImageRoot + "secnav/" + "s_arrow.gif";
	
	// FIXER SCRIPT
	document[active_menu].src = eval(active_menu + "_ov.src");
	courtesymenu = new Image();courtesymenu.src = navImageRoot + "mainnav/" + active_menu + "_up.gif";
	fixer = eval(active_menu + "_up");
	fixer.src = eval(active_menu + "_ov.src");
	if (active_sec != null) {
		document[active_sec].src = s_arrow_ov.src;
	}
	
	// CONCEPT DROP IMAGES
	d_distinctivedesign_up = new Image();d_distinctivedesign_up.src = navImageRoot + "drops/theconcept/" + "d_distinctivedesign_up.gif";
	d_distinctivedesign_ov = new Image();d_distinctivedesign_ov.src = navImageRoot + "drops/theconcept/" + "d_distinctivedesign_ov.gif";
	d_maintenancefree_up = new Image();d_maintenancefree_up.src = navImageRoot + "drops/theconcept/" + "d_maintenancefree_up.gif";
	d_maintenancefree_ov = new Image();d_maintenancefree_ov.src = navImageRoot + "drops/theconcept/" + "d_maintenancefree_ov.gif";
	d_coachstyleliving_up = new Image();d_coachstyleliving_up.src = navImageRoot + "drops/theconcept/" + "d_coachstyleliving_up.gif";
	d_coachstyleliving_ov = new Image();d_coachstyleliving_ov.src = navImageRoot + "drops/theconcept/" + "d_coachstyleliving_ov.gif";
	d_singlefamilylots_up = new Image();d_singlefamilylots_up.src = navImageRoot + "drops/theconcept/" + "d_singlefamilylots_up.gif";
	d_singlefamilylots_ov = new Image();d_singlefamilylots_ov.src = navImageRoot + "drops/theconcept/" + "d_singlefamilylots_ov.gif";
	// COMMUNITY DROP IMAGES
	d_location_up = new Image();d_location_up.src = navImageRoot + "drops/thecommunity/" + "d_location_up.gif";
	d_location_ov = new Image();d_location_ov.src = navImageRoot + "drops/thecommunity/" + "d_location_ov.gif";
	d_masterplan_up = new Image();d_masterplan_up.src = navImageRoot + "drops/thecommunity/" + "d_masterplan_up.gif";
	d_masterplan_ov = new Image();d_masterplan_ov.src = navImageRoot + "drops/thecommunity/" + "d_masterplan_ov.gif";
	d_availablelots_up = new Image();d_availablelots_up.src = navImageRoot + "drops/thecommunity/" + "d_availablelots_up.gif";
	d_availablelots_ov = new Image();d_availablelots_ov.src = navImageRoot + "drops/thecommunity/" + "d_availablelots_ov.gif";
	d_secureentry_up = new Image();d_secureentry_up.src = navImageRoot + "drops/thecommunity/" + "d_secureentry_up.gif";
	d_secureentry_ov = new Image();d_secureentry_ov.src = navImageRoot + "drops/thecommunity/" + "d_secureentry_ov.gif";
	d_amenitieslanscaping_up = new Image();d_amenitieslanscaping_up.src = navImageRoot + "drops/thecommunity/" + "d_amenitieslanscaping_up.gif";
	d_amenitieslanscaping_ov = new Image();d_amenitieslanscaping_ov.src = navImageRoot + "drops/thecommunity/" + "d_amenitieslanscaping_ov.gif";
	d_architecturalcontrols_up = new Image();d_architecturalcontrols_up.src = navImageRoot + "drops/thecommunity/" + "d_architecturalcontrols_up.gif";
	d_architecturalcontrols_ov = new Image();d_architecturalcontrols_ov.src = navImageRoot + "drops/thecommunity/" + "d_architecturalcontrols_ov.gif";
	// HOMES DROP IMAGES
	d_coachomes_up = new Image();d_coachomes_up.src = navImageRoot + "drops/thehomes/" + "d_coachomes_up.gif";
	d_coachomes_ov = new Image();d_coachomes_ov.src = navImageRoot + "drops/thehomes/" + "d_coachomes_ov.gif";
	d_manorhomes_up = new Image();d_manorhomes_up.src = navImageRoot + "drops/thehomes/" + "d_manorhomes_up.gif";
	d_manorhomes_ov = new Image();d_manorhomes_ov.src = navImageRoot + "drops/thehomes/" + "d_manorhomes_ov.gif";
	d_virtualtours_up = new Image();d_virtualtours_up.src = navImageRoot + "drops/thehomes/" + "d_virtualtours_up.gif";
	d_virtualtours_ov = new Image();d_virtualtours_ov.src = navImageRoot + "drops/thehomes/" + "d_virtualtours_ov.gif";
	// BUILDERS DROP IMAGES
	d_winningconstruction_up = new Image();d_winningconstruction_up.src = navImageRoot + "drops/thebuilders/" + "d_winningconstruction_up.gif";
	d_winningconstruction_ov = new Image();d_winningconstruction_ov.src = navImageRoot + "drops/thebuilders/" + "d_winningconstruction_ov.gif";
	d_granvillehomes_up = new Image();d_granvillehomes_up.src = navImageRoot + "drops/thebuilders/" + "d_granvillehomes_up.gif";
	d_granvillehomes_ov = new Image();d_granvillehomes_ov.src = navImageRoot + "drops/thebuilders/" + "d_granvillehomes_ov.gif";
	d_larattahomes_up = new Image();d_larattahomes_up.src = navImageRoot + "drops/thebuilders/" + "d_larattahomes_up.gif";
	d_larattahomes_ov = new Image();d_larattahomes_ov.src = navImageRoot + "drops/thebuilders/" + "d_larattahomes_ov.gif";
	loaded = true;
 }
}

function showLayer( layerId )  {
	if (loaded) {
		stopTimer();
		resetAllDrops();
		document[active_menu].src = courtesymenu.src;
		if (isNav6) {
			document.getElementById( layerId ).style.visibility = "visible"
		}
		else if (isIE) {
			document.all[ layerId ].style.visibility = "visible";
		}
		else if (isNav4) {
			document.layers[ layerId ].visibility = "show";
		}
	}
}

function hideLayer( layerId )  {
	if (loaded) {
		if (isNav6) {
			document.getElementById( layerId ).style.visibility = "hidden"
		}
		else if (isIE) {
			document.all[ layerId ].style.visibility = "hidden";
		}
		else if (isNav4) {
			document.layers[ layerId ].visibility = "hide";
		}
	}
}

function resetAllDrops()  {
	hideLayer( "concept_drop" );imgOff( "theconcept" );
	hideLayer( "community_drop" );imgOff( "thecommunity" );
	hideLayer( "homes_drop" );imgOff( "thehomes" );
	hideLayer( "builders_drop" );imgOff( "thebuilders" );
	hideLayer( "contact_drop" );imgOff( "contactus" );
}
	
function startTimer() {
	stopTimer();
	topMenuTimer = setTimeout( "resetAllDrops()", 100 );
}

function stopTimer(){
  	if ( topMenuTimer ) {
		clearTimeout( topMenuTimer );
		topMenuTimer = null;
	}
}

function imgOn( imgName ) {
	if (loaded) {
		if ( document.images ) {
	    	document[ imgName ].src = eval( imgName + "_ov.src" );
		}
	}
}

function imgOff( imgName ) {
	if (loaded) {
		if ( document.images ) {
		    document[ imgName ].src = eval( imgName + "_up.src" );
		}
	}
}

function arrowOn( imgName ) {
	if (loaded) {
		if ( document.images ) {
			document[active_sec].src = s_arrow_up.src;
	    	document[ imgName ].src = s_arrow_ov.src;
		}
	}
}

function arrowOff( imgName ) {
	if (loaded) {
		if ( document.images ) {
			if (active_sec != imgName) {
				document[active_sec].src = s_arrow_ov.src;
	    		document[ imgName ].src = s_arrow_up.src;
			}
		}
	}
}

function dropImgOn( theLayer, imgName) {
	stopTimer();
	if (loaded) {
		if (isNav4) {
			document.layers[theLayer].document[imgName].src = eval( imgName + "_ov.src" );
		}
		else {
    		document[ imgName ].src = eval( imgName + "_ov.src" );
		}		
	}
}


function dropImgOff( theLayer, imgName) {
	startTimer(); 
	if (loaded) {
		if (isNav4) {
			document.layers[theLayer].document[imgName].src = eval( imgName + "_up.src" );
		}
		else {
	   		document[ imgName ].src = eval( imgName + "_up.src" );		
		}
	}
}

function poppic (docname) {
	popup = window.open (docname,'poppic','Height=470,width=470,scrollbars=0');
}

function popmap (docname) {
	popup = window.open (docname,'popmap','Height=553,width=485,scrollbars=0,toolbar=1,menubar=1');
}

function roadmap (docname) {
	popup = window.open (docname,'roadmap','Height=455,width=825,scrollbars=0,toolbar=1,menubar=1');
}

function borough (docname) {
	popup = window.open (docname,'borough','Height=500,width=600,scrollbars=0,toolbar=1,menubar=1');
}

//-->