window.onload=function() {

preloadImages();
CanIGetAWitness();

}


function CanIGetAWitness() {

// ** needed for the Online Print Center pages ** //
if (typeof visYear!="undefined" && typeof visYear!="null") {
init();
}


var check = document.getElementsByTagName('img');
var proceed = 0;
var logout = 0;
for (i=0;i<check.length;i++) {
if (check[i].src.indexOf('dave_15.gif')!=-1) proceed = 1;
if (check[i].src.indexOf('ff_logout.gif')!=-1) {
check[i].parentNode.parentNode.style.display = 'none';
logout = 1;
}
}

if (proceed == 0) {

var tbar = document.getElementById('tbar');
var ibar = window.frames['ibar'];

var header = document.createElement('div');
header.appendChild(document.createTextNode('Read why our clients love printing with us!'));
header.style.fontWeight = 'bold';
// header.style.fontVariant = 'small-caps';
header.style.fontSize = '18px';
header.style.lineHeight = '19px';

var hr1 = document.createElement('hr');
hr1.className = 'hbar';

var hr2 = document.createElement('hr');
hr2.className = 'hbar';

var hr3 = document.createElement('hr');
hr3.className = 'hbar';

var tcontent01 = ibar.document.getElementById('tcontent01').innerHTML;
var tcontent02 = ibar.document.getElementById('tcontent02').innerHTML;

var tauthor01 = ibar.document.getElementById('tauthor01').innerHTML;
var tauthor02 = ibar.document.getElementById('tauthor02').innerHTML;

var test01 = document.createElement('div');
var test02 = document.createElement('div');

test01.className = 'tcontent';
test02.className = 'tcontent';
test01.innerHTML = '&#147;'+tcontent01+'&#148;';
test02.innerHTML = '&#147;'+tcontent02+'&#148;';

var tauth01 = document.createElement('div');
var tauth02 = document.createElement('div');

tauth01.className = 'tauthor';
tauth02.className = 'tauthor';
tauth01.innerHTML = tauthor01;
tauth02.innerHTML = tauthor02;

tbar.appendChild(header);
tbar.appendChild(hr1);
tbar.appendChild(test01);
tbar.appendChild(tauth01);
tbar.appendChild(hr2);
tbar.appendChild(test02);
tbar.appendChild(tauth02);
tbar.appendChild(hr3);
}

if (logout == 1) {
var loglink = document.createElement('a');
loglink.setAttribute('href','index.iml?mdl=login/logout.mdl&action=logout');

var logimg = document.createElement('img');
logimg.src = 'design9/alt_2648/ff_logout.gif';
logimg.style.border = '0';

var logdiv = document.getElementById('logbutton');
logdiv.style.width = "130px";
logdiv.style.textAlign = "center";
logdiv.style.marginTop = "20px";

loglink.appendChild(logimg);
logdiv.appendChild(loglink);
}

// SURVEY-RELATED STUFF STARTS HERE //
if (proceed==1) {
var survey_image = new Image();
var survey_preload = new Image();
var survey_link = document.createElement('a');
survey_link.setAttribute('href','index.iml?mdl=2648Tandem/survey.mdl');
survey_image.src = '2648Tandem/TellUs1.gif';
survey_preload.src = '2648Tandem/TellUs2.gif';
survey_link.appendChild(survey_image);
survey_image.onmouseover = new Function("this.src='2648Tandem/TellUs2.gif'");
survey_image.onmouseout = new Function("this.src='2648Tandem/TellUs1.gif'");

var links=document.getElementsByTagName('a');
var stop=0;
for (i=0;i<links.length;i++) {
if (links[i].className=="sidekick"&&stop==0) {
links[i].parentNode.appendChild(survey_link);
stop=1;
}
}
}
// SURVEY-RELATED STUFF ENDS HERE //

}
