function detailsWin(iFile,x,y) {
	var imagewindow=window.open(""+iFile+"","Details","width="+x+",height="+y+",menubar=no,toolbar=no,scrollbars=yes,resizable");
	imagewindow.resizeTo(x,y);
	imagewindow.focus();
}
function roll(state,imagename){ 
	document.images[imagename].src="/images/"+imagename+"_"+state+".gif"; 
}
function roll2(at,state,imagename){ 
	document.images[at].src="/images/"+imagename+"_"+state+".gif"; 
}
var isDHTML=0;
var isLayers=0;
var isAll=0;
var isID=0;
if(document.getElementById){
	isID=1;isDHTML=1;
}else{
	if(document.all){isAll=1;isDHTML=1;
	}else{
		browserVersion = parseInt(navigator.appVersion);
		if((navigator.appName.indexOf('Netscape')!=-1)&&(browserVersion==4)){isLayers=1;isDHTML=1;}
	}
}
function findDOM(objectID,withStyle){
	if(withStyle==1){
		if(isID){return(document.getElementById(objectID).style);}
		else{if(isAll){return(document.all[objectID].style);}
		else{if(isLayers){return(document.layers[objectID]);}
		};}
	}else{
		if(isID){return(document.getElementById(objectID));}
		else{if(isAll){return(document.all[objectID]);}
		else{if(isLayers){return(document.layers[objectID]);}
		};}
	}
}
function changeStyle(objectID,styleName,newValue){
	var dom=findDOM(objectID,1);
	if(dom){dom[styleName]=newValue;}
}
function setClass(objectID,newClass){
	var dom=findDOM(objectID,0);
	if(dom){dom.className=newClass;}
}
// Sneaky Email Function
function sef(domain,name){
	parent.location='m'+'ai'+'lto:'+name+'@'+domain;
}

function delay(r,g,b,element) {
	setTimeout("fadetext("+r+","+g+","+b+",'"+element+"'),2000");
}
function fadetext(r,g,b,element){
var rdone=false;
var bdone=false;
var gdone=false;
if(g<198){g+=2;}else{g=198;gdone=true;
	if(b>63){b-=2}else{b=63;bdone=true;
		if(r<141){r+=2;}else{r=141;rdone=true;}
	}
}
	document.getElementById(element).style.borderColor="rgb("+r+","+g+","+b+")";
	document.getElementById(element).style.color="rgb("+r+","+g+","+b+")";
	if(rdone==true && bdone==true && gdone==true){
		return;
	}else{
		setTimeout("fadetext("+r+","+g+","+b+",'"+element+"'),500");
	}
}
function contactSubmit(){
	if(document.contact.firstname.value=='') { 
		alert('Some required information was missing from the form.\n\nPlease include your First Name.');
		document.contact.firstname.focus();
		return false;
	}
	if(document.contact.lastname.value=='') { 
		alert('Some required information was missing from the form.\n\nPlease include your Last Name.');
		document.contact.lastname.focus();
		return false;
	}
	if(document.contact.email.value=='') { 
		alert('Some required information was missing from the form.\n\nPlease include your Email Address.');
		document.contact.email.focus();
		return false;
	}
	AtPos=document.contact.email.value.indexOf("@");
	StopPos=document.contact.email.value.lastIndexOf(".");
	if (AtPos==-1 || StopPos==-1){
		alert('Some required information was incorectly entered into the form.\n\nPlease verify your Email Address.');
		document.contact.email.focus();
		return false;
	}
	if(StopPos<AtPos){
		alert('Some required information was incorectly entered into the form.\n\nPlease verify your Email Address.');
		document.contact.email.focus();
		return false;
	}
	if(StopPos-AtPos==2){
		alert('Some required information was incorectly entered into the form.\n\nPlease verify your Email Address.');
		document.contact.email.focus();
		return false;
	}
	if(AtPos==0 || StopPos==0){
		alert('Some required information was incorectly entered into the form.\n\nPlease verify your Email Address.');
		document.contact.email.focus();
		return false;
	}
	if(StopPos==document.contact.email.value.length-1){
		alert('Some required information was incorectly entered into the form.\n\nPlease verify your Email Address.');
		document.contact.email.focus();
		return false;
	}
	if(document.contact.image.value=='') { 
		alert('Some required information was missing from the form.\n\nPlease type in the Image Verification.');
		document.contact.image.focus();
		return false;
	}
	document.contact.submit();
}
function loanPurpose(purpose){
	changeStyle('purchase','display','none');
	changeStyle('refinance','display','none');
	changeStyle('cashout','display','none');
	changeStyle(purpose,'display','block');
}