Hi,

I added a code to my template.php which is add jquery ui.dialog.js file to the page. And this code works only for specific content type. Also boost module work on my site.

But after added this code site performance decreased. Load average values are so high. You can see my code below. What can be the reason of performance decreasing?

Added to template.php

function garland_preprocess_page(&$variables) {
if (isset($variables['node']) && $variables['node']->type == 'product') {//'product' is the target content type
// Add js
drupal_add_css(drupal_get_path('modules', 'jquery_ui') . '/themes/default/ui.all.css');
jquery_ui_add('ui.dialog');
$variables['scripts'] = drupal_get_js();
}
}

Added to node-product.tpl.php

echo '<div id="popupdialog" title="Warning">Bla bla bla bla</div>
<script language="javascript">
if (Drupal.jsEnabled) {
jQuery(document).ready(function(){
jQuery("#popupdialog").dialog({
closeOnEscape: false,
modal:true,
buttons: {
        "Yes": function() {
          $( this ).dialog( "close" );
        },
        "No": function() {
          window.location = "http://www.example.com";
        }
      }
});
});
}
</script>
';