 // Function to 'activate' rollover images in a static routine.
 
function swap(img,imgsrc){
	document[img].src=[imgsrc];
}

// preload rollovers

/*

var theNav = new Array()
theNav[0] = '/nav_imgs/invest_on2.gif'
theNav[1] = '/nav_imgs/news_on2.gif'
theNav[2] = '/nav_imgs/contact_on2.gif'
theNav[3] = '/nav_imgs/properties_on2.gif'
theNav[4] = '/nav_imgs/about_on2.gif'

*/


//New Window w/location

function winpop(w,h,url,winnm){
    var xpos=(screen.width)/2-(w/2);
    var ypos=(screen.height)/2-(h/2);
	var features="toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+w+",height="+h+",left="+xpos+",top="+ypos+"";
	var x=window.open(url,winnm,features);
	x.focus();
}

function scrollpop(w,h,url,winnm){
    var xpos=(screen.width)/2-(w/2);
    var ypos=(screen.height)/2-(h/2);
	var features="toolbar=no,status=yes,menubar=no,location=no,scrollbars=yes,resizable=no,width="+w+",height="+h+",left="+xpos+",top="+ypos+"";
	var x=window.open(url,winnm,features);
	x.focus();
	
}

// Functions to check email validity within form

function isEmail(elm) {
	if (elm.value.indexOf("@") != "-1" &&
		elm.value.indexOf(".") != "-1" &&
		elm.value != "")
		return true;
		else return false;
}

function isFilled(elm) {
	if (elm.value == "" ||
		elm.value == null)
	return false;
	else return true;
}

function formFilled(form) {
var errorMessage, valid_func;
errorMessage = "Please give us your\n \n";
valid_func = 1;
	if (isEmail(form.email) == false) {
	errorMessage += "email address\n";
	valid_func = 0;
	form.email.focus();
	}
	errorMessage += "\n so we can contact you \n with the information you request.";
	if (valid_func == 0) {
		alert(errorMessage);
		return false;
	}
// popup window confirmation
/*
 	else 
 		winpop('240','100','req_conf.html','conf_win');
		return true;
*/
}


// random image script

var theImages = new Array()
theImages[0] = '/fact_imgs/fact1.gif' // enter image sources
theImages[1] = '/fact_imgs/fact2.gif'
theImages[2] = '/fact_imgs/fact3.gif'
theImages[3] = '/fact_imgs/fact4.gif'
theImages[4] = '/fact_imgs/fact5.gif'
theImages[5] = '/fact_imgs/fact6.gif'
theImages[6] = '/fact_imgs/fact7.gif'
theImages[7] = '/fact_imgs/fact8.gif'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'"width="230" height="101" alt="" border="0" />');
}

