﻿


//Sprachen wechseln
function switchLang(link, frame){
    $(document).ready(function() {
        $(link).click(function() {
        $("#pagerRight > div").hide(); 
        $(frame).show(); 
        $("#sprachFrame a").css("background-position", "0 0"); 
        $(link).css("background-position", "0 -11px");         
        $.cookie('link', link, { path: '/', expires: 10 });
        $.cookie('frame', frame, { path: '/', expires: 10 });
        });
    });
}

//Sprachen in cookie speichern
$(document).ready(function() { 

    if($.cookie('link')!=null) {
        $("#pagerRight > div").hide();              
        $($.cookie('frame')).show(); 
        $("#sprachFrame a").css("background-position", "0 0");
        $($.cookie('link')).css("background-position", "0 -11px");    
    } 
});

// jSlide (Link-Vorheriges Bild, Link-Nächstes Bild, DIV mit Bildern)    	
function jSlide(prev, next, frame){    
    $(document).ready(function() {
        var curr = 0;
        var c = $(frame + " img");
        // Nächstes Bild    
        $(next).click(function() {
            c.hide(); 
            curr = Math.abs((curr + 1) % c.length);       
            $(frame + " img:eq(" + curr + ")").show();  
        });    
        // Vorheriges Bild
        $(prev).click(function() {  
            if (curr == 0){curr = c.length;} 
            c.hide();
            curr = curr - 1;  
            $(frame + " img:eq(" + curr + ")").show(); 
        }); 
    }); 
}

jSlide("#lnkPrev", "#lnkNext, #imgFrame img", "#imgFrame");

