var box_content = new Array();

box_content['why'] = '<b>Welcome to The Best Home Search Ever !</b><hr size=1> \
        This home search tool will let you search in ways you never though were possible, including:<p> \
        <table cellpadding=10> \
        <tr> \
                <td valign=top> \
                        <img src="assets/images/best_deck.gif"> \
                </td> \
                <td valign=top> \
                        <strong>Search the listing notes:</strong> Do you want a home with a deck, or close to a certain restaurant?  You can search for those keywords in the listing \
                        notes.  No other site lets you do this! \
                </td> \
        </tr> \
        <tr> \
                <td valign=top> \
                        <img src="assets/images/best_matching.gif"> \
                </td> \
                <td valign=top> \
                        <strong>See how many homes match your search criteria, in real-time:</strong>  As you change your search criteria, the site updates the number of homes \
                that match your search criteria.  Cool, huh? \
                </td> \
        </tr> \
        </table>';


box_content['foreclosures'] = "<b>Searching For Foreclosures:</b> Use the 'Property' tab to search the listing notes for the word 'foreclosure' or 'bank'.  You'll get a list of homes that have the following types of terms in the notes:  'pre-foreclosure', 'bank owned' , 'foreclosure sale', etc.<p><b>Here's How to search:</b><ul><li> Do a regular search using city, state, etc.<li>Click on the 'Property' tab to open it up.  There you'll see a box that says 'search the listing notes'.  In this section, type 'foreclosure'<li>Note: For you bargain hunters out there, you might also want to look at some of the options in the 'Bargain Hunter' tab";
box_content['open_house'] = "<b>Searching For Open Houses:</b> Return only properties with open houses scheduled in the next week.";
box_content['publicComments'] = "<b>Search The Listing Notes:</b>These are the comments about a property.  You can search for keyword terms like 'deck' or 'fireplace' or 'Metro'.<p><b>Here's How to search:</b><ul><li>+ sign means the word must be included in the search results, i.e., <i>+deck +woods</i> would only return results that have both words.  Alternately, you can put quotes around the phrase to require that exact phrase.<li>- sign means the word is omitted from the search results, i.e., <i>+metro -bus</i> would return all results that have <i>metro</i> but not any that have <i>metro bus</i><li>If there isn't any sign in front of the word and you're only searching for one word, like <i>metro</i>, your search will work, but if you are searching for multiple words, like <i>backs to woods</i>, you'll have to put quotes around the phrase to require all terms.</ul><p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=crimson>restrictive</font></i>, meaning the more you pick, the fewer properties will show up.  We'll pull everything that matches ALL of the criteria.";
box_content['fireplaces'] = "<b>Search on fireplaces:<b> When you check this option, we do a couple things:<ul><li>We look for properties where the listing agent checked that it had a fireplace.<li>We also include any listings with the keyword 'fireplace' in the listing notes, just to make sure we're finding you all the possibile properties.  Think of it as a little extra feather in your hat... at no charge!</ul><p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=crimson>restrictive</font></i>, meaning the more you pick, the fewer properties will show up.  We'll pull everything that matches ALL of the criteria.";
box_content['acres'] = "<b>Search on acres:</b> We'll search proeprties that have the specified acreage (or more).  <p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=crimson>restrictive</font></i>, meaning the more you pick, the fewer properties will show up.  We'll pull everything that matches ALL of the criteria.";
box_content['garage'] = "<b>Search on garage spaces:</b> Searches this many (or more) spaces.<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=crimson>restrictive</font></i>, meaning the more you pick, the fewer properties will show up.  We'll pull everything that matches ALL of the criteria.";
box_content['builtBetween'] = "<b>Search on when this property was built:</b> Restrict your search results to only have homes built in certain years.<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=crimson>restrictive</font></i>, meaning the more you pick, the fewer properties will show up.  We'll pull everything that matches ALL of the criteria.";
box_content['hoafee'] = "<b>Search on HOA/Condo Fee:</b> Don't want to pay too much in HOA or condo fees?  Then this search criteria is for you!  It restricts the search results to only show properties that have fees up to your specified max.<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=crimson>restrictive</font></i>, meaning the more you pick, the fewer properties will show up.  We'll pull everything that matches ALL of the criteria.";
box_content['fsqf'] = "<b>Search on Finished Square Footage:</b> Need some space?  You've found the place!  Search for homes of a certain size or larger with this option.<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=crimson>restrictive</font></i>, meaning the more you pick, the fewer properties will show up.  We'll pull everything that matches ALL of the criteria.";
box_content['basement'] = "<b>Search on Basement:</b> Do you need a basement for all your extra stuff?  You can require one here.<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=crimson>restrictive</font></i>, meaning the more you pick, the fewer properties will show up.  We'll pull everything that matches ALL of the criteria.";
box_content['walkoutBasement'] = "<b>Search on whether this property has a walkout basement:</b> Aah, we're getting specific now, aren't we?  Good thing, too - we let you specify not only basements, but walk-out (including 'walk-up') basements too.  Enjoy your newfound searching freedom!<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=crimson>restrictive</font></i>, meaning the more you pick, the fewer properties will show up.  We'll pull everything that matches ALL of the criteria.";
box_content['elevator'] = "<b>Search on whether this property has an elevator:</b> Do you have an elderly family member living with you that wants to go up & down in style?  Easy, just require an eleveator in your search.<p>But Important! Many listing agents don't even know that an 'elevator' option exists, so they don't check it.  That means if you were to search for an elevator, you'd be out of luck if the listing agent didn't check it off.  But we've removed this issue by also searching the listing notes for the word 'elevator' when you check it here.  See, we're always looking out for you!<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=crimson>restrictive</font></i>, meaning the more you pick, the fewer properties will show up.  We'll pull everything that matches ALL of the criteria.";
box_content['exactBeds'] = "<b>Return only properties with this exact numbers of beds:</b> This is nitpicky, but some people love it.  By default, our 'beds' criteria above says 1+, 2+, etc.  Some people just want 1,2, etc, without the plus.  By checking this, you'll be able to get more specific, i.e., if you ONLY want properties with 3 bedrooms and not more.  Yes, we too can be very detail-oriented sometimes!";
box_content['exactBaths'] = "<b>Return only properties with this exact numbers of baths:</b> This is nitpicky, but some people love it.  By default, our 'baths' criteria above says 1+, 2+, etc.  Some people just want 1,2, etc, without the plus.  By checking this, you'll be able to get more specific, i.e., if you ONLY want properties with 2 bathrooms and not more.  Yes, we too can be very detail-oriented sometimes!";
box_content['neighborhood'] = "<b>Search on neighborhood:</b> Do you <i>really</i> want to live in that one specific neighborhood?  Well, we let you do it!  Enter the name of the neighborhood here, like 'Hiddenbrook' or 'South Riding', and we'll only pull houses that are in those neighboroods.  Aah, but what if the listing agent didn't include the neighborhood in the listing?  Yes, we thought of that too!  As a courtesy we also search the listing notes for the name of the neighborhood, just in case it's in there.<p> And what if you can't remember the full name?  Don't dispair, just type a partial name, and we'll search by that too. (You just might get a few more results, lke if you're looking for 'The Fountains at McLean' but you can't remember the name, so you type 'Fountains', we might return other communities with the word 'Fountains' in the name too.)<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=crimson>restrictive</font></i>, meaning the more you pick, the fewer properties will show up.  We'll pull everything that matches ALL of the criteria.";
box_content['street'] = "<b>Search on street:</b> Aah, so you're not content to live in a specific neighborhood, but you actually want to live on a specific <i>street</i>?!  No problem, we can help.  Just type it here.  And partial names are OK too, we'll expand the search for you.<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=crimson>restrictive</font></i>, meaning the more you pick, the fewer properties will show up.  We'll pull everything that matches ALL of the criteria.<p>It's ok to just put in a street name.</p>";

