// Allgemeine JavaScript Funktionen

$(document).ready(function()
{
	$("#subnavi ul a[rel='history']").click( function(e) { return false; e.preventDefault(); })
	ZebraTables();
	$(".noscriptanchors").prependTo("body");
    
    //$("#promotion_modal").jqm();
    //$("#promotion_modal").jqmShow();
    
    $("#recommend_modal").load("../_modal_recommend.php");
    $("#newsletter_subscription_modal").load("../_modal_newsletter.php");
    $("#offer_modal").load("../_modal_offer.php");
    
    $("#newsletter_subscription_modal").hide();
    $("#recommend_modal").hide();
    $("#promotion_modal").hide();
    $("#offer_modal").hide();

    //$("#recommend_modal").jqm();
    //$("#recommend_modal").jqmShow();
    
    $("#newsletter_subscription_modal").jqm();
    $("#button_newsletter").click(function(e) { e.preventDefault(); $("#newsletter_subscription_modal").jqmShow(); });
    
    $("#recommend_modal").jqm();
    $("#button_recommend").click(function(e) { e.preventDefault(); $("#recommend_modal").jqmShow(); });
});

function CloseContentDivs()
{
	var h = $("body").height();
	//alert (h);
    $("body").animate({ scrollTop: h }, "slow");
	//$(".navidiv").hide("slow");    
}

function UnsetNaviClass()
{
	$("#subnavi a").removeClass("selected");
}

function ZebraTables()
{
	$("table.zebra").find("tr:nth-child(even)").each(
        function(i) {
          if( 0 == $(this).find("th").length ) {
            $(this).addClass("even");
          }
        }
      );
}