﻿function wsfBannerExposure(id)
{
    wsBanners.Exposure(id,
        wsfBannerExposureOnSucceeded,
        wsfBannerExposureOnFailed);
}
function wsfBannerExposureOnSucceeded(res){}
function wsfBannerExposureOnFailed(err){}
//---------------------------------------------------------------
function wsfBannerChoose(sControlID, sPlacement, sWidth, sHeight)
{
    wsBanners.Choose(
        sControlID,
        sPlacement,
        sWidth,
        sHeight,
        wsfBannerChooseOnSucceeded,
        wsfBannerChooseOnFailed);
}

function wsfBannerChooseOnSucceeded(res)
{
    $get(res.sControlID + 'Timeout').value = res.sTimeout;
    $get(res.sControlID).innerHTML = res.sBanner;
}

function wsfBannerChooseOnFailed(err){}

//------------------------------------------------------------------------
function wsfContactUs(idPage)
{
    var o = new Object();
        o.sIdPage = idPage;
        o.sName = $get('txtName').value;
        if(null != (e = $get('txtCompany'))){ o.sCompany = $get('txtCompany').value;}else{ o.sCompany = ''};
        if(null != (e = $get('txtArea'))){ o.sAarea = $get('txtArea').value;}else{ o.sAarea = ''};
        if(null != (e = $get('txtAddress'))){ o.sAddress = $get('txtAddress').value;}else{ o.sAddress = ''};
        if(null != (e = $get('txtZip'))){ o.sZip = $get('txtZip').value;}else{ o.sZip = ''};
        if(null != (e = $get('txtPhone'))){ o.sPhone = $get('txtPhone').value;}else{ o.sPhone = ''};
        if(null != (e = $get('txtCellular'))){ o.sCellular = $get('txtCellular').value;}else{ o.sCellular = ''};
        if(null != (e = $get('txtFax'))){ o.sFax = $get('txtFax').value;}else{ o.sFax = ''};
        if(null != (e = $get('txtEmail'))){ o.sEmail = $get('txtEmail').value;}else{ o.sEmail = ''};
        if(null != (e = $get('txtAge'))){ o.sAge = $get('txtAge').value;}else{ o.sAge = ''};
        if(null != (e = $get('txtContent'))){ o.sContent = $get('txtContent').value;}else{ o.sContent = ''};
        if(null != (e = $get('chbSex'))){ o.sSex = $get('chbSex').value;}else{ o.sSex = ''};
        if(null != (e = $get('chbMailing'))){ o.sMailing = $get('chbMailing').checked ? 'true':'false';}else{ o.sMailing = 'false'};

    wsBanners.SaveLandPageContact(o,
        wsfContactUsOnSucceeded(),
        wsfContactUsOnFailed);
}
function wsfContactUsOnSucceeded(json)
{
        if(null != (e = $get('divForm')))
        e.style.display = 'none' ;
        
        if(null != (e1 = $get('divTanks')))
        e1.style.display = '' ;
//    var id = $get('txtIdPage').value;
//    window.location = 'ResponseLandPage.aspx?id='+ id +'';
}
function wsfContactUsOnFailed()
{
    alert('failure');
}
//--------------------------------------------------------------
