﻿
function init() {
    $('#Accordion > li.bg5').css('width', '480px');
    $('.heading', '#Accordion > li.bg5').stop(true, true).fadeOut();
    $('.bg-description', '#Accordion > li.bg5').stop(true, true).slideDown(500);
    $('.description', '#Accordion > li.bg5').stop(true, true).fadeIn();
}
jQuery.fn.center = function () {
    this.css("position", "absolute");
    this.css("top", ($(window).height() - this.height()) / 2 + $(window).scrollTop() + "px");
    this.css("left", ($(window).width() - this.width()) / 2 + $(window).scrollLeft() + "px");
    return this;
}
$(document).ready(function () {

    $('body').show();
    $(window).resize(function () {
        $('#Wrapper').center();
    });
    $('#Wrapper').center();
    $('#SliderContainer').show();

    $('.waterproofing').click(function () {
        window.location = "Pillar-Construction-Services.asp#s_waterproofing";
    });

    $('.envelope').click(function () {
        window.location = "Pillar-Construction-Services.asp#s_envelope";
    });

    $('.eifs-stucco').click(function () {
        window.location = "Pillar-Construction-Services.asp#s_eifsstucco";
    });

    $('.drywall').click(function () {
        window.location = "Pillar-Construction-Services.asp#s_drywall";
    });

    $('.restoration').click(function () {
        window.location = "Pillar-Construction-Services.asp#s_restoration";
    });

    $("#TopNavigationHP").find("a").each(function (i) {
        $(this).removeClass('top-navigation-on');
        $(this).addClass('top-navigation-off');
    });

    $('#Accordion > li').hover(
			function () {
			    var $this = $(this);
			    $this.stop().animate({ 'width': '480px' }, 1500);
			    $('.heading', $this).stop(true, true).fadeOut();
			    $('.bg-description', $this).stop(true, true).slideDown(1200);
			    $('.description', $this).stop(true, true).fadeIn();
			    $('#SliderContainer').css({ 'z-index': '0' });
			},
			function () {
			    var $this = $(this);
			    $this.stop().animate({ 'width': '130px' }, 1500);
			    $('.heading', $this).stop(true, true).fadeIn();
			    $('.description', $this).stop(true, true).fadeOut(1200);
			    $('.bg-description', $this).stop(true, true).slideUp(1200);
			    $('#SliderContainer').delay(500).fadeIn(3000);
			    $('#SliderContainer').css({ 'z-index': '300' });
			});

    $("#PillarSlider").easySlider({
        auto: true,
        continuous: true,
        controlsShow: false,
        speed: 5000,
        pause: 1000
    });

    $(".hpSliderThing").fancybox({
        'autoDimensions': true,
        'transitionIn': 'elastic',
        'transitionOut': 'elastic'
    });

});
