﻿function startdemotouronload() {
    if (typeof (getQueryVariable('video')) != "undefined") {
        openlightbox('' + getQueryVariable('video') + '');
    }
}

function closelightbox() {
    document.getElementById('coverup').style.display = "none";
    document.getElementById('windowpane').style.display = "none";
    document.getElementById('lightbox').style.display = "none";
    if (document.getElementById('leftcolumn')) document.getElementById('leftcolumn').style.visibility = "visible";
}

function closestandalonebox() {
    document.getElementById('coverup').style.display = "none";
    document.getElementById('standalone').style.display = "none";
    document.getElementById('lightbox').style.display = "none";
    if (document.getElementById('leftcolumn')) document.getElementById('leftcolumn').style.visibility = "visible";
}

var whichpartofthetour = 1;

function openlightbox(section) {
    section = section - 1;
    whichpartofthetour = section;
    Changetutorial('next');
    document.getElementById('coverup').style.display = "block";
    document.getElementById('windowpane').style.display = "block";
    document.getElementById('lightbox').style.display = "block";
    document.getElementById('leftcolumn').style.visibility = "hidden";

}

function Changetutorial(whichway) {

    document.getElementById('prevBtn').style.display = 'block';
    document.getElementById('nextBtn').style.display = 'block';

    if (whichway == 'next') { whichpartofthetour = whichpartofthetour + 1; }
    if (whichway == 'prev') { whichpartofthetour = whichpartofthetour - 1; }

    if (whichpartofthetour == '0') {
        whichpartofthetour = 1;
        return null;
    }

    if (whichpartofthetour == '13') {
        whichpartofthetour = 12;
        return null;
    }

    LogVideoTour(whichpartofthetour);

    if (whichpartofthetour == '1') {
        var h3 = '1. Quick Search';
        var description = 'Quick Search allows you to do just what the name implies: quickly execute a <strong>Property Trade Search</strong> right from the homepage.  In this video we&rsquo;ll run a search for <strong>Office properties in Chicago</strong>, see a view of the <strong>Pricing tab</strong>, and finally we&rsquo;ll sort the results by <strong>Capitalization Rate</strong>.';
        document.getElementById('prevBtn').style.display = 'none';
    }

    if (whichpartofthetour == '2') {
        var h3 = '2. Advanced Search';
        var description = 'Advanced Search allows you to do search the same massive deals database as Quick Search.  It also enables you to specify a myriad of additional search criteria, so you can narrow your search results and zero in on the deals most relevant to you.  In this video, we&rsquo;ll do a search for <strong>Retail</strong> properties in the <strong>NYC Metro</strong> area.  We&rsquo;re going to specify that we&rsquo;re only interested in deals <strong>over $5 million</strong>, that the buildings were <strong>built after 2005</strong>, and we&rsquo;ll <strong>exclude Single Tenant</strong> properties.';
    }

    if (whichpartofthetour == '3') {
        var h3 = '3. Property Details';
        var description = 'The Property Details page shows you all the relevant information attached to a given property, as well as an advanced Google Map.  In this video, we&rsquo;ll view the details of a property by clicking on the <strong>Details icon</strong> in the search results.  We&rsquo;ll then take a brief glance at some of the details, and conclude by seeing a <strong>hybrid map/satellite view</strong> of the property.';
    }

    if (whichpartofthetour == '4') {
        var h3 = '4. Plot Comparables Set';
        var description = 'From the Search Results page, we&rsquo;ll check off the properties we wish to plot on the map, and click "<strong>Plot Comp Set</strong>."  The next page has a <strong>Google Map</strong> where we can click on the Property icons to view the <strong>Address, Price, Price per Square Foot</strong>, and the <strong>Buyer, Seller, and Brokers</strong> involved in the deal.<br /><br />The selected deals are all listed below the map with the deal specifics for you to print or export. Want all the deal specifics? Click "Show Comp Set with all property details" to get all the Property Details pages as well.';
    }

    if (whichpartofthetour == '5') {
        var h3 = '5. Export Options';
        var description = 'Sure our website looks great, and is probably the most convenient way <em><strong>ever</strong></em> to analyze RE data.  But we understand that our clients need to be able to email data back and forth, or load it onto their cell phones.  So we have a super quick and easy way to export nearly any kind of data on our site to <strong>Excel</strong> and <strong>PDF</strong> files.  In this video we&rsquo;ll do export to both Excel and PDF formats right from the Search Results page, but note that this feature is available throughout our site.';
    }

    if (whichpartofthetour == '6') {
        var h3 = '6. Topic Search';
        var description = 'Our Google-powered Topic Search allows you to search all of our reports for any word or phrase.';
    }

    if (whichpartofthetour == '7') {
        var h3 = '7. Set up a Deal Alert';
        var description = 'If you find yourself frequently searching for the same types of properties in the same area, hunting for new deals, we&rsquo;ve created a feature just for you.  Our site will do the searching for you and automatically send you an email when new deals matching your search specification are added to our database.';
    }

    if (whichpartofthetour == '8') {
        var h3 = '8. Excel Formatted Charts';
        var description = 'Our reports are all available as PDFs, but did you know the charts from each report are available in Microsoft Excel format?';
    }

    if (whichpartofthetour == '9') {
        var h3 = '9. Cap Rates & Players Tabs, Company Profiles';
        var description = 'This video will show you the <strong>Cap Rates</strong> and <strong>Players</strong> tabs of the Search Results page, and highlight some of the key information and features of the <strong>Company Profiles</strong> page.';
    }

    if (whichpartofthetour == '10') {
        var h3 = '10. Logging in & Modifying User Options';
        var description = 'You&rsquo;ll learn how to log in, and modify key preferences like measurement units, currencies, and whether sites open in a new window or not.';
    }

    if (whichpartofthetour == '11') {
        var h3 = '11. Finding Reports';
        var description = 'This video will show you exactly where to find and download our reports.';
    }

    if (whichpartofthetour == '12') {
        var h3 = '12. Troubled Asset Search';
        var description = 'RCA has synthesized data from a vast array of sources including our own transaction data, title records and CMBS files into a simple, but powerful online tool. The database has information on both securitized and non-securitized mortgages as well as additional property types that RCA has not traditionally tracked.';
        document.getElementById('nextBtn').style.display = 'none';
    }


//    if (whichpartofthetour == '21') {
//        var h3 = '1. Quick Search';
//        var description = 'Quick Search allows you to do just what the name implies: quickly execute a <strong>Property Trade Search</strong> right from the homepage.  In this video we&rsquo;ll run a search for <strong>Office properties in Chicago</strong>, see a view of the <strong>Pricing tab</strong>, and finally we&rsquo;ll sort the results by <strong>Capitalization Rate</strong>.';
//        document.getElementById('prevBtn').style.display = 'none';
//    }

//    if (whichpartofthetour == '22') {
//        var h3 = '2. Advanced Search';
//        var description = 'Advanced Search allows you to do search the same massive deals database as Quick Search.  It also enables you to specify a myriad of additional search criteria, so you can narrow your search results and zero in on the deals most relevant to you.  In this video, we&rsquo;ll do a search for <strong>Retail</strong> properties in the <strong>NYC Metro</strong> area.  We&rsquo;re going to specify that we&rsquo;re only interested in deals <strong>over $5 million</strong>, that the buildings were <strong>built after 2005</strong>, and we&rsquo;ll <strong>exclude Single Tenant</strong> properties.';
//    }

//    if (whichpartofthetour == '23') {
//        var h3 = '3. Property Details';
//        var description = 'The Property Details page shows you all the relevant information attached to a given property, as well as an advanced Google Map.  In this video, we&rsquo;ll view the details of a property by clicking on the <strong>Details icon</strong> in the search results.  We&rsquo;ll then take a brief glance at some of the details, and conclude by seeing a <strong>hybrid map/satellite view</strong> of the property.';
//    }
//    if (whichpartofthetour == '24') {
//        var h3 = '4. Plot Comparables Set';
//        var description = 'From the Search Results page, we&rsquo;ll check off the properties we wish to plot on the map, and click "<strong>Plot Comp Set</strong>."  The next page has a <strong>Google Map</strong> where we can click on the Property icons to view the <strong>Address, Price, Price per Square Foot</strong>, and the <strong>Buyer, Seller, and Brokers</strong> involved in the deal.<br /><br />The selected deals are all listed below the map with the deal specifics for you to print or export. Want all the deal specifics? Click "Show Comp Set with all property details" to get all the Property Details pages as well.';
//    }
//    if (whichpartofthetour == '25') {
//        var h3 = '5. Set Up a Deal Alert';
//        var description = 'If you find yourself frequently searching for the same types of properties in the same area, hunting for new deals, we&rsquo;ve created a feature just for you.  Our site will do the searching for you and automatically send you an email when new deals matching your search specification are added to our database.';
//    }
//    if (whichpartofthetour == '26') {
//        var h3 = '6. Trends & Trades';
//        var description = '';
//    }
//    if (whichpartofthetour == '27') {
//        var h3 = '7. Cross-Border Capital Tracker';
//        var description = '';
//    }
    var NewSwf = "FlashTour\\" + whichpartofthetour + ".swf";
    if (document.all) {
        document.tour.LoadMovie(0, NewSwf);
        document.getElementById('headlinetochange').innerHTML = h3;
        document.getElementById('texttochange').innerHTML = description;
    }
    else {
        document.embeds['tour'].src = '' + NewSwf;
        document.getElementById('headlinetochange').innerHTML = h3;
        document.getElementById('texttochange').innerHTML = description;
    }

}


