$(document).ready(function() {
    
    // add glamour.css stylesheet to document
    $('head').append('<!-- JS Glamour Stylesheet -->\n <link rel="stylesheet" type="text/css" href="'+ config.STATIC_URL +'css/glamour.css" media="screen" />');
    
    // style the select elements
    if (!$.browser.opera && !$.browser.msie ) {

        $('form.location select').each(function(){
            var title = $(this).attr('title');
            if( $('option:selected', this).val() != ''  ) title = $('option:selected',this).text();
            $(this)
                .css({'z-index':2,'opacity':0,'-khtml-appearance':'none'})
                .after('<span class="select">' + title + '</span>')
                .change(function(){
                    val = $('option:selected',this).text();
                    $(this).next().text(val);
                });
        });
        
        // $('[href="#Location"]').click(function(){
        //     $('#Location').next()
        // });
        
        $('#Location').focus(function(){
            $(this).next().addClass('focusd');
        });
        
        $('#Location').blur(function(){
            $(this).next().removeClass('focusd');
        });
        
        $('[href="#Location"]').click(function(){
            $('#Location').focus();
        });
    };
    
    
    $('#startDate').datepicker();
    
    setupZoom();
    
});


$(window).load(function(){
    
    $('head').append(
        '<link rel="stylesheet" type="text/css" href="'+ config.STATIC_URL +'css/custom-theme/jquery-ui-1.8.7.custom.css" media="all" />'
    );
    
});
