summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
Diffstat (limited to 'media')
-rw-r--r--media/js/base.js91
1 files changed, 71 insertions, 20 deletions
diff --git a/media/js/base.js b/media/js/base.js
index 62a72f4..91305a2 100644
--- a/media/js/base.js
+++ b/media/js/base.js
@@ -10,34 +10,40 @@ function setMaxHeight(group, target) {
thisHeight = $(this).height();
if(thisHeight > tallest) {
tallest = thisHeight;
- }
+ };
});
target.height(tallest);
-}
+};
+
/*This is the jquery stuff */
-$(document).ready(function() {
+$(document).ready(function() {
$('.searchable li').quicksearch({
position: 'before',
attached: 'ul.searchable',
labelText: '',
loaderText: '',
- delay: 100
-})
+ delay: 100});
$('table.searchable tr').quicksearch({
position: 'before',
- attached: 'table.searchable:first',
-});
+ attached: 'table.searchable:first'});
-$(".toggleEyeCandy").click(function () {
- $(".leftMargin,.rightMargin").toggle("fade");
- $(".toggleEyeCandy").toggle();
- });
+$(".killEyeCandy").click(function () {
+ killEyeCandy();
+ setCookie("eyeCandy", "False", 100);
+ }
+ );
+
+$(".showEyeCandy").click(function () {
+ showEyeCandy();
+ setCookie("eyeCandy", "True", 100);
+ }
+ );
-$(".toggleMenu").click(function () {
+$(".toggleMenu").click(function () {
$("ul.dropdown li:not(.toggleMenu)").toggle();
$(".toggleMenu").toggle();
});
@@ -52,30 +58,50 @@ $("a.closeDiv").click(function () {
/*$("#footerLinks").hover(
function() {$(".footer").fadeIn("slow")},
- function() {$(".footer").fadeOut("slow")}
+ function() {$(".footer").fadeOut("slow")}
);*/
function linkHover(hoverLink,image){
-$(hoverLink).hover(
+$(hoverLink).bind('mouseover',
function() {
- $(image).fadeIn("slow");
+ $(image).stop().css("opacity", "1.0").fadeIn("slow");
/* $(hoverLink).css("background","gray");*/
- },
+ });
+$(hoverLink).bind('mouseout',
function() {
- $(image).fadeOut("slow");
+ $(image).stop().fadeOut("slow");
/* $(hoverLink).css("background","black");*/
- }
+ }
);
};
+function showEyeCandy(){
+$("#eyeCandyFooterPopUps").load("/eyecandy");
+$(".leftMargin,.rightMargin").show();
+$(".showEyeCandy").hide();
+$(".killEyeCandy").show();
linkHover("#cavesLink","#richardBanner");
linkHover("#caversLink","#timeMachine");
linkHover("#surveyBinderLink","#surveyHover");
-linkHover("#troggle","#timeMachine");
+linkHover("#troggle","#timeMachine");};
+
+function killEyeCandy(){
+$(".leftMargin,.rightMargin").hide();
+$(".showEyeCandy").show();
+$(".killEyeCandy").hide();
+$("#cavesLink").unbind('mouseover').unbind('mouseout');
+$("#caversLink").unbind('mouseover').unbind('mouseout');
+$("#surveyBinderLink").unbind('mouseover').unbind('mouseout');
+$("#troggle").unbind('mouseover').unbind('mouseout');};
+
+if (getCookie("eyeCandy") == "False")
+ {killEyeCandy();}
+else
+ {showEyeCandy();}
/*dropdown (well, up actually) menu code from http://css-tricks.com/simple-jquery-dropdowns/*/
$("ul.dropdown li").hover(
@@ -83,7 +109,7 @@ $("ul.dropdown li").hover(
$(this).addClass("hover");
$('ul:first',this).css('visibility','visible')
},
-
+
function(){
$(this).removeClass("hover");
$('ul:first',this).css('visibility', 'hidden');
@@ -94,3 +120,28 @@ $("ul.dropdown li").hover(
});
+
+/* Cookies */
+function setCookie(c_name,value,expiredays)
+{
+var exdate=new Date();
+exdate.setDate(exdate.getDate()+expiredays);
+document.cookie=c_name + "=" +escape(value) +
+((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) + ";path=/";
+}
+
+function getCookie(c_name)
+{
+if (document.cookie.length>0)
+ {
+ c_start=document.cookie.indexOf(c_name + "=");
+ if (c_start!=-1)
+ {
+ c_start=c_start + c_name.length+1;
+ c_end=document.cookie.indexOf(";",c_start);
+ if (c_end==-1) c_end=document.cookie.length;
+ return unescape(document.cookie.substring(c_start,c_end));
+ }
+ }
+return "";
+}; \ No newline at end of file