function changeAtState() {
	nowAt = document.getElementById("propTypeSelect").value;
	if (nowAt == "mfr" || nowAt == "sfr" ) {
		document.getElementById("nav_bba").style.backgroundImage = "url(http://www.pjmorgan.com/images/at/ourlistings-residentialforsale.gif)";
			document.getElementById("nav_baa").style.backgroundImage = "url(http://www.pjmorgan.com/images/nav/ourlistings-commercial.gif)";
			document.getElementById("nav_bfa").style.backgroundImage = "url(http://www.pjmorgan.com/images/nav/ourlistings-landfarm.gif)";
			document.getElementById("nav_bca").style.backgroundImage = "url(http://www.pjmorgan.com/images/nav/ourlistings-residentialforrent.gif)";
	}
	if (nowAt == "com" ) {
		document.getElementById("nav_baa").style.backgroundImage = "url(http://www.pjmorgan.com/images/at/ourlistings-commercial.gif)";
			document.getElementById("nav_bba").style.backgroundImage = "url(http://www.pjmorgan.com/images/nav/ourlistings-residentialforsale.gif)";
			document.getElementById("nav_bfa").style.backgroundImage = "url(http://www.pjmorgan.com/images/nav/ourlistings-landfarm.gif)";
			document.getElementById("nav_bca").style.backgroundImage = "url(http://www.pjmorgan.com/images/nav/ourlistings-residentialforrent.gif)";
	}
	if (nowAt == "ld" ) {
		document.getElementById("nav_bfa").style.backgroundImage = "url(http://www.pjmorgan.com/images/at/ourlistings-landfarm.gif)";
			document.getElementById("nav_baa").style.backgroundImage = "url(http://www.pjmorgan.com/images/nav/ourlistings-commercial.gif)";
			document.getElementById("nav_bba").style.backgroundImage = "url(http://www.pjmorgan.com/images/nav/ourlistings-residentialforsale.gif)";
			document.getElementById("nav_bca").style.backgroundImage = "url(http://www.pjmorgan.com/images/nav/ourlistings-residentialforrent.gif)";
	}
	if (nowAt == "rnt" ) {
		document.getElementById("nav_bca").style.backgroundImage = "url(http://www.pjmorgan.com/images/at/ourlistings-residentialforrent.gif)";
			document.getElementById("nav_bfa").style.backgroundImage = "url(http://www.pjmorgan.com/images/nav/ourlistings-landfarm.gif)";
			document.getElementById("nav_baa").style.backgroundImage = "url(http://www.pjmorgan.com/images/nav/ourlistings-commercial.gif)";
			document.getElementById("nav_bba").style.backgroundImage = "url(http://www.pjmorgan.com/images/nav/ourlistings-residentialforsale.gif)";
	}
}

function checkPage(pageName) {
	if (pageName == null || pageName == "mfr" || pageName == "sfr" ) {
		document.getElementById("nav_bba").style.backgroundImage = "url(http://www.pjmorgan.com/images/at/ourlistings-residentialforsale.gif)";
	}
	if (pageName == "com" ) {
		document.getElementById("nav_baa").style.backgroundImage = "url(http://www.pjmorgan.com/images/at/ourlistings-commercial.gif)";
	}
	if (pageName == "ld" ) {
		document.getElementById("nav_bfa").style.backgroundImage = "url(http://www.pjmorgan.com/images/at/ourlistings-landfarm.gif)";
	}
	if (pageName == "rnt" ) {
		document.getElementById("nav_bca").style.backgroundImage = "url(http://www.pjmorgan.com/images/at/ourlistings-residentialforrent.gif)";
	}
}

function showSubs(subID) {
	if (document.getElementById) {


		if (document.getElementById(subID + "_sub").style.visibility == "visible") {
			document.getElementById(subID + "_sub").style.visibility = "hidden";
			document.getElementById(subID + "_sub").style.position = "absolute";
			
			//if (subID == "nav_b") {
			//	document.getElementById('navTop_b').style.backgroundImage="url(http://www.pjmorgan.com/images/nav/ourlistings.gif)";
			//}
			if (subID == "nav_c") {
				document.getElementById('navTop_c').style.backgroundImage="url(http://www.pjmorgan.com/images/nav/propertymanagement.gif)";
			}
			if (subID == "nav_d") {
				document.getElementById('navTop_d').style.backgroundImage="url(http://www.pjmorgan.com/images/nav/services.gif)";
			}
			if (subID == "nav_e") {
				document.getElementById('navTop_e').style.backgroundImage="url(http://www.pjmorgan.com/images/nav/team.gif)";
			}
			if (subID == "nav_f") {
				document.getElementById('navTop_f').style.backgroundImage="url(http://www.pjmorgan.com/images/nav/tipsandtools.gif)";
			}
		} else {
		
			//document.getElementById('nav_b_sub').style.visibility = "hidden";
			document.getElementById('nav_c_sub').style.visibility = "hidden";
			document.getElementById('nav_d_sub').style.visibility = "hidden";
			document.getElementById('nav_e_sub').style.visibility = "hidden";
			document.getElementById('nav_f_sub').style.visibility = "hidden";
			
			//document.getElementById('nav_b_sub').style.position = "absolute";
			document.getElementById('nav_c_sub').style.position = "absolute";
			document.getElementById('nav_d_sub').style.position = "absolute";
			document.getElementById('nav_e_sub').style.position = "absolute";
			document.getElementById('nav_f_sub').style.position = "absolute";
					
			document.getElementById(subID + "_sub").style.visibility = "visible";
			document.getElementById(subID + "_sub").style.position = "";	
		}
		
	}
}




