$(document).ready(

function()
{

  var fnSelect =    
  function ()
    {
      this.select();     
    };
  
	// Following throwing an error only in IE .
	// Todo: find out what the issue is with IE. 
	if ( navigator.appName != "Microsoft Internet Explorer" ) 
  {  
	 $("input").focus 
	  (
	    fnSelect	    
	  );		
  }
	
  $("textarea").focus 
  (
    fnSelect
  
  );

  }
);