/*
AnimLyte
©2007 Dan Schellhas
*/
var isIE = navigator.userAgent.indexOf('MSIE') + 1;
var isSafari = navigator.userAgent.indexOf('Apple') + 1;
function pDefault(e) {
if (e.preventDefault)
e.preventDefault();
e.returnValue = false;
}
function getOffsetLeft(obj) {
if (obj.parentNode != undefined) {
return parseInt(getOffsetLeft(obj.parentNode)) + parseInt(obj.offsetLeft);
}
return 0;
}
function getOffsetTop(obj) {
if (obj.parentNode != undefined) {
return parseInt(getOffsetTop(obj.parentNode)) + parseInt(obj.offsetTop);
}
return 0;
}
var screenX, screenY, scrollX, scrollY;
window.onscroll = getScreen;
function getScreen() {
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
screenX = window.innerWidth;
screenY = window.innerHeight;
scrollX = window.pageXOffset;
scrollY = window.pageYOffset;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
screenX = document.documentElement.clientWidth;
screenY = document.documentElement.clientHeight;
scrollX = document.documentElement.scrollLeft;
scrollY = document.documentElement.scrollTop;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
screenX = document.body.clientWidth;
screenY = document.body.clientHeight;
scrollX = document.body.scrollLeft;
scrollY = document.body.scrollTop;
}
}
function ani(e, t, p1) {
this.e = e;
this.t = t;
this.p1 = p1;
}
function dropStack(e, t, p1) {
this.anim = new Array();
var a = new ani(e, t, p1);
if (e) { this.anim.push(a); }
}
function pushAnim (e, index, t, p1) {
var tempa = new ani(e, t, p1);
for (var i = 0; i <= index; i++) {
if (!a[index]) {
a.push(new dropStack(null, null, null));
}
}
a[index].anim.push(tempa);
}
function dePX (s) {
if (s.substr(s.length - 2) == 'px') {
return parseInt(s.substr(0, s.length - 2));
}
else {
if (!s) {
s = 0;
}
return parseInt(s);
}
}
var ECONOMY = 1000 / 24;
var AVERAGE = 40;
var QUALITY = 20;
var an = setInterval(Animate, ECONOMY);
var idle = false;
var noClick = false; var clicked = false;
var a = new Array();
a.push(new dropStack(function () { idle = true; noClick = false; }, null, null));
//a.pushAnim(function () { alert("Huh?"); }, 5, "Me!", null);
function deIdle() {
idle = false;
}
function Animate() {
var curAnims = a.shift();
if (curAnims != undefined) {
for (var i = 0; i < curAnims.anim.length; i++) {
//if (curAnims[i].t) { alert(curAnims[i].t.id); }
curAnims.anim[i].e(curAnims.anim[i].t, curAnims.anim[i].p1);
}
}
}
function expandDown(elHeight, ppf, baseHeight) {
if (!ppf) { ppf = elHeight - baseHeight }
var dHeight = elHeight - baseHeight;
var frames = Math.ceil(dHeight / ppf);
var targets = new Array();
var temp = this;
while (temp.nodeName == "DIV") {
targets.push(temp);
temp = temp.parentNode;
}
for (var i = 1; i <= frames; i++) {
var p1 = baseHeight + dHeight - (dHeight * ((frames - i) / frames));
for (var j = 0; j < targets.length; j++) {
curHeight = targets[j].offsetHeight;
//if (!isIE) {
curHeight += ((dePX(this.style.borderWidth) * 2) + dePX(this.style.paddingTop) + dePX(this.style.paddingBottom) + dePX(this.style.marginTop) + dePX(this.style.marginBottom));
//}
var pt = curHeight + dHeight - (dHeight * ((frames - i) / frames));
if (j > 0) {
pushAnim(function (t,p1) { t.style.height = p1 + "px"; }, i, targets[j], pt);
}
else {
pushAnim(function (t,p1) { t.style.height = p1 + "px"; }, i, targets[j], p1);
}
}
}
}
function shrinkUp(elHeight, ppf) {
var targets = new Array();
var temp = this;
while (temp.nodeName == "DIV") {
targets.push(temp);
temp = temp.parentNode;
}
if (!ppf) { ppf = targets[0].offsetHeight - elHeight; }
var dHeight = targets[0].offsetHeight - elHeight;
var frames = Math.ceil(dHeight / ppf);
for (var i = 1; i <= frames; i++) {
var p1 = targets[0].offsetHeight - dHeight + (dHeight * ((frames - i) / frames));
for (var j = 0; j < targets.length; j++) {
curHeight = targets[j].offsetHeight;
var pt = curHeight - dHeight + (dHeight * ((frames - i) / frames));
if (j) {
pushAnim(function (t,p1) { t.style.height = p1 + "px"; }, i, targets[j], pt);
}
else {
pushAnim(function (t,p1) { t.style.height = p1 + "px"; }, i, targets[j], p1);
}
}
}
}
function expandUR(baseX, baseY, size, ppf, delay) {
if (!ppf) { ppf = size; }
if (!delay) { delay = 0; }
var frames = Math.ceil(size / ppf);
this.style.left = baseX;
pushAnim(function (t) { t.style.visibility = 'visible'; }, delay + 1, this);
for (var i = 1; i <= frames; i++) {
pushAnim(function (t, p1) { t.style.width = t.style.height = p1 + "px"; }, delay + i, this, (size * i / frames))
pushAnim(function (t, p1) { t.style.top = p1 + "px"; }, delay + i, this, baseY - (size * i / frames))
}
}
function expandU(baseX, baseY, size, ppf, delay) {
if (!ppf) { ppf = size; }
if (!delay) { delay = 0; }
var frames = Math.ceil(size / ppf);
if (!frames) { frames = 1; }
this.style.left = baseX;
pushAnim(function (t) { t.style.visibility = 'visible'; }, delay + 1, this);
for (var i = 1; i <= frames; i++) {
pushAnim(function (t, p1) { t.style.height = p1 + "px"; }, delay + i, this, (size * i / frames))
pushAnim(function (t, p1) { t.style.top = p1 + "px"; }, delay + i, this, baseY - (size * i / frames))
}
}
function zoomIn(centerX, centerY, sizeX, sizeY, frames, delay) {
if (!delay) { delay = 0; }
if (!frames) { frames = 1; }
//this.style.overflow = 'hidden';
this.style.height = '0px';
this.style.width = '0px';
this.style.top = centerY;
this.style.left = centerX;
pushAnim(function (t) { t.style.visibility = 'visible'; }, delay + 1, this);
for (var i = 1; i <= frames; i++) {
pushAnim(function (t, p1) { t.style.width = p1 + "px"; }, delay + i, this, (sizeX * i / frames))
pushAnim(function (t, p1) { t.style.height = t.style.fontSize = p1 + "px"; }, delay + i, this, (sizeY * i / frames))
pushAnim(function (t, p1) { t.style.top = p1 + "px"; }, delay + i, this, centerY - (sizeY / 2 * i / frames))
pushAnim(function (t, p1) { t.style.left = p1 + "px"; }, delay + i, this, centerX - (sizeX / 2 * i / frames))
}
}
function zoomVertical(centerX, centerY, sizeX, sizeY, frames, delay) {
if (!delay) { delay = 0; }
if (!frames) { frames = 1; }
this.style.overflow = 'hidden';
this.style.height = '0px';
this.style.width = '0px';
this.style.top = centerY;
this.style.left = centerX;
pushAnim(function (t) { t.style.visibility = 'visible'; }, delay + 1, this);
for (var i = 1; i <= frames; i++) {
pushAnim(function (t, p1) { t.style.width = t.style.fontSize = t.style.lineHeight = p1 + "px"; }, delay + i, this, (sizeX * i / frames))
pushAnim(function (t, p1) { t.style.height = p1 + "px"; }, delay + i, this, (sizeY * i / frames))
pushAnim(function (t, p1) { t.style.top = p1 + "px"; }, delay + i, this, centerY - (sizeY / 2 * i / frames))
pushAnim(function (t, p1) { t.style.left = p1 + "px"; }, delay + i, this, centerX - (sizeX / 2 * i / frames))
}
}
function pushLeft(baseX, size, ppf, delay) {
if (!delay) { delay = 0; }
if (!ppf) { ppf = size; }
var frames = Math.ceil(size / ppf);
this.overflow = 'hidden';
this.style.width = '0px';
this.style.left = baseX;
pushAnim(function (t) { t.style.visibility = 'visible'; }, delay + 1, this);
for (var i = 1; i <= frames; i++) {
pushAnim(function (t, p1) { t.style.width = p1 + "px"; }, delay + i, this, (size * i / frames))
pushAnim(function (t, p1) { t.style.left = p1 + "px"; }, delay + i, this, baseX - (size * i / frames))
}
}
function slideDown(startY, endY, ppf, delay) {
var delta = endY - startY;
if (!delay) { delay = 0; }
if (!ppf) { ppf = delta; }
var frames = Math.ceil(delta / ppf);
pushAnim(function (t) { t.style.visibility = 'visible'; }, delay + 1, this);
for (var i = 1; i <= frames; i++) {
pushAnim(function (t, p1) { t.style.top = p1 + "px"; }, delay + i, this, startY + (delta * i / frames))
}
}
function expandIn(sX, sY, eX, eY, ppf, delay) {
if (!ppf) { ppf = size; }
if (!delay) { delay = 0; }
var xDif = eX - sX;
var yDif = eY - sY;
if (yDif > xDif) {
var frames = Math.ceil(yDif / ppf);
}
else {
var frames = Math.ceil(xDif / ppf);
}
this.style.left = sX;
this.style.top = sY;
pushAnim(function (t) { t.style.visibility = 'visible'; }, delay + 1, this);
for (var i = 1; i <= frames; i++) {
pushAnim(function (t, p1) { t.style.width = p1 + "px"; }, delay + i, this, (xDif * i / frames))
pushAnim(function (t, p1) { t.style.height = p1 + "px"; }, delay + i, this, (yDif * i / frames))
if (xDif < 0) { pushAnim(function (t, p1) { t.style.left = p1 + "px"; }, delay + i, this, sX - (xDif * i / frames)) }
if (yDif < 0) { pushAnim(function (t, p1) { t.style.top = p1 + "px"; }, delay + i, this, sY - (yDif * i / frames)) }
}
}
function shrinkOut(ppf, delay) {
if (!ppf) { ppf = this.offsetWidth; }
if (!delay) { delay = 0; }
var xDif = this.offsetWidth;
var yDif = this.offsetHeight;
var frames = Math.ceil(xDif / ppf);
for (var i = 1; i <= frames; i++) {
pushAnim(function (t, p1) { t.style.width = p1 + "px"; }, delay + i, this, (xDif * (frames - i) / frames))
pushAnim(function (t, p1) { t.style.height = p1 + "px"; }, delay + i, this, (yDif * (frames - i) / frames))
}
pushAnim(function (t, p1) { t.style.visibility = 'hidden'; }, delay + i, this, this);
}
var calBox;
function absOffsetLeft(target) {
if (target.parentNode) {
parents = absOffsetLeft(target.parentNode);
}
else {
parents = 0;
}
if ((!isNaN(target.offsetLeft) && ((target.nodeName == "TD")))||(!target.firstChild)) {
return target.offsetLeft + parents;
}
else {
return parents;
}
}
function absOffsetTop(target) {
if (target.parentNode) {
parents = absOffsetTop(target.parentNode);
}
else {
parents = 0;
}
if ((!isNaN(target.offsetTop) && ((target.nodeName == "DIV" && target.style.position == "absolute")||(target.nodeName == "TD")))||(!target.firstChild)) {
return target.offsetTop + parents;
}
else {
return parents;
}
}
function lyteCal(target, def, box) {
calBox = document.getElementById(box);
calBox.style.visibility = "hidden";
calBox.style.border = "2px solid #383838";
calBox.style.backgroundColor = "#ffd";
calBox.style.position = "absolute";
calBox.style.width = "250px";
var targetBox = document.getElementById(target);
//calBox.style.left = absOffsetLeft(targetBox) + 'px';
//calBox.style.top = absOffsetTop(targetBox) + 'px';
calBox.innerHTML = showCal(def, target);
calBox.style.visibility = "visible";
}
function showCal(def, target) {
var yy = 0;
var mm = 0;
if (def) {
yy = def.substr(0,4);
mm = def.substr(4,2);
}
else {
var temp = new Date();
yy = temp.getFullYear();
mm = temp.getMonth();
}
var dow = ['Mon','Tue','Wed','Thu','Fri','Sat', 'Sun'];
var moy = ['January','February','March','April','May','June','July','August','September','October','November','December'];
if (mm < 0 || mm > 12) {alert('month must be between 1 and 12'); return false;}
if (yy != 0 && (yy < 1901 || yy > 2100)) {alert('year must be after 1900 and before 2101'); return false;}
var calendar = new Date();
var today = calendar.getDate();
calendar.setDate(1);
if (yy > 1900) calendar.setFullYear(yy);
if (mm > 0) calendar.setMonth(mm - 1);
var yy = year = calendar.getFullYear();
var month = calendar.getMonth();
calendar.setDate(today);
var weekday = calendar.getDay() - 1;
var dd = new Date(year, month + 1, 0);
var dim = dd.getDate();
var td_start = '
';
var cal = ''
if (document.getElementById) {
var mmb = month;
mm = month + 1;
var yya = yyb = yy;
if (mmb <1) {mmb += 12; yyb--;}
var mma = month + 2;
if (mma > 12) {mma -= 12; yya++;}
var yb = yy -1;
var ya = yy +1;
cal += ' ';
} else {cal += ' ';}
cal += ' ' + moy[month] + ' ' + year + ' | ';
for(dex=0; dex < 7; dex++) { cal += td_start + dow[dex] + '';}
cal += ' ';
var day2 = today;
for (dex = today; dex > 6; dex -=7) day2 = dex;
weekday -= day2 - 1;
while (weekday < 0) weekday += 7;
for(dex=0; dex < weekday; dex++) cal += td_start + ' ';
for(dex=1; dex <= dim; dex++) {
if(weekday == 7) {cal += ' '; weekday = 0;}
cal += td_start + ''+ dex + '';
weekday += 1;
}
for(dex=weekday; dex < 7; dex++) cal += td_start + ' '; cal += '
';
cal += ' ';
return cal;
}
function calSelect(val, target) {
calBox.style.visibility='hidden';
calBox = "";
var targetBox = document.getElementById(target);
targetBox.value = val;
targetBox.onchange();
}
// Calendar Popup
// copyright 11Nov2001, 8dec2007 by Stephen Chapman, Felgall Pty Ltd
var pagebg = '#add9f5'; // pop-up background colour
var headbg = '#cccccc'; // table heading background colour
var todaybg = '#9999cc'; // current day of month background colour
// valid range for yy is 1901 to 2100 inclusive or zero for current year
// valid range for mm is 1 to 12 or zero for current month
// permission is granted to use this javascript provided that the below code is not altered
function monthlength(month,year) {
var dd = new Date(year, month, 0);
return dd.getDate();
}
function dispCal(yy,mm) {
var dow = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
var moy = ['January','February','March','April','May','June','July','August','September','October','November','December'];
if (mm < 0 || mm > 12) {alert('month must be between 1 and 12'); return false;}
if (yy != 0 && (yy < 1901 || yy > 2100)) {alert('year must be after 1900 and before 2101'); return false;}
var calendar = new Date();
var today = calendar.getDate();
calendar.setDate(1);
if (yy > 1900) calendar.setFullYear(yy);
if (mm > 0) calendar.setMonth(mm - 1);
var yy = year = calendar.getFullYear();
var month = calendar.getMonth();
calendar.setDate(today);
var weekday = calendar.getDay();
var daysInMonth = monthlength(month,year);
var hilite_start = ' | ';
var td_start = ' | ';
var cal = '' + moy[month] + ' ' + year + ' | ';
for(dex=0; dex < 7; dex++) {if(weekday == dex) cal += td_start + '' + dow[dex] + ''; else cal += td_start + dow[dex] + '';}
cal += ' ';
var day2 = today;
for (dex = today; dex > 6; dex -=7) day2 = dex;
weekday -= day2 - 1;
while (weekday < 0) weekday += 7;
for(dex=0; dex < weekday; dex++) cal += td_start + ' ';
for(dex=1; dex <= daysInMonth; dex++) {
if(weekday == 7) {cal += ' '; weekday = 0;}
if(today==dex) cal += hilite_start + dex + ''; else cal += td_start + dex + '';
weekday += 1;
}
for(dex=weekday; dex < 7; dex++) cal += td_start + ' '; cal += '
';
if (document.getElementById && arguments.length == 2) {
var mmb = month;
mm = month + 1;
var yya = yyb = yy;
if (mmb <1) {mmb += 12; yyb--;}
var mma = month + 2;
if (mma > 12) {mma -= 12; yya++;}
var yb = yy -1;
var ya = yy +1;
cal += ' ';
} else {cal += ' ';}
cal += ' ';
return cal;
}
function calendar(yy,mm) {var cal = dispCal(yy,mm); if (!cal) return false; TheNewWin = window.open('','calendar','height=255,width=260,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); TheNewWin.document.write('Calendar<\/title>');
if (document.getElementById) TheNewWin.document.write(' |