function isset(variable){
  if ( typeof( variable ) != "undefined" ) {
       return true;
     }
  else {
       return false;
  }
}   

function getSelectedValue(li)
{    
  var reg=new RegExp("[#]+", "g");
  var id = jQuery(li).attr("id");  
  var tid=id.split(reg);
  return tid[1];
}   

function getSelectedText(li)
{                                   
  return jQuery(li).text();
} 

function initSelect(select_id)
{                             
    jQuery('#'+select_id+' input.selected_option_value').val(getSelectedValue('#'+select_id+' ul li:first-child'));
    jQuery('#'+select_id+' a.selected_option_text').text(getSelectedText('#'+select_id+' ul li:first-child'));
    
    jQuery('#'+select_id+' ul li').each(function(){ 

          jQuery(this).removeClass('selected_option');   
          jQuery(this).css('background-color', 'white');  

      }); 
}

jQuery(document).ready(function() {
  jQuery('body').click(function(){              
    jQuery('.select_custom div.jScrollPaneContainer').fadeOut('fast');      
  });  
}); 

