//intro onMove tab and footer fades in
$(document).ready(function(){
    $('#topTab,#advTabDefault,#growl,#signBox, #consumerSignBox, #privacydis,#privacy,#disclaimer,#advTab,#footer,#signBoxContainer').hide();
    $('#fader').mousemove(function(event) {
        $('#advTabDefault').fadeIn(2000);
        $('#topTab').fadeIn(2000);
        $('#footer').fadeTo("fast", 0.65);
        $('#footer').fadeIn(2000);
        $('#fader').remove();
    });
    $(function(){
        $.fn.supersized.options = {
            startwidth: 1920,
            startheight: 1080,
            vertical_center: 1,
            slideshow: 1,
            //navigation: 1,
            transition: 1, //0-None, 1-Fade, 2-slide top, 3-slide right, 4-slide bottom, 5-slide left
            //pause_hover: 0,
            //slide_counter: 1,
            slide_captions: 1,
            slide_interval: 75000
        };
        $('#supersize').supersized();
    });
});

//Top panel slide fuction
$(document).ready(function(){
    $('#preRegister').hide();
    $('#topSlide').hide();
    $('#topTab').toggle(function() {
        $(this).addClass("active");
    }, function () {
        $(this).removeClass("active");
    });
    $('#topTab').click(function(){
        $('#topSlide').slideToggle(50);
    });
    $('.signup').click(function(){
        $('#growl').show();
        $('#preRegister').show();
    });
    
    
    $('.regAgent').click(function(){
        $('#preRegister').fadeOut();
        $('#signBox').show();
        $('#signBoxContainer').fadeIn(1000).load('register/agentReg.html');
    });

    
    /* $('.regConsumer').click(function(){
        $('#preRegister').fadeOut();
        $('#signBox').show();
        $('#signBoxContainer').fadeIn(1000).load('register/consumerReg.html');
    });
    */



    $('.privacy,.disclaimer').click(function(){
        $('#growl').show();
        $('#privacydis').show();
        if(this.className=='privacy'){
            $('#privacy').show();
            $('#privacy').load("privacydis/privacy.html")
        }
        else if(this.className=='disclaimer'){
            $('#disclaimer').show();
            $('#disclaimer').load("privacydis/disclaimer.html")
        }
    });
    $('.closeRegFormBtn').click(function(){
        $('#privacydis,#agentSignBox,#consumerSignBox,#privacy,#disclaimer,#preRegister,#growl,#signBox').hide();
        $('#signBoxContainer').load('img/whitebg.png');
    });
});

//Advanced panel slide animation
$(document).ready(function(){
    $('#advTray').hide();
    $('#advAgents').hide();
    $('#advTabDefault').click(function() {
        $('#advTabDefault').hide();
        $('#advTab').show();
        $('#advTray').show();
        $("#boxinner").animate({
            marginTop:"-185px"
        }, 0 );
    });
    $('#advTab').click(function () {
        $('advTab').hide();
        $('#advTray').hide();
        $("#boxinner").animate({
            marginTop:"-135px"
        }, 0);
        $('#advTabDefault').show();
    });
});

//password hides on click fix
$(document).ready(function() {
    $('#passwordDefault').show();
    $('#password').hide();
    $('#passwordDefault').focus(function() {
        $('#passwordDefault').hide();
        $('#password').show();
        $('#password').focus();
    });
    $('#password').blur(function() {
        if($('#password').val() == '') {
            $('#passwordDefault').show();
            $('#password').hide();
        }
    });
    $('#email,#searchBox,.inputUI').each(function() {
        var default_value = this.value;
        $(this).focus(function() {
            if(this.value == default_value) {
                this.value = '';
            }
        });
        $(this).blur(function() {
            if(this.value == '') {
                this.value = default_value;
            }
        });
    });

});

//Serch box input radio fuctions
$(document).ready(function(){
    $("input:radio").each( function() {
        (this.checked) ? $("#fake"+this.id).addClass('checkedbtn') : $("#fake"+this.id).removeClass('checkedbtn');
    });
    $("#realestatebtn").click(function(){
        $("#advProperties").show();
        $("#advAgents").hide();
        $("#agentbtn").removeClass('checkedbtn');
        $(this).addClass('checkedbtn');
        $(this.hash).trigger("click");
        return false;
    });
    $("#agentbtn").click(function(){
        $("#advAgents").show();
        $("#advProperties").hide();
        $("#realestatebtn").removeClass('checkedbtn');
        $(this).addClass('checkedbtn');
        $(this.hash).trigger("click");
        return false;
    });
});