function openFlashWindow(daSWF, headline) {

    document.getElementById('headline').innerHTML = headline;

    // Hide or show the correct DIVS
    document.getElementById('coverup').style.display = "block";
    document.getElementById('lightbox').style.display = "block";

    document.getElementById('windowpane').style.display = "none";
    document.getElementById('standalone').style.display = "block";

    // Get the Movie
    var NewSwf = "/FlashTour/" + daSWF + ".swf";

    //var movieObj;

    // Insert the Movie into the window
    if (document.all) {
        document.demo.LoadMovie(0, NewSwf);
        //movieObj = document.tour;
    }
    else {
        document.embeds['demo'].src = '' + NewSwf;
        //movieObj = document.embeds['demo'];
    }

//    // Get the Movie's Dimensions
//    
//    var daWidth = movieObj.TGetProperty("/", 8);
//    var daHeight = movieObj.TGetProperty("/", 9);

//    // Tell someone about it
//    alert("The current dimensions for the Flash Object (" + movieObj.name + ") are " + daWidth + " in width and " + daHeight + " in height.");

//    // Resize the Window
//    if (daWidth) {
//        document.getElementById('demo').style.width = daWidth + "px";
//        if (document.embeds['demo']) { document.embeds['demo'].style.width = daWidth + "px"; }
//    }

//    if (daHeight) {
//        document.getElementById('demo').style.height = daHeight + "px";
//        if (document.embeds['demo']) { document.embeds['demo'].style.height = daHeight + "px"; }
//    }

//    // Subfunction 
//    function getFlashObj(movie) {
//        if (window.document[movie]) {
//            return window.document[movie];
//        }
//        if (navigator.appName.indexOf("Microsoft Internet") == -1) {
//            if (document.embeds && document.embeds[movie]) {
//                return document.embeds[movie];
//            }
//        } else {
//            return document.getElementById(movie);
//        }
//    }
}

