i_amapon = new Image
i_amapon.src = "/ob/icons/icoamap_on.gif"
i_bldgbon = new Image
i_bldgbon.src = "/ob/icons/icobldgb_on.gif"
i_contacton = new Image
i_contacton.src = "/ob/icons/icocontact_on.gif"
i_fpon = new Image
i_fpon.src = "/ob/icons/icofp_on.gif"
i_mapon = new Image
i_mapon.src = "/ob/icons/icomap_on.gif"
i_portfolioon = new Image
i_portfolioon.src = "/ob/icons/icoportfolio_on.gif"
i_touron = new Image
i_touron.src = "/ob/icons/icotour_on.gif"
i_webon = new Image
i_webon.src = "/ob/icons/icoweb_on.gif"
i_mailon = new Image
i_mailon.src = "/ob/icons/mail_yes_on.gif"


i_amapsmon = new Image
i_amapsmon.src = "/ob/icons/icoamap_sm_on.gif"
i_bldgbsmon = new Image
i_bldgbsmon.src = "/ob/icons/icobldgb_sm_on.gif"
i_contactsmon = new Image
i_contactsmon.src = "/ob/icons/icocontact_sm_on.gif"
i_fpsmon = new Image
i_fpsmon.src = "/ob/icons/icofp_sm_on.gif"
i_mapsmon = new Image
i_mapsmon.src = "/ob/icons/icomap_sm_on.gif"
i_portfoliosmon = new Image
i_portfoliosmon.src = "/ob/icons/icoportfolio_sm_on.gif"
i_toursmon = new Image
i_toursmon.src = "/ob/icons/icotour_sm_on.gif"
i_websmon = new Image
i_websmon.src = "/ob/icons/icolisting_sm_on.gif"
i_listingsmon = new Image
i_listingsmon.src = "/ob/icons/icolisting_sm_on.gif"
i_mailsmon = new Image
i_mailsmon.src = "/ob/icons/mail_yes_sm_on.gif"

var printallurl;
function printmro(printallurl){
window.location= printallurl;
self.print();
}

function printMe(){	

		self.print();	

}

if (document.images) {
		check_yes = new Image
		check_no = new Image
		check_yes.src = "/spimg/check_yes.gif"
		check_no.src = "/spimg/check_no.gif"
}
else {
		check_yes = ""
		check_no = ""
		document.showpix = ""
		document.showdata = ""
}


var lc_region
var lc_cust_id
function newsearch(){
	lc_region=document.savequerylist.Q_REGION.value;
	lc_custid=document.savequerylist.cust_id 
        ? document.savequerylist.cust_id.value 
        : document.savequerylist.cust_id.value;
	document.location="sp_form.mpl?Q_REGION="+lc_region+"&cust_id="+lc_custid;
return false
}



var winurl
var newWin
var lc_cust_id
function showbuilding(lcbldg_id, flag){
	if (newWin && newWin.open && !newWin.closed) {          
                newWin.close();
      }

	if(document.savequerylist.cust_id){
		lc_cust_id=document.savequerylist.cust_id.value;
		// flag is used to limit display to query matches
		if ( flag == 'Y' || flag == 'y' ) {
			winurl='/getbldg.mpl' + location.search.replace("&pg=","&xpg=") + '&bookref='+lcbldg_id;
		}
		else {
			winurl='/getbldg.mpl?bookref='+lcbldg_id+"&cust_id="+lc_cust_id+"&Q_images=showpix";
		}
        }
	else{
		if ( flag == 'Y' || flag == 'y' ) {
			winurl='/getbldg.mpl' + location.search.replace("&pg=","&xpg=");
		}
		else {
			winurl='/getbldg.mpl?bookref='+lcbldg_id+"&Q_images=showpix";
		}
	}
        newWin = window.open(winurl,lcbldg_id,'resizable=yes,menubar=no,toolbar=yes,scrollbars=yes,width=680,height=500,location=no,copyhistory=no');
	this.newWin.focus()
}

//var pixwin=null;
function pixwinopen(){
 return mro_openwin('pixwin');
//if (pixwin && pixwin.open && !pixwin.closed) pixwin.close();
//pixwin = window.open("",'pixwin','resizable=yes,menubar=no,toolbar=yes,scrollbars=yes,width=740,height=500,location=no,copyhistory=no');
//pixwin.focus()
//return true
}

