function navigate_to_set_menu(where, menu, ref) {
    var ref = ref || false;
    if ((new RegExp(/^\#/)).test(where)) {
        return false;
    }
    if (menu != false) {
	Set_Cookie('cincork_menu_alias', menu);
    }

    if (!ref) {
        window.location = where;
    } else {
        window.opener.location = where;
    }
    return false;
}

function bindButtonsets() {
	var bts = jQuery.merge($(".ui-set-button"), $(".ui-set-buttonset").find("button, a"));
    bts.each(function () {
        var self = $(this);
    	var op = {};
        if (self.find("img").length == 0) {
        	op = {icons : {}};
            op.label = self.text();
            if (op.label.length == 0) {op.label = '&nbsp;'; op.text = false;}
            if (new RegExp("icon-primary", "gi").test(self.attr("class"))) {op.icons.primary = self.attr("class").match(/icon-primary-([^\s]*)/i)[0].toString().replace("icon-primary-", "ui-icon-");}
            if (new RegExp("icon-secondary", "gi").test(self.attr("class"))) {op.icons.secondary = self.attr("class").match(/icon-secondary-([^\s]*)/i)[0].toString().replace("icon-secondary-", "ui-icon-");}
        }
        self.button(op);
    });
    $(".ui-set-buttonset")
    .buttonset()
    .children("*")
    .css("margin-left", "-2px");
}

$(document).ready(function() {
	$("select").not("#callMonthSelector").not(".long_select_multi").combobox({selectbox:true});
	$("button").button();
});

