2009-05-18 04:25:42 +01:00
|
|
|
/* The following serves to stretch the content div to the bottom of the margin images, or vice versa*/
|
2009-05-13 05:25:17 +01:00
|
|
|
|
2009-05-18 04:25:42 +01:00
|
|
|
function contentHeight(){
|
|
|
|
setMaxHeight($(".rightMargin,#content,.leftMargin,#col2"),$("#content"));
|
|
|
|
};
|
|
|
|
|
|
|
|
function setMaxHeight(group, target) {
|
|
|
|
tallest = 0;
|
|
|
|
group.each(function() {
|
|
|
|
thisHeight = $(this).height();
|
|
|
|
if(thisHeight > tallest) {
|
|
|
|
tallest = thisHeight;
|
2009-06-28 19:33:24 +01:00
|
|
|
};
|
2009-05-18 04:25:42 +01:00
|
|
|
});
|
|
|
|
target.height(tallest);
|
2009-06-28 19:33:24 +01:00
|
|
|
};
|
|
|
|
|
2009-05-18 04:25:42 +01:00
|
|
|
|
|
|
|
|
2009-05-19 06:32:42 +01:00
|
|
|
/*This is the jquery stuff */
|
2009-06-28 19:33:24 +01:00
|
|
|
$(document).ready(function() {
|
2009-05-13 06:22:07 +01:00
|
|
|
|
|
|
|
$('.searchable li').quicksearch({
|
|
|
|
position: 'before',
|
|
|
|
attached: 'ul.searchable',
|
|
|
|
labelText: '',
|
|
|
|
loaderText: '',
|
2009-06-28 19:33:24 +01:00
|
|
|
delay: 100});
|
2009-05-13 06:22:07 +01:00
|
|
|
|
|
|
|
$('table.searchable tr').quicksearch({
|
|
|
|
position: 'before',
|
2009-06-28 19:33:24 +01:00
|
|
|
attached: 'table.searchable:first'});
|
2009-05-13 06:22:07 +01:00
|
|
|
|
2009-06-28 19:33:24 +01:00
|
|
|
$(".killEyeCandy").click(function () {
|
|
|
|
killEyeCandy();
|
|
|
|
setCookie("eyeCandy", "False", 100);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
$(".showEyeCandy").click(function () {
|
|
|
|
showEyeCandy();
|
|
|
|
setCookie("eyeCandy", "True", 100);
|
|
|
|
}
|
|
|
|
);
|
2009-05-13 06:22:07 +01:00
|
|
|
|
2009-06-28 19:33:24 +01:00
|
|
|
$(".toggleMenu").click(function () {
|
2009-05-18 04:25:42 +01:00
|
|
|
$("ul.dropdown li:not(.toggleMenu)").toggle();
|
|
|
|
$(".toggleMenu").toggle();
|
|
|
|
});
|
|
|
|
|
2009-05-13 06:22:07 +01:00
|
|
|
$(".footer").hide();
|
|
|
|
$(".fadeIn").hide();
|
|
|
|
setTimeout("$('.leftMargin.fadeIn').fadeIn(3000);",1000);
|
|
|
|
setTimeout("$('.rightMargin.fadeIn').fadeIn(3000);",2000);
|
2009-05-19 06:32:42 +01:00
|
|
|
$("a.closeDiv").click(function () {
|
|
|
|
$(this).parent().hide();
|
|
|
|
});
|
2009-05-13 06:22:07 +01:00
|
|
|
|
|
|
|
/*$("#footerLinks").hover(
|
|
|
|
function() {$(".footer").fadeIn("slow")},
|
2009-06-28 19:33:24 +01:00
|
|
|
function() {$(".footer").fadeOut("slow")}
|
2009-05-13 06:22:07 +01:00
|
|
|
);*/
|
|
|
|
|
|
|
|
function linkHover(hoverLink,image){
|
|
|
|
|
2009-06-28 19:33:24 +01:00
|
|
|
$(hoverLink).bind('mouseover',
|
2009-05-13 06:22:07 +01:00
|
|
|
function() {
|
2009-06-28 19:33:24 +01:00
|
|
|
$(image).stop().css("opacity", "1.0").fadeIn("slow");
|
2009-05-18 04:25:42 +01:00
|
|
|
/* $(hoverLink).css("background","gray");*/
|
2009-06-28 19:33:24 +01:00
|
|
|
});
|
|
|
|
$(hoverLink).bind('mouseout',
|
2009-05-13 06:22:07 +01:00
|
|
|
function() {
|
2009-06-28 19:33:24 +01:00
|
|
|
$(image).stop().fadeOut("slow");
|
2009-05-18 04:25:42 +01:00
|
|
|
/* $(hoverLink).css("background","black");*/
|
2009-06-28 19:33:24 +01:00
|
|
|
}
|
2009-05-13 06:22:07 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2009-06-28 22:23:56 +01:00
|
|
|
function showEyeCandy(){
|
|
|
|
switchStylestyle("eyeCandy");
|
2009-06-28 19:33:24 +01:00
|
|
|
$("#eyeCandyFooterPopUps").load("/eyecandy");
|
|
|
|
$(".leftMargin,.rightMargin").show();
|
|
|
|
$(".showEyeCandy").hide();
|
|
|
|
$(".killEyeCandy").show();
|
2009-05-18 04:25:42 +01:00
|
|
|
linkHover("#cavesLink","#richardBanner");
|
|
|
|
linkHover("#caversLink","#timeMachine");
|
2009-05-13 06:22:07 +01:00
|
|
|
linkHover("#surveyBinderLink","#surveyHover");
|
2009-06-28 19:33:24 +01:00
|
|
|
linkHover("#troggle","#timeMachine");};
|
|
|
|
|
|
|
|
function killEyeCandy(){
|
2009-06-28 22:23:56 +01:00
|
|
|
switchStylestyle("plain");
|
2009-06-28 19:33:24 +01:00
|
|
|
$(".leftMargin,.rightMargin").hide();
|
|
|
|
$(".showEyeCandy").show();
|
|
|
|
$(".killEyeCandy").hide();
|
|
|
|
$("#cavesLink").unbind('mouseover').unbind('mouseout');
|
|
|
|
$("#caversLink").unbind('mouseover').unbind('mouseout');
|
|
|
|
$("#surveyBinderLink").unbind('mouseover').unbind('mouseout');
|
2009-06-28 22:23:56 +01:00
|
|
|
$("#troggle").unbind('mouseover').unbind('mouseout');
|
|
|
|
};
|
2009-06-28 19:33:24 +01:00
|
|
|
|
|
|
|
if (getCookie("eyeCandy") == "False")
|
|
|
|
{killEyeCandy();}
|
|
|
|
else
|
|
|
|
{showEyeCandy();}
|
2009-05-13 06:22:07 +01:00
|
|
|
|
2009-05-18 04:25:42 +01:00
|
|
|
/*dropdown (well, up actually) menu code from http://css-tricks.com/simple-jquery-dropdowns/*/
|
|
|
|
$("ul.dropdown li").hover(
|
|
|
|
function(){
|
|
|
|
$(this).addClass("hover");
|
|
|
|
$('ul:first',this).css('visibility','visible')
|
|
|
|
},
|
2009-06-28 19:33:24 +01:00
|
|
|
|
2009-05-18 04:25:42 +01:00
|
|
|
function(){
|
|
|
|
$(this).removeClass("hover");
|
|
|
|
$('ul:first',this).css('visibility', 'hidden');
|
2009-05-13 06:22:07 +01:00
|
|
|
});
|
2009-05-13 05:25:17 +01:00
|
|
|
|
2009-05-18 04:25:42 +01:00
|
|
|
$("ul.dropdown li ul li:has(ul)").find("a:first").append(" » ");
|
|
|
|
/* end dropdown menu code */
|
|
|
|
|
|
|
|
});
|
2009-05-13 06:22:07 +01:00
|
|
|
|
2009-06-28 19:33:24 +01:00
|
|
|
|
|
|
|
/* 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 "";
|
2009-06-28 22:23:56 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Style Sheet Switcher */
|
|
|
|
function switchStylestyle(styleName)
|
|
|
|
{
|
|
|
|
$('link[@rel*=style][title]').each(function(i)
|
|
|
|
{
|
|
|
|
this.disabled = true;
|
|
|
|
if (this.getAttribute('title') == styleName) this.disabled = false;
|
|
|
|
});
|
|
|
|
}
|