box_content['busStop'] = "<b>Search on whether this is within one mile of a bus stop:</b> Yes, Metro rocks, and being close to a Metro bus stop is even better.  Check this box if you want a bus stop close by.<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=green>additive</font></i>, meaning the more you pick, the more properties will show up.  We'll pull everything that matches ANY of the criteria.";
box_content['metroStation'] = "<b>Search on whether this is within one mile of a Metro Station:</b> If you want to live close to the metro station, select this option!  <p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=green>additive</font></i>, meaning the more you pick, the more properties will show up.  We'll pull everything that matches ANY of the criteria.";
box_content['commRail'] = "<b>Search on whether this is within one mile of a rail line:</b> Lines like VRE - if you're looking for Metro lines, use the option above.<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=green>additive</font></i>, meaning the more you pick, the more properties will show up.  We'll pull everything that matches ANY of the criteria.";
box_content['metroRemarks'] = "<b>Search whether this has \"Metro\" in the description:</b><p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=green>additive</font></i>, meaning the more you pick, the more properties will show up.  We'll pull everything that matches ANY of the criteria.";

box_content['priceDrop'] = "<b>Price Drop:</b> Ooohhh Cool!  Yes, we're the only search engine that offers this!  You can search for properties that have been reduced in price!";
box_content['marketLength'] = "<b>Market Length:</b> Search for properties that have been on for more than 'X' days.";


