summaryrefslogtreecommitdiff
path: root/public/javascripts/public.js
blob: 091936078aa4dd24528bde9194794579c769bcae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Shadowbox.init({
  skipSetup : true
});


$(document).ready(function(){

  Shadowbox.setup(".shadowbox_image", {gallery : "fofo"})
    
  if ($("#headline_image img").length != 0) {
    image_handler.initialize();
  }
  
  $("div#headline_image a").bind("click", function() {
    return false;
  });
  
  $("div#headline_image a img").bind("click", function(){
    $(".shadowbox_image:first").trigger("click");
  });
});


var image_handler = {
  initialize : function() {
        
    path_name     = window.location.pathname;
    locale_rexexp = /^\/(en|de)\\/;
    locale_match  = locale_rexexp.exec(path_name);
    
    if (locale_match) {
      locale = locale_match[0];
    }
    else {
      locale = "/de/";
    }
    
    path = path_name.replace(/\/(de|en)*\/*/, "");
    gallery_path = "";
  }
};