/*
Copyright 2006-2009 XtraLean Software, April 8, 2009
Fixed no preload when captions are off
ShutterBug helper functions
*/
var browserFade = "Undefined";
var globalCanFade = true;
var isSafari = false;
var attrArray = null;
function _addAttr(attrName)
{
value = attrArray[attrName];
if (value == null)
return "";
return attrName + '="' + value + '" ';
}
function _addParam(attrName)
{
value = attrArray[attrName];
if (value == null)
return "";
return ' \n';
}
function insertQuicktime()
{
attrArray = new Array();
attrArray["src"] = arguments[1];
attrArray["width"] = arguments[2];
attrArray["height"] = arguments[3];
attrArray["autoplay"] = arguments[4];
attrArray["controller"] = arguments[5];
attrArray["loop"] = arguments[6];
if (arguments[7] == 'true')
attrArray["hidden"] = arguments[7];
// fixed attributs
attrArray["classid"] = "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";
attrArray["pluginspage"] = "http://www.apple.com/quicktime/download/";
attrArray["codebase"] = "http://www.apple.com/qtactivex/qtplugin.cab";
attrArray["type"] = "video/quicktime";
var insertString = '\n';
var divelement = document.getElementById(arguments[0]);
divelement.innerHTML = insertString;
}
function insertFlash()
{
attrArray = new Array();
attrArray["src"] = arguments[1];
attrArray["movie"] = arguments[1];
attrArray["width"] = arguments[2];
attrArray["height"] = arguments[3];
attrArray["loop"] = arguments[4];
attrArray["scale"] = arguments[5];
attrArray["bgcolor"] = arguments[6];
attrArray["play"] = "true";
attrArray["menu"] = "false";
attrArray["quality"] = "best";
attrArray["classid"] = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
attrArray["pluginspage"] = "http://www.macromedia.com/go/getflashplayer";
attrArray["codebase"] = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";
attrArray["type"] = "application/x-shockwave-flash";
var insertString = '\n';
var divelement = document.getElementById(arguments[0]);
divelement.innerHTML = insertString;
}
function clickLink (address) {
var max = address.length;
var i;
var clickTo = '';
var c = 0;
for (i=0; i 0 && this.autoPlay == 0) {
var next, prev, count;
next = this.current;
prev = this.current;
count = 0;
do {
if (++next >= this.slides.length) next = this.firstslide;
if (--prev < 0) prev = this.slides.length - 1;
imgPreloader = new Image();
imgPreloader.src = this.slides[next].src;
imgPreloader = new Image();
imgPreloader.src = this.slides[prev].src;
} while (++count < this.prefetch);
}
if (this.repeat == false) {
if (this.prevControl) {
if (this.current == this.firstslide) {
this.prevControl.style.display = "none";
} else {
this.prevControl.style.display = "";
}
}
if (this.nextControl) {
if (this.current == this.slides.length - 1) {
this.nextControl.style.display = "none";
} else {
this.nextControl.style.display = "";
}
}
}
if (this.autoPlay == 1)
this.playnextslide();
}
this.init = function() {
if (window.clientInformation) {
if (window.clientInformation.appName.indexOf("croso") > 0)
if (window.clientInformation.platform.indexOf("PPC") > 0) {
globalCanFade = false;
}
}
if (navigator.vendor) {
if (navigator.vendor.indexOf("Apple") >= 0) {
var jk = navigator.appVersion.indexOf("Safari/");
if (jk != -1) {
var version = parseInt(navigator.appVersion.substr(jk+7,3));
if (version < 312)
globalCanFade = false;
}
isSafari = true;
}
}
this.playControl = document.getElementById('ssplay');
this.prevControl = document.getElementById('ssprev');
this.nextControl = document.getElementById('ssnext');
this.loading = document.getElementById('ssloading');
this.viewerA = document.getElementById('ssviewerA');
this.viewerB = document.getElementById('ssviewerB');
this.viewerA.style.top = "0px";
this.viewerA.style.left = "-9999px";
this.viewerB.style.top = "0px";
this.viewerB.style.left = "-9999px";
var string1 = location.hash;
var snum = string1.substring(1,string1.length);
if (snum) {
this.current = parseInt(snum);
if (this.current < this.firstslide)
this.current = this.firstslide;
} else {
if (this.random == false)
this.current = this.firstslide;
else
this.current = Math.floor((this.slides.length-this.firstslide)*Math.random()) + this.firstslide;
}
if (this.playControl && this.autoPlay==1) {
this.playControl.href = "javascript:"+this.name+".stop()";
setTimeout(this.name + ".setStopLabel()", 25);
}
setTimeout(this.name+".update()", 250);
}
this.goto_slide = function(n) {
if (this.current != n) {
if (n == -1) {
n = this.slides.length - 1;
}
if (n < this.firstslide)
n = this.firstslide;
if (n < this.slides.length && n >= this.firstslide) {
this.lastslide = this.current;
this.current = n;
}
this.stop();
this.update();
}
}
this.next = function() {
lastcurrent = this.current;
if (this.current < this.slides.length - 1) {
this.lastslide = this.current;
this.current++;
} else if (this.repeat) {
this.lastslide = this.current;
this.current = this.firstslide;
}
if (lastcurrent == this.current)
return;
this.stop();
this.update();
}
this.previous = function() {
lastcurrent = this.current;
if (this.current > this.firstslide) {
this.lastslide = this.current;
this.current--;
} else if (this.repeat) {
this.lastslide = this.current;
this.current = this.slides.length - 1;
}
if (lastcurrent == this.current)
return;
this.stop();
this.update();
}
}
//// font cracker code
function fontSpecs(id, lineheight, fontsize, classname) {
this.id = id;
this.lineheight = lineheight;
this.fontsize = fontsize;
this.classname = classname;
}
function fontCracker () {
this.fs = new Array();
this.addfs = function(id,lineheight,fontsize,classname) {
var i = this.fs.length;
this.fs[i] = new fontSpecs(id,lineheight,fontsize,classname);
}
this.crackFonts = function () {
if (document.styleSheets[0].cssRules) {
for (var i=0; i bottom)
bottom = test;
}
}
footer = document.getElementById('footerbox');
if (footer)
footer.style.top = bottom + 'px';
}
}
function putCounterAtBottomOfPage () {
var footer = document.getElementById('footerbox');
var counter = document.getElementById('counter');
if (footer && counter) {
var position = findBottom(footer);
position += 50;
counter.style.top = position + 'px';
counter.style.display = "";
}
}
TextResizeDetector.TARGET_ELEMENT_ID = 'sbpage';
TextResizeDetector.USER_INIT_FUNC = sbpageinit;
/////// before/after slideshow
function beforeafterslide(number,disable,top,left,width,height,number2,top2,left2,width2,height2) {
if (parseInt(disable) == 1) {
this.src = 'pictures/image' + number + '.jpg';
this.after = 'pictures/image' + number2 + '.jpg';
} else {
this.src = 'pictures/slide' + number + '.jpg';
this.after = 'pictures/slide' + number2 + '.jpg';
}
this.textid = 'stext' + number;
this.top = top + 'px';
this.left = left + 'px';
this.width = width + 'px';
this.height = height + 'px';
this.top2 = top2 + 'px';
this.left2 = left2 + 'px';
this.width2 = width2 + 'px';
this.height2 = height2 + 'px';
// calculate rollover size
rleft = left;
if (rleft > left2) rleft = left2;
rtop = top;
if (rtop > top2) rtop = top2;
rright = left + width;
if (rright < (left2 + width2)) rright = left2+width2;
rbottom = top + height;
if (rbottom < (top2 + height2)) rbottom = top2 + height2;
rwidth = rright - rleft;
rheight = rbottom - rtop;
this.rtop = rtop + 'px';
this.rleft = rleft + 'px';
this.rwidth = rwidth + 'px';
this.rheight = rheight + 'px';
}
function beforeafter( slideshowname ) {
this.name = slideshowname;
this.repeat = true;
this.prefetch = 2;
this.slides = new Array();
this.current = 0;
this.lastslide = -1;
this.firstslide = 0;
this.imageIn = 0;
this.imageOut = 0;
this.afterLabel = 'After';
this.beforeLabel = 'Before';
this.beforeAfterControl = 0;
this.beforeAfterStat = 0;
this.rollovers = 0;
this.prevControl = 0;
this.nextControl = 0;
this.loading = 0;
this.viewerA = 0;
this.viewerB = 0;
this.currentViewer = 0;
this.rolloverarea = 0;
this.random = false;
this.add_slide = function(number,disable,top,left,width,height,number2,top2,left2,width2,height2) {
var i = this.slides.length;
this.slides[i] = new beforeafterslide (number,disable,top,left,width,height,number2,top2,left2,width2,height2);
}
this.setBeforeLabel = function() {
this.beforeAfterControl.innerHTML = this.beforeLabel;
}
this.setAfterLabel = function() {
this.beforeAfterControl.innerHTML = this.afterLabel;
}
this.after = function() {
var slide = this.slides[ this.current ];
this.beforeAfterStat = 1;
this.imageIn.style.top = slide.top2;
this.imageIn.style.left = slide.left2;
this.imageIn.style.width = slide.width2;
this.imageIn.style.height = slide.height2;
this.imageIn.src = "bitmaps/blank.gif";
this.imageIn.src = slide.after;
if (this.beforeAfterControl) {
this.beforeAfterControl.href = "javascript:"+this.name+".before()";
setTimeout(this.name + ".setBeforeLabel()", 25);
}
}
this.before = function() {
var slide = this.slides[ this.current ];
this.beforeAfterStat = 0;
this.imageIn.style.top = slide.top;
this.imageIn.style.left = slide.left;
this.imageIn.style.width = slide.width;
this.imageIn.style.height = slide.height;
this.imageIn.src = "bitmaps/blank.gif";
this.imageIn.src = slide.src;
if (this.beforeAfterControl) {
this.beforeAfterControl.href = "javascript:"+this.name+".after()";
setTimeout(this.name + ".setAfterLabel()", 25);
}
}
this.beforeafter = function () {
if (this.beforeAfterStat == 1)
this.before();
else
this.after();
}
this.showslide = function () {
if (this.currentViewer == 0) {
this.imageOut = this.viewerA;
this.imageIn = this.viewerB;
this.currentViewer = 1;
} else {
this.imageOut = this.viewerB;
this.imageIn = this.viewerA;
this.currentViewer = 0;
}
var slide = this.slides[ this.current ];
fadeIn(100, this.imageOut);
fadeIn(0, this.imageIn);
this.imageOut.style.zIndex = 1;
this.imageIn.style.zIndex = 2;
if (this.beforeAfterStat == 0) {
this.imageIn.style.top = slide.top;
this.imageIn.style.left = slide.left;
this.imageIn.style.width = slide.width;
this.imageIn.style.height = slide.height;
this.imageIn.src = "bitmaps/blank.gif";
this.imageIn.src = slide.src;
} else {
this.imageIn.style.top = slide.top2;
this.imageIn.style.left = slide.left2;
this.imageIn.style.width = slide.width2;
this.imageIn.style.height = slide.height2;
this.imageIn.src = "bitmaps/blank.gif";
this.imageIn.src = slide.after;
}
fadeIn(0, this.imageOut);
fadeIn(100, this.imageIn);
// mouse rollover functions
if (this.rollovers == 1) {
this.rolloverarea.style.left = slide.rleft;
this.rolloverarea.style.top = slide.rtop;
this.rolloverarea.style.width = slide.rwidth;
this.rolloverarea.style.height = slide.rheight;
this.rolloverarea.style.display = "";
this.rolloverarea.style.zIndex = 3;
}
// turn off captions for all slides except the current one
for (i=0; i 0) {
var next, prev, count;
next = this.current;
prev = this.current;
count = 0;
do {
if (++next >= this.slides.length) next = this.firstslide;
if (--prev < 0) prev = this.slides.length - 1;
imgPreloader = new Image();
imgPreloader.src = this.slides[next].src;
imgPreloader = new Image();
imgPreloader.src = this.slides[next].after;
imgPreloader = new Image();
imgPreloader.src = this.slides[prev].src;
imgPreloader = new Image();
imgPreloader.src = this.slides[prev].after;
} while (++count < this.prefetch);
}
if (this.repeat == false) {
if (this.prevControl) {
if (this.current == this.firstslide) {
this.prevControl.style.display = "none";
} else {
this.prevControl.style.display = "";
}
}
if (this.nextControl) {
if (this.current == this.slides.length - 1) {
this.nextControl.style.display = "none";
} else {
this.nextControl.style.display = "";
}
}
}
}
this.init = function() {
this.beforeAfterControl = document.getElementById('ssbeforeafter');
this.prevControl = document.getElementById('ssprev');
this.nextControl = document.getElementById('ssnext');
this.loading = document.getElementById('ssloading');
this.viewerA = document.getElementById('ssviewerA');
this.viewerB = document.getElementById('ssviewerB');
this.viewerA.style.top = "0px";
this.viewerA.style.left = "-9999px";
this.viewerB.style.top = "0px";
this.viewerB.style.left = "-9999px";
if (this.rollovers) {
this.rolloverarea = document.getElementById('ssrollover');
if (this.rolloverarea) {
this.rolloverarea.slideshow = this;
this.rolloverarea.onmouseover = function() {
this.slideshow.after();
}
this.rolloverarea.onmouseout = function() {
this.slideshow.before();
}
}
}
var string1 = location.hash;
var snum = string1.substring(1,string1.length);
if (snum) {
this.current = parseInt(snum);
if (this.current < this.firstslide)
this.current = this.firstslide;
} else {
if (this.random == false)
this.current = this.firstslide;
else
this.current = Math.floor((this.slides.length-this.firstslide)*Math.random()) + this.firstslide;
}
setTimeout(this.name+".showslide()", 250);
}
this.goto_slide = function(n) {
if (this.current != n) {
if (n == -1) {
n = this.slides.length - 1;
}
if (n < this.firstslide)
n = this.firstslide;
if (n < this.slides.length && n >= this.firstslide) {
this.lastslide = this.current;
this.current = n;
}
this.showslide();
}
}
this.next = function() {
lastcurrent = this.current;
if (this.current < this.slides.length - 1) {
this.lastslide = this.current;
this.current++;
} else if (this.repeat) {
this.lastslide = this.current;
this.current = this.firstslide;
}
if (lastcurrent == this.current)
return;
this.showslide();
}
this.previous = function() {
lastcurrent = this.current;
if (this.current > this.firstslide) {
this.lastslide = this.current;
this.current--;
} else if (this.repeat) {
this.lastslide = this.current;
this.current = this.slides.length - 1;
}
if (lastcurrent == this.current)
return;
this.showslide();
}
}