Question: I am having a javascript error on my site <http://fightgifs.com> with this line of code in `footer.php`:

```
var main_menu=new main_menu.dd("main_menu");

```

> 
> Uncaught TypeError: Cannot read property 'dd' of undefined
> 
> 
> 

Anyone has an idea what to do ? The error is creating a problem for a javascript plugin (Shashin). Whole script:

```
<script type="text/javascript">

jQuery(document).ready(function($){

$('.carousel').elastislide({

    imageW  : 145,

    minItems    : 2,

    margin      : 10

});

var main_menu=new main_menu.dd("main_menu");

main_menu.init("main_menu","menuhover");

});

</script>

```

Answer: 
The `main_menu` you expected this to refer to is actually being [shadowed](https://en.wikipedia.org/wiki/Variable_shadowing).

```
var main_menu = new main_menu.dd("main_menu");

```

Both mentions of `main_menu` actually refer to the local variable being declared, which will be `undefined` rather than an object with a `.dd()` method.

To avoid this, you'll have to rename one of them.

```
var menu = new main_menu.dd("main_menu");

menu.init("main_menu","menuhover");

```

Or, if you don't need the `var` afterwards, you can also skip it:

```
new main_menu.dd("main_menu")
    .init("main_menu","menuhover");

```
Your code of `main_menu` object has a problem. Post your code related to main\_menu or check code yourself.