﻿$(document).ready(function() {

    $('h1').mouseover(function() {
        $(this).css('cursor', 'pointer');
    }).click(function() {
        document.location = '/';
    });
    
    $('.corners').corners();
    
    $('#quickQuote label').each(function() {
        var $label = $(this);
        var $control = $('#' + $(this).attr('for'));
        $control.val($label.text());        
    }).css('display', 'none');    
    
    /*var $slideshow = $('#slideshow');    
    if ($slideshow.length > 0)
    {
	    $slideshow.loader({url:'WebService.asmx/GetImages', path: 'img/slideshow/', wrapperTag: 'li'}, function() {
	        $slideshow.easySlider({
		        controlsShow: true,
		        auto: true,
		        continuous: true,
		        speed: 1500,
		        pause: 5000	  	 
		    });
	    });
    }*/
    
    
    var $portfolio = $('#portfolio');
    if ($portfolio.length > 0)
    {
        $('#portfolio a').lightBox();
    }
    
    if ($.browser.msie && $.browser.version.substring(0, 1) === '6') 
    {
        $('#areasServicedContainer > li').click(function() {
            $('#serviceAreas').slideDown().css('margin-left', '-84px');   
        });
    }   
    
    
        
    /* Quick Quote form
    ***************************************************************************************************** */
    
    var obj = {
        'txtName': 'Name (first last)',
        'txtEmail': 'email@domain.com',
        'txtBody': 'Tell us about your project...'
    };
    
    $('#quickQuote input[type="text"], #quickQuote textarea').focus(function() {      
        var $this = $(this);
        for (var i in obj)
        {
            if (obj[i] == $this.val())
            {
                $this.val('');
                break;
            }
        }
    });
        
    $('#quickQuote input[type="text"], #quickQuote textarea').blur(function() {
        var $this = $(this);
        if ($this.val() == '')
        {
            var name = $this.attr('name').split('$').pop();
            $this.val(obj[name]);
        }                        
    });
});