﻿var cache = [];
$.fn.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--; ) {
        var cacheImage = document.createElement('img');
        cacheImage.src = arguments[i];
        cache.push(cacheImage);
    }
}

$("").preLoadImages("images/glddheader.png", "images/glddintheader.png");

$(document).ready(function() {

    $('#ctl00_ContentPlaceHolder1_chkAgree').change(function(e) {
        if ($(this).attr('checked') == true) {
            $('#ctl00_ContentPlaceHolder1_btnSubmit').attr("disabled", false);
        } else {
            $('#ctl00_ContentPlaceHolder1_btnSubmit').attr("disabled", true);
        }

    });

    $('.homeImgLink').click(function() {
        document.location.href = 'http://www.gldd.com/';
    });


    $('.svypics').hide();
    $('.svypics').cycle({
        fx: 'fade',
        speed: 2000,
        timeout: 7000
    });
    $('.svypics').fadeIn();

    $('.svyintpics').hide();
    $('.svyintpics').cycle({
        fx: 'fade',
        speed: 2000,
        timeout: 7000
    });
    $('.svyintpics').fadeIn();

    //$("a[rel='doctype']").each(function() {
    //   alert($(this + "[rel='doctype']"));
    $("a[rel='docico'][href$='.pdf']").addClass("pdf");
    $("a[rel='docico'][href$='.doc'], a[href$='.txt'], a[href$='.rft']").addClass("txt");
    $("a[rel='docico'][href$='.zip'], a[href$='.rar']").addClass("zip");
    $("a[rel='docico'][href$='.jpg'], a[href$='.gif', a[href$='.png', a[href$='.bmp']").addClass("imgico");
    $("a[rel='docico'][href^='mailto:']").addClass("email");
    $("a[rel='docico']").filter(function() {
        return this.hostname && this.hostname !== location.hostname;
    }).addClass("external").attr("target", "_blank");
    //});
    //  var x = $("a[rel='doctype'][href$='.pdf']");


});