function sendspace() {
    return pixwinopen();
}

                           
var valuestart=0
var valueend=0
var myCookie=""
         

function eat(chip){
        myValue=chip.value+"|";
        myCookie=GetCookie("spacelist");
        if (myCookie==null){
                myCookie=""
                SetCookieEZ("spacelist",myCookie);
        }
        if (myCookie==""&&chip.checked){
                myCookie=myValue;
                SetCookieEZ("spacelist",myCookie);
                parent.nav_top.refreshsplist()
                return 1;
        }
        if (myCookie==myValue&&!chip.checked){
                myCookie="";
                SetCookieEZ("spacelist",myCookie);
                parent.nav_top.refreshsplist()
                return 1;
        }         
        valuestart=myCookie.indexOf(myValue);
        valueend=valuestart+myValue.length-1;
        if (valuestart==-1 && chip.checked){
                myCookie=myCookie+myValue;
                SetCookieEZ("spacelist",myCookie);
        }
        //remove of not checked
        if (valuestart!=-1 && !chip.checked){
                myCookie=myCookie.substring(0,valuestart)+myCookie.substring(valueend+1,myCookie.length)
                SetCookieEZ("spacelist",myCookie);
        }
        //ClearCookie("spacelist")
        parent.nav_top.refreshsplist()
        return 1;
}
        
function GetCookie(name) {
        var result = null;
        var myCookie = " " + document.cookie + ";";
        var searchName = " " + name + "=";
        var startOfCookie = myCookie.indexOf(searchName)
        var endOfCookie;
        if (startOfCookie != -1) {
                startOfCookie += searchName.length; // skip past cookie name
                endOfCookie = myCookie.indexOf(";", startOfCookie);
                result = unescape(myCookie.substring(startOfCookie,endOfCookie));
        }
        return result;
}

function SetCookieEZ(name, value) {
        document.cookie = name + "=" + escape(value);
}

function SetCookie(name, value, expires, path, domain, secure) {
        var expString = ((expires == null)
                ? "" : ("; expires=" + expires.toGMTString()))
        var pathString = ((path == null) ? "" : ("; path=" + path))
        var domainString = ((domain == null)
                ? "" : ("; domain=" + domain))
        var secureString = ((secure == true) ? "; secure" : "")
        document.cookie = name + "=" + escape(value)
                + expString + pathString + domainString
                + secureString;
}

function ClearCookie(name) {
        var ThreeDays = 3 * 24 * 60 * 60 * 1000;
        var expDate = new Date();
        expDate.setTime (expDate.getTime() - ThreeDays);
        document.cookie = name + "=ImOutOfHere; expires="
                + expDate.toGMTString();
}


var qListWindow=null
function qlist(form){
 var w=400
 var h=450
 var y=75
 var x=screen.width-(w+50)
 if (mylistwindow && mylistwindow.open && !mylistwindow.closed)
  mylistwindow.close()
 if (qListWindow && qListWindow.open && !qListWindow.closed)
  qListWindow.close()
 qListWindow = window.open(window.location+"&action=qrysumm","qListWindow",
  "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,"+
  "resizable=yes,width="+w+",height="+h+",top="+y+",left="+x+",screenY="+y+
  ",screenX="+x)
 qListWindow.focus()
 qListWindow.focus()
 return true
}



var whichsubmit=""
var loginval=""
function validateIt(form) {
 loginval=GetCookie("Login")
 if (loginval!="Y") {
  alert ("You need to log in before saving a list")       
  parent.nav_top.signinwin()
  return false;
 }
 if(form.Q_bookrefs!=null){
  alert("The list Currently displayed is a Building watch list.\nTo save this list use the My Buildings List popup Window")
  blist();
  return false;
 }
 if (form.spids!=null){
  alert("The list Currently displayed is a Space list.\nTo save this list use the My Spaces popup Window")
  splist();
  return false
 }

 qlist(form)
 return false

 if (form.Q_sp_agent_name.value.length==0) {
  alert("Please enter a listname.");
  document.whichsubmit = " "
  form.Q_sp_agent_name.focus();
  return false;
 }

 //?????
 return sql_submit_oc();
 //return validateSaveQuery();
 //return true;
}

