/* 
 Document   : jquery.oneitimageslider
 Created on : Dec 03, 2013, 11:03:10 AM
 Author     : Saliya Randunu - salya@oneit.com.au
 Description:
 OneIT Tooltip.
 */


(function($) {

    $.fn.oneitinputrole = function()
    {
        
        
         $(this).each(function(){
             var $self = $(this);
             var $role = $self.attr('role');
             var $faicon = $("<i/>",{"class" : "glyphicon glyphicon-" + getRoleIcon($role)});
        
        
            $self.wrap('<div class="role-input"></div>');
            $self.before($faicon);
            if($role==='WHOLE_CURRENCY')
            	$self.after('<div class="role-suffix">.00</div>');
        });
      
        
        
        function getRoleIcon(role){
            
            var roleicons = [];
            
            roleicons['EMAIL'] = "envelope";
            roleicons['ADDRESS'] = "home";
            roleicons['CURRENCY'] = "usd";
            roleicons['WHOLE_CURRENCY'] = "usd";
            roleicons['PHONE'] = "earphone";
            roleicons['MOBILE'] = "phone";
            roleicons['WEB'] = "globe";
            roleicons['FAX'] = "print";
            roleicons['WORK'] = "briefcase";
            
            
            return(roleicons[role]);
            
        }
       

    };//end of plugin

}(jQuery));
