$(document).ready(function(){
  $(function()
  {

  // form styling default
  formInit();
  //datagrid colors
  dataGridInit();

$("#search_custom").focus(function(){
$("#search_custom").css('background', 'rgb(255, 255, 255)');
});

$("#search_custom").blur(function(){
  if($("#search_custom").val()=='')
    {
      $("#search_custom").css('background', 'rgb(255, 255, 255)');
    }else{
      $("#search_custom").css('background', 'rgb(255, 255, 255)  url(assets/templates/nisweb/images/search_img.gif) no-repeat scroll left center;');
    }
});

});

});

function formInit()
{
  // set scc class to all input Types
  $('.dlForm :text').addClass('inputText');
  $('.dlForm :radio').addClass('inputRadio');
  $('.dlForm :checkbox').addClass('inputCheckbox');
  $('.dlForm :password').addClass('inputPassword');
  $('.dlForm :file').addClass('inputFile');
  $("fieldset[id*='Address']").addClass('dt25');
//highlight active form element.
/*
  $('.dlForm input, .dlForm textarea, .dlForm select').focus(function(){
    $(this).css('background-color','#ffcf37');
  }).blur(function(){
    $(this).css('background-color','inherit');
  })
   */

  
}// end of function
function dataGridInit()
{
  
  if($('.tGrid').length)
  {
    //sets first and last trow s of the body of the table.
    $('.tGrid tbody :first-child').addClass('first');
    $('.tGrid tbody :last-child').addClass('last');

    $('.tGrid tr :first-child').addClass('first');
    $('.tGrid tr :last-child').addClass('last');

    // set alternative colour css style
    $('.tGrid').each(function(){
      $('.tGrid tbody tr:even').addClass('even');
      $('.tGrid tbody tr:odd').addClass('odd');
    });

  }
}// end of function


