// index javascript 
function toggle1(show) 
	{
	if(show == "quick")
		{document.getElementById('quick').style.display="block";
		document.getElementById('open').style.display="none";
		// commented out map since map link now goes to a separate page. --keith
		//document.getElementById('map').style.display="none";
		document.getElementById('index_qsearch').style.backgroundColor="#e9edf7";
		document.getElementById('index_qsearch').style.color="#001a6d";
		document.getElementById('index_msearch').style.backgroundColor="#0043A2";
		document.getElementById('index_msearch').style.color="#e9edf7";
		document.getElementById('index_ohouse').style.backgroundColor="#0043A2";
		document.getElementById('index_ohouse').style.color="#e9edf7";
		}
		
	else if(show == "open")
		{document.getElementById('quick').style.display="none";
		document.getElementById('open').style.display="block";
		//document.getElementById('map').style.display="none";
		document.getElementById('index_ohouse').style.backgroundColor="#e9edf7";
		document.getElementById('index_ohouse').style.color="#001a6d";
		document.getElementById('index_msearch').style.backgroundColor="#0043A2";
		document.getElementById('index_msearch').style.color="#e9edf7";
		document.getElementById('index_qsearch').style.backgroundColor="#0043A2";
		document.getElementById('index_qsearch').style.color="#e9edf7";
		}
	
	/*else if(show == "map")
		{document.getElementById('quick').style.display="none";
		document.getElementById('open').style.display="none";
		document.getElementById('map').style.display="block";
		document.getElementById('index_msearch').style.backgroundColor="#e9edf7";
		document.getElementById('index_msearch').style.color="#001a6d";
		document.getElementById('index_ohouse').style.backgroundColor="#0043A2";
		document.getElementById('index_ohouse').style.color="#e9edf7";
		document.getElementById('index_qsearch').style.backgroundColor="#0043A2";
		document.getElementById('index_qsearch').style.color="#e9edf7";
		} */
		}
	
function toggle2(show) 
	{	
	 if(show == "buy")
		{document.getElementById('buy').style.display="block";
		document.getElementById('sell').style.display="none";
		document.getElementById('invest').style.display="none";
		document.getElementById('index_buy').style.backgroundColor="#e9edf7";
		document.getElementById('index_buy').style.color="#001a6d";
		document.getElementById('index_sell').style.backgroundColor="#0043A2";
		document.getElementById('index_sell').style.color="#e9edf7";
		document.getElementById('index_invest').style.backgroundColor="#0043A2";
		document.getElementById('index_invest').style.color="#e9edf7";}
		
		
	else if(show == "sell")
		{document.getElementById('buy').style.display="none";
		document.getElementById('sell').style.display="block";
		document.getElementById('invest').style.display="none";
		document.getElementById('index_sell').style.backgroundColor="#e9edf7";
		document.getElementById('index_sell').style.color="#001a6d";
		document.getElementById('index_buy').style.backgroundColor="#0043A2";
		document.getElementById('index_buy').style.color="#e9edf7";
		document.getElementById('index_invest').style.backgroundColor="#0043A2";
		document.getElementById('index_invest').style.color="#e9edf7";}

		
	else if(show == "invest")
		{document.getElementById('buy').style.display="none";
		document.getElementById('sell').style.display="none";
		document.getElementById('invest').style.display="block";
		document.getElementById('index_invest').style.backgroundColor="#e9edf7";
		document.getElementById('index_invest').style.color="#001a6d";
		document.getElementById('index_buy').style.backgroundColor="#0043A2";
		document.getElementById('index_buy').style.color="#e9edf7";
		document.getElementById('index_sell').style.backgroundColor="#0043A2";
		document.getElementById('index_sell').style.color="#e9edf7";}
		}


