/**
 * Default renderer for object inspector
 */
App.Inspector.Renderers.Default = function (wrapper_dom) {
  var wrapper = $(wrapper_dom);
  
  wrapper_dom.insp_data.wireframe_head = $('<div class="head"></div>').appendTo(wrapper);

  wrapper_dom.insp_data.inspector_wrapper = $('<div class="vcard">' +
			                                          '<div class="vcard_content"></div>' +
			                                          '<div class="vcard_bottom"></div>' +
			                                          '<div class="vcard_bottom_shadow_left"></div><div class="vcard_bottom_shadow_right"></div>' +
			                                        '</div>').appendTo(wrapper_dom.insp_data.wireframe_head);
  
  wrapper_dom.insp_data.inspector_content = wrapper_dom.insp_data.inspector_wrapper.find('div.vcard_content:first');
  
  // object icon
  var object_class = wrapper_dom.insp_data.settings.object['class'];
  var object_module = (object_class + 's').toLowerCase();
  
  if(object_class == 'Milestone') {
    object_module = 'system';
  } else if(object_class == 'TodoList') {
  	object_module = 'todo';
  } else if(object_class == 'ProjectObjectSubtask') {
  	object_module = 'subtasks';
  } else if($.inArray(object_class, ['Bookmark', 'TextDocument', 'YouTubeVideo']) != -1) {
    object_module = 'files';
  } else if($.inArray(object_class, ['Notebook', 'NotebookPage']) != -1) {
    object_class = 'notebook';
    object_module = 'notebooks';
  } else if($.inArray(object_class, ['TimeRecord', 'Expense']) != -1) {
  	object_module = 'tracking';
  } else if(object_class == 'ProjectSourceRepository') {
    object_class = object_module = 'source';
  } // if
  
  wrapper_dom.insp_data.inspector_wrapper_icon = $('<div class="vcard_image"><div class="vcard_image_frame">' +
				                                             '<img src="' + App.Wireframe.Utils.imageUrl('icons/96x96/' + object_class.toLowerCase() + '.png', object_module, 'phone') + '" alt=""/>' +
				                                           '</div></div>').appendTo(wrapper_dom.insp_data.inspector_content);
  
  wrapper_dom.insp_data.widgets = wrapper_dom.insp_data.inspector_wrapper_icon.find('div.vcard_image_frame');

  // properties
  wrapper_dom.insp_data.properties_block = $('<div class="vcard_data"><div class="properties"></div></div><div class="clear"></div>').appendTo(wrapper_dom.insp_data.inspector_content);
  wrapper_dom.insp_data.properties = wrapper_dom.insp_data.properties_block.find('div.properties:first');
  
  // body
  if(wrapper_dom.insp_data.settings.supports_body && wrapper_dom.insp_data.settings.object.body_formatted != '') {
    wrapper.parents('.object_wrapper:first').find('div.object_content').prepend('<div class="wireframe_content_wrapper"><div class="object_body object_body_default"><div class="object_body_content formatted_content"></div></div></div>');
  } // if
}; // Default renderer