Ensure "local variable" have a local scope using "var" keyword.

This commit doesn't fix any particular issue but is made anticipating
possible side effect.
Prevent extensions from being loaded twice when page is initially invisible.

When both embedded within a QWebView and initially invisible, the window
height and width are not valid. This mean that when the page is loaded in
an invisible widget, any computed value relying on the window height/width
 will be incorrect. This is the case with method like: idealNumberOfItems(),
pageLimit(), ...

To overcome this issue, we leverage the "Visiblity API" introduced mid-2011.
See http://www.w3.org/TR/2011/WD-page-visibility-20110602/

Since the different browser implement it differently, we also added a small
jquery plugin providing a cross-browser interface to the "visibilityChange"
event. The plugin has been locally updated to be compatible with older
version of jquery. In our case, "on/off" has been changed into
"bind/unbind". An extra check has also been added to check if "toElement"
property exists.

Remarks:

(1) If there are no support for visibility API, all extensions will
be fetched.

(2) The "PageVisibility API" should probably be added in Midas core.

(3) JQuery version associated with Midas core should be updated.

(4) The webkit provided by Qt doesn't support page visibility. It emulated
by catching the show/hide event associated with the widget.

See http://na-mic.org/Mantis/view.php?id=2911

Fixes issue 2911
Merge pull request #36 from jcfr/prevent-additional-fetch-when-embedded

Prevent additional fetch when embedded