function initializeJQueryCode() {
    $('.marquee-cycle').cycle({ fx: 'fade', speed: 2000, timeout: 5000 });

    $(".colorbox").colorbox({
        transition: "none",
        width: "80%",
        height: "90%",
        iframe: true
    });

    $(".select_all input:checkbox").click(function() {
       
       
        $(".grid_selectable input:checkbox").attr("checked", function() {
            this.checked = !(this.checked == true);
        });

    });
}

$(document).ready(function() {
    initializeJQueryCode();
});


function PopupWindow(aUrl, w, h, sb, rs, tb, dir, st, mnu){
	if (!sb) sb = "yes"; if (!rs) rs = "yes"; if (!tb) tb = "no"; if (!dir) dir = "no"; if (!st) st = "no"; if (!mnu) mnu = "no";
	popupWin=window.open(aUrl,"PopupWin","scrollbars="+sb+",resizable="+rs+",toolbar="+tb+",directories="+dir+",status="+st+",menubar="+mnu+",width="+w+",height="+h+",resizable=yes");
	popupWin.self.focus();
}

function HideShowControl(ctrlid) {
    var ctrl = document.getElementById(ctrlid);
    if (ctrl.style.display == "none") {
        ctrl.style.display = "";
    }
    else {
        ctrl.style.display = "none";
    }
}

function HideControl() {
    var ctrl;

    for (i = 0; i < arguments.length; i++) {
        ctrl = document.getElementById(arguments[i]);
        if (ctrl.style.display != "none") {
            ctrl.style.display = "none";
        }
    }
}

function ShowControl() {
    var ctrl;

    for (i = 0; i < arguments.length; i++) {
        ctrl = document.getElementById(arguments[i]);

        if (ctrl.style.display == "none") {
            ctrl.style.display = "";
        }
    }
}

function vimeoLoadingThumb(id) {
    var url = "http://vimeo.com/api/v2/video/" + id + ".json?callback=showThumb";

    var id_img = "#vimeo-" + id;
    $(id_img).before('<script type="text/javascript" src="' + url + '"></script>');
}


function showThumb(data) {
    var id_img = "#vimeo-" + data[0].id;
    $(id_img).attr('src', data[0].thumbnail_medium);
}

//function LoadSystemBuilderDefaults(seasonDefault, speciesDefault, terrainDefault) {

//    var season = document.getElementById(seasonDefault);
//    if (season) season.checked = true;
//}