var serchstr
var olddoc=""
var len_str
var len_url
//serchstr="Q_images=showpix"	


function revisepix(serchstr,img_obj){
	len_str=serchstr.length
	oldurl=document.location.toString()
	len_url=oldurl.length
	lc_pos=oldurl.indexOf(serchstr)

	if (lc_pos!=-1){
		newurl_pt1=oldurl.substring(0,lc_pos)	
		newurl_pt2=oldurl.substring(lc_pos+len_str,len_url)
		newurl=newurl_pt1+newurl_pt2
		img_obj.src=check_no.src
	}
	else {
		newurl=oldurl+"&"+serchstr
		img_obj.src=check_yes.src
	}
	document.location=newurl
	return false
}

function reviseformat(widget){
	var sUrl = location.toString();
    var rePattern = new RegExp('(&|\\?){1}'+widget.name+'=[^&]*&*');
	var sNewUrl = sUrl.replace(rePattern, "$1");

	switch(widget.type){
	case 'select-one':
		sNewUrl += '&'+widget.name+'='+widget.options[widget.selectedIndex].value;
		// remove min so we start at beginning of list.
		var rePattern2 = new RegExp( '(&|\\?)+min=[^&]*&*' );
		sNewUrl = sNewUrl.replace(rePattern2, "$1");
		break;
	case 'checkbox':
		if ( widget.checked == true ){
			sNewUrl += '&'+widget.name+'='+widget.value;
		}
		break;
	}
	location = sNewUrl;
	return false;
}

function initpix(serchstr,obj_img){
	oldurl=document.location.toString()
	lc_pos=oldurl.indexOf(serchstr)
	if (lc_pos!=-1){
		obj_img.src=check_yes.src
		}
	else {
		obj_img.src=check_no.src
		}
return true
}

  var to = null;
  var subject = null;
  var bodytxt =null;
  var doc=null;	
  var lcbodytxt=null;
  var lcmsgtxt=null;
function mailit(to,lcbldg) {
	lcmsgtxt= "Regarding: "+lcbldg+" Space Availabilities"
	lcbodytxt="I would like more information about available space at "+lcbldg
  	doc = "mailto:" + to + 
    "?subject=" + escape(lcmsgtxt) + 
    "&body=" + escape(lcbodytxt); 
    window.location = doc;
}



    	  var spurl="";
        var SpListWindow = null

 function splist(){
	var w=400
	var h=450
	var y=25
	var x=screen.width-(w+25)

	if (mylistwindow && mylistwindow.open && !mylistwindow.closed) {		
		mylistwindow.close();
	}


        // does the window really exist
                if (SpListWindow && SpListWindow.open && !SpListWindow.closed) {                
                        SpListWindow.close();
                }       
                cok1=GetCookie("spacelist");
                if(cok1==null){cok1="";}
                        coklistname=GetCookie("sp_user_srch_name");
                        if(coklistname==null){coklistname="";}
                        coklistname=escape(coklistname);
                        coksrchid=GetCookie("sp_user_srch_ID");
                        if(coksrchid==null){coksrchid="";}
                spurl='/space.mpl?action=summary&spids='+cok1+'&Q_images=showpix'+
                '&sp_user_srch_name='+coklistname+'&sp_user_srch_id='+coksrchid;      
               SpListWindow = window.open(spurl,"SpListWindow",
                "toolbar=no,location=no,directories=no,status=yes," +
                "menubar=no,scrollbars=yes,resizable=yes,"+
                "width="+w+
		",height="+h+
		",top="+y+
		",left="+x+
                ",screenY="+y+
		",screenX="+x);
                SpListWindow.focus()
        }

        function closeSplistWindow(){
                if (SpListWindow && SpListWindow.open && !SpListWindow.closed) {                
                        SpListWindow.close();
                }
        }       

        function refreshsplist(){
                splist();
                // here for backward compatibility
        }

var BldgListWin = null

