aboutflag = 0
workflag = 0
strategyflag = 0
contactflag = 0
okflag = 0;

function expandnav(x) {

	if (x == 1) {
		overflag = 1
		collapsenav(x);
		if (okflag == 0) {
			if (aboutflag == 0) {
				okflag = 1;
				aboutflag = 1
				setTimeout("setflag(0)",190)
			}
			setTimeout("showsubnav('storysubnav')",200)
		}
	}
	if (x == 2) {
		overflag = 1
		collapsenav(x);
		if (okflag == 0) {
			if (workflag == 0) {
				okflag = 1;
				workflag = 1
				setTimeout("setflag(0)",190)
			}
			setTimeout("showsubnav('competitivesubnav')",200)
		}
	}
	if (x == 3) {
		overflag = 1
		collapsenav(x);
		if (okflag == 0) {
			if (strategyflag == 0) {
				okflag = 1;
				strategyflag = 1
				setTimeout("setflag(0)",190)
			}
			setTimeout("showsubnav('worksubnav')",200)
		}
	}
	if (x == 4) {
		collapsenav(x);
	}
	if (x == 5) {
		overflag = 1
		collapsenav(x);
		if (okflag == 0) {
			if (contactflag == 0) {
				okflag = 1;
				contactflag = 1
				setTimeout("setflag(0)",190)
			}
		}
	}
}

function setmenu(a,x) {
	overflag = 1
	document.getElementById(a).innerHTML = x;
}

function setflag(x) {
	okflag = x;
}

lastsub = 0;
overflag = 0;

function showsubnav(x) {
	overflag = 1
//alert("show="+	overflag)
	which = document.getElementById(x)
	if (!document.getElementById)
	return
	which.style.display="block"
	lastsub = x
}

function collapsenav(x) {
//alert(x)
	if (x != 1) {
		which = document.getElementById('storysubnav')
		which.style.display="none"
		setmenu('story','OUR STORY')
		aboutflag = 0
	}

	if (x != 2) {
		which = document.getElementById('competitivesubnav')
		which.style.display="none"
		setmenu('competitive','COMPETITIVE ADVANTAGE')
		workflag = 0
	}

	if (x != 3) {
		which = document.getElementById('worksubnav')
		which.style.display="none"
		setmenu('work','WORK WITH US')
		strategyflag = 0
	}
return
	if (x != 5) {
		setmenu('contact','CONTACT CCS')
		contactflag = 0
	}
}

function subnavover(x) {
	dot = document.getElementById(x+"dot")
	dot.src = "http://www.realcapitalsolutions.com/wp-content/themes/RealCapitalWP/images/dot.gif"
	overflag = 1
}
function subnavout(x) {
	dot = document.getElementById(x+"dot")
	dot.src = "http://www.realcapitalsolutions.com/wp-content/themes/RealCapitalWP/images/spacer.gif"
	hidesubnav(x)
}

function hidesubnav(x) {
	overflag = 0
	setTimeout("hidesubnavs()",500)
}

function hidesubnavs(x) {
//alert("hide="+	overflag)
	if (overflag == 0) {
		collapsenav(-1)
	}
}

function nothing() {
	return;
}


function popup(i,x,y) {
	self.name="main"
	var popup = window.open( "http://www.realcapitalsolutions.com/wp-content/themes/RealCapitalWP/images/"+i+"_lg.jpg", "popup", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+x+",height="+y+"")
	popup.focus()
}

function map() {
	self.name="main"
	var mappopup = window.open( "map.php", "mappopup", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=445,height=390")
	mappopup.focus()
}

function florida() {
	self.name="main"
	var mappopup = window.open( "florida.php", "mappopup", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=550,height=473")
	mappopup.focus()
}

function southwest() {
	self.name="main"
	var mappopup = window.open( "southwest.php", "mappopup", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=550,height=473")
	mappopup.focus()
}

function contact() {
	self.name="main"
	var contactpopup = window.open( "contact_popup.php", "contactpopup", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=500,height=600")
	contactpopup.focus()
}

function graph(x) {
	self.name="main"
	var graphpopup = window.open( "graphics/" + x, "graphpopup", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=547")
	graphpopup.focus()
}

function video(x) {
	self.name="main"
	var videopopup = window.open( "media/" + x, "videopopup", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=320,height=255")
	videopopup.focus()
}