box_content['toBeBuilt'] = "<b>To Be Built:</b> This option will give you mostly land sales, with proposed structures, often being sold by a smaller developer or a custom builder.<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=green>additive</font></i>, meaning the more you pick, the more properties will show up.  We'll pull everything that matches ANY of the criteria.";
box_content['underConstruction'] = "<b>Under Construction:</b> These will usually be Spec homes (homes currently under construction).<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=green>additive</font></i>, meaning the more you pick, the more properties will show up.  We'll pull everything that matches ANY of the criteria.";
box_content['newConstruction'] = "<b>New Construction:</b> These will be newly built homes, often by the major builders.<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=green>additive</font></i>, meaning the more you pick, the more properties will show up.  We'll pull everything that matches ANY of the criteria.";
box_content['asIsCondition'] = "<b>As Is Condition:</b> Homes being sold as-is.  Buying one of these homes will usually require a disclaimer that you're accepting the home as-is.<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=green>additive</font></i>, meaning the more you pick, the more properties will show up.  We'll pull everything that matches ANY of the criteria.";
box_content['fixerUpper'] = "<b>Fixer Upper:</b> A home that needs a little TLC (very similar to the 'needs work' category).<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=green>additive</font></i>, meaning the more you pick, the more properties will show up.  We'll pull everything that matches ANY of the criteria.";
box_content['needsWork'] = "<b>Needs Work:</b> A bit more than a fixer-upper, these homes usually need substantial renovations.<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=green>additive</font></i>, meaning the more you pick, the more properties will show up.  We'll pull everything that matches ANY of the criteria.";
box_content['shell'] = "<b>Shell:</b> A home that's been completely gutted<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=green>additive</font></i>, meaning the more you pick, the more properties will show up.  We'll pull everything that matches ANY of the criteria.";
box_content['rehab'] = "<b>Rehab:</b> Some listing agents will put homes that <i>need</i> to be rehabbed in this category, others will put homes that have <i>just been</i> rehabbed into this category.<p><font color=crimson><b>A Note About This Page:</font></b> The search options on this page are <i><font color=green>additive</font></i>, meaning the more you pick, the more properties will show up.  We'll pull everything that matches ANY of the criteria.";