function blist(){
 var y = 0;
 var h = 450;
 var w = 400;
 var x = screen.width-(w);

 if (mylistwindow && mylistwindow.open && !mylistwindow.closed)
  mylistwindow.close();

 if (BldgListWin && BldgListWin.open && !BldgListWin.closed)
  BldgListWin.close();

 var delim = '|';
 var ckBlist = new Cookie(document,'blist',0,'/', document.domain);
 ckBlist.load();
 var Q_bookrefs = ckBlist.blist == null ? '' : escape(ckBlist.blist);
 var sp_agent_name = ckBlist.sp_agent_name == null ? '' : escape(ckBlist.sp_agent_name);
 var sp_agent_ID = ckBlist.sp_agent_ID == null ? '' : escape(ckBlist.sp_agent_ID);
 var Q_rentmin = ckBlist.Q_rentmin == null ? '' : escape(ckBlist.Q_rentmin);
 var Q_rentmax = ckBlist.Q_rentmax == null ? '' : escape(ckBlist.Q_rentmax);
 var Q_sizemin = ckBlist.Q_sizemin == null ? '' : escape(ckBlist.Q_sizemin);
 var Q_sizemax = ckBlist.Q_sizemax == null ? '' : escape(ckBlist.Q_sizemax);

 var myurl='/space.mpl?action=bldgsumm&Q_bookrefs='+Q_bookrefs+'&sp_agent_name='+sp_agent_name+'&sp_agent_ID='+sp_agent_ID + '&Q_sizemin=' + Q_sizemin  + '&Q_sizemax=' + Q_sizemax + '&Q_rentmin=' + Q_rentmin + '&Q_rentmax=' + Q_rentmax;

 BldgListWin = window.open(myurl,"BldgListWin",
  "toolbar=no,location=no,directories=no,status=yes," +
		"menubar=no,scrollbars=yes,resizable=yes," +
		"width="+w+",height="+h+"," + 
		"screenY="+y+",screenX="+x+",top="+y+",left="+x);
 BldgListWin.focus()
 return false
}

function updateBldgList(chkbox){
	var delim = '|';
        var ckBlist = new Cookie(document,'blist',0,'/', document.domain);
        ckBlist.load();

        var bookref=chkbox.value + delim;

	if ( chkbox.checked ) {
		//if its there already then do nothing else add it
		if ( ckBlist.blist ==  null || ckBlist.blist == '' ) {
			 ckBlist.blist = bookref;
		}
		else if ( ckBlist.blist.indexOf(bookref) == -1 ) {
			ckBlist.blist += bookref;
		}
	}
	else{
		//remove of not checked
		if ( ckBlist != null ){
			var iStart=ckBlist.blist.indexOf(bookref);
			var iEnd=iStart+bookref.length;
			if ( iStart != -1 ) {
				ckBlist.blist=ckBlist.blist.substring(0,iStart)+ckBlist.blist.substring(iEnd,ckBlist.blist.length);
			}
		}
	}

	ckBlist.store();
        blist();
        return false;
}


var bldgpixwin
var lc_cust_id
var pixhtm
var lc_address
var lc_cityst
var lc_pixpath
function showbldgpix(lc_address,lc_cityst,lc_pixpath){

        //lc_cust_id=document.savequerylist.Q_cust_id.value;
        //if (lc_cust_id==null){
        //        lc_cust_id=1
        //}       
        closebldgpix(); 
        bldgpixwin = window.open("",'bldgpixwin','resizable=yes,menubar=no,toolbar=yes,scrollbars=yes,width=500,height=500,location=no,copyhistory=no,screenX=475,screenY=50,left=475,top=50');
                
        bldgpixwin.focus();
        bldgpixwin.document.open()
        pixhtm=''
        pixhtm+='<html><head><title>'
        pixhtm+=lc_address
        pixhtm+='</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">'
        pixhtm+='<meta http-equiv="Referrer" content="http://devel.mrofficespace.com/index.html">'
        pixhtm+='<style type="text/css">'
        pixhtm+='<!--.pixaddress {  font-family: Arial, Helvetica, sans-serif; font-size: 18pt; font-weight: bold}-->'
        pixhtm+='<!--.pixcityst {  font-family: Arial, Helvetica, sans-serif; font-size: 14pt; font-weight: bold}-->'
        pixhtm+='</style></head>'
        pixhtm+='<body bgcolor="#FFFFFF" text="#000000"><table align="center" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td  width="100%"  valign="top" align=center><span class="pixaddress">'
        pixhtm+=lc_address
        pixhtm+='</span><br><span class="pixcityst">'
        pixhtm+=lc_cityst
        pixhtm+='</span></b></td></tr><tr><td  width="100%"  valign="top">&nbsp;</td></tr><tr><td align="center" valign="top">'
        pixhtm+='<img src="'+lc_pixpath+'"'
        pixhtm+='></td></tr></table></body></html>'
        bldgpixwin.document.write(pixhtm)
        bldgpixwin.document.close()
}

