﻿
var GeneralScriptMethods =
{
    fillOptions: function(collection) {
        var options = '';
        $.each(collection, function(index, value) {
            if (index == 0) { options += '<option selected value="' + value + '">' + value + '</option>'; }
            else { options += '<option value="' + value + '">' + value + '</option>'; }
        });

        return options;
    },

    fillOptionsV2: function(collection) {
        var options = '';
        $.each(collection, function(index, value) {
            if (index == 0) { options += '<option selected value="' + value.id + '">' + value.Name + '</option>'; }
            else { options += '<option value="' + value.id + '">' + value.Name + '</option>'; }
        });

        return options;
    },
    AddToCookie: function(CookieObj, field, info, path) {

        // save the to field
        CookieObj.items.push({
            'field': path,
            'info': info,
            'val': field.val()
        });
    },
    SetHeight: function(x, y) {
        var a = parseInt(x.height());
        //var b = parseInt(y.height());
        
        //var c = b > a ? b : a;
        //x.height(c);
        //y.height(c);
        y.height(a);
    }
};