function highlightEmpty(subID) {
	document.getElementById('navTop_c').style.backgroundImage="url(http://www.pjmorgan.com/images/nav/propertymanagement.gif)";
	document.getElementById('navTop_d').style.backgroundImage="url(http://www.pjmorgan.com/images/nav/services.gif)";
	document.getElementById('navTop_e').style.backgroundImage="url(http://www.pjmorgan.com/images/nav/team.gif)";
	document.getElementById('navTop_f').style.backgroundImage="url(http://www.pjmorgan.com/images/nav/tipsandtools.gif)";
	
	//if (subID == "nav_b") {
	//	document.getElementById('navTop_b').style.backgroundImage="url(http://www.pjmorgan.com/images/at/ourlistings.gif)";
	//}
	if (subID == "nav_c") {
		document.getElementById('navTop_c').style.backgroundImage="url(http://www.pjmorgan.com/images/at/propertymanagement.gif)";
	}
	if (subID == "nav_d") {
		document.getElementById('navTop_d').style.backgroundImage="url(http://www.pjmorgan.com/images/at/services.gif)";
	}
	if (subID == "nav_e") {
		document.getElementById('navTop_e').style.backgroundImage="url(http://www.pjmorgan.com/images/at/team.gif)";
	}
	if (subID == "nav_f") {
		document.getElementById('navTop_f').style.backgroundImage="url(http://www.pjmorgan.com/images/at/tipsandtools.gif)";
	}
}

function opacityChange(opacity, thediv, theimage) {
	var object = document.getElementById(thediv).style;
	if (opacity == 100) {
		object.opacity = 0;
		object.MozOpacity = 0;
		object.KhtmlOpacity = 0;
		object.filter = "alpha(opacity=0)";
		document.getElementById(theimage).style.backgroundImage = "url(" + document.getElementById(thediv).src + ")";
	}
	else {
		object.opacity = (opacity/100);
		object.MozOpacity = (opacity/100);
		object.KhtmlOpacity = (opacity/100);
		object.filter = "alpha(opacity=" + opacity + ")";
	}
}


function imageFade(thediv, theimage, imageloc, time) {
	var speed = Math.round(time / 10);
	var timer = 0;
	opacityChange(0, theimage);
	document.getElementById(theimage).src = imageloc;
	for(i = 0; i <= 100; i++) {
		setTimeout("opacityChange(" + i + ",'" + theimage + "','" + thediv + "')",(timer * speed));
		timer++;
	}
}

var slideCache = new Array();

function RunSlideShow(thediv,theimage,imageFiles,displaySecs) {
	var imageSeparator = imageFiles.indexOf(";");
	var nextImage = imageFiles.substring(0,imageSeparator);
	imageFade(thediv,theimage,nextImage,100);
	var nextImages= imageFiles.substring(imageSeparator+1,imageFiles.length)+ ';' + nextImage;
	setTimeout("RunSlideShow('"+thediv+"','"+theimage+"','"+nextImages+"',"+displaySecs+")",displaySecs*1000);

	imageSeparator = nextImages.indexOf(";");
	nextImage = nextImages.substring(0,imageSeparator);
	if (slideCache[nextImage] == null) {
		slideCache[nextImage] = new Image;
		slideCache[nextImage].src = nextImage;
	}
}


function auctionLargeView(imageFile) {
	bigWindow = window.open("largeViewAuction.asp?img=" + imageFile,"bigWindow","width=780,height=570,scrollbars=1");
	bigWindow.focus();
}
function associationsLargeView(imageFile) {
	bigWindow = window.open("largeViewAssociation.asp?img=" + imageFile,"bigWindow","width=780,height=570,scrollbars=1");
	bigWindow.focus();
}
function propertiesLargeView(imageFile) {
	bigWindow = window.open("largeViewProperties.asp?img=" + imageFile,"bigWindow","width=780,height=570,scrollbars=1");
	bigWindow.focus();
}