/* banner rotate script
function loadpage() {

    index1 = 0;
    listofimages = new Array(2);
    listofimages[0] = new Image(742,100)
    listofimages[0].src = "images/banners/care-horiz-index1.jpg"
    listofimages[1] = new Image(742,100)
    listofimages[1].src = "images/banners/teamb-horiz-index1.jpg"

    thetimer = setTimeout("changeimage()", 4000);

}

function changeimage(){

    index1 = index1 + 1
    if (index1 == "2") {

        index1 = 0 

    }
    imagesource = listofimages[index1].src
    window.document.rotban.src = imagesource

    thetimer = setTimeout("changeimage()", 4000);

}

function changebanner() {

    if (index1 == 0) {

        newlocation = "care.shtml" 

    }
    else if (index1 == 1) {

        newlocation = "care_teambuilder.shtml" 

    }
    location = newlocation 

}
*/

// toggle script that only displays one at a time out of 6 possible
function togg6(num) {
	var fullpath='sub' + num;
	var text=document.getElementById(fullpath);
	for (i=1; i<7; i++) {
		if(text.style.display!='block'){
		var forpath ='sub' + i;
		if(document.getElementById(forpath).style.display="block") {
			document.getElementById(forpath).style.display="none";
		}
	}
	}
	if(text.style.display != 'block') {
			text.style.display='block';
			}
	else{text.style.display = 'none';
}
}
// toggle script that only displays one at a time out of 4 possible
function togg4(num) {
	var fullpath='sub' + num;
	var text=document.getElementById(fullpath);
	for (i=1; i<5; i++) {
		if(text.style.display!='block'){
		var forpath ='sub' + i;
		if(document.getElementById(forpath).style.display="block") {
			document.getElementById(forpath).style.display="none";
		}
	}
	}
	if(text.style.display != 'block') {
			text.style.display='block';
			}
	else{text.style.display = 'none';
}
}

// toggle script that only displays one at a time out of 9 possible
function toggemp(num) {
	var fullpath='sub' + num;
	var text=document.getElementById(fullpath);
	for (i=1; i<10; i++) {
		if(text.style.display!='block'){
		var forpath ='sub' + i;
		if(document.getElementById(forpath).style.display="block") {
			document.getElementById(forpath).style.display="none";
		}
	}
	}
	if(text.style.display != 'block') {
			text.style.display='block';
			}
	else{text.style.display = 'none';
}
}
 
 
// main navigation drop down menu script

function sshow(menu){
	for (i=1; i<9; i++){
	    var smenu="smenu"+i;
		if(document.getElementById(smenu).style.display="block") {
			document.getElementById(smenu).style.display="none";}	
			}
	document.getElementById(menu).style.display="block";
	}

function shide(){
    for (i=1; i<9; i++){
	    var smenu="smenu"+i;
		if(document.getElementById(smenu).style.display="block"){
			document.getElementById(smenu).style.display="none";}
			}
			}


//script for index listings banner 
function ahigh (which) {
	document.getElementById(which).style.background = "#36c" ;
	document.getElementById(which).style.color = "#e9edf7" ;
	}
function alow (which) {
	document.getElementById(which).style.background = "#7398FF" ;
	document.getElementById(which).style.color = "#001a6d" ;
	}
function high (which) {
	document.getElementById(which).style.background = "#f90" ;
	}
function low (which) {
	document.getElementById(which).style.background = "#7398FF" ;
	}


function propertyLookup(property_id) {
    
    location = "http://dev:8080/new_web/property_details.jsp?property_id=" + property_id;
}


// function to toggle the display of divs with id="sub1, sub2, etc..." on or off.
function togg(num) {
	var fullpath='sub' + num;
	var text=document.getElementById(fullpath);
	if(text.style.display != 'block') {
			text.style.display='block';
			}
	else{text.style.display = 'none';
}
}

function togg_info() {
	var text=document.getElementById('editmyinfo');
	var text2=document.getElementById('myacctinfo')
	if(text.style.display != 'block') {
			text.style.display='block';
			text2.style.display='none';
			}
	else{text.style.display = 'none';
		text2.style.display='block';
}
}

function reloAdbanner () {
	
		if (document.images) {
				if (document.relobanner.complete) {
					thisAd ++
					if (thisAd == reloCount) {
						thisAd = 0;
					}
				document.relobanner.src = reloImages[thisAd];
				}
			setTimeout("reloAdbanner()", 8000)
		}
}

function reloLocation () {
		document.location.href = reloLoc[thisAd];
}