//JS file required to be included for storing the Personalization cookie values
//The file assumes that CookieUtility.js is included before calling any functions from this file

//Method to call all the respective methods for storing in Cookie if valid value is passed
function storePersonalizationCookie(model,year,zip)
{
    CookieUtility.COOKIE_DOMAIN = '.fordvehicles.com';  
   
    if(model != null  && model != 'null')
    {
        storeModelInCookie(model);  
    }
    if(year != null && year != 'null')
    {
        storeYearInCookie(year);    
    }
    if(zip != null && zip != 'null')
    {
        storeZipcodeInCookie(zip);  
    }
}

//Method to store the Model name in the Cookie FPI
function storeModelInCookie(model)
{
    CookieUtility.setSubCookieValue("FPI", "Model", model, sDefaultLifeTime);
}

//Method to store the zipcode in the Cookie FPI
function storeZipcodeInCookie(zip)
{
    CookieUtility.setSubCookieValue("FPI", "zip", zip, sDefaultLifeTime);
}

//Method to store the Year in the Cookie FPI
function storeYearInCookie(year)
{
    CookieUtility.setSubCookieValue("FPI", "Year", year, sDefaultLifeTime);
}              