box_content['audrey'] = "<b>We'd like you to meet Audrey.</b><hr size=1>She will be your virtual assistant to help you find your next home.  First you need to train her, here's how:  Each listing has three buttons, just press the appropriate button if you really like a home or really dislike it.  Once Audrey learns what types of homes you like, she will start emailing you similar homes when they come on the market.  To have her do this, just give us your name and email address.";

box_content['removeRestore'] = "You just removed a property from your list.  If you email this list to a friend, removed properties won't be sent.  Just 'Restore' the property to put it back on!";

box_content['foreclosures2'] = "<b>Searching For Foreclosures:</b> When you check this box, we'll search for any listings that have the following terms in the listing notes: \"bank owned\", foreclose, foreclosure, REO, \"third party\", \"party approval\", \"bank approval\", or \"short sale\"";

box_content['changes_desc'] = "<b>Anything Changes:</b> We will monitor the Sales Price and Property Status (active, withdrawn, etc.) for changes.";

box_content['nopropertiesselected'] = "You must select at least one property in order to calculate your route.";

box_content['monthly_payment'] = "Based on the assumption of a 20% down payment and 6.0% interest rate";


function hideAllSelects() {
	var selectElements = document.getElementsByTagName('select');
	for (var i=0; i < selectElements.length; i++) {
		selectElements[i].style.visibility = 'hidden';
	}
}

function showAllSelects() {
	var selectElements = document.getElementsByTagName('select');
	for (var i=0; i < selectElements.length; i++) {
		selectElements[i].style.visibility = 'visible';
	}
}

function showBox(content_id){
	hideAllSelects();
    $('box').innerHTML = '<img id="close" src="/assets/images/close.gif" onclick="hideBox()" alt="Close" title="Close this window" />' + box_content[content_id];
    $('overlay').show();
    $('overlay').style.height = document.body.clientHeight + 'px'; 
	$('box_cont').makePositioned();
	center('box_cont');
	$('box_cont').show();	
}


function _showBox(content_id){
    $('box').innerHTML = '<img id="close" src="/assets/images/close.gif" onclick="hideBox()" alt="Close" title="Close this window" />' + box_content[content_id];
    $('overlay').show();
    center('box');
    $('overlay').style.height = document.body.clientHeight + 'px';
  
    return false;
}

function hideBox(){
    $('box_cont').hide();
    $('box2_cont').hide();
	$('overlay').hide();
    showAllSelects();
    return false;
}

function center(element){
    if (element == 'box') 
        hideAllSelects();
    try{
        element = $(element);
    }catch(e){
        return;
    }

    var my_width  = 0;
    var my_height = 0;

    if ( typeof( window.innerWidth ) == 'number' ){
        my_width  = window.innerWidth;
        my_height = window.innerHeight;
    }else if ( document.documentElement && 
             ( document.documentElement.clientWidth ||
               document.documentElement.clientHeight ) ){
        my_width  = document.documentElement.clientWidth;
        my_height = document.documentElement.clientHeight;
    }
    else if ( document.body && 
            ( document.body.clientWidth || document.body.clientHeight ) ){
        my_width  = document.body.clientWidth;
        my_height = document.body.clientHeight;
    }

    element.style.position = 'absolute';
    element.style.zIndex   = 99;

    var scrollY = 0;

    if ( document.documentElement && document.documentElement.scrollTop ){
        scrollY = document.documentElement.scrollTop;
    }else if ( document.body && document.body.scrollTop ){
        scrollY = document.body.scrollTop;
    }else if ( window.pageYOffset ){
        scrollY = window.pageYOffset;
    }else if ( window.scrollY ){
        scrollY = window.scrollY;
    }

    var elementDimensions = Element.getDimensions(element);

    var setX = ( my_width  - elementDimensions.width  ) / 2;
    var setY = ( my_height - elementDimensions.height ) / 2 + scrollY;

    setX = ( setX < 0 ) ? 0 : setX;
    setY = ( setY < 0 ) ? 0 : setY;

    element.style.left = setX + "px";
    element.style.top  = setY + "px";

    element.style.display  = 'block';
}
