/*files:js/spon.js*/
/*spon.js*/
// Adjustment: Content page header-image
    $('#image img').removeAttr('height');


// Adjustment: Height from sidebar
    var col2Height = $('#column2').height();
    var col3Height = $('#column3').height();

    if (col2Height > col3Height) {
        $('#column3').height($('#column2').height());
    }


// Function: Google Map Detail
    function setGoogleMap(a,b,c,d) {
        var address = a;
        var zipcode = b;
        var place   = c;
        var name    = d;

        var mapLocation = address + ', ' + zipcode + ' ' + place;

        $('#mapCanvas').goMap({
            address: mapLocation,
            zoom: 15,
            icon: 'images/icon_googlemap.png',
            scaleControl: true,
            maptype: 'ROADMAP',
            mapTypeControl: true,
            mapTypeControlOptions: {
                position: 'RIGHT',
                style: 'DROPDOWN_MENU'
            }
        });

        $.goMap.createMarker({
            address: mapLocation,
            title: name,
            html: '<a href="http://maps.google.com/maps?f=d&hl=en&geocode=&saddr=&daddr='+address+', '+zipcode+' '+place+'" target="_blank">'+name+'</a><br />'+address+'<br />'+zipcode+' '+place
        });
    }


// Function: Vacancy form validation
    $('#vacancy a.vacancyApply').bind('click', function(e){
        e.preventDefault();
        $('#vacancy').addClass('show');
        $('#form-100').show();
        $('#element-100-vacature').val($('#vacancy h1').html());
    });


// Function: Colorbox for footerimages
    $('#footerImages img').colorbox({
        href: function() {
            var url = $(this).attr('src');
            return url;
        },
        rel: 'footerImages',
        scalePhotos: true,
        maxWidth: '100%',
        maxHeight: '100%',
        slideshow: true,
        slideshowAuto: false,
        slideshowSpeed: 3000
    });


// Adjustment: Footer images resize + fadeclass
    if ($('#footerImages img').length > 0) {
        $('#footerImages').addClass('active');
        $('#footerImages img').each(function() {
            $(this).removeAttr('height');
            $(this).addClass('photo');
        });
    } else {
        $('#footerImages').hide();
    }


// Function: Fade thumbnail photos
    $('#contentPage .albumCollection, #footerImages').hover(function() {
        $('#contentPage .photo').hover(function() {
            $('#contentPage .photo').fadeTo(0, .7);
            $(this).fadeTo(0, 1);
        }, function() {
            $(this).fadeTo(0, .7);
        });
    }, function() {
        $('#contentPage .photo').fadeTo(0, 1);
    });



// Function: Custom validation for contactform
$('.zend_form textarea').bind('keypress keyup blur mousemove mouseup', function(e) {
    if(this.value.length > 1000) {
        this.value = this.value.substr(0, 1000);
    }
});