function closebldgpix(){
        if (bldgpixwin && bldgpixwin.open && !bldgpixwin.closed) {
                bldgpixwin.close();
        }
        return                          
}    

var mylistwindow = null
	function showmylistwindow() {
 	var y = 100;
      var h = 600;
      var w = 440;
	var x = (screen.width/2)-(w/2);
		if (mylistwindow && mylistwindow.open && !mylistwindow.closed) {		
			mylistwindow.close();
		}
		mylistwindow = window.open("","mylistwindow",
		"toolbar=no,location=no,directories=no,status=yes," +
		"menubar=no,scrollbars=yes,resizable=yes," +
		"width="+w+",height="+h+"," + 
		"screenY="+y+",screenX="+x+",top="+y+",left="+x);     	
        	mylistwindow.focus();
		return true;
	}

var signinwindowurl="";
		var signinwindow = null

        function signinwin(){
		if (signinwindow && signinwindow.open && !signinwindow.closed) {		
			signinwindow.close();
		}	        
        	signinwindowurl='/sp_login.mpl?action=loginform&popup=y';
        	signinwindow = window.open(signinwindowurl,"signinwindow",
       	 	'resizable=yes,menubar=no,toolbar=no,scrollbars=yes,width=470,height=500,location=no,copyhistory=no');
        	signinwindow.focus();
		return false;
	}
                            

function validateSaveQuery(){

	//wSaveListDialog = window.open('savelistdialog.html','savelistdialog','width=330,height=275,resize=yes');
	var msg = 'Please note your list contains the following criteria and will\nbe constrained by these values when viewed in the future.\n\n';
	msg += '______________________________________________________\n\n';
	if (document.savequerylist.Q_bookrefs) {
		msg += '\t* Selected Buildings from your building list';
	}
	if (document.savequerylist.Q_tlat.value != 'null'){
		msg += '\t- A selected MAP area.';
	}
	msg += '\n\n______________________________________________________\n\n';
	msg += '\n\nDo you wish to continue saving this list?';
	if (document.savequerylist.Q_bookrefs || document.savequerylist.Q_tlat.value != 'null'){
		if(confirm(msg)){
			return true;
		}
		else{
			return false;
		}
	}
}

function sql_submit_oc(){
	var ckUserPrefs = new Cookie(document,'UserPrefs',120,'/','.mrofficespace.com');
	ckUserPrefs.load();

	if (document.savequerylist.Q_bookrefs || (document.savequerylist.Q_tlat && document.savequerylist.Q_tlat.value != 'null') ){
		if (!ckUserPrefs.warnings || ckUserPrefs.warnings == 'Y') { 
			var myURL = '/savelistdialog.html?';
			if (document.savequerylist.Q_bookrefs) myURL += 'blist=y&';	
			if (document.savequerylist.Q_tlat.value != 'null') myURL += 'map=y&';	
			//alert(myURL);
			winSQLDialog = window.open(myURL,'winSQLDialog','height=310,width=350,scrollbars=yes');
			return false;
		}
	}
	return true;
}

var spaceWin
function openSpaceWin(lcbldg_id, flag){
 //return mro_openwin('mro_getbldg');
if (spaceWin && spaceWin.open && !spaceWin.closed) spaceWin.close();
spaceWin = window.open('','spaceWin','resizable=yes,menubar=no,toolbar=yes,scrollbars=yes,width=680,height=500,location=no,copyhistory=no');
this.spaceWin.focus()
}

var popmsgwin

function popmsg(dowhat){
	if (popmsgwin && popmsgwin.open && !popmsgwin.closed) {
		popmsgwin.close();
	}
	if (dowhat=="open"){
	popmsgwin = window.open('/msgs/msg_searching.html','popmsgwin','resizable=no,menubar=no,toolbar=no,scrollbars=no,width=200,height=200,location=no,copyhistory=no,screenY=250,screenX=450,top=250,left=450');
	this.popmsgwin.focus()
	}
}

