﻿function addToFavourites()
{
    
    serviceProxy = new myshoes.dk.Shoehorn();
    serviceProxy.set_defaultSucceededCallback(FavSucceededCallback);
    serviceProxy.set_defaultFailedCallback(FavFailedCallback);
    
    var sectionId = window.document.getElementById('ctl00_MainPlaceHolder_sectionId');
    var subSectionId = window.document.getElementById('ctl00_MainPlaceHolder_subSectionId');
    var brandId = window.document.getElementById('ctl00_MainPlaceHolder_brandId');
    
    serviceProxy.addToFavourites(sectionId.value, subSectionId.value, brandId.value);
    
}

function FavSucceededCallback(result)
{    
    showSmallMessagePopup(2);    
}

// Callback function invoked when a call to 
// the  service methods fails.
function FavFailedCallback(error, userContext, methodName) 
{
    alert(error.get_message());
}
