﻿var WIN_OPTIONS = "width=622,height=640,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=1";

var CONTACT_WIN_OPTIONS = "width=622,height=770,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=1";

//IE background image caching
try{document.execCommand("BackgroundImageCache",false,true);}catch(err){}

function openWindow(name, url)
{
    window.open(url, name, WIN_OPTIONS);
}

function openGeneralWindow(name,url)
{
    window.open(url,name);
}

var WIN_OPTIONS_CUSTOM1 = "width=800,height=640,status=1,toolbar=1,location=1,menubar=1,directories=0,resizable=1,scrollbars=1";
function privacy()
{    
    window.open("http://www22.verizon.com/privacy/", "privacy", WIN_OPTIONS_CUSTOM1);
}

function terms() 
{
    window.open("https://referafriend.verizon.com/Terms.aspx", "terms", WIN_OPTIONS_CUSTOM1);
}

function rules()
{
    openWindow("rules", appRoot + "PopUp/Rules.aspx");
}

function verizon() 
{
    window.open("https://www22.verizon.com/myverizon/", "Verizon", WIN_OPTIONS_CUSTOM1);
}

function verizonHBOPromoT() 
{
    window.open("https://www22.verizon.com/foryourhome/registration/reg/orlogin.aspx?LOBCode=C&PromoTCode=A0352&PromoSrcCode=T&POEId=TL1SP&CMP=DMC-A0352", "Verizon", WIN_OPTIONS_CUSTOM1);
}

function hbo() {
    window.open("https://www.hbo.com", "HBO", WIN_OPTIONS_CUSTOM1);
}

function hboEntourage() {
    window.open("http://www.hbo.com/entourage", "HBO", WIN_OPTIONS_CUSTOM1);
}


function hboBanner() {
    window.open("http://store.hbo.com/home/index.jsp", "HBO", WIN_OPTIONS_CUSTOM1);
}

function vzwBanner() {
    window.open("http://www22.verizon.com/foryourhome/registration/reg/orlogin.aspx?LOBCode=C&PromoTCode=A0352&PromoSrcCode=T&POEId=TL1SP&CMP=DMC-A0352", "Verizon", WIN_OPTIONS_CUSTOM1);
}

function faq() 
{
    openWindow("faq", appRoot + "Popup/Faq.aspx");
}

function wideDownLoad() {
    //window.open(appRoot + "downloads/entourage_LiveTheDream_wide.zip", "WideDL", WIN_OPTIONS_CUSTOM1);
    window.location = appRoot + "downloads/entourage_LiveTheDream_wide.zip";
}

function stanDownLoad() {
    //window.open(appRoot + "downloads/entourage_LiveTheDream.zip", "StanDL", WIN_OPTIONS_CUSTOM1);
    window.location = appRoot + "downloads/entourage_LiveTheDream.zip";
}

function ShowControl(show,hide1,hide2) 
{
    if (show != '') document.getElementById(show).style.display = 'block';
    if (hide1 != '') document.getElementById(hide1).style.display = 'none';
    if (hide2 != '') document.getElementById(hide2).style.display = 'none';    
}

var randomKey = Math.round(Math.random() * 10000000000000);

function ClearCheckBoxesOnSurvey() 
{
    var cb = document.getElementsByTagName("input")
    for (i = 0; i < cb.length;  i++) {
        if (cb[i].type == 'checkbox' && cb[i].name != 'ctl00$Content$q4$15') {
            cb[i].checked = false;
        }
    }

}

/*activity calls section*/
var hboLink = "hboLink";
var hboEntourageLink = "hboEntourageLink";
var vzwLink = "vzwLink";
var hboBannerLink = "hboBannerLink";
var hboShopButtonLink = "hboShopLink";
var vzwBannerLink = "vzwBannerLink";
var stanDownLoadLink = "stanDownloadLink";
var wideDownLoadLink = "wideDownloadLink";
var praHBO = "Entourage.PRA.HBO";


function hboLinkClick(referrer, pageUrl, query) {
    WebActivities.RecordClick(referrer, pageUrl, hboLink, query);
    hbo();
}

function hboEntourageLinkClick(referrer, pageUrl, query) 
{
    WebActivities.RecordClick(referrer, pageUrl, hboEntourageLink, query);
    hboEntourage();
}

function verizonLinkClick(referrer, pageUrl, query) {
    WebActivities.RecordClick(referrer, pageUrl, vzwLink, query);
    verizon();
}

function hboBannerLinkClick(referrer, pageUrl, query) {
    WebActivities.RecordClick(referrer, pageUrl, hboBannerLink, query);
    hboBanner();
}

function vzwBannerLinkClick(referrer, pageUrl, query) {
    WebActivities.RecordClick(referrer, pageUrl, vzwBannerLink, query);
    verizonHBOPromoT();
}

function hboShopButtonLinkClick(referrer, pageUrl, query) {
    WebActivities.RecordClick(referrer, pageUrl, hboShopButtonLink, query);
    hboBanner();
}

function wideDownLoadLinkClick(referrer, pageUrl, query) {
    WebActivities.RecordClick(referrer, pageUrl, wideDownLoadLink, query);
    wideDownLoad();
}

function standardDownLoadLinkClick(referrer, pageUrl, query) {
    WebActivities.RecordClick(referrer, pageUrl, stanDownLoadLink, query);
    stanDownLoad();
}

function praHBOLinkClick(referrer, pageUrl, query) {
    WebActivities.RecordClick(referrer, pageUrl, praHBO, query);
    verizonHBOPromoT();
}


function flashTrackingReceiver(eventQuery) 
{
    WebActivities.RecordFlash(eventQuery);
}