function setVals(){
	document.srchform.Q_tlat.value = GetCookie('Q_tlat');
	document.srchform.Q_tlong.value = GetCookie('Q_tlon');
	document.srchform.Q_blat.value = GetCookie('Q_blat');
	document.srchform.Q_blong.value = GetCookie('Q_blon');
	clearlatlon();
}

function clearlatlon(){
	ClearCookie('Q_tlat','.mrofficespace.com', '/');
	ClearCookie('Q_tlon','.mrofficespace.com', '/');
	ClearCookie('Q_blat','.mrofficespace.com', '/');
	ClearCookie('Q_blon','.mrofficespace.com', '/');
}

//var winPrintWin=null;
function old__openPrintWin(sHref){
        if (winPrintWin && winPrintWin.open && !winPrintWin.closed) {
               winPrintWin.close();
        }
        winPrintWin = window.open('/spframes/printlistings_fr.html','winPrintWin','resizable=yes,width=740,height=525,location=no,copyhistory=no');
//alert('number of frames is ' + winPrintWin.frames.length );
        winPrintWin.focus();
        winPrintWin.frames['printWinMain'].location=sHref;
//alert('hello world 2');
        return false;
}

var winPrintWin=null;
function openPrintWin(sHref){
        if (winPrintWin && winPrintWin.open && !winPrintWin.closed) {
               winPrintWin.close();
        }
        var docPW =
'<html>'+
'<head>'+
'        <meta http-equiv="Content-Type" content="text/html" />'+
'        <meta http-equiv="Expires" content="Mon, 04 Dec 1887 23:00:00 GMT">'+
'        <title>Print Listings</title>'+
'</head>'+
'<frameset border="0" frameSpacing="0" rows="90,*" frameBorder="0">'+
'        <frame name="toolbar" marginwidth="0" marginheight="0" src="/spframes/printtoolbar.html" frameborder="0" noresize="" />'+
'        <frame name="printWinMain" src="'+ sHref +'" marginwidth="0" marginheight="0" frameborder="0" noresize="" />'+
'</frameset>'+
'</html>';

        winPrintWin = window.open('','winPrintWin','resizable=yes,width=740,height=525,location=no,copyhistory=no');
        winPrintWin.document.open();
        winPrintWin.document.write(docPW);
        winPrintWin.document.close();
        winPrintWin.focus();
        //winPrintWin.frames['printWinMain'].location=sHref;
        return false;
}


var aOpenWindows = new Array();
var aWindows = new Array();

aWindows["pixwin"]  = 'resizable=yes,menubar=no,toolbar=no,scrollbars=yes,width=740,height=575,location=no,copyhistory=no'
aWindows["mro_getbldg"] = 'resizable=yes,menubar=no,toolbar=no,scrollbars=yes,width=680,height=500,location=no,copyhistory=no';
aWindows["bldgpixwin"] = 'resizable=yes,menubar=no,toolbar=no,scrollbars=yes,width=680,height=500,location=no,copyhistory=no';
function mro_openwin(sWinName, sWinURL){
 var newWin;
 //if (aOpenWindows[sWinName] && aOpenWindows[sWinName].open && !aOpenWindows[sWinName].closed) 
 // aOpenWindows[sWinName].close();
 if ( sWinURL == null ) sWinURL = '';
 newWin = window.open(sWinURL,sWinName,aWindows[sWinName]);
 newWin.focus();
 aOpenWindows[sWinName] = newWin;
}

function MROISwap(ref) { //v1.0 ;
   if(document.getElementById){
	var a,asrc_on,b,i,j;
	j=ref.childNodes.length;
	a=ref.childNodes;
	for (i=0; i<j; i++){ 
		if (ref.childNodes[i].nodeType==1){ 
		if (a[i].src.indexOf("gif")!=-1){a[i].src=a[i].src.replace(".gif","_on.gif")};
		if (a[i].src.indexOf("jpg")!=-1){a[i].src=a[i].src.replace(".jpg","_on.jpg")};
		}
 	}	
   }		
}