function opengenericbox(daSWF, daWidth, daHeight) {

    document.getElementById('coverup').style.display = "block";
    document.getElementById('windowpane').style.display = "block";
    document.getElementById('lightbox').style.display = "block";
    if (document.getElementById('warningtext')) document.getElementById('warningtext').style.display = "block";

    if (daWidth) {
        document.getElementById('daSWFholder').style.width = daWidth;
        if (document.embeds['daEmbed']) document.embeds['daEmbed'].style.width = daWidth;
        if (document.embeds['daSWFholder']) document.embeds['daSWFholder'].style.width = daWidth;
    }

    if (daHeight) {
        document.getElementById('daSWFholder').style.height = daHeight;
        if (document.embeds['daSWFholder']) document.embeds['daSWFholder'].style.height = daHeight;
        if (document.embeds['daEmbed']) document.embeds['daEmbed'].style.height = daHeight;
    }

    if (document.all) {
        document.daSWFholder.LoadMovie(0, daSWF);
    }
    else {
        if (document.embeds['daSWFholder']) document.embeds['daSWFholder'].src = '' + daSWF;
        if (document.embeds['daEmbed']) document.embeds['daEmbed'].src = '' + daSWF;
    }

}

function openwarningbox(daWidth, daHeight, daMessage) {

    document.getElementById('coverup').style.display = "block";
    document.getElementById('windowpane').style.display = "block";
    document.getElementById('lightbox').style.display = "block";
    document.getElementById('flashpanel').style.display = "block";
    document.getElementById('flashpanel').innerHTML = "";
    if (daWidth) {
        document.getElementById('windowpane').style.width = daWidth;
    }

    if (daHeight) {
        document.getElementById('windowpane').style.height = daHeight;
    }

    paragraphText = document.getElementById('warningtext');
    if (daMessage) paragraphText.innerHTML = daMessage;

}

//Custom openbox

function openbox(daWidth, daHeight) {

    document.getElementById('coverup').style.display = "block";
    document.getElementById('windowpane').style.display = "block";
    document.getElementById('lightbox').style.display = "block";
    if (daWidth) {
        document.getElementById('windowpane').style.width = daWidth;
    }

    if (daHeight) {
        document.getElementById('windowpane').style.height = daHeight;
    }
}

