// ---------- Do Not Remove ----------
// Copyright 2009 Live Face On Web, LLC
// Version: 10.0.2-BkCustom
// Date: 10/14/2009
//
// Below enter the URL location where the files are residing
var lf_URL = 'http://invitation.intellipriceauto.com/invitation/';
// Below enter the URL for the close button image file
var lf_closeIMG = 'http://invitation.intellipriceauto.com/invitation/invites/btnClose.png';
// Below enter the URL for the main image file
var lf_mainIMG = 'http://invitation.intellipriceauto.com/invitation/invites/VYT_250_SM_FRONT.png';
//Below enter the transparency level of the main image
var lf_tpLevel = 85;
// Below select from a choice of Static, Relative, or Dynamic position for the LiveFaceOnWeb Presentation
// 1 = Static Position // 2 = Relative Position // 3 = Dynamic Position // 4 = Relative Position with Dynamic Preset
var lf_Position = 3;
// Below enter LiveFaceOnWeb Presentation OffSet Position
// OffSet Position specifies the top and the left position for Static and Relative Positions only
var lf_OffSet_Top_Position = 0;
var lf_OffSet_Left_Position = 0;
// Below select the preset Dynamic position for LiveFaceOnWeb Presentation
// 1 = Top left // 2 = Top right // 3 = Bottom left // 4 = Bottom right // 5 = Middle // 6 = Top // 7 = Right Middle // 8 = Bottom Middle // 9 = Left Middle of the browser screen
var lf_Position_Dynamic = 5;
// Below enter the delay lenght in seconds before LiveFaceOnWeb Presentation appears
var lf_tDLB = 0;
// Below enter the amount of seconds LiveFaceOnWeb Presentation appears after it has completed playing
var lf_tDLA = 0;
// Below select how LiveFaceOnWeb Presentation should appear for the same visitor
// 1 = Play everytime // 2 = Play ones per visitors session // 3 = Play in so many days // 4 = Play in so many minutes
var lf_PresPlay = 2;
var lf_PresPlayDays = 0;
// Below enable the Click-On-Me Functionality for LiveFaceOnWeb Presentation
var lf_cOMW = 1;
// Below enter the Click-On-Me Functionality URL
var lf_cOMURL = 'http://www.intelliprice.com/intellipricedealer/start.htm?dealerid=5495007&bid=INV002';
// Below select Click-On-Me Functionality Window Settings
// Below enable the Fade-In Effect
var lf_fIE = 1;
// Below enter the duration of Fade-In Effect in seconds
var lf_fIET = 1;
// Below enable Fade-Out Effect
var lf_fOE = 1;
// Below enter the duration of Fade-Out Effect in seconds
var lf_fOET = 1;

var lf_SWF_File_Width = 340;
var lf_SWF_File_Height = 365;
var lf_ID = 'bkAct';

var lf_divHorPos = 0;
var lf_divVerPos = 0;
var lfVersion = -1;
var arrNavInfo = [];
var lfString;
var lfParamString;
var divID = 'div' + lf_ID;
var timeoutID;

arrNavInfo.navprop = navigator.userAgent.toLowerCase();

if (navigator.vendor == 'KDE' || (document.childNodes && (!document.all || navigator.accentColorName) && !navigator.taintEnabled)) {
    arrNavInfo[0] = 'kde';
    arrNavInfo[1] = 'Safari';
} else if (window.opera && document.childNodes) {
    arrNavInfo[0] = 'opr';
    arrNavInfo[1] = 'Opera';
} else if (navigator.appName.indexOf('WebTV') + 1) {
    arrNavInfo[0] = 'wtv';
    arrNavInfo[1] = 'WebTV';
} else if (navigator.product == 'Gecko') {
    arrNavInfo[0] = 'gek';
    arrNavInfo[1] = 'Gecko engine (Mozilla, Netscape 6+ etc.)';
} else if (document.getElementById) {
    arrNavInfo[0] = 'ie';
    arrNavInfo[1] = 'Internet Explorer 5+';
} else {
    arrNavInfo[0] = 'na';
    arrNavInfo[1] = 'an unknown browser';
}
function runLFOW() {
    try {
        if (lf_PresPlay == 1) {
            lf_createCookie(lf_ID, 'on', -1);
            if (lf_tDLB > 0) {
                timeoutID = setTimeout("showLFOW_Video()", (lf_tDLB * 1000));
            } else {
                showLFOW_Video();
            }
        } else if (lf_PresPlay == 2) {
            if (lf_readCookie(lf_ID) == 'no') {
                lf_createCookie(lf_ID, 'on');
                if (lf_tDLB > 0) {
                    timeoutID = setTimeout("showLFOW_Video()", (lf_tDLB * 1000));
                } else {
                    showLFOW_Video();
                }
            }
        } else if (lf_PresPlay == 3) {
            if (lf_readCookie(lf_ID) == 'no') {
                lf_createCookie(lf_ID, 'on', lf_PresPlayDays);
                if (lf_tDLB > 0) {
                    timeoutID = setTimeout("showLFOW_Video()", (lf_tDLB * 1000));
                } else {
                    showLFOW_Video();
                }
            }
        } else if (lf_PresPlay == 4) {
            if (lf_readCookie(lf_ID) == 'no') {
                lf_createCookie(lf_ID, 'on', lf_PresPlayDays);
                if (lf_tDLB > 0) {
                    timeoutID = setTimeout("showLFOW_Video()", (lf_tDLB * 1000));
                } else {
                    showLFOW_Video();
                }
            }
        }
    } catch (e) {
        showLFOW_Video();
    }
}
if ((lf_Position !== 2) && (arrNavInfo[0] !== 'na')) {
    try {
        if (window.addEventListener) window.addEventListener('load', runLFOW, false);
        else if (window.attachEvent) window.attachEvent('onload', runLFOW);
    } catch (e) {
        runLFOW();
    }
} else {
    runLFOW();
}
function showLFOW_Video() {
    if ((lf_Position !== 2) && (arrNavInfo[0] !== 'na')) {
        try {
            var lfDiv = document.createElement('div');
            if (lfDiv === undefined) {
                lf_Position = 'err';
            } else if (lfDiv == null) {
                lf_Position = 'err';
            } else {
                lfDiv.id = divID;
                lfDiv.style.position = 'absolute';
                lfDiv.style.zIndex = 9999999999;
                if (lf_Position == 1) {
                    lfDiv.style.left = lf_OffSet_Left_Position + 'px';
                    lfDiv.style.top = lf_OffSet_Top_Position + 'px';
                } else {
                    lfDiv.style.left = 0;
                    lfDiv.style.top = 0;
                }
                lfDiv.style.height = lf_SWF_File_Height;
                lfDiv.style.width = lf_SWF_File_Width;
                lfDiv.style.visibility = 'visible';
            }
        } catch (e) {
            lf_Position = 'err';
        }
    }
    compileLFOW()
    if ((lf_Position !== 2) && (lf_Position !== 'err') && (arrNavInfo[0] !== 'na')) {
        lfDiv.innerHTML = lfString;
        document.body.appendChild(lfDiv);
    } else if (lf_Position !== 2) {
        document.write('<div id="' + divID + '" style="position: absolute;z-index: 9900;left: 0px;top: 0px;height: ' + lf_SWF_File_Height + 'px;width: ' + lf_SWF_File_Width + 'px;">' + lfString + '</div>');
    } else {
        document.write('<div id="' + divID + '" style="position: relative;z-index: 9900;left: ' + lf_OffSet_Left_Position + 'px;top: ' + lf_OffSet_Top_Position + 'px;height: ' + lf_SWF_File_Height + 'px;width: ' + lf_SWF_File_Width + 'px;">' + lfString + '</div>');
    }
    if ((lf_Position !== 1) && lf_Position !== 2) {
        switch (arrNavInfo[0]) {
            case 'ie':
                if (lf_Position !== 4) {
                    window.onscroll = ScrollHnd;
                    window.onresize = ScrollHnd;
                    window.setInterval('ScrollHnd()', 30);
                }
                break;
            case 'gek':
                if (lf_Position !== 4) {
                    if (window.onscroll === undefined) {
                        window.setInterval('ScrollHnd()', 30);
                    } else {
                        window.onscroll = ScrollHnd;
                        window.onresize = ScrollHnd;
                    }
                }
                break;
            case 'opr':
                if (lf_Position !== 4) {
                    window.onscroll = ScrollHnd;
                    window.onresize = ScrollHnd;
                }
                break;
            case 'kde':
                if (lf_Position !== 4) {
                    window.onscroll = ScrollHnd;
                    window.onresize = ScrollHnd;
                }
                break;
            case 'wtv':
                if (lf_Position !== 4) {
                    if (window.onscroll === undefined) {
                        window.setInterval('ScrollHnd()', 30);
                    } else {
                        window.onscroll = ScrollHnd;
                        window.onresize = ScrollHnd;
                    }
                }
                break;
        }
        ScrollHnd();
    }
}
function ScrollHnd() {
    try {
        var divScroll;
        var wnd;
        var screenWd = 0;
        var screenHt = 0;
        var screenX = 0;
        var screenY = 0;
        var objDoc;
        var divLeft = 0;
        var divTop = 0;

        objDoc = document;
        wnd = window;

        if (objDoc.getElementById) {
            divScroll = objDoc.getElementById(divID);
            if (divScroll.style) {
                divScroll = divScroll.style;
            }
        }
        if (window.innerHeight) {
            screenHt = wnd.innerHeight;
            screenWd = wnd.innerWidth;
        }
        else if (objDoc.documentElement && (objDoc.documentElement.clientWidth || objDoc.documentElement.clientHeight)) {
            screenWd = objDoc.documentElement.clientWidth;
            screenHt = objDoc.documentElement.clientHeight;

        }
        else if (objDoc.body && (objDoc.body.clientWidth || objDoc.body.clientHeight)) {
            screenWd = objDoc.body.clientWidth;
            screenHt = objDoc.body.clientHeight;
        }
        if (window.innerHeight) {
            screenY = wnd.pageYOffset;
            screenX = wnd.pageXOffset;
        }
        else if (objDoc.body && (objDoc.body.scrollLeft || objDoc.body.scrollTop)) {
            screenY = objDoc.body.scrollTop;
            screenX = objDoc.body.scrollLeft;
        }
        else if (objDoc.documentElement && (objDoc.documentElement.scrollLeft || objDoc.documentElement.scrollTop)) {
            screenY = objDoc.documentElement.scrollTop;
            screenX = objDoc.documentElement.scrollLeft;
        }
        divLeft = divLeft + lf_divHorPos;
        divTop = divTop + lf_divVerPos;
        divLeft = divLeft + screenX;
        divTop = divTop + screenY;
        if (lf_Position_Dynamic == 6) {
            divLeft = divLeft + ((screenWd / 2) - (lf_SWF_File_Width / 2));
        } else if (lf_Position_Dynamic == 7) {
            divLeft = divLeft + (screenWd - lf_SWF_File_Width);
            divTop = divTop + ((screenHt / 2) - (lf_SWF_File_Height / 2));
        } else if (lf_Position_Dynamic == 8) {
            divLeft = divLeft + ((screenWd / 2) - (lf_SWF_File_Width / 2));
            divTop = divTop + (screenHt - lf_SWF_File_Height);
        } else if (lf_Position_Dynamic == 9) {
            divTop = divTop + ((screenHt / 2) - (lf_SWF_File_Height / 2));
        } else {
            if (lf_Position_Dynamic == 5) {
                divLeft = divLeft + ((screenWd / 2) - (lf_SWF_File_Width / 2));
                divTop = divTop - ((screenHt / 2) - (lf_SWF_File_Height / 2));
            }
            if ((lf_Position_Dynamic % 2) == 0) {
                divLeft = divLeft + (screenWd - lf_SWF_File_Width);
            }
            if ((lf_Position_Dynamic < 3) == false) {
                divTop = divTop + (screenHt - lf_SWF_File_Height);
            }
        }
        if ((lf_Position_Dynamic == 4) && (arrNavInfo[0] !== 'ie')) {
            divLeft = divLeft - 30;
            divTop = divTop - 30;
        }
        divScroll.left = divLeft + 'px';
        if (screenHt < lf_SWF_File_Height) {
            divScroll.top = '0px';
        } else {
            divScroll.top = divTop + 'px';
        }
    } catch (e) { }
}
function compileLFOW() {
    lfParamString = '?lf_tpLevel=' + lf_tpLevel;
    lfParamString += '&lf_tDLA=' + lf_tDLA;
    lfParamString += '&lf_fIE=' + lf_fIE;
    lfParamString += '&lf_fIET=' + lf_fIET;
    lfParamString += '&lf_fOE=' + lf_fOE;
    lfParamString += '&lf_fOET=' + lf_fOET;
    lfParamString += '&lf_closeIMG=' + lf_closeIMG;
    lfParamString += '&lf_mainIMG=' + lf_mainIMG;
    lfParamString += '&lf_cOMW=' + lf_cOMW;
    lfParamString += '&lf_cOMURL=' + escape(lf_cOMURL);
    lfString = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='" + lf_SWF_File_Width + "' height='" + lf_SWF_File_Height + "' id='obj" + lf_ID + "' align='middle' codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0' >";
    lfString += "<param name='movie' value='" + lf_URL + 'bkLoader.swf' + lfParamString + "' />";
    lfString += "<param name='quality' value='high' />";
    lfString += "<param name='wmode' value='transparent' />";
    lfString += "<param name='allowScriptAccess' value='always' />";
    lfString += "<param name='loop' value='false' />";
    lfString += "<embed src='" + lf_URL + 'bkLoader.swf' + lfParamString + "' allowScriptAccess='always' quality='high' wmode='transparent' loop='false' width='" + lf_SWF_File_Width + "' height='" + lf_SWF_File_Height + "' name='obj" + lf_ID + "' align='middle' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' />";
    lfString += "</object>";
}
function lf_createCookie(strName, strValue, strDays) {
    if ((lf_PresPlay !== 4) && (strDays)) {
        var date = new Date();
        date.setTime(date.getTime() + (strDays * 24 * 60 * 60 * 1000));
        var expires = '; expires=' + date.toGMTString();
    } else if ((lf_PresPlay == 4) && (strDays)) {
        var date = new Date();
        date.setTime(date.getTime() + (strDays * 60000));
        var expires = '; expires=' + date.toGMTString();
    } else var expires = '';
    document.cookie = strName + '=' + strValue + expires + '; path=/';
}
function lf_readCookie(strName) {
    var strNameplus = strName + '=';
    var arrCk = document.cookie.split(';');
    for (var i = 0; i < arrCk.length; i++) {
        var c = arrCk[i];
        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
        if (c.indexOf(strNameplus) == 0) return c.substring(strNameplus.length, c.length);
    }
    return 'no';
}
function closeLFDiv() {
    try {
        var killDiv = document.getElementById(divID);
        document.body.removeChild(killDiv);
    } catch (e) { }
}