function MROIRestore(ref) { //v1.0
    if(document.getElementById){
      var a,i,j;
	j=ref.childNodes.length;
	a=ref.childNodes;
	for (i=0; i<j; i++){ 
		if (ref.childNodes[i].nodeType==1){ 		
 		a=ref.childNodes;
		if (a[i].src.indexOf("_on")!=-1){a[i].src=a[i].src.replace("_on","")};
		}
 	}	
    }
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; 
  document.MM_sr=new Array; 
  for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){
    document.MM_sr[j++]=x;
    if(!x.oSrc) 
     x.oSrc=x.src; x.src=a[i+2];
   }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  
  if(!d) d=document; 
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; 
	n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all) x=d.all[n]; 
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for (i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); 
  return x;
}

/*
 * SPACE LISTS
 * since we're storing in a cookie the limit is 4KB
 */
function MRO_chk1OnClick(field){
 if ( field.checked )
  MRO_spcListAdd(field.value)
 else
  MRO_spcListDel(field.value)
}

function MRO_spcListDel(spcID){
 var myValue=spcID+"|";
 var spcList=GetCookie("spacelist");
 if ( spcList != null && spcList != "" ){
   var valuestart=spcList.indexOf(myValue);
   if ( valuestart != -1 ){
    var valueend=valuestart+myValue.length-1;
    spcList=spcList.substring(0,valuestart)+spcList.substring(valueend+1,spcList.length)
    SetCookieEZ("spacelist",spcList);
   }
 }
}

function MRO_spcListAdd(spcID){
 var myValue=spcID+"|";
 var spcList=GetCookie("spacelist");
 if ( spcList==null || spcList=="" ){
  spcList=myValue;
 }
 else {
  var valuestart=spcList.indexOf(myValue);
  if ( valuestart == -1 ){
   spcList=spcList+myValue;
  }
 }
 SetCookieEZ("spacelist",spcList);
}

function MRO_spcListClear(){
 document.cookie="spacelist=";
 document.cookie="sp_user_srch_id=";
 document.cookie="sp_user_srch_name=";
}

/*
 * BUILDING LISTS
 * since we're storing in a cookie the limit is 4KB
 */
function MRO_updateBldgList(chkbox){
 if ( chkbox.checked )
  MRO_bldListAdd(chkbox.value)
 else
  MRO_bldListDel(chkbox.value)
}

function MRO_bldListDel(blID){
 var myValue=blID+"|";
 var blList=GetCookie("blist");
 if ( blList != null && blList != "" ){
   var valuestart=blList.indexOf(myValue);
   if ( valuestart != -1 ){
    var valueend=valuestart+myValue.length-1;
    blList=blList.substring(0,valuestart)+blList.substring(valueend+1,blList.length)
    SetCookieEZ("blist",blList);
   }
 }
}

function MRO_bldListAdd(blID){
 var myValue=blID+"|";
 var blList=GetCookie("blist");
 if ( blList==null || blList=="" ){
  blList=myValue;
 }
 else {
  var valuestart=blList.indexOf(myValue);
  if ( valuestart == -1 ){
   blList=blList+myValue;
  }
 }
 SetCookieEZ("blist",blList);
}

function MRO_bldListClear(){
 document.cookie="blist=";
 document.cookie="blist_id=";
 document.cookie="blist_name=";
}

function setSelectedTab(tabID){
 var tab = parent.document.getElementById(tabID);
 if ( tab == null ) return;
 var currtab = parent.document.getElementById('current');
 if ( currtab == null )
   currtab = parent.document.getElementById('unselectedtab');
 if ( currtab && currtab != null ){
  if (currtab.oldid && currtab.oldid != null){
   currtab.id = currtab.oldid;
  }
  else{
   currtab.id = 'unselectedtab';
  }
 }
 tab.oldid=tab.id;
 tab.id='current';
}

function MrO_clrChkBoxes(f){
 for(var i=0;i<f.elements.length;i++){
  var e=f.elements[i];
  if(e.type=='checkbox' && e.checked)
   e.checked = 0;
 }
 return true;
}

function attatchLinkBehavior(){
		if (document.getElementsByTagName) {
			var links = document.getElementsByTagName("a"); // Find all links in page
			for (var i=0; i <links.length; i++) {
				if (links[i].className.match("MrFtLnk")) { // find all links with class "progressive"
					links[i].onclick = function() {return false;};
				}
			}
		}
	}
