var menu=function(){ var t=15,z=50,s=6,a; function dd(n){this.n=n; this.h=[]; this.c=[]} dd.prototype.init=function(p,c){ a=c; var w=document.getElementById(p), s=w.getElementsByTagName('ul'), l=s.length, i=0; for(i;i=c.mh&&f==1)){ if(f==1){c.style.filter=''; c.style.opacity=1; c.style.overflow='visible'} clearInterval(c.t); return } var d=(f==1)?Math.ceil((c.mh-h)/s):Math.ceil(h/s), o=h/c.mh; c.style.opacity=o; c.style.filter='alpha(opacity='+(o*100)+')'; c.style.height=h+(d*f)+'px' } return{dd:dd} }(); $(document).ready(function() { /* HANDLE TOGGLE VALUES IN INPUT BOXES */ var x = 0; $(".toggle").each(function() { togglevals[x] = $(this).val(); $(this).attr({"togglenum":x}); x++; }); $(".toggle").click(function() { var togglenum = $(this).attr("togglenum"); if ($(this).val() == togglevals[togglenum]) $(this).val(""); }); $(".toggle").bind("blur",function() { var togglenum = $(this).attr("togglenum"); if ($(this).val() == '') $(this).val(togglevals[togglenum]); }); /* END TOGGLE BOX HANDLING */ /* HANDLE HOVER EFFECTS */ $(".fade").css({"opacity":0.5}); $(".fade").hover(function() { $(this).fadeTo("slow",0.9); },function() { $(this).fadeTo("fast",0.5); }); /* END HOVER EFFECTS */ /* HANDLE HOVER IMAGE CHANGES */ $(".flip").hover(function() { if ($(this).attr("class").indexOf("flip") < 0) return false; $(this).attr({"src":$(this).attr("src").replace(/images\/images\//g,"images/")}); $(this).attr({"src":$(this).attr("src").replace("images/","images/images/")}); },function() { if ($(this).attr("class").indexOf("flip") < 0) return false; $(this).attr({"src":$(this).attr("src").replace("images/images/","images/")}); }); /* END HOVER IMAGE CHANGES */ /* OUR PEOPLE */ if ($("#ourPeople").length > 0) { $("#ourPeople div.box").hover(function() { var i = $(this).attr("id"); $("#"+i+" img.off").fadeOut("normal",null); $("#"+i+" img.on").fadeIn("normal",null); },function() { var i = $(this).attr("id"); $("#"+i+" img.off").fadeIn("normal",null); $("#"+i+" img.on").fadeOut("normal",null); }); } }); /* AUTO ROTATING PHOTOS */ var g_curpic = 1; var g_maxpics = 3; var g_pictimer = ''; function rotateMainPic() { if (g_pictimer != '') clearTimeout(g_pictimer); $("#pic"+g_curpic).fadeOut("slow",null); g_curpic++; if (g_curpic > g_maxpics) g_curpic = 1; $("#pic"+g_curpic).fadeIn("slow",function() { g_pictimer = setTimeout("rotateMainPic()",7000); }); } /* END AUTO ROTATING PHOTOS */ /* SWAP PHOTO */ function showSwapPhoto(id,direction) { if (id == null) { var ids = getNextAndPrevPhoto(); id = ids[direction]; if (id == undefined) return false; } $('.swapGallery img:visible').hide(); $('#photo-'+id).show(); $("#galleryTop .right a").removeClass("selected"); $("#galleryTop .right a#link-"+id).addClass("selected"); getNextAndPrevPhoto(); return false; } function getNextAndPrevPhoto() { var cur = $("#galleryTop .right a.numLink").index($(".selected")); var max = $("#galleryTop .right a.numLink").length; if (max == 1 || cur == -1) $("#nextPhotoLink, #prevPhotoLink").hide(); else { var next = cur+1; var prev = cur-1; if (next < max) { var nextImgId = $("#galleryTop .right a.numLink:eq("+next+")").attr("id").replace("link-",""); if (nextImgId*1 == 0) $("#nextPhotoLink").addClass("disabled"); else $("#nextPhotoLink").removeClass("disabled"); } else $("#nextPhotoLink").addClass("disabled"); if (prev >= 0) { var prevImgId = $("#galleryTop .right a.numLink:eq("+prev+")").attr("id").replace("link-",""); if (prevImgId*1 == 0) $("#prevPhotoLink").addClass("disabled"); else $("#prevPhotoLink").removeClass("disabled"); } else $("#prevPhotoLink").addClass("disabled"); } return [prevImgId,nextImgId]; } /* END SWAP PHOTO */