﻿

function DealerRO(ButtonName, Filename) {
    $('.' + ButtonName).attr("src", "../siteimages/" + Filename);
    $('.' + ButtonName).fadeIn('5000');
}


function ShowItem() {
    $('.HowItWorksContainerHover').hoverIntent(config);

    

    }


    var config = {
        over: makeTall, // function = onMouseOver callback (REQUIRED)    
        timeout: 500, // number = milliseconds delay before onMouseOut    
        out: makeShort // function = onMouseOut callback (REQUIRED)
    };
    
		$(document).ready(function(){
			$(".demo3 li").hoverIntent({
				over: makeTall, 
				timeout: 500, 
				out: makeShort
			});
		}); // close document.ready
 
		function makeTall(){  $(this).animate({"height":75},200);}
		function makeShort(){ $(this).animate({"height":50},200);} 

function HideItem() {


    
        $('.HowItWorksContainerHover').animate({

        width: 'toggle'
    },
        {
            duration: 150,
            specialEasing: { width: 'horizontal', height: 'easeOutBounce' }
        });
    }

//Show login container
function ShowLogin() {
    //$(".LoginContainer").show();


    $('.LoginContainer').animate({

        height: 'toggle'
    },
        {
            duration: 150,
            specialEasing: { width: 'horizontal', height: 'easeOutBounce' }
        });
    }

    //show general stats or help container
    function ShowStatsOrHelp(id1, id2, MenuLink) {
        $('.' + id1).hide();
        $('.' + id2).hide();

        $('.' + id1).show();

        if (MenuLink == 'divGeneralStatsLink') {
            $('.' + 'divGeneralStatsLink').removeClass('StatsMenuInactive ');
            $('.' + 'divGeneralStatsLink').addClass('StatsMenu');

            $('.' + 'divHelpLink').removeClass('StatsMenu');
            $('.' + 'divHelpLink').addClass('StatsMenuInactive');
            $('.MainStatsContainer').show();
        }

        if (MenuLink == 'divHelpLink') {
            $('.' + 'divHelpLink').removeClass('StatsMenuInactive ');
            $('.' + 'divHelpLink').addClass('StatsMenu');

            $('.' + 'divGeneralStatsLink').removeClass('StatsMenu ');
            $('.' + 'divGeneralStatsLink').addClass('StatsMenuInactive');
            $('.MainStatsContainer').hide();
        }
    }

    //Show advanced stats containers
    function ShowContainer(id1, id2, id3, LabelText, MenuLink) {
        //$(".LoginContainer").show();

        $('.' + id1).hide();
        $('.' + id2).hide();
        $('.' + id3).hide();

        $('.' + id1).show();
        $('.lblStatLabel').text(LabelText);

        if (MenuLink == 'divRegionsLink') {
            $('.' + 'divRegionsLink').removeClass('StatsMenuInactive ');
            $('.' + 'divRegionsLink').addClass('StatsMenu');

            $('.' + 'divCityLink').removeClass('StatsMenu');
            $('.' + 'divCityLink').addClass('StatsMenuInactive');

            $('.' + 'divDateLink').removeClass('StatsMenu ');
            $('.' + 'divDateLink').addClass('StatsMenuInactive');
        }

        if (MenuLink == 'divCityLink') {
            $('.' + 'divCityLink').removeClass('StatsMenuInactive ');
            $('.' + 'divCityLink').addClass('StatsMenu');

            $('.' + 'divRegionsLink').removeClass('StatsMenu ');
            $('.' + 'divRegionsLink').addClass('StatsMenuInactive');

            $('.' + 'divDateLink').removeClass('StatsMenu ');
            $('.' + 'divDateLink').addClass('StatsMenuInactive');
        }

        if (MenuLink == 'divDateLink') {
            $('.' + 'divDateLink').removeClass('StatsMenuInactive ');
            $('.' + 'divDateLink').addClass('StatsMenu');

            $('.' + 'divRegionsLink').removeClass('StatsMenu ');
            $('.' + 'divRegionsLink').addClass('StatsMenuInactive');

            $('.' + 'divCityLink').removeClass('StatsMenu');
            $('.' + 'divCityLink').addClass('StatsMenuInactive');
        }
    }


//Colorbox stuff

$(document).ready(function() {
    //Examples of how to assign the ColorBox event to elements
$(".LoginForm").colorbox({ iframe: true, transition: "none", innerHeight: "325px", innerWidth: "516px", scrolling: false });
    $(".ViewSpecs").colorbox({ iframe: true, transition: "none", height: "450px", width: "350px", scrolling: false });
    $(".UploadFiles").colorbox({ iframe: true, transition: "none", height: "600px", width: "700px", scrolling: false });
    $("a[rel='example2']").colorbox({ transition: "elastic", slideshow: false,arrowKey:false, height: "450px", width: "600px" });
    $(".example6").colorbox({ iframe: true, transition: "none", height: "500px", width: "550px", scrolling: false });
    $(".ForgotPassword").colorbox({ iframe: true, transition: "none", height: "250px", width: "400px", scrolling: false });


    //Example of preserving a JavaScript event for inline calls.
    $("#click").click(function() {
        $('#click').css({ "background-color": "#f00", "color": "#fff", "cursor": "inherit" }).text("Open this window again and this message will still be here.");
        return false;
    });
});





/**
* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne brian(at)cherne(dot)net
*/
(function($) { $.fn.hoverIntent = function(f, g) { var cfg = { sensitivity: 7, interval: 100, timeout: 0 }; cfg = $.extend(cfg, g ? { over: f, out: g} : f); var cX, cY, pX, pY; var track = function(ev) { cX = ev.pageX; cY = ev.pageY }; var compare = function(ev, ob) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); if ((Math.abs(pX - cX) + Math.abs(pY - cY)) < cfg.sensitivity) { $(ob).unbind("mousemove", track); ob.hoverIntent_s = 1; return cfg.over.apply(ob, [ev]) } else { pX = cX; pY = cY; ob.hoverIntent_t = setTimeout(function() { compare(ev, ob) }, cfg.interval) } }; var delay = function(ev, ob) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); ob.hoverIntent_s = 0; return cfg.out.apply(ob, [ev]) }; var handleHover = function(e) { var ev = jQuery.extend({}, e); var ob = this; if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t) } if (e.type == "mouseenter") { pX = ev.pageX; pY = ev.pageY; $(ob).bind("mousemove", track); if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout(function() { compare(ev, ob) }, cfg.interval) } } else { $(ob).unbind("mousemove", track); if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout(function() { delay(ev, ob) }, cfg.timeout) } } }; return this.bind('mouseenter', handleHover).bind('mouseleave', handleHover) } })(jQuery);





