﻿
$(document).ready(function() {

    $(".signin").click(function(e) {
        e.preventDefault();
        $("fieldset#signin_menu").toggle();
        $(".signin").toggleClass("menu-open");
    });

    $("fieldset#signin_menu").mouseup(function() {
        return false
    });
    $(document).mouseup(function(e) {
        if ($(e.target).parent("a.signin").length == 0) {
            $(".signin").removeClass("menu-open");
            $("fieldset#signin_menu").hide();
        }
    });

});

jQuery(function() {
    // Colorbox Options
    $(".colorbox").live("click", function() {
        $("<a href=" + $(this).attr("href") + " />").colorbox({ open: true,
            maxWidth: 800, maxHeight: 600, resize: true, slideshow: true,
            slideshowAuto: true, next: 'Sonraki'
        });
        return false;
    });
    $(".iframe").colorbox({ width: "645", height: "540", iframe: true });
    $(".iframeProduct").colorbox({ width: "960", height: "580", iframe: true });
});


function refreshScoreTable() {
    $.ajax({
        url: "ScoreTable.aspx",
        cache: false,
        success: function(html) {
            $("#scoreTable").html(html);
        }
    });
}

function refreshColorScoreTable() {
    $.ajax({
        url: "ColorScoreTable.aspx",
        cache: false,
        success: function(html) {
            $("#scoreTable").html(html);
        }
    });
}

// activate tabs with JavaScript
// wait until document is fully scriptable
$(document).ready(function() {

	// select #flowplanes and make it scrollable. use circular and navigator plugins
    $("#flowpanes").scrollable({ size: 1, clickable: false}).circular().navigator({

		// select #flowtabs to be used as navigator
		navi: "#flowtabs",

		// select A tags inside the navigator to work as items (not direct children)
		naviItem: 'a',

		// assign "current" class name for the active A tag inside navigator
		activeClass: 'current'

	});
});

