//
// Menu Write Functions
//
function writeTop() {
  toppage = '<div align=center><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height=1 colspan=5><img src=/images/pixel-clear.gif width=779 height=1></td></tr>'
	   + '<tr><td><img src=/images/pixel-clear.gif width="55" height="2"></td><td><img src="/images/pixel-clear.gif" width="40" height="2"></td><td height=2><img src="/images/pixel-clear.gif" width="350" height="2"></td><td height=2><img src="/images/pixel-clear.gif" width="180" height="2"></td><td height=2><img src="/images/pixel-clear.gif" width="15" height="2"></td></tr>'
  if (st != 'US'){
	toppage = toppage + '<tr><td colspan="5" align="right"><img src="/images/pixel-gray.gif" width="100%" height="1"></td></tr>'
	   + '<tr><td width="15" align="right" bgcolor="#CCCCCC"><img src="/images/loc_current.gif" width="55" height="23"></td>'
	   + '<td align=left valign=center><font face="Arial, Helvetica, sans-serif" size="2"><img src="/images/pixel-clear.gif" width="5" height="2">Location:</font></td>'
	   + '<td><font face="Arial, Helvetica, sans-serif" size="2"><b>';
  	if(cn == 'NONE'){ 
    	    toppage = toppage + sn ;
 	} else {
    	    toppage = toppage + cn + " area, " + sn ;
	}
  }
    toppage = toppage + '</font></td><td align="right" valign="center" nowrap><font face="Arial, Helvetica, sans-serif" size="2">';
//  if(ag.length + ln.length + ot.length > 0) {
//	toppage = toppage + "<b>Your&nbsp;Team:</b>";
//  }
  if(ag.length > 0){
    toppage =toppage + "&nbsp;<b>Agent:</b><a href='" + aw + "' target=_blank>" + ag + "</a>&nbsp;";
  };
  if(ln.length > 0){
    toppage = toppage +  ((ag.length >0)? "&nbsp;&nbsp;" : "") + "&nbsp;<b>Lender:</b><a href='" + lw + "' target=_blank>" + ln + "</a>&nbsp;";
  };
  if(ot.length > 0){
    toppage = toppage +  ((ag.length + ln.length >0)? "&nbsp;&nbsp;" : "") + "&nbsp;<b>Other:</b><a href='" + ow + "' target=_blank>" + ot + "</a>&nbsp;";
  };
  if (st != 'US'){
    toppage = toppage + '</font></td><td width="15" align="right"><img src="/images/pixel-clear.gif" width="15" height="2"></td></tr>';
  }
  toppage = toppage + '<tr><td colspan="5" height=1><img src="/images/pixel-gray.gif" width=100% height=1></td></tr>'
            + "</table></div>";
  toppage = '';
  return toppage;
};

function writePrequal() {
  return "<a href='/dyn/" + st + "/" + cn + "/prequal.html?" + shell + banner + "'>"
};

//
// Used for Drop Down Menu Navigation
//

// original code by Bill Trefzger 12/12/96
function go(select){
   var tito = select;
   location.href = tito.options[tito.selectedIndex].value
   return false;
};

//
// For Set State and Set County navigation
//
function goHere(state) {
	location.href = thescript + shell + banner + "state=" + state
}


//
// Email Pop-Up Functions
//
function openit(param) {
// this will open the window, sending info on the command line
   var myurl = "/sendUSHUD.html?" + param;
	window.open(myurl, '', 'width=500,height=450,resizeable=1')
}; // function openit

function openit2(param) {
// this will open the window, sending info on the command line
   var myurl = "/sendExpert.php?" + param;
	window.open(myurl, '', 'width=525,height=300,scrollbars=1,resizable=1')
}; // function openit

function Feedback(){
	window.open("/includes/feedback.htm","","height=455,width=460,status=no,scrollbars=yes,location=no,toolbar=no,directories=no,menubar=no,resizeable=yes")
};

//
// Creates the Parse Object
//
function parse() {
//  The Parse Object
//  Written by C. David Dent
//
	this.url = document.URL;
	if (this.url.indexOf('?') > 0) {
		var usplit = this.url.split('?');
		this.input = usplit[1];
		var pairs = this.input.split('&');
		 for (i=0; i < pairs.length; i++) { 
		 	 temp = pairs[i].split('=');
			 var t1 = temp[0];
			 var t2 = unescape(temp[1]);
			 this[t1] = t2
		 } // for i
	} else {
		this.input = " "
	};
	return this
};

//
// To carry shell variable through
//
