$(document).ready( function(){

  // put all initilizers here.
  vtip();});

function nominateThis(value,category_id){
            var selectOption = $('#category');
            $(selectOption).find("option[value='"+category_id+"']").attr("selected","selected");
              jQuery.ajax({
                 url: "<?php echo url_for('awards/subCats')?>",
                  data: { id: id=category_id},
                  dataType :'html',
                  success: function (html) {
                     jQuery('#nominate').html(html);
                }
            });

            $("#category option:selected").each(function () {
                $("#vote_button").html("<input class='btnGreen' type='submit' value='санал өгч байна' name='smt_signin'/>");
            })


        }
          $(document).ready(function(){
            $("#category").change(function()
            {
                $("#category option:selected").each(function () {
                    $("#vote_button").html("<input class='btnGreen' type='submit' value='санал өгч байна' name='smt_signin'/>");
                });

            }
        )
}
    );

/**
Vertigo Tip by www.vertigo-project.com
Requires jQuery
 */

this.vtip = function() {
  this.xOffset = -10; // x distance from mouse
  this.yOffset = 10; // y distance from mouse

  $(".vtip").unbind().hover(
    function(e) {
      this.t = this.title;
      this.title = '';
      this.top = (e.pageY + yOffset);
      this.left = (e.pageX + xOffset);

      $('body').append( '<p id="vtip"><img id="vtipArrow" src="/images/vtip_arrow.png"/>' + this.t + '</p>' );

      $('p#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn("slow");

    },
    function() {
      this.title = this.t;
      $("p#vtip").fadeOut("slow").remove();
    }
    ).mousemove(
    function(e){
      this.top = (e.pageY + yOffset);
      this.left = (e.pageX + xOffset);

      $("p#vtip").css("top", this.top+"px").css("left", this.left+"px");
    }
    );

};

