/* DEBS AD*/
var blnSlidingAd;
var blnSlideAdDown;
var objDebsAd;
var intCurrentDebsAdHeight = 0;
var intMaxDebsAdHeight = 500;
var timerSlidingDebsAd;
var intMax02AdHeight = 500;
var intCurrent02AdHeight = 0;
var timerSliding02Ad;

function showAd(type)
{
if(type == "debs"){
    if (blnSlidingAd != true)
        {
        blnSlidingAd = true;
        blnSlideAdDown = (intCurrentDebsAdHeight == 0) ? true : false;

        objDebsAd = document.getElementById("debsAd");
        objDebsAd.style.height = intCurrentDebsAdHeight + "px";

        timerSlidingDebsAd = setInterval("slideDebsAd()",5);
        }
}
else
{
    if (blnSlidingAd != true)
        {
        blnSlidingAd = true;
        blnSlideAdDown = (intCurrent02AdHeight == 0) ? true : false;

        obj02Ad = document.getElementById("Ad02");
        obj02Ad.style.height = intCurrent02AdHeight + "px";

        timerSliding02Ad = setInterval("slide02Ad()",5);
        }
    }
}



function slideDebsAd()
{
if (blnSlideAdDown)
    {
    intCurrentDebsAdHeight = (intCurrentDebsAdHeight + 40 > intMaxDebsAdHeight) ? intMaxDebsAdHeight : intCurrentDebsAdHeight + 40;
    }
else
    {
    intCurrentDebsAdHeight = (intCurrentDebsAdHeight - 40 < 0) ? 0 : intCurrentDebsAdHeight - 40;
    }

objDebsAd.style.height = intCurrentDebsAdHeight + "px";

if (intCurrentDebsAdHeight == 0 || intCurrentDebsAdHeight == intMaxDebsAdHeight)
    {
    clearInterval(timerSlidingDebsAd);
    blnSlidingAd = false;
    }
}

function slide02Ad()
{
if (blnSlideAdDown)
    {
    intCurrent02AdHeight = (intCurrent02AdHeight + 40 > intMax02AdHeight) ? intMax02AdHeight : intCurrent02AdHeight + 40;
    }
else
    {
    intCurrent02AdHeight = (intCurrent02AdHeight - 40 < 0) ? 0 : intCurrent02AdHeight - 40;
    }

obj02Ad.style.height = intCurrent02AdHeight + "px";

if (intCurrent02AdHeight == 0 || intCurrent02AdHeight == intMax02AdHeight)
    {
    clearInterval(timerSliding02Ad);
    blnSlidingAd = false;
    }
}


/* DEBS AD*/




var blnSliding;
var blnDoneOnce;
var blnSlideLeft;
var objCurrentImage;
var objNextImage;
var intCurrentImagePosition;
var intNextImagePosition;
var intCurrentImageNumber = 1;
var timerSliding;



function moveSlide(intDirection)
{
var intNewImgNumber = (intDirection == 0) ? parseInt(intCurrentImageNumber) - 1 : parseInt(intCurrentImageNumber) + 1;

if (intNewImgNumber == 0 || intNewImgNumber == -1)
    {
    intNewImgNumber = 12;
    }
else if (intNewImgNumber == 13)
    {
    intNewImgNumber = 1;
    }

showSlide(intNewImgNumber);
}



function showSlide(intImageNumber)
{
if (blnSliding != true)
    {
    if (blnDoneOnce != true)
        {
        objCurrentImage = document.getElementById("slideShowImage1");
        }

    objNextImage = document.getElementById("slideShowImage" + intImageNumber);

    if (objCurrentImage != objNextImage)
        {
        blnSliding = true;

        intCurrentImagePosition = 0;

        if (parseInt(intCurrentImageNumber) < parseInt(intImageNumber))
            {
            blnSlideLeft = true;
            intNextImagePosition = 361;
            }
        else
            {
            blnSlideLeft = false;
            intNextImagePosition = -361;
            }

        objNextImage.style.left = intNextImagePosition + "px";
        objNextImage.style.display = "block";

        timerSliding = setInterval("slideImage()",10);
        blnDoneOnce = true;
        }
    }
}



function slideImage()
{
if (blnSlideLeft)
    {
    intCurrentImagePosition = intCurrentImagePosition - 10;
    intNextImagePosition = intNextImagePosition - 10;
    }
else
    {
    intCurrentImagePosition = intCurrentImagePosition + 10;
    intNextImagePosition = intNextImagePosition + 10;
    }

objCurrentImage.style.left = intCurrentImagePosition + "px";
objNextImage.style.left = intNextImagePosition + "px";

if (intNextImagePosition == 1 || intNextImagePosition == -1)
    {
    objNextImage.style.left = "0px";

    clearInterval(timerSliding);
    blnSliding = false;

    var objPhotoCaptionDiv = document.getElementById("photoCaption");

    if (objPhotoCaptionDiv.hasChildNodes())
        {
        while (objPhotoCaptionDiv.childNodes.length >= 1)
            {
            objPhotoCaptionDiv.removeChild(objPhotoCaptionDiv.firstChild);
            }
        }

    intCurrentImageNumber = objNextImage.id.substring(14);

    var objNewCaption = document.createElement("p");
    objNewCaption.innerHTML = intCurrentImageNumber + " of 19";
    objPhotoCaptionDiv.appendChild(objNewCaption);

    objCurrentImage.style.display = "none";
    objCurrentImage = objNextImage;
    }
}












function doWebsiteBy(blnOnOff, strPath)
{
if (blnOnOff == 1)
    {
    document.getElementById("websiteByNames").className = "showThis";
    //document.getElementById("seraphimImg").src = strPath + "images/seraphim1.jpg";
    document.getElementById("demonDesignImg").src = strPath + "images/demondesign1.jpg";
    }
else
    {
    document.getElementById("websiteByNames").className = "hideThis";
    //document.getElementById("seraphimImg").src = strPath + "images/seraphim.jpg";
    document.getElementById("demonDesignImg").src = strPath + "images/demondesign.jpg";
    }
}



function changeClass(strID, strClassNameOff, strClassNameOn)
{
var objObject = document.getElementById(strID);
objObject.className = (objObject.className == strClassNameOff) ? strClassNameOn : strClassNameOff;
}



function readMore(blnOn)
{
document.getElementById("readMoreLink").className = (blnOn == 1) ? "hideThis" : "showThis";
document.getElementById("readMore").className = (blnOn == 1) ? "showThis" : "hideThis";
}



function openPopup(intWidth, intHeight, strURL)
{
var intLeft = (screen.width) ? (screen.width - intWidth) / 2 : 0;
var intTop = (screen.height) ? (screen.height - intHeight) / 2 : 0;

var strSettings = "height=" + intHeight;
strSettings += ",left=" + intLeft;
strSettings += ",top=" + intTop;
strSettings += ",width=" + intWidth;
strSettings += ",toolbar=0";
strSettings += ",scrollbars=0";
strSettings += ",statusbar=0";
strSettings += ",menubar=0";
strSettings += ",resizable=0";

window.open(strURL, "popVirtualTour", strSettings);
}



function goURL(strURL)
{
window.location.href = strURL;
}


function showOffer(blnOpenClose)
{
document.getElementById("offerText").style.display = (blnOpenClose == 1) ? "block" : "none";
 
}
