7731298b516995c8b2d11d3880a931df47d8e853
[matthijs/projects/wipi.git] / static / exodus / js / homepage.js
1 var active = false;\r
2 \r
3 //changes the preview image\r
4 function switchCloseup(to) {\r
5         /* Deselect all closeups */\r
6         $(".closeup div").removeClass('selected');\r
7         /* Select the wanted one */\r
8         $(".closeup div." + to).addClass('selected');\r
9 }\r
10 \r
11 //hides all previewcontent and reveales the selected info\r
12 function switchInfo(cls) {\r
13         /* Deselect all summaries */\r
14         $(".summary div").removeClass('selected');\r
15         /* Select the wanted one */\r
16         $(".summary div." + cls).addClass('selected');\r
17         /* Save the selected area to reset to on mouseout */\r
18         active = cls;\r
19 }\r
20 \r
21 //after loading the document do this:\r
22 $(document).ready( function () {\r
23         $("area").mouseout (function (){\r
24                 /* Switch back to the selected area */\r
25                 switchCloseup(active);\r
26         });\r
27 \r
28         $("area").mousemove (function (){\r
29                 /* Switch to the area we're hovering over */\r
30                 switchCloseup($(this).attr('class'));\r
31         });\r
32 \r
33         $("area").click (function (){\r
34                 /* Select a different area */\r
35                 switchInfo($(this).attr('class'));\r
36                 return false;\r
37         });\r
38 });\r