// ---------- Do Not Remove ----------
// Copyright 2009 Live Face On Web, LLC
// Version: 10.0.2-BkCustom
// Date: 10/14/2009
//
var VER_lf_URL = 'http://invitation.intellipriceauto.com/invitation/';
var VER_lf_closeIMG = 'http://invitation.intellipriceauto.com/invitation/invites/btnClose1x1.png';
var VER_lf_mainIMG = 'http://invitation.intellipriceauto.com/invitation/invites/VYT_BLANK_FRONT.png';
var VER_lf_tpLevel = 85;
var VER_lf_Position = 3;
var VER_lf_OffSet_Top_Position = 0;
var VER_lf_OffSet_Left_Position = 0;
var VER_lf_Position_Dynamic = 6;
var VER_lf_tDLB = 0;
var VER_lf_tDLA = 0;
var VER_lf_PresPlay = 2;
var VER_lf_PresPlayDays = 0;
var VER_lf_cOMW = 1;
var VER_lf_cOMURL = 'http://www.intelliprice.com/intellipricedealer/start.htm?dealerid=7339001&bid=INV000';
var VER_lf_fIE = 1;
var VER_lf_fIET = 1;
var VER_lf_fOE = 1;
var VER_lf_fOET = 1;

var VER_lf_SWF_File_Width = 1;
var VER_lf_SWF_File_Height = 1;
var VER_lf_BlankID = 'cpnBlank';

var VER_lf_divHorPos = 0;
var VER_lf_divVerPos = 0;
var VER_lfVersion = -1;
var VER_arrNavInfo = [];
var VER_lfString;
var VER_lfParamString;
var VER_divID = 'div' + VER_lf_BlankID;
var VER_timeoutID;

VER_arrNavInfo.navprop = navigator.userAgent.toLowerCase();

