// /*   PLS_BannersAndScrolls.js   3/12/2010 2:42:48 PM ----------------- */
// Scrolling Ad Javascript
// copyright 3rd September 2004, by Stephen Chapman
// permission to use this Javascript on your web page is granted
// provided that all of the code in this script (including these
// comments) is used without any alteration

var aDOM = 0, ieDOM = 0, nsDOM = 0; var stdDOM = document.getElementById;
if (stdDOM) aDOM = 1; else {ieDOM = document.all; if (ieDOM) aDOM = 1; else {
var nsDOM = ((navigator.appName.indexOf('Netscape') != -1)
&& (parseInt(navigator.appVersion) ==4)); if (nsDOM) aDOM = 1;}}
function findDOM(objectId, wS) {
if (stdDOM) return wS ? document.getElementById(objectId).style:
document.getElementById(objectId);
if (ieDOM) return wS ? document.all[objectId].style: document.all[objectId];
if (nsDOM) return document.layers[objectId];
}

function findLivePageWidth() {return window.innerWidth != null? window.innerWidth: document.body.clientWidth != null? document.body.clientWidth:null;}
function findAdWidth(objectID) {var obj = findDOM(objectID,0); if(obj.offsetWidth) return obj.offsetWidth; if (obj.clip) return obj.clip.width; return 220;}
var right = 1;
var countdown = 10;
var slideDelay = 0;
var objStyle = null;

function startAd(objectID) {
if (aDOM) {
 objStyle = findDOM(objectID,1);
 var rightBoundary = findLivePageWidth() - findAdWidth(objectID);
 rightBoundary -= rightBoundary % 2;
slideAd(0,rightBoundary,rightBoundary);
}
}

function slideAd(currentPos, finalPos,rightBoundary) {
if (currentPos != finalPos) {
if (currentPos > finalPos) currentPos -= 2; else currentPos += 2;
objStyle.left = currentPos;
}
else {
 countdown--;
 if (right) {finalPos = 0; currentPos = rightBoundary; right = 0;}
 else       {finalPos = rightBoundary; currentPos = 0; right = 1;}
}
if (countdown > 0)
 setTimeout('slideAd('+currentPos+','+finalPos+','+rightBoundary+')',slideDelay);
if (countdown == 0)
 objStyle.visibility = 'hidden';
return;
}
function hideAd(objectID) {
 objStyle = findDOM(objectID,1);
 objStyle.visibility = 'hidden';
}
function displayAd(adText,cd) {
document.writeln('<div id="mainAd" onmouseover="countdown = -1;"><div align="center">\r\n'+adText+'<br \/><a href="#" onmouseover="countdown = -1;" onclick="hideAd(\'mainAd\');"><Font color=red>Close</Font><\/a>\r\n<\/div><\/div>');
countdown = cd;
startAd('mainAd');
}

/*  Cycling / Rotating Banners  */

/*------------ The "A" Group ----------------------*/
var imgs = new Array(); 
var imgcnt = 0; 
var thisimg = 0;

imgs[imgcnt++] = 'Logos\/BlizzardFenceLogoReversed.jpg';
imgs[imgcnt++] = 'Logos\/BlizzardManLogo.jpg';

function rotate() {
    if (document.images) {
        thisimg++;
        if (thisimg >= imgcnt) thisimg = 0;
            document.rollimg.src = imgs[thisimg];
            setTimeout("rotate();",2000);
        }
    }
    setTimeout("rotate();",2000); 
    
    /*  Cycling / Rotating Banners  */

/*------------ The "A" Group ----------------------*/
var imgsA = new Array();
var imgcntA = 0;
var thisimgA = 0;

imgsA[imgcntA++] = 'ScreenShots\/ASinglePageWebSite.jpg';
imgsA[imgcntA++] = 'ScreenShots\/YourFavoriteLinks.jpg';
imgsA[imgcntA++] = 'ScreenShots\/HHHGymnastics.jpg';
/*------------ The "B" Group ----------------------*/
var imgsB = new Array();
var imgcntB = 0;
var thisimgB = 0;

imgsB[imgcntB++] = 'ScreenShots\/BlackForestBakery.jpg';
imgsB[imgcntB++] = 'ScreenShots\/PLSEnergySavings.jpg';
imgsB[imgcntB++] = 'ScreenShots\/OlsenBrothersTree.jpg';
/*------------ The "C" Group ----------------------*/
var imgsC = new Array();
var imgcntC = 0;
var thisimgC = 0;

imgsC[imgcntC++] = 'ScreenShots\/NicolesCreations.jpg';
imgsC[imgcntC++] = 'ScreenShots\/RainBowCookies.jpg';
imgsC[imgcntC++] = 'ScreenShots\/LindenLine.jpg';

/*------------ The "D" Group ----------------------*/
var imgsD = new Array();
var imgcntD = 0;
var thisimgD = 0;

imgsD[imgcntD++] = 'ScreenShots\/BKSigns.jpg';
imgsD[imgcntD++] = 'ScreenShots\/CieloArtStudios.jpg';
imgsD[imgcntD++] = 'ScreenShots\/ShepherdsGateLI.jpg';

/*------------ The "E" Group ----------------------*/
var imgsE = new Array();
var imgcntE = 0;
var thisimgE = 0;

imgsE[imgcntE++] = 'ScreenShots\/888-5SpyCam.jpg';
imgsE[imgcntE++] = 'ScreenShots\/BlizzardFence.jpg';
imgsE[imgcntE++] = 'ScreenShots\/PLSSamples.jpg';







function rotateA() {
    if (document.images) {
        thisimgA++;
        if (thisimgA >= imgcntA) thisimgA = 0;
            document.rollimgA.src = imgsA[thisimgA];
            setTimeout("rotateA();",3000);
        }
    }
    setTimeout("rotateA();",2000);

function rotateB() {
    if (document.images) {
        thisimgB++;
        if (thisimgB >= imgcntB) thisimgB = 0;
            document.rollimgB.src = imgsB[thisimgB];
            setTimeout("rotateB();",3000);
        }
    }
    setTimeout("rotateB();",2000);

function rotateC() {
    if (document.images) {
        thisimgC++;
        if (thisimgC >= imgcntC) thisimgC = 0;
            document.rollimgC.src = imgsC[thisimgC];
            setTimeout("rotateC();",3000);
        }
    }
    setTimeout("rotateC();",2000);

function rotateD() {
    if (document.images) {
        thisimgD++;
        if (thisimgD >= imgcntD) thisimgD = 0;
            document.rollimgD.src = imgsD[thisimgD];
            setTimeout("rotateD();",3000);
        }
    }
    setTimeout("rotateD();",2000);

function rotateE() {
    if (document.images) {
        thisimgE++;
        if (thisimgE >= imgcntE) thisimgE = 0;
            document.rollimgE.src = imgsE[thisimgE];
            setTimeout("rotateE();",3000);
        }
    }
    setTimeout("rotateE();",2000);