// in progress
var showing = "";
function showDiv(menuID) {
if (document.getElementById) {
document.getElementById(menuID).style.zIndex = 10;
document.getElementById(menuID).style.visibility = "visible";
}
showing = menuID;
}
function hideDiv() {
if (document.getElementById) {
document.getElementById(showing).style.visibility = "hidden";
}
}
Cookie = function(name, expiration, path, domain, secure) {
this.$name = name;
this.$expiration = (expiration) ? new Date(expiration) : null;
this.$path = (path) ? path : null;
this.$domain = (domain) ? domain : null;
this.$secure = (secure) ? secure : false;
}
Cookie.prototype.store = function() {
var cookieval = "";
for(var prop in this) {
// ignore props with names that begin with '$' and also methods.
// Colons and ampersands are used for individual state variables
// we store within a single cookie value.
if ((prop.charAt(0) == '$') || ((typeof this[prop]) == 'function'))
continue;
if (cookieval != "")
cookieval += '&';
cookieval += prop + ':' + escape(this[prop]);
}
var cookie = this.$name + '=' + cookieval;
if (this.$expiration) cookie += '; expires=' + this.$expiration.toGMTString();
if (this.$path) cookie += '; path=' + this.$path;
if (this.$domain) cookie += '; domain=' + this.$domain;
if (this.$secure) cookie += '; secure';
// now store the cookie
document.cookie = cookie;
}
Cookie.prototype.load = function() {
var allcookies = document.cookie;
if (allcookies != "" && allcookies.indexOf(this.$name) != -1) {
var start = allcookies.indexOf(this.$name) + (this.$name.length + 1);
var end = (allcookies.indexOf(";", start) != -1) ? allcookies.indexOf(";", start) : allcookies.length;
var cookieval = allcookies.substring(start, end);
var a = cookieval.split('&');
for(var i=0; i < a.length; i++) {
a[i] = a[i].split(':');
}
for(var i=0; i < a.length; i++) {
this[a[i][0]] = unescape(a[i][1]);
}
return true;
} else {
return false;
}
}
function sizeFont(size) {
var i, fontLink;
for (i=0; (fontLink = document.getElementsByTagName("link")[i]); i++) {
if(fontLink.getAttribute("rel").indexOf("style") > -1 && fontLink.getAttribute("title")) {
fontLink.disabled = true;
if (fontLink.getAttribute("title") == size) {
fontLink.disabled = false;
}
}
}
oldfontimg = document.getElementById('fontimg_' + fontsize);
oldfontimg.src = oldfontimg.src.substring(0, (oldfontimg.src.length-11)) + ".gif";
fontsize = size;
fontimg = document.getElementById('fontimg_' + size);
fontimg.src = fontimg.src.substring(0, (fontimg.src.length-4)) + "_active.gif";
var fontCookie = new Cookie('fontsize', '01/01/2020', '/', '.tisch.nyu.edu');
fontCookie.fsize = size;
fontCookie.store();
}
var fontCookie = new Cookie('fontsize');
fontCookie.load();
var fontsize = (fontCookie.fsize != null) ? fontCookie.fsize : "small";
medium_font = "alternate ";
large_font = "alternate ";
if (fontsize == "medium") {
medium_font = "";
} else if (fontsize == "large") {
large_font = "";
}
document.write('');
document.write('');
function fontswitcher() {
// don't show fontswitcher if running Mac IE 5 because of horrific display problems
if (!((navigator.appName.indexOf("Microsoft") != -1) && (navigator.userAgent.indexOf("Mac") != -1))){
document.getElementById("fontswitcher").className = "fontswitcher";
fontimg = document.getElementById("fontimg_" + fontsize);
fontimg.src = fontimg.src.substring(0, (fontimg.src.length-4)) + "_active.gif";
}
}
//Begin Scrolling Functions (jquery dependent)
var scrollElement, scrollIncrement, duration, maxPosition, setLength;
var currentPosition = 1;
function scrollInit(id, increment, dur, setLen)
{
scrollElement = $(id);
scrollIncrement = increment;
duration = dur;
setLength = setLen;
maxPosition = Math.ceil(photocount/setLength);
}
function tnCheck(imageNum)
{
setNum = Math.ceil((which+1)/7);
if(setNum > currentPosition)
{
tnScroll("next");
}
else if(setNum < currentPosition && setNum != 0)
{
tnScroll("previous");
}
}
function tnScroll(direction)
{
if(direction == "next")
{
if(currentPosition+1 <= maxPosition)
{
currentPosition++;
scrollElement.animate({top: "-=" + setLength*scrollIncrement}, duration);
}
}
else if(direction == "previous")
{
if(currentPosition-1 >= 1)
{
currentPosition--;
scrollElement.animate({top: "+=" + setLength*scrollIncrement}, duration);
}
}
}
//End Scrolling Functions