if (navigator.vendor == 'KDE' || (document.childNodes && (!document.all || navigator.accentColorName) && !navigator.taintEnabled)) {
    VER_arrNavInfo[0] = 'kde';
    VER_arrNavInfo[1] = 'Safari';
} else if (window.opera && document.childNodes) {
    VER_arrNavInfo[0] = 'opr';
    VER_arrNavInfo[1] = 'Opera';
} else if (navigator.appName.indexOf('WebTV') + 1) {
    VER_arrNavInfo[0] = 'wtv';
    VER_arrNavInfo[1] = 'WebTV';
} else if (navigator.product == 'Gecko') {
    VER_arrNavInfo[0] = 'gek';
    VER_arrNavInfo[1] = 'Gecko engine (Mozilla, Netscape 6+ etc.)';
} else if (document.getElementById) {
    VER_arrNavInfo[0] = 'ie';
    VER_arrNavInfo[1] = 'Internet Explorer 5+';
} else {
    VER_arrNavInfo[0] = 'na';
    VER_arrNavInfo[1] = 'an unknown browser';
}
function VER_runLFOW() {
    try {
        if (VER_lf_PresPlay == 1) {
            VER_lf_createCookie(VER_lf_BlankID, 'on', -1);
            if (VER_lf_tDLB > 0) {
                VER_timeoutID = setTimeout("VER_showLFOW_Video()", (VER_lf_tDLB * 1000));
            } else {
                VER_showLFOW_Video();
            }
        } else if (VER_lf_PresPlay == 2) {
            if (lf_readCookie(VER_lf_BlankID) == 'no') {
                VER_lf_createCookie(VER_lf_BlankID, 'on');
                if (VER_lf_tDLB > 0) {
                    VER_timeoutID = setTimeout("VER_showLFOW_Video()", (VER_lf_tDLB * 1000));
                } else {
                    VER_showLFOW_Video();
                }
            }
        } else if (VER_lf_PresPlay == 3) {
            if (VER_lf_readCookie(VER_lf_BlankID) == 'no') {
                VER_lf_createCookie(VER_lf_BlankID, 'on', VER_lf_PresPlayDays);
                if (VER_lf_tDLB > 0) {
                    VER_timeoutID = setTimeout("VER_showLFOW_Video()", (VER_lf_tDLB * 1000));
                } else {
                    VER_showLFOW_Video();
                }
            }
        } else if (VER_lf_PresPlay == 4) {
            if (VER_lf_readCookie(VER_lf_BlankID) == 'no') {
                VER_lf_createCookie(VER_lf_BlankID, 'on', VER_lf_PresPlayDays);
                if (VER_lf_tDLB > 0) {
                    VER_timeoutID = setTimeout("VER_showLFOW_Video()", (VER_lf_tDLB * 1000));
                } else {
                    VER_showLFOW_Video();
                }
            }
        }
    } catch (e) {
        VER_showLFOW_Video();
    }
}
if ((VER_lf_Position !== 2) && (VER_arrNavInfo[0] !== 'na')) {
    try {
        if (window.addEventListener) window.addEventListener('load', VER_runLFOW, false);
        else if (window.attachEvent) window.attachEvent('onload', VER_runLFOW);
    } catch (e) {
        VER_runLFOW();
    }
} else {
    VER_runLFOW();
}
function VER_showLFOW_Video() {
    if ((VER_lf_Position !== 2) && (VER_arrNavInfo[0] !== 'na')) {
        try {
            var lfDiv = document.createElement('div');
            if (lfDiv === undefined) {
                VER_lf_Position = 'err';
            } else if (lfDiv == null) {
                VER_lf_Position = 'err';
            } else {
                lfDiv.id = VER_divID;
                lfDiv.style.position = 'absolute';
                lfDiv.style.zIndex = 9999999999;
                if (VER_lf_Position == 1) {
                    lfDiv.style.left = VER_lf_OffSet_Left_Position + 'px';
                    lfDiv.style.top = VER_lf_OffSet_Top_Position + 'px';
                } else {
                    lfDiv.style.left = 0;
                    lfDiv.style.top = 0;
                }
                lfDiv.style.height = VER_lf_SWF_File_Height;
                lfDiv.style.width = VER_lf_SWF_File_Width;
                lfDiv.style.visibility = 'visible';
            }
        } catch (e) {
            VER_lf_Position = 'err';
        }
    }
    VER_compileLFOW()
    if ((VER_lf_Position !== 2) && (VER_lf_Position !== 'err') && (VER_arrNavInfo[0] !== 'na')) {
        lfDiv.innerHTML = VER_lfString;
        document.body.appendChild(lfDiv);
    } else if (VER_lf_Position !== 2) {
        document.write('<div id="' + VER_divID + '" style="position: absolute;z-index: 9900;left: 0px;top: 0px;height: ' + VER_lf_SWF_File_Height + 'px;width: ' + VER_lf_SWF_File_Width + 'px;">' + VER_lfString + '</div>');
    } else {
        document.write('<div id="' + VER_divID + '" style="position: relative;z-index: 9900;left: ' + VER_lf_OffSet_Left_Position + 'px;top: ' + VER_lf_OffSet_Top_Position + 'px;height: ' + VER_lf_SWF_File_Height + 'px;width: ' + VER_lf_SWF_File_Width + 'px;">' + VER_lfString + '</div>');
    }
    if ((VER_lf_Position !== 1) && VER_lf_Position !== 2) {
        switch (VER_arrNavInfo[0]) {
            case 'ie':
                if (VER_lf_Position !== 4) {
                    window.onscroll = VER_ScrollHnd;
                    window.onresize = VER_ScrollHnd;
                    window.setInterval('VER_ScrollHnd()', 30);
                }
                break;
            case 'gek':
                if (VER_lf_Position !== 4) {
                    if (window.onscroll === undefined) {
                        window.setInterval('VER_ScrollHnd()', 30);
                    } else {
                        window.onscroll = VER_ScrollHnd;
                        window.onresize = VER_ScrollHnd;
                    }
                }
                break;
            case 'opr':
                if (VER_lf_Position !== 4) {
                    window.onscroll = VER_ScrollHnd;
                    window.onresize = VER_ScrollHnd;
                }
                break;
            case 'kde':
                if (VER_lf_Position !== 4) {
                    window.onscroll = VER_ScrollHnd;
                    window.onresize = VER_ScrollHnd;
                }
                break;
            case 'wtv':
                if (VER_lf_Position !== 4) {
                    if (window.onscroll === undefined) {
                        window.setInterval('VER_ScrollHnd()', 30);
                    } else {
                        window.onscroll = VER_ScrollHnd;
                        window.onresize = VER_ScrollHnd;
                    }
                }
                break;
        }
        VER_ScrollHnd();
    }
}
function VER_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(VER_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 + VER_lf_divHorPos;
        divTop = divTop + VER_lf_divVerPos;
        divLeft = divLeft + screenX;
        divTop = divTop + screenY;
        if (VER_lf_Position_Dynamic == 6) {
            divLeft = divLeft + ((screenWd / 2) - (VER_lf_SWF_File_Width / 2));
        } else if (VER_lf_Position_Dynamic == 7) {
            divLeft = divLeft + (screenWd - VER_lf_SWF_File_Width);
            divTop = divTop + ((screenHt / 2) - (VER_lf_SWF_File_Height / 2));
        } else if (VER_lf_Position_Dynamic == 8) {
            divLeft = divLeft + ((screenWd / 2) - (VER_lf_SWF_File_Width / 2));
            divTop = divTop + (screenHt - VER_lf_SWF_File_Height);
        } else if (VER_lf_Position_Dynamic == 9) {
            divTop = divTop + ((screenHt / 2) - (VER_lf_SWF_File_Height / 2));
        } else {
            if (VER_lf_Position_Dynamic == 5) {
                divLeft = divLeft + ((screenWd / 2) - (VER_lf_SWF_File_Width / 2));
                divTop = divTop - ((screenHt / 2) - (VER_lf_SWF_File_Height / 2));
            }
            if ((VER_lf_Position_Dynamic % 2) == 0) {
                divLeft = divLeft + (screenWd - VER_lf_SWF_File_Width);
            }
            if ((VER_lf_Position_Dynamic < 3) == false) {
                divTop = divTop + (screenHt - VER_lf_SWF_File_Height);
            }
        }
        if ((VER_lf_Position_Dynamic == 4) && (VER_arrNavInfo[0] !== 'ie')) {
            divLeft = divLeft - 30;
            divTop = divTop - 30;
        }
        divScroll.left = divLeft + 'px';
        if (screenHt < VER_lf_SWF_File_Height) {
            divScroll.top = '0px';
        } else {
            divScroll.top = divTop + 'px';
        }
    } catch (e) { }
}
function VER_compileLFOW() {
    VER_lfParamString = '?lf_tpLevel=' + VER_lf_tpLevel;
    VER_lfParamString += '&lf_tDLA=' + VER_lf_tDLA;
    VER_lfParamString += '&lf_fIE=' + VER_lf_fIE;
    VER_lfParamString += '&lf_fIET=' + VER_lf_fIET;
    VER_lfParamString += '&lf_fOE=' + VER_lf_fOE;
    VER_lfParamString += '&lf_fOET=' + VER_lf_fOET;
    VER_lfParamString += '&lf_closeIMG=' + VER_lf_closeIMG;
    VER_lfParamString += '&lf_mainIMG=' + VER_lf_mainIMG;
    VER_lfParamString += '&lf_cOMW=' + VER_lf_cOMW;
    VER_lfParamString += '&lf_cOMURL=' + escape(VER_lf_cOMURL);
    VER_lfString = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='" + VER_lf_SWF_File_Width + "' height='" + VER_lf_SWF_File_Height + "' id='obj" + VER_lf_BlankID + "' align='middle' codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0' >";
    VER_lfString += "<param name='movie' value='" + VER_lf_URL + 'bkLoader.swf' + VER_lfParamString + "' />";
    VER_lfString += "<param name='quality' value='high' />";
    VER_lfString += "<param name='wmode' value='transparent' />";
    VER_lfString += "<param name='allowScriptAccess' value='always' />";
    VER_lfString += "<param name='loop' value='false' />";
    VER_lfString += "<embed src='" + VER_lf_URL + 'bkLoader.swf' + VER_lfParamString + "' allowScriptAccess='always' quality='high' wmode='transparent' loop='false' width='" + VER_lf_SWF_File_Width + "' height='" + VER_lf_SWF_File_Height + "' name='obj" + VER_lf_BlankID + "' align='middle' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' />";
    VER_lfString += "</object>";
}
function VER_lf_createCookie(strName, strValue, strDays) {
    if ((VER_lf_PresPlay !== 4) && (strDays)) {
        var date = new Date();
        date.setTime(date.getTime() + (strDays * 24 * 60 * 60 * 1000));
        var expires = '; expires=' + date.toGMTString();
    } else if ((VER_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 VER_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 VER_closeLFDiv() {
    try {
        var killDiv = document.getElementById(VER_divID);
        document.body.removeChild(killDiv);
    } catch (e) { }